Author |
Topic: Coin tossing: no two consecutive heads (Read 8791 times) |
|
NickH
Senior Riddler
Gender:
Posts: 341
|
|
Coin tossing: no two consecutive heads
« on: Jan 22nd, 2003, 6:40pm » |
Quote Modify
|
An unbiased coin is tossed n times. What is the probability that no two consecutive heads appear?
|
|
IP Logged |
Nick's Mathematical Puzzles
|
|
|
RexJacobus
Newbie
Gender:
Posts: 14
|
|
Re: Coin tossing: no two consecutive heads
« Reply #1 on: Jan 23rd, 2003, 6:37am » |
Quote Modify
|
Off the top of my head I saw that if you flip two coins only 1 of the permutations is false. From there I intuitively saw the following progression: (I am newbie, forgive me if I should hide the following. I looked in the FAQs but couldn't find out how you do that. ) If you double number of false permutations for and add n-1 then you would have the next number of false permutations. ie 1 out of 4 false for 2 flips; 3 flips double the one and add n-1 = 3 out 8 false; double the 3 and add n-1 for 8 out 16 false. Writing that progression out mathematically is proving to be a pain in the arse though. I'm still working on that and my lunch hour is up. Rex
|
|
IP Logged |
|
|
|
wowbagger
Uberpuzzler
Gender:
Posts: 727
|
|
Re: Coin tossing: no two consecutive heads
« Reply #3 on: Jan 23rd, 2003, 9:43am » |
Quote Modify
|
First of all, here's my answer: pn = 3/4 - n2-n I arrived at it by the recurrence relation RexJacobus mentioned. You can find a closed form expression for pn if you look at the amount added when progressing from n to n+1. After that it's all about not getting consufed by all these 2s and ns. It's a nice little practice to work it out by hand, I'd say.
|
|
IP Logged |
"You're a jerk, <your surname>!"
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Coin tossing: no two consecutive heads
« Reply #4 on: Jan 23rd, 2003, 10:17am » |
Quote Modify
|
on Jan 23rd, 2003, 9:43am, wowbagger wrote:First of all, here's my answer: pn = 3/4 - n2-n |
| is pn is the chance of not getting consecutive head, you'd expect pn to get smaller as n gets larger.. Your function does the opposite, it get's larger as n get's larger (than 1 / LN(2) ~= 1.44)..
|
« Last Edit: Jan 23rd, 2003, 10:21am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
wowbagger
Uberpuzzler
Gender:
Posts: 727
|
|
Re: Coin tossing: no two consecutive heads
« Reply #5 on: Jan 23rd, 2003, 10:26am » |
Quote Modify
|
on Jan 23rd, 2003, 10:17am, towr wrote: is pn is the chance of not getting consecutive head, you'd expect pn to get smaller as n gets larger.. Your function does the opposite, it get's larger as n get's larger.. |
| You're right, of course. I counted the wrong possible outcomes once again... So the answer should be pn = n/2n+1/4 then.
|
|
IP Logged |
"You're a jerk, <your surname>!"
|
|
|
NickH
Senior Riddler
Gender:
Posts: 341
|
|
Re: Coin tossing: no two consecutive heads
« Reply #6 on: Jan 23rd, 2003, 10:26am » |
Quote Modify
|
Here's a list of all the outcomes for 6 coins, with no consecutive heads in red. There are only 21 such outcomes... HHHHHH, HHHHHT, HHHHTH, HHHHTT, HHHTHH, HHHTHT, HHHTTH, HHHTTT, HHTHHH, HHTHHT, HHTHTH, HHTHTT, HHTTHH, HHTTHT, HHTTTH, HHTTTT, HTHHHH, HTHHHT, HTHHTH, HTHHTT, HTHTHH, HTHTHT, HTHTTH, HTHTTT, HTTHHH, HTTHHT, HTTHTH, HTTHTT, HTTTHH, HTTTHT, HTTTTH, HTTTTT, THHHHH, THHHHT, THHHTH, THHHTT, THHTHH, THHTHT, THHTTH, THHTTT, THTHHH, THTHHT, THTHTH, THTHTT, THTTHH, THTTHT, THTTTH, THTTTT, TTHHHH, TTHHHT, TTHHTH, TTHHTT, TTHTHH, TTHTHT, TTHTTH, TTHTTT, TTTHHH, TTTHHT, TTTHTH, TTTHTT, TTTTHH, TTTTHT, TTTTTH, TTTTTT
|
« Last Edit: Jan 23rd, 2003, 10:29am by NickH » |
IP Logged |
Nick's Mathematical Puzzles
|
|
|
wowbagger
Uberpuzzler
Gender:
Posts: 727
|
|
Re: Coin tossing: no two consecutive heads
« Reply #7 on: Jan 23rd, 2003, 10:45am » |
Quote Modify
|
Well, looks like my little formula does not give the same result as the brute force approach. However, the error is below 5% in this case. I hope at least the asymptotic behaviour is correct...
|
|
IP Logged |
"You're a jerk, <your surname>!"
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Coin tossing: no two consecutive heads
« Reply #8 on: Jan 23rd, 2003, 10:57am » |
Quote Modify
|
let's make phn the chance of getting n coins without consecutive heads and ending on heads, and ptn the chance of getting n coins without consecutive heads and ending on tails. ph1=1/2 pt1=1/2 phn= 1/2 * ptn-1 ptn= 1/2 * ptn-1 + 1/2 * phn-1 then of course pn = ptn + phn
|
« Last Edit: Jan 23rd, 2003, 10:59am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Coin tossing: no two consecutive heads
« Reply #9 on: Jan 23rd, 2003, 11:07am » |
Quote Modify
|
hmm.. any valid sequence will be of the form T*(HT+)*(H?)T* the maximum number of H in n coinflips, will be (n+1) div 2. And given m H, you just need to distribute the remaining n-2m+1 (given m heads, you need m-1 tails to seperated them) tails between the heads, m+1 bins.. Of course I don't remember how to do that, but I've seen William do it somewhere else.. (just can't remember where)
|
« Last Edit: Jan 23rd, 2003, 11:11am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Coin tossing: no two consecutive heads
« Reply #11 on: Jan 23rd, 2003, 12:09pm » |
Quote Modify
|
also it's fib(n+2)/2^n (granted, I lack proof, but it seems to be so nonetheless) so,
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
RexJacobus
Newbie
Gender:
Posts: 14
|
|
Re: Coin tossing: no two consecutive heads
« Reply #12 on: Jan 24th, 2003, 1:41am » |
Quote Modify
|
I am more of a verbal intuiter who is okay with numbers than a true math bod. Is (n+2)/2^n the definition of a fibonacci sequence? In the end I came up with 2(2^n + (2^(n-1) – 2)) – 2(n-1) / 2^(n+2) Rex
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Coin tossing: no two consecutive heads
« Reply #13 on: Jan 24th, 2003, 7:21am » |
Quote Modify
|
fibonacci sequence: fib(0)=0 fib(1)=1 fib(n)=fib(n-1)+fib(n-2) which is equal to (((1+sqrt5)/2)^n - ((1-sqrt5)/2)^n)/sqrt(5)
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
SWF
Uberpuzzler
Posts: 879
|
|
Re: Coin tossing: no two consecutive heads
« Reply #14 on: Jan 24th, 2003, 6:03pm » |
Quote Modify
|
That is cool that the Fibonacci sequence comes out of this. Knowing that makes it easier to prove what the probablity is. Let Hn be the number of acceptable (not two heads in a row) permuations of n flips with heads on the final flip. Let Tn be the number of acceptable permutations of n flips with tails on the final flip. Any sequence of n acceptable flips ending in tails can be turned in an acceptable sequence of n+1 flips ending in heads, by appending heads to the end of the sequence. This also gives every possible acceptable sequence of n+1 ending in heads, so Hn+1=Tn. Any sequence of n acceptable flips can be turned in an acceptable sequence of n+1 flips ending in tails, by appending tails to the end of the sequence. So Tn+1=Tn+Hn. By the result of previous paragraph this reduces to: Tn+1=Tn+Tn-1. The results of the last two paragraphs give: Hn+1=Tn=Tn-1+Tn-2 =Hn+Hn-1. By listing the possibilities, H1=1 and H2=1. With the recurrance relation above, this means H is the Fibonacci sequence: Hn=Fn. It also means Tn=Fn+1. Total number of acceptalbe permuations of n flips is Tn+Hn=Fn+1+Fn=Fn+2. Probability is this divided by 2n, which is exactly the form towr inferred.
|
|
IP Logged |
|
|
|
NickH
Senior Riddler
Gender:
Posts: 341
|
|
Re: Coin tossing: no two consecutive heads
« Reply #15 on: Jan 25th, 2003, 7:55am » |
Quote Modify
|
It is cool that the Fibonacci sequence is involved! See the solution at my puzzle site for an alternative derivation.
|
« Last Edit: Jan 25th, 2003, 8:02am by NickH » |
IP Logged |
Nick's Mathematical Puzzles
|
|
|
|