/two-candles-one-cake

Primary LanguageJupyter NotebookMIT LicenseMIT

Two Candles, One Cake

Interactive visualisations here https://visual-candles-cake.apps.sjtrny.com

Problem

Suppose that you have a Battenburg cake, which is 1 unit long.

You then:

  • place two candles at random positions along the length
  • randomly cut the cake across the length

What is the probability that the knife cuts between the two candles?

Solution

When the candles and knife are uniformly distributed the probability that the knife is between both candles is

$$P(C_{1,2} < K < C_{1,2}) = \frac{1}{3}$$

Working and Code

Full working is provided in the main notebook.

A live version of the notebook can be launched on mybinder.org.

Alternative Solution

An alternative solution using two dependent variables is presented in the dependent-alternative notebook.