← Back to list

The Deterministic Mind in a Stochastic World

A wandering conversation about what Monte Carlo algorithms and an ancient Taoist parable have quietly been saying to each other for a…

Vinod Louis · 2026-04-17 15:44 · 0 claps · 12.2 min read
#monte-carlo #monte-carlo-simulation #markov-chain-monte-carlo #probability #tech-philosophy
Open on Medium ↗
Wiki topics: PHI · Philosophy 💻 · Programming 🔧 · Data Engineering 📐 · Mathematics

The Deterministic Mind in a Stochastic World

A wandering conversation about what Monte Carlo algorithms and an ancient Taoist parable have quietly been saying to each other for a couple of thousand years.

There’s a story in the Zhuangzi, a Taoist text from around the 4th century BCE, that I keep coming back to whenever I think about probability. A man is rowing across a river when he notices another boat drifting straight toward him through the fog. He yells. He curses. His blood pressure climbs. Then, just before impact, the fog clears a little, and he sees it: the other boat is empty. Nobody steering it, nobody on board. Just a wooden hull doing what hulls do when left to a current. And his rage, which a second ago felt completely justified, just falls away. Nothing changed about the situation. The collision was still coming. But with no one to blame, there was nothing to be angry at.

Zhuangzi’s point was about projection. We don’t suffer from what happens to us; we suffer from the story we layer on top of it. We load every drifting boat with an imaginary captain who is personally out to get us. The boat was always empty. We’re the ones who keep filling it.

Jump forward about 2,300 years. It’s 1946, Stanislaw Ulam is recovering from encephalitis in a Los Alamos hospital bed, and he’s playing solitaire to pass the time. He starts wondering about the odds of winning, not as an idle curiosity, but as a mathematician’s reflex. The combinatorics are so brutally complex that any analytical approach would take lifetimes. But here’s the thing: he had cards in his hand. He could just… play it out. Deal the deck, see what happens. Do it a hundred times, perhaps a thousand times. The answer wouldn’t be derived; it would just crystallise, slowly, from a pile of accumulated games. Together with John von Neumann, he turned that hospital-bed insight into what they’d call the Monte Carlo method, named after the casino down the coast where randomness was also, technically, the point.

When faced with a problem beyond your control, the wisest approach is to stop resisting it. Instead, practice patience and honesty, and simply observe how it unfolds.“

— Adapted from Ulam’s reflections, Adventures of a Mathematician, 1987

What does it mean to let the boat be empty?

The empty boat is basically a philosophy of dropping your expectations about what the answer should look like before you’ve looked for it. It’s not saying the world is meaningless; it’s saying that when you approach a problem already certain of its shape, you stop seeing the actual problem and start defending your pre-drawn map of it. The fog isn’t dangerous; the imaginary oarsman you put in it is.

This is a trap that neat, deterministic computation runs into pretty often. We write equations that presuppose the answer’s structure. We build algorithms that encode our assumptions into the skeleton of a solution. When the problem is clean, low-dimensional, smooth, and well-behaved, this is great. But when reality gets messy and high-dimensional, our rigid boats keep smashing into a river that has no interest in cooperating.

Monte Carlo methods are what you get when you finally set down the oars, stop navigating, and just let the current reveal the information to you.

Monte Carlo: Wisdom Assembled from Ignorance

The core idea is almost aggressively simple: when you can’t work something out analytically, sample it randomly. Take one draw from the space of possibilities. Take another. Take fifty thousand more. Don’t try to understand the whole from any single sample — just keep accumulating them, patiently and without agenda, until the shape of the answer emerges on its own.

An Unusual Example: Bertrand’s Needle and the Average Chord

Here’s a problem that doesn’t get enough attention. Draw a circle. Pick two points anywhere on its circumference, completely at random. Connect them. You’ve drawn a chord. Now ask: what’s the average length of a random chord in a unit circle?

Mathematical derivation for average length of chord

Mathematical derivation for average length of chord

You could work this out with calculus; it’s not impossible, and the answer turns out to be 4r/π (roughly 1.273 for a unit circle with r=1). But the Monte Carlo route is more satisfying. Don’t integrate. Just throw two random points on the circle’s edge, measure the distance between them, and write it down. Do this tens of thousands of times. Average all those distances. Watch as 4/π quietly assembles itself from a pile of individually meaningless measurements. No single chord knew it was contributing to a mathematical constant. The aggregate didn’t care. It just worked.

What makes this example particularly nice is that it has a twin, the Bertrand paradox, which asks a slightly different version of the same question and gets a different answer depending on how you define “random chord”. The answer changes based on what you mean by random. Monte Carlo makes that concrete: you can run three versions of the simulation, each with a different sampling method, and watch three different averages emerge. The math isn’t broken. You just had an imaginary oarsman in the boat, a hidden assumption about what “random” meant.

Play with the interactive demo below:

[embed]Monte Carlo - Average Chord Length Click here to simulate the Monte Carlo Chord examplevinodlouis.com

Watch the early samples. The average jumps to and fro. Each chord is just a chord. It doesn’t know what it’s helping to compute. But give it a few thousand samples and something steadies. The number stops lurching. 4/π has shown up, not because we understood the geometry but because we watched it faithfully, without trying to force it into shape.

“The empty boat asks nothing of the river. It simply goes where the water goes. And somehow, through this total surrender, it finds the other shore.”

That’s what feels almost philosophical about this. Each sample carries exactly zero understanding of the final answer. No single chord knows about 4/π. But stop loading the boat with your derivation and watch, the accumulated emptiness becomes precise knowledge. A monk might call this anattā, the absence of inherent self in any single thing. A statistician calls it the Central Limit Theorem. Zhuangzi would probably smile and say: You stopped filling the boat.

The Technical Machinery

Let’s be specific. A Monte Carlo estimator for some quantity, whether it’s an integral, a physical constant, or a probability, follows a simple pattern:

# Monte Carlo estimation of the average chord length
# in a unit circle. Theoretical answer: 4r/π ≈ 1.27324

import random, math

def random_point_on_circle() -> tuple[float, float]:
    """Pick a uniformly random angle; return
    (x, y) on the unit circle boundary."""
    angle = random.uniform(0, 2 * math.pi)
    return math.cos(angle), math.sin(angle)

def monte_carlo_avg_chord(n_samples: int) -> float:
    """Estimate the average chord length by sampling.

    Each sample:
        1. Pick two random boundary points.
        2. Compute their Euclidean distance.

    The running average converges to 4/π
    by integral geometry (r = 1 here).
    Convergence rate: O(1 / √n)."""
    total_length = 0.0

    for _ in range(n_samples):
        x1, y1 = random_point_on_circle()
        x2, y2 = random_point_on_circle()
        total_length += math.hypot(x2 - x1, y2 - y1)

    return total_length / n_samples

# ── convergence demo ────────────────────────────────
# O(1/√n) holds regardless of dimensionality —
# Monte Carlo's key advantage in high-dim spaces.

target = 4 / math.pi

for n in [100, 10_000, 1_000_000]:
    est = monte_carlo_avg_chord(n)
    err = abs(est - target)
    print(f"n={n:>10,}  avg ≈ {est:.6f}  err={err:.6f}")

# --- OUTPUT ------------------------------------------
# n=       100  avg ≈ 1.168228  err=0.105012
# n=    10,000  avg ≈ 1.272394  err=0.000845
# n= 1,000,000  avg ≈ 1.273983  err=0.000743

That O(1/√n) convergence rate is the key technical fact to hold onto. Classical numerical integration gets better rates in one dimension; quadrature rules can be very efficient for simple, smooth problems. But throw a high-dimensional problem at them, and they fall apart fast. It’s called the curse of dimensionality, and it’s brutal. Monte Carlo doesn’t care. Whether you’re integrating over 3 variables or 3,000, the convergence rate stays at O(1/√n). The empty boat is equally at home on any river, wide or narrow.

That’s why Monte Carlo shows up everywhere messy: financial risk models with thousands of correlated variables, quantum physics simulations, Bayesian inference over huge parameter spaces, and yes, stochastic gradient descent in machine learning, which is really just a Monte Carlo estimator of the true gradient, computed too cheaply to be exact but good enough to get the job done a million times a day.

Applications: Where the Boat Actually Sails

Financial Modeling

Imagine you’re trying to figure out the fair price of a bet that pays out based on how 50 different stocks move together over the next year. Writing a single formula that captures all of that, how each stock behaves, how they influence each other, how that compounds over time, is basically hopeless. So instead, you simulate. You run thousands of pretend futures: the market does this, then that, then this. Each simulated future spits out a payoff. You average them all. That average is your price. No formula needed, just enough fake runs of the world.

Radiation Transport Physics

This is where Monte Carlo was actually born. At Los Alamos in the 1940s, Ulam and von Neumann needed to understand what happens when a neutron enters a lump of fissile material. It’s a mess; the neutron might bounce off an atom, get absorbed, or kick off a fission that releases more neutrons, each of which then does its own unpredictable thing. There’s no clean equation for all of that branching chaos. So they tracked individual neutrons one at a time, letting each one play out randomly, and collected the results across thousands of simulated histories. The averages told them things like how far neutrons travel on average and whether a chain reaction would sustain itself. Each simulated neutron was ignorant. The pile of them wasn’t.

Bayesian Inference (MCMC)

Say you’ve built a model with dozens of unknown parameters and you’ve collected some data. You want to know: given what I observed, what parameter values are actually plausible? There’s a probability distribution that answers this, the posterior, but for any genuinely interesting model, it’s some tangled, high-dimensional shape with no formula you can write down or visualise.

So instead of solving for it, you explore it. You start somewhere in the parameter space and take a random step. If the new spot fits the data better, you move there. If it fits worse, you might still move there, but only with some probability, proportional to how much worse it is. Repeat this thousands of times, and the trail you leave behind naturally spends more time in the regions that actually explain the data, and less in the ones that don’t. That trail is the answer, not derived, just walked into existence one step at a time.

In every one of these applications, Monte Carlo works precisely because it refuses to presuppose what the answer looks like. It carries no map. It samples the process and lets the answer crystallize from the aggregate like the Taoist sage who stops forcing outcomes and acts from a genuine openness to what’s actually there.

Markov Chains: The Boat with One Memory

If Monte Carlo is the philosophy of the empty boat carried by the current, then Markov Chains are that boat given exactly one piece of information: where am I right now? Not where I’ve been. Not where I’m headed. Just now.

A Markov Chain is a sequence of states where the probability of the next state depends only on the current one, not on any history before it. Formally: P(Xₙ₊₁ | Xₙ, Xₙ₋₁, …, X₀) = P(Xₙ₊₁ | Xₙ). The past is irrelevant. The future is unknown. Only this moment governs the transition. The empty boat doesn’t remember yesterday’s current. It only responds to the water directly underneath it, right now. In the weather example below, if it’s sunny today, tomorrow has an 80% chance of being sunny, 15% cloudy, 5% rainy. Yesterday’s weather is irrelevant. The chain doesn’t hold grudges.

A Simple Weather Markov Chain With State Transition Probabilities

A Simple Weather Markov Chain With State Transition Probabilities

Each row sums to 1.0. The chain knows nothing except its current state. Simulated thousands of times via Monte Carlo, it eventually reveals the stationary distribution, the long-run fraction of time spent in each state, without ever needing to solve the underlying equations.

Run this simple chain for long enough and something useful appears: the stationary distribution, roughly, the fraction of days you’d expect to be sunny, cloudy, or rainy in the long run. You didn’t solve any equations to get there. You just let the chain run and watch where it spends its time.

MCMC pushes this further. If you can cleverly design a chain whose long-run distribution matches exactly the probability distribution you’re trying to understand, then running the chain is the inference. The Metropolis-Hastings algorithm does this: it proposes a random step, checks whether the new spot is more or less plausible than the current one, and either accepts the move or stays put. It sometimes wanders into low-probability territory. It occasionally backtracks. From the outside, it looks aimless. But the path it traces, over thousands of steps, carves out the shape of a distribution that had no closed form, known only by being inhabited, step by step.

What this Algorithm Teaches the Philosopher

Back to the river. The man whose boat was nearly hit has seen the empty vessel; his anger is gone, and now he rows in silence. Nothing about the situation changed; it was the same river, same drifting boat. The only thing that shifted was him. He stopped expecting the world to have intent, and the moment he did, the problem dissolved.

Monte Carlo works the same way. You stop trying to understand a system completely before engaging with it. Instead, you just observe it honestly, repeatedly, without forcing it into a shape you’ve already decided on. Each sample is dumb. It knows nothing. But keep collecting them, and the truth assembles itself from the pile.

The fancier techniques of importance sampling, stratified sampling, and control variates are just ways of observing more carefully. Not controlling the river, just standing at the bank with steadier hands. Less noise in the witness, better picture of the thing being witnessed.

That’s what the algorithm quietly teaches: you don’t need a complete theory of something to reason accurately about it. You need patience, honesty, and enough samples. Which, if you think about it, is pretty good life advice too.

“All our knowledge begins with the senses, proceeds to understanding, and ends with reason. But reason itself must sometimes step aside and let chance speak.”

There’s something worth pausing on here. We tend to trust things that sound precise, exact models, clean proofs, definitive answers. But the methods actually doing the heaviest lifting in modern science and technology, folding proteins, pricing financial instruments, mapping the early universe, and training large AI models, are all fundamentally built on randomness. They don’t overcome uncertainty. They run on it.

And Monte Carlo is honest about its limits in a way most tools aren’t. It will get you to the right answer eventually, but eventually means with infinite samples, which you never have. Every finite run still has some wobble in it. That’s not a flaw waiting to be patched. That’s just the truth: certainty isn’t available in finite time, and Monte Carlo doesn’t pretend it is. It gives you the best approximation your sample size allows and tells you exactly how much to trust it.

Engineering culture tends to treat uncertainty as something to be stamped out. More tests, tighter constraints, more rigorous proofs. That instinct makes sense in a lot of places. But Monte Carlo points at something the deterministic toolkit tends to miss: sometimes, in a world that is genuinely complex and high-dimensional and irreducibly noisy, the right move isn’t to force it into a clean shape. It’s to develop a principled, patient practice of sampling from it.

This isn’t laziness. It takes real care to design good sampling procedures, checking statistical properties, computing honest confidence intervals, and knowing where variance is dangerous.

In the end, the Monte Carlo practitioner and the Taoist sage are doing something recognisably similar. They’re learning to stop filling the other boat with their projections, and instead receiving what the river actually offers: not certainty, but something richer truth in distribution.

“Don’t demand that the river flow straight. Sample it where it bends, where it eddies, where it drops without warning. In ten thousand samples, you’ll know it better than any map ever told you.”

A Final Thought

Stanislaw Ulam didn’t set out to change computing. He was in a hospital bed, sick, bored, dealing cards to himself. He got curious about solitaire odds. Not curious enough to do the math, the math was too ugly, but curious enough to just… play. Deal a hand. See what happens. Deal another. Write down what you saw. Do it enough times, and the answer stops hiding. That’s it. That’s the whole thing.

He didn’t conquer the problem. He stopped needing to. He let go of the idea that understanding had to come from the top down, from some elegant equation that already knew the answer, and instead let it bubble up from the bottom, one dumb random sample at a time. Each card flip knew nothing. But Ulam was patient. And patience, it turns out, is its own kind of intelligence.

This is what the empty boat is really about. Not emptiness as absence. Emptiness as readiness. The boat that carries no fixed destination can go anywhere the river needs it to go. The man who doesn’t already know what the cards will say can actually see what they do say.

We’re taught that insight is an act of force, sharper thinking, harder concentration, better models. And sometimes it is. But some problems don’t yield to force. They yield to something quieter: the willingness to not know, to sample without agenda, to sit with uncertainty long enough that the shape of the truth becomes visible not in a single brilliant moment, but across a thousand ordinary ones.

Most of us spend our lives trying to solve for the answer before we’ve dealt the cards carrying maps of destinations we haven’t reached, filling every approaching boat with a captain we invented. But perhaps the deepest act of intelligence available to a human being is the same one Ulam stumbled into flat on his back in 1946: to release the grip, sample faithfully from whatever the moment actually offers, and trust that meaning like 4r/π doesn’t need to be forced into existence. It was always there in the aggregate, waiting for someone patient enough to stop solving and start seeing.

Happy Learning!


메타데이터
post_id
2cc2676c77f9
slug
the-deterministic-mind-in-a-stochastic-world-2cc2676c77f9
url
https://medium.com/@louis.vinod14/the-deterministic-mind-in-a-stochastic-world-2cc2676c77f9
canonical_url
https://medium.com/@louis.vinod14/the-deterministic-mind-in-a-stochastic-world-2cc2676c77f9
author_url
https://medium.com/@louis.vinod14
status
ok
fetched_at
2026-06-09 15:37:30