Skip to content
Philosophy for Kids

Why Bananas Don't Cause Migraines: The Hidden Math of Cause and Effect

The Grill, the Banana, and the Mystery of Cause and Effect

Even a simple grill has a hidden causal structure—equations and arrows that explain how things work.

Imagine you’re at a cookout. You turn a knob, press the igniter, and a flame appears. Then you put a patty on the grill, and it cooks. Simple, right? But hidden inside that ordinary moment is a puzzle philosophers and scientists have been wrestling with for a century: how do we know what causes what?

Back in 1921, a biologist named Sewall Wright was trying to understand how genes influence traits in animals. He realized you could use mathematics to map out cause and effect. His tool, now called a causal model, represents a system with variables—things that can take different values—and equations showing how each variable depends on others.

Let’s build a model of the grill. We’ll use variables like these:

  • Gas knob (0 for off, 1 for low, 2 for medium, 3 for high)
  • Igniter (1 if pressed, 0 if not)
  • Flame (0 for off, 1 for low, 2 for medium, 3 for high)
  • Meat on (1 for yes, 0 for no)
  • Meat cooked (0 for raw, 1 for rare, 2 for medium, 3 for well done)

The relationships between them can be written as equations:

  • Flame = Gas level × Igniter
  • Meat cooked = Flame × Meat on

These equations together form a structural equation model (SEM). But there’s also a picture that helps us see the causal connections at a glance: a directed acyclic graph (DAG). In a DAG, variables are dots, and arrows show direct causes. For our grill, Gas knob → Gas level → Flame → Meat cooked, with Igniter also pointing to Flame and Meat on pointing to Meat cooked. The graph is “acyclic” because no arrow loops back to cause itself. This tiny model already contains a powerful idea: causation flows in one direction.

What If We Intervened? The Power of ‘Do’

When you intervene, you "break" the normal causal arrows and set a variable yourself.

Now, let’s ask a “what if” question. Suppose the flame was high and the meat well done. What if the flame had been low instead? Would the meat have been rare?

If we simply observe the world, all we see is what actually happened. But a causal model lets us compute counterfactuals—statements about situations that didn’t happen. To do this, we use the idea of an intervention. When you intervene, you force a variable to a chosen value by overriding its usual causes—like lighting the grill with a match instead of the igniter. In the SEM, we replace the equation for that variable with a new fixed value.

For example, to see what would happen if the flame were low, we replace Flame = Gas level × Igniter with Flame = 1. Then we solve the remaining equations. If Meat on = 1, the meat cooked value would be 1, so it would be rare. This gives us the structural counterfactual: “If the flame had been set to low, the meat would have been rare.” Notice we don’t reason backward: we don’t ask “If the meat were rare, would the flame have been low?” An intervention only changes things downstream, never upstream. That matches how we think about real actions: pressing a button doesn’t change what happened before.

When Coincidence Looks Like Causation: Probability and the Markov Condition

Probability patterns can fool you—two things can rise and fall together without one causing the other.

Real life is messier than a grill. Often we can’t write down exact equations because we don’t know all the hidden factors. Instead, we rely on probabilities: how often things happen together.

Meet Cheryl. She loves bananas, but she’s noticed that on days she eats one, she often gets a migraine later. She knows a banana doesn’t cause the headache—but how can she prove it? She builds a causal model with three variables: Potassium deficiency (K), Banana (B), and Migraine (M). Her doctor tells her that low potassium makes her crave bananas and triggers migraines. So the true DAG is K → B and K → M, with no arrow between B and M.

If we just looked at the probabilities, we’d see that eating a banana raises the chance of a migraine. But we’d be mistaking correlation for causation. To avoid this, causal models rely on a key principle called the Markov Condition. It says: once you know the direct causes (the “parents” of a variable), knowing about any other earlier variable tells you nothing extra about that variable. In Cheryl’s case, once you know she has a potassium deficiency, knowing whether she ate a banana gives no additional information about her migraine probability. The parents screen off the other influences.

When a DAG and a probability distribution satisfy the Markov Condition, we call the combination a causal Bayes net. These nets allow us to compute the probabilities of different outcomes, but only if we have the right causal structure. The challenge is that several different DAGs can fit the same pattern of correlations. For instance, instead of K causing both B and M, it could be that B causes M directly—but we know from biology that’s not true here. The goal of causal discovery is to use data and background knowledge to figure out which DAG is correct.

From Data to Diagrams: Discovering Causes Without Experiments

Often the same data can fit several causal stories—you need extra clues to pick the right one.

Often we can’t do experiments. You can’t randomly assign people to have potassium deficiencies just to see what happens. So how do scientists learn causal structure from sheer observation?

If you have a probability distribution over a set of variables, and you assume the Markov Condition and an extra condition called Faithfulness (roughly, all the independencies in the data are required by the causal graph, not by lucky cancellations), then you can narrow down the possible DAGs to a set called a Markov equivalence class. For three variables X, Y, Z, if X and Z are independent only when you condition on Y, then the only DAGs consistent with that pattern must have Y as a common effect of X and Z (a “collider”), like X → Y ← Z. But if the pattern is different, you might be left with several possibilities that you can’t distinguish without more information.

The breakthrough came when researchers realized that if you can perform even a few interventions—setting a variable yourself—you can greatly speed up discovery. With enough well-chosen interventions, you can pin down the exact causal graph even when hidden common causes are lurking. The math behind this, developed especially by computer scientist Judea Pearl and the team of Peter Spirtes, Clark Glymour, and Richard Scheines, shows that causal structure leaves a detectable signature in probabilities, and interventions make that signature crystal clear.

The Philosopher Who Solved Newcomb’s Problem (and Saved Cheryl’s Breakfast)

Cheryl's choice: eat the banana because it's harmless pleasure, or avoid it because it's linked to migraines?

Now back to Cheryl. Should she eat a banana? Ordinary decision theory would tell her to avoid it because eating a banana is evidence that a migraine is coming. But that seems irrational—the banana doesn’t cause the migraine. This puzzle, known as Newcomb’s problem, has troubled philosophers for decades.

Causal models offer a clean solution: treat your own action as an intervention. When Cheryl decides to eat a banana, she isn’t just observing herself; she’s doing it, breaking the arrow from potassium deficiency to banana eating. The probability of a migraine, given that she intervenes to eat a banana, is the same as if she didn’t—because the common cause is no longer providing information about her state. Using the do-calculus, a set of rules for computing the effects of interventions, we find that eating a banana gives Cheryl a small bit of pleasure (utility 1) with no extra migraine risk. So the rational choice is to eat it.

This approach, called Causal Decision Theory, isn’t just about bananas. It reshapes how we think about free will, responsibility, and policy. Every time you choose something, you are intervening on the world. Causal models give you a framework to think clearly about what will actually happen as a result of your action, rather than what your action merely signals.

Why This Matters: Your Brain Is a Causal Model

You automatically build causal models all the time—this math helps you test them.

When you say, “I failed the test because I didn’t study,” you’re building a tiny causal model in your head. When you wonder, “Would I have won if I’d passed the ball?” you’re asking a counterfactual question. These aren’t just academic games—they’re the foundation of how we explain, predict, and decide.

Understanding the formal tools of causal models gives you a superpower: the ability to tell when your brain’s quick causal stories might be wrong. It helps you spot hidden common causes, avoid superstitious reasoning (lucky socks don’t cause wins), and make decisions that actually bring about the outcomes you want. The same math that saves Cheryl from needless banana avoidance is used in medicine to figure out whether a drug works, in economics to assess policy, and in law to determine fault.

So next time you’re grilling, craving a banana, or just wondering why things happen, remember: there’s a whole hidden algebra of cause and effect, and you’re already starting to master it.

Think about it

  1. If you discovered that students who drink more coffee get better grades, how could you test whether coffee really causes the grade boost, or whether some third factor (like more sleep) explains both?
  2. Imagine you could rewind your morning and choose a different breakfast. If everything else then played out exactly the same, would that prove your breakfast choice was a true cause of what happened later? Why might you still be unsure?
  3. Should juries use causal models to decide whether a person’s actions caused harm, even if the model can only give probabilities, not certainties? What might be fair or unfair about that?