Fooling Your Math Teacher - Heads or Tails

Let’s say my hypothetical math teacher wanted to show me that the odds for heads or tails (on a fair coin toss) are about 50:50, so he gave me homework to toss a coin for 100 times and write down the result.
Well, I certainly have better things to do than tossing a coin 100 times just to demonstrate a simple probability of 50:50, so I decide to fake it.
I sit around and just randomly write “H” and “T”, making sure that the number of heads is roughly close to the number of tails and hand over my assignment:
H TT H T HH TT HH TT H TTT H T H TT H TT H T HH T HH T HH T H T H TTT H T H TT HHH T HH TT H TT HH TT H T H T H TT HH TT H TTT H TTT H T HH T H T H T HH T H TTT H T H
It may look OK, but my hypothetical math teacher should immediately suspect I didn’t really toss a coin. How can he tell? Well, I ran a simple computer program simulating 1 million sets of a 100 fair coin tosses, and this is what I got:
~54% of the results contained at least 7 consecutive H's or T's.
~81% of the results contained at least 6 consecutive H's or T's.
~99% of the results contained at least 5 consecutive H's or T's.
~99.97% of the results contained at least 4 consecutive H's or T's.
All of them contained at least 3 consecutive H's or T's.
Looking at my fake result, you'll notice that the maximum number of consecutive heads or tails is only three. Although the math teacher cannot be 100% sure, the chances for this result being a fake is 99.97% - I should have added longer consecutive series of H’s or T’s.
Some more interesting coin tossing related issues, and the exact probabilities for having consecutive heads or tails can be found here (thank you Michael Hovdan from the Reservoir Engineering Blog and Tamera Daun from Pentad for the link).

BTW, the image is of an ancient Hebrew coin from Judea, coined at 68 AD during The First Jewish-Roman War. These are ancient letters on the coin, but I can read them: That’s “SHEKEL ISRAEL” (Israeli Shekel) and “SHIN-GIMMEL” (marks the third year of the war) on the left, and “YERUSHALAYIM HAKDOSHA” (holy Jerusalem) on the right.

~~~
p.s. Cannibals don’t like brave men; they prefer chickens.

4 comments:

Anonymous said...

I just love stuff, and observations, like this! :)

Anonymous said...

Hi Uri,

4-heads is only a private case of any other 4-tuple (e.g. HTHT, HHHT) and therefore not having at-least one of the 2^n n-tuples is equally strange.

Moreover, what about non-consecutive occurences? for example, having H?H?H?H (? stands of whatever) is expected to occur as many times as H???H???H???H and so on.

Uri Kalish said...

Hey Yair,

1. You must agree that consecutive tosses are much easier to spot when looking at a result.

2. Not all x-letter-words have the same probabilities for appearing in a result. For example, the odds for having 'HHHHH' are not equal to the odds for having 'HHTHH'. In this case our intuition telling us that the word 'HHHHH' is not as common as the word 'HHTHH' is correct, but we tend to exaggerate while assessing its rareness.

kw said...

On principle, everyone should read Fernat's Equasion.

That way we can be suitably down to reality. Particularly when it comes to tossing coins.

I love your blog. Keep up the good work.