# Episode 6

In **episode 6**, Oxford DPhil student Zheneng joins us to explain hypothesis testing, and we finish some curve sketching from the previous episode.

#### Further Reading

#### Optional Stopping

Something I wanted to talk about on the livestream is an effect called “optional stopping”. It happens when you do something multiple times, but rather than stopping after a certain fixed number of trials, you stop once some condition has been met. This can have an effect on statistics calculated from your results. Here’s an example of what I mean.

Question: Suppose I roll a fair die until you get a 6, then stop, and then work out the proportion of rolls that are 6. What do we expect this number to be?

Answer: Let’s make a table of what might happen.

Outcome (? is anything except 6) | Probability | Observed Proportion |

6 | $\displaystyle \frac{1}{6}$ | $1$ |

?6 | $\displaystyle \left(\frac{5}{6}\right)\left(\frac{1}{6}\right)$ | $\displaystyle \frac{1}{2}$ |

??6 | $\displaystyle \left(\frac{5}{6}\right)^2\left(\frac{1}{6}\right)$ | $\displaystyle \frac{1}{3}$ |

... | ... | ... |

Now we want the expected value for the proportion. The way to work out the expected value is to multiply each observed value by its probability, and add all of those up. Here, we’ve got the calculation;

\begin{align*}

\text{Expected Proportion}=&\frac{1}{6}\times 1 + \left(\frac{5}{6}\right)\left(\frac{1}{6}\right)\times \frac{1}{2}+\left(\frac{5}{6}\right)^2\left(\frac{1}{6}\right)\times \frac{1}{3}+\cdots\\

=& \frac{1}{5}\left(\frac{5}{6}+\frac{1}{2}\left(\frac{5}{6}\right)^2+\frac{1}{3}\left(\frac{5}{6}\right)^3+\cdots\right)\\

\end{align*}

Here I’ll use a little bit of algebra to simplify this sum. If you’ve seen the Taylor series for $\ln(1+x)$, then you might have seen this coming. If not, then this step is essentially magic!

\begin{align*}

=& \frac{1}{5}\ln \frac{1}{1-\frac{5}{6}}\\

=& \frac{1}{5}\ln 6\\

\approx&0.36

\end{align*}

So in conclusion, if you roll a fair die until you get a six and then stop, then I expect more than a sixth of your dice rolls to be six. This is a sort of counter-intuitive property of expectation; formally, mathematicians write things like

$$ \text{In general,}\quad \mathbb{E}\left(\frac{1}{X}\right)\neq \frac{1}{\mathbb{E}(X)}.$$

To be really clear about why this is counter-intuitive; I expect you to roll the die six times, and I expect (I know!) that you’ll have exactly one six. But I expect more than one-sixth of your rolls to be six!

Exercise: Check that, for the problem above, the expected number of dice rolls is 6.

Exercise: Suppose I roll a fair die until I get two sixes (not necessarily in a row). Find the expected number of rolls, and find the expected “proportion of rolls that are six” (this last calculation needs a trick like the one above!).

Adding consecutive numbers

Here’s the add break problem again (with a clarification about positive numbers). On the livestream, we talked about solutions to the first three parts, but I don’t think I saw anyone solve (and prove) the last part.

Ariana is experimenting with adding consecutive positive whole numbers together. For example;

\begin{align*}

33+34=&67\\

5+6+7+8=&26\\

1+2+3+4+5+6+7+8=&36

\end{align*}

Which numbers can Ariana make by adding together two consecutive numbers?

Which numbers can Ariana make by adding together three consecutive numbers?

Which numbers can Ariana make by adding together four consecutive numbers?

Which numbers can't be made, no matter how many consecutive numbers Ariana uses?

If you solve the last part, let us know on oomc [at] maths.ox.ac.uk and we might feature your solution on the livestream!

Hypothesis testing

The suspiciously-successful Minecraft speedruns were submitted to mcspeedrun.com. You can find their original report here; https://mcspeedrun.com/dream.pdf . That document goes into plenty of extra detail and brings in lots of high-powered statistical techniques that don’t change the final answer much.

#### Curve sketching

People seemed to like the curve sketching, so here are a couple more.

$$\text{(a)} \quad x^3+y^3=1 \qquad\text{(b)}\quad y=e^{-x}\sin(x)$$

One of these is related to a spring. The other is just a nice graph that I like!

If you want to get in touch with us about any of the mathematics in the video or the further reading, feel free to email us on oomc [at] maths.ox.ac.uk.