Blog

This is my personal blog. It showcases applied mathematics across a wide span of subjects, from physics and engineering to finance, history and medicine: the models, the methods that solve them, the code that runs them and the algorithms behind them, often with a live model you can try for yourself. Each post starts from a question and works it through to a number. Nothing here is a product or advice; the research papers live under Research.

Sort:

The Rule That Fits One Ward

Hospitals are told to keep their beds at most 85% full. At that occupancy a 100-bed ward is full about once a month, a 20-bed ward within a week and a 500-bed hospital about once in six years. The Ornstein–Uhlenbeck process explains why: what matters is the distance to a full ward in standard deviations, and it grows with the square root of the size.

Read more →

The Barrier That Comes Early

A price starts at $100 and the average wait until it first reaches $120 is nine years. Yet there is a 40% chance it gets there within a year, and the most likely moment is three months away. Under geometric Brownian motion the whole distribution of that wait is one closed formula, which prices an up-and-out call and a clause in a project contract alike.

Read more →

The Birds That Turn as One

A starling watches its six or seven nearest neighbours, however far away they are. Put that rule and its obvious rival into Vicsek's flock of 400 birds and the rival wins when the birds are packed close, then collapses when the flock spreads out. Counting costs a little agreement and buys a flock that does not break.

Read more →

The IQ Map That Filled Its Own Blanks

The world IQ map gives 200 countries a colour, and they all look equally sure. Behind the United States stand 62,296 people; behind Angola, nineteen; behind fifty countries, nobody, their colour copied from next door, and five sit at a floor of 60 that no test produced. Yet the measured part holds up: it tracks the World Bank's school tests at r = 0.81. The copies track nothing.

Read more →

The Wave That Nobody Ordered

In the Beer Game, customer demand steps once from 4 cases a week to 8, yet the factory's orders swing to 33. Written as 27 differential equations and fed the ordering rule Sterman fitted to real players, the model reproduces their waves, and shows the one number that stops them: what was already on its way.

Read more →

The Cell That Solves Bellman’s Equation

A bacterium shifted to better food must decide, protein by protein, whether to build ribosomes or the enzymes that feed them. Posed as optimal control, Bellman's equation says the answer is all or nothing, switched along a single curve. E. coli has no brain, but its alarm molecule ppGpp switches the same way, and gets 98% of what is possible.

Read more →

The Equation That Paints a Jaguar

In 1952 Alan Turing wrote down two chemicals and a race, and showed that spots can appear from nothing. Seventy years on, a pair of his equations paints a jaguar: a spotted cub first, then broken rosettes with dark centres, from three changes of rate. And in fetal house-cat skin, biologists have now caught the real thing: an activator and an inhibitor laying down the stripes before birth.

Read more →

The Best of 490 Backtests Is Noise

Search a few hundred strategy variants on one year of data and the best one scores a Sharpe near three — with no edge in any of them. The arithmetic, the figure, and what survives it.

Read more →

The Battleship That Solved a Differential Equation

The 16-inch guns of USS Iowa threw a 1,225 kg shell 38.7 km, and aiming them is a boundary-value problem for an ordinary differential equation. Fitted to the Navy's range tables, the model finds the gun's best angle beyond its turret's 45-degree stop, a bunker that breaks only from farther away, and a weaker charge that spares a town.

Read more →

The Third Walker

Einstein and Gödel walked home together for years, and on one question they never settled: Gödel's rotating universe, where a traveller can loop back into the past, and his claim that it proves the passing of time is unreal, here too. Einstein called it important and left it open. Hermann Weyl worked down the corridor. This is the walk where he joins them.

Read more →

When to Shoot

Two duellists walk towards each other, one bullet each. Fire too soon and you will probably miss, and a miss is fatal. In 1949 David Blackwell worked out the answer in a day: fire when your two chances add up to one, the good shot and the bad shot at the same instant. Then he made the pistols silent, and the only safe strategy became a roll of the dice.

Read more →

The Man Who Could Have Won the Nobel Twice

In 1965 Paul Samuelson wrote down an option formula with two unknowns, and admitted he had no theory to pin them down. Set both to the interest rate and it is the Black–Scholes–Merton formula, term for term, eight years early. The missing piece was not mathematics but an argument, and his own student helped supply it.

Read more →

The Game That Remembered

Roulette cannot be beaten because the wheel forgets every spin. A deck of cards does not forget. In 1961 a young mathematician proved it, took the proof to Reno and won $11,000 in a weekend. Then he found the harder truth: with a real edge you can still go broke, and betting twice the right amount earns you exactly nothing.

Read more →

The System That Could Not Lose

Dostoevsky wrote home from Wiesbaden that he had found the secret of roulette: you just can't lose. Then he signed away his future, gambled the advance, and dictated a novel in 26 days to save himself. The doubling system every gambler knew wins 39 nights out of 40 — and loses exactly the house edge anyway.

Read more →

The Tanks That Counted Themselves

Before D-Day the Allies needed to know how many tanks Germany built each month. The spies said about 1,400. A few statisticians read the serial numbers off wrecked gearboxes and said 246. The records, opened after the war, said 245 — and the best estimate throws away every serial number but one.

Read more →

The Forest That Burns All at Once

Over forty fire seasons in British Columbia, the number of fires varied six-fold and the area burned nearly a thousand-fold. Fewer fires now burn thirty-five times the area they did in the 1990s. A percolation threshold explains why, and a fire PDE on a patchy forest shows fuel 12.5% drier turning the same lightning strike into a fire a hundred times larger.

Read more →

The Road That Made Everyone Late

Close a busy road and the traffic gets faster. Cities have done it and been surprised. The reason is arithmetic, it needs every driver to be perfectly selfish and perfectly informed, and in the smallest version a free new road costs everybody fifteen minutes. Then it turns out the most destructive road of all is not the free one.

Read more →

The Urn That Decides Once

An urn with one red ball and one black. Draw one, put it back with a friend of the same colour, forever. The share of red settles — and it settles on a number drawn uniformly from nought to one, so there is no typical outcome at all. Then de Finetti removes the mechanism entirely, and one exponent decides whether the rich getting richer ends in a monopoly or in a permanent accident.

Read more →

The Bird Does Not Come Home

A drunk man and a drunk pigeon leave the same pub with all the time in the world. The man is certain to find his way back. The pigeon manages it 34% of the time and otherwise never. One extra dimension turns a certainty into a bet you mostly lose — and then the sky turns out to have a ceiling.

Read more →

Where the Force Vanishes Is Not Where It Rests

Set the arrivals equal to the cancellations, solve for the queue size, and you have found the point where the force on the book vanishes. You have not found where the book sits. The two answers differ by a term nobody writes down, worth 14.2% across three order books that share a balance point exactly.

Read more →

Everybody Wants the Cheap Plug

Ten thousand vehicles, two cheap places to charge and one hour. A mean field game — Hamilton–Jacobi–Bellman backwards, Fokker–Planck forwards — solved on a torus and animated, and the 1.60% that nobody's mistake accounts for.

Read more →

One Hundred Prisoners, Fifty Opens

A hundred prisoners, a hundred boxes, fifty opens each, and all must succeed. Opening at random gives one chance in 1.27 x 10^30. One sentence of strategy gives 31 per cent, and it never decays with the size of the room.

Read more →

A Coin With No Memory Still Looks Cold

For thirty years the hot hand was the textbook case of seeing pattern in noise. The test itself was biased: in four fair flips, the share of heads following a head averages 0.4048, not 0.5.

Read more →

The Body That Is Always Falling

Stand still for a photograph and you are falling the whole time: an upside-down pendulum whose lean doubles every 0.22 seconds, caught by a brain that sees it late. The equation of standing is a second-order Langevin equation turned upside down, and it has a hard limit: with reflexes slower than 0.46 seconds, nothing can hold you up. Try it yourself.

Read more →

The Barrier Your Monte Carlo Never Sees

Discrete Monte Carlo monitoring silently under-counts barrier crossings with a stubborn sqrt(dt) bias — a one-line Brownian-bridge correction removes almost all of it.

Read more →

When Sampling Faster Makes You Wrong

Realized variance should converge to an SDE's quadratic variation as you sample faster — market microstructure noise makes it diverge instead. The volatility signature plot, and the two-scale fix.

Read more →

The Neuron as a Density: Fokker–Planck with a Reset

The same absorbing barrier, seen forward: the firing rate is a probability flux, the reset kinks the density, and a recurrent network has to solve for its own rate.

Read more →

The Neuron as an Ornstein–Uhlenbeck Process

A leaky integrate-and-fire neuron's subthreshold voltage is an Ornstein-Uhlenbeck process, and its firing rate is a first-passage time — the same barrier-crossing math that prices a down-and-out option.

Read more →

Cholesky vs Eigendecomposition: Two Ways to Sample Correlated Gaussians

Two matrix square roots for sampling correlated normals: Cholesky is several times faster, but the eigendecomposition survives a correlation matrix that isn't positive definite.

Read more →

The 1/√N Wall: Why Monte Carlo Is Slow, and What Beats It

Monte Carlo error falls like 1/sqrt(N) no matter how clever your sampler. Quasi-Monte Carlo bends the exponent, not just the constant.

Read more →

Euler–Maruyama vs Milstein: The Term That Matters

One extra term from the Itô–Taylor expansion doubles the strong order of an SDE solver — measured directly against an exact solution.

Read more →

Integrating Oscillations: Filon vs Levin

Two classical methods for oscillatory integrals that beat the O(omega)-points curse — compared against an exact solution, with the log-error plot to prove it.

Read more →

The Itô Integral: A Running Bet You Fix Before the Flip

Why the naive guess for the Itô integral is wrong, and the correction that makes stochastic calculus honest.

Read more →

The Average That Drowned a City

In 1997 Grand Forks built its dikes to a forecast crest of 49 feet. The river came in at 54.35. The forecast was a median, the damage was convex, and the city evaluated the damage at the average crest instead of averaging the damage. The forecaster's own record put the chance of topping the dikes at one in four.

Read more →

The Cube Root That Runs the Treasury

How much cash should a company keep? If its daily cash flow is a random walk and every transfer costs a fee, the best rule is a band: do nothing inside it, and jump back to a return point a third of the way up. The return point is a cube root, which makes the rule remarkably forgiving.

Read more →

De Rerum Electione: The Choice That Is Not a Swerve

A sequel in verse to De Rerum Stochástica. Lucretius put free will in the random swerve; Cicero called that childish, Laplace took the swerve away, and Born gave chance back to physics. The mathematics of control puts freedom somewhere else: in the steering, not the noise.

Read more →

The Win Rate That Means Nothing

Put the stop nine times further from the entry than the target and you win 90% of your trades on any stock, and make nothing. The optional stopping theorem shows why a win rate is a setting, not a skill, and what costs and exits do to a day trader's record.

Read more →

The Lead That Never Changes Hands

A fund manager with no skill spends at least 80% of twenty years ahead of the index with probability 29.5%, and a record that looks fair, ahead 40 to 60% of the time, turns up only 12.8% of the time. Lévy's arcsine law explains why, and why the same curve decides when the lead last changed hands.

Read more →

The Return That Takes Four Centuries

A share with 20% volatility and a 5% expected return gives away its volatility in a single day of one-minute prices, to within 0.72 of a point. Its expected return needs 400 years of data to be known to within one point. Quadratic variation and Girsanov's theorem explain why, and why sampling more often cannot help.

Read more →

The Stagflation Trap: Optimal Monetary Policy as an HJB Problem

A linear-quadratic HJB model that makes the stagflation trap mathematically precise: why a persistent supply shock forces the optimal steady state away from zero inflation and zero output gap simultaneously.

Read more →

De Rerum Stochástica: Lucretius’s Random Swerve and the Birth of SDEs

Epicurus added a random, uncaused swerve (Lucretius would call it the clinamen) to save atomism from determinism. Two thousand years later, it became the diffusion term in every SDE ever written.

Read more →

From Plasma to Game Theory: The Unlikely Journey of an SDE

McKean-Vlasov SDEs emerged from plasma physics in the 1960s. Mean field games arrived from economics in 2006. They converged on the same equation from opposite directions.

Read more →

Markov Chains in Supermarket Management

How Markov chains model checkout queues and customer flow — and what the stationary distribution tells a supermarket manager about staffing and store layout.

Read more →

Kelly, the Growth-Optimal Portfolio, and the Benchmark Approach to Option Pricing

The Kelly criterion and Black-Scholes option pricing are the same mathematical object viewed from different angles. Both lead to the growth-optimal portfolio — Platen's benchmark — which prices derivatives under the real-world measure without requiring a risk-neutral one.

Read more →

The Bookmaker’s Measure: Kelly, Martingale, and the Price of an Edge

The bookmaker is not running a gambling operation. They are constructing a risk-neutral measure. Understanding that changes everything about how you think about betting strategies — including why Martingale fails even when you have edge.

Read more →

The Kelly Criterion — Why the Optimal Strategy Is Never Used

A 60/40 coin. A provably optimal betting strategy. And almost nobody uses it. Kelly's 1956 result is one of the few places in finance where the correct answer is known and rationally ignored.

Read more →

Four Historical Decisions an ABM Would Have Changed

Smoot-Hawley was not unique. From Versailles to Vietnam to Stalin's grain quotas to the Maginot Line — the same pattern recurs. A model that forgets the other agents in the system.

Read more →

The Trade War Nobody Chose: Smoot-Hawley and the Model That Would Have Stopped It

In 1930, a thousand economists begged Hoover not to sign the Smoot-Hawley tariff. He signed it anyway. An agent-based model would have shown exactly what happened next — before it happened.

Read more →

CAD 530 a Month: What Your Car Insurance Premium Actually Pays For

A friend bought a Ford F-150 in Ontario. The insurance quote came in at 530 dollars a month. I built a mathematical model to find out how much of that is justified.

Read more →

Langevin Dynamics and Why They Matter in Finance

The Langevin equation was written to describe a particle in a fluid. It turns out to be exactly the right language for interest rates, volatility, and forward curves.

Read more →