Almost Sure
Almost Sure

@Almost_Sure

9 Tweets 2 reads Sep 12, 2023
How frequently do streaks of luck come along?
If I repeatedly flip a coin ๐Ÿช™, any fule kno it takes on average two tosses to get a head. Or six rolls of a dice ๐ŸŽฒ on average to get a six.
What about two heads in a row? Or, two sixes in a row, or three or four...?
A #random๐Ÿงต
At first guess you might think it takes 4 tosses on average to get two heads in a row, since the probability of getting two heads on any two consecutive tosses is 1 in 4.
But this is too small. Being twice the time for a single head, it is the expected time to get two heads...
...๐˜ฏ๐˜ฐ๐˜ต ๐˜ฏ๐˜ฆ๐˜ค๐˜ฆ๐˜ด๐˜ด๐˜ข๐˜ณ๐˜ช๐˜ญ๐˜บ ๐˜ค๐˜ฐ๐˜ฏ๐˜ด๐˜ฆ๐˜ค๐˜ถ๐˜ต๐˜ช๐˜ท๐˜ฆ.
So 4 is too small.
You might also guess at 8, since if we were to divide the sequence into pairs of coin tosses, each has 1/4 of being two heads, so it should take on average 4 pairs of tosses.
๐˜›๐˜ ๐˜›๐˜› ๐˜๐˜› ๐™ƒ๐™ƒ
But this ignores the fact that the first two consecutive heads might not align with the way we grouped them into pairs:
๐˜›๐˜ ๐˜›๐˜› ๐˜๐˜› ๐˜›๐™ƒ ๐™ƒ๐˜›
So 8 is too big. The true answer has to be between 4 and 8.
In fact, it can be shown that it takes, on average, ๐Ÿฒ tosses.
Similarly it takes ๐Ÿฐ๐Ÿฎ dice rolls on average to get two consecutive sixes!
This is more than the naรฏve guess of 6ยฒ=36.
Going further...it takes 14 tosses on average to get three consecutive heads of a coin, and 258 rolls of a dice for three consecutive sixes.
Spot the pattern?
The expected time to get 1,2 and 3 consecutive heads are respectively:
2, 2ยฒ+2 = 6, 2ยณ+2ยฒ+2 = 14
Expected time to get 1,2 and 3 consecutive sixes of a dice are respectively:
6, 6ยฒ+6 = 42, 6ยณ+6ยฒ+6 = 258
Can you guess how long it takes to get six sixes on average?
Did you get it?
6โถ+6โต+6โด+6ยณ+6ยฒ+6 = 55,986
Well done!
The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will eventually type the complete works of William Shakespeare.
en.wikipedia.org
Being a little less ambitious, how long before it types the word ABRACADABRA?
We suppose it hits each letter A through Z independently with equal probability, and ignore any other characters.

Loading suggestions...