Mrs. Moudine read our numbers back to us — the VaR, the probability bands, the fan of a thousand possible futures for a portfolio that didn’t exist outside a spreadsheet — and singled out the Monte Carlo simulation as the best part of the submission. It should have felt like a finish line. Instead it itched. I could tell her what the model output. I was much less sure I could tell her what it did, or why doing that particular thing, a thousand times over, was supposed to tell anyone something true about risk.
The assignment
The brief, for our financial markets class, was concrete enough: manage a simulated 1,000,000 MAD portfolio on the Casablanca Stock Exchange, using three years of historical data up to January 2nd. Pick positions, justify them, then answer the question every portfolio manager eventually has to answer — not “what will this be worth,” which nobody can honestly promise, but “how badly could this go, and how do I know.”
My team split the work the way teams do. Someone owned the fundamentals, someone owned the writeup, and the simulation — the part that took a spreadsheet of prices and turned it into a thousand imagined years — fell to whoever was willing to fight with the probability theory. We delivered something solid. Mrs. Moudine’s praise for the Monte Carlo piece specifically was, in hindsight, the moment the rest of this story starts from.
A game of solitaire, not a spreadsheet
It helps to know where the method actually comes from, because it isn’t finance at all — and knowing that made the discomfort I felt sharper, not softer.
In 1946, the mathematician Stanislaw Ulam was recovering from an illness and playing endless hands of Canfield solitaire, trying to work out his odds of winning by pure combinatorics. The card-by-card math was intractable. Then he had the insight that mattered: instead of calculating the probability exactly, he could lay out a large number of hands at random and simply count how many won. Enough random trials, and the count converges on the true probability — no closed-form solution required.
Ulam was at Los Alamos at the time, working alongside John von Neumann on the hydrogen bomb, where the same trick applied to a problem with real stakes: predicting how neutrons diffuse through fissile material, a process too chaotic to solve directly but perfectly suited to being simulated thousands of times over. The method needed a code name for classified work, and Ulam’s colleague Nicholas Metropolis picked one from Ulam’s uncle, who used to borrow money from relatives to gamble at the Monte Carlo casino in Monaco. The name stuck for the same reason the method works: it’s random trials standing in for an answer nobody can compute by hand.
That’s the part I hadn’t sat with. I’d used a technique invented to model nuclear chain reactions to price the downside of a bank stock and a hospital-chain stock — and I could run it, but I couldn’t yet explain why simulating a thousand solitaire hands tells you anything real about a thousand possible market years. Praise for output I couldn’t fully derive felt like credit I hadn’t earned.
Deciding to earn it
So I sat back down, alone, and rebuilt the model from scratch — not to produce a better grade, since the grade was already in, but to dissect the thing piece by piece until I could account for every number it produced. Historical volatility, estimated the same way a risk desk would. A random daily return drawn from that volatility, repeated across 252 trading days — a year of market sessions. The whole path repeated a thousand times, the same way Ulam repeated his solitaire deals, until the shape of the outcomes stopped depending on which particular thousand trials you happened to run. And then Value at Risk: not “what will happen,” but “below what threshold does only the worst 5% of these thousand imagined years fall” — the number a real portfolio manager actually needs on a Monday morning.
Nothing about the underlying finance was exotic. What changed was that every line now had to survive me asking “why this, and not something else” — the same discipline Mrs. Moudine’s comment had quietly demanded and that a team deadline hadn’t left room for the first time around.
A small, stubborn detail: the typesetting
One decision from that solo pass is worth admitting to, because it says something about what I was actually chasing. I wrote the final report in Typst instead of the usual Word-and-export pipeline — a markup-based typesetting tool built for exactly the kind of document where equations, tables, and figures need to sit on the page with the same precision the numbers inside them are supposed to have. It was a small thing, technically unnecessary, and it mattered to me anyway: if the point of the rebuild was to stop taking anything on faith, the document explaining it should look like it wasn’t either.
What the itch actually led to
The report below is that solo rebuild, in full — methodology, assumptions, results, and the limits of what a thousand simulated years can and can’t tell you. It’s also, as it turned out, not the end of the story. Understanding the model well enough to rebuild it once made it obvious the next step wasn’t a report at all: a real, versioned, reusable tool, extended with a full fundamental thesis on the two stocks involved and a Value-at-Risk engine that didn’t have to be re-derived by hand for the next allocation. That project — the Casablanca Quant Framework — is documented separately, here, with the encrypted data pipeline that came with treating market data like something worth protecting.
None of it would exist if a compliment had just felt earned the first time.