Expecting Perfection

If the expected number of flips to get k k tails in a row on a fair coin is a perfect number , then find k k .


The answer is 2.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Mark Hennings
Oct 30, 2019

Let E k , j E_{k,j} be the expected number of tosses of the coin to get k k tails in a row, given that we already have a run of j j heads. Then E k , k = 0 E_{k,k} = 0 while E k , j = 1 2 ( 1 + E k , 0 ) + 1 2 ( 1 + E k , j + 1 ) 0 j k 1 E_{k,j} \; =\; \tfrac12(1 + E_{k,0}) + \tfrac12(1 + E_{k,j+1}) \hspace{2cm} 0 \le j \le k-1 Thus 2 E k , j = 2 + E k , 0 + E k , j + 1 E k , j 2 j = 2 + E k , 0 2 j + 1 + E k , j + 1 2 j + 1 E k , 0 E k , j 2 j = r = 0 j 1 ( E k , r 2 r E k , r + 1 2 r + 1 ) = r = 0 j 1 2 + E k , 0 2 r + 1 = ( 2 + E k , 0 ) ( 1 2 j ) \begin{aligned} 2E_{k,j} & = \; 2 + E_{k,0} + E_{k,j+1} \\ \frac{E_{k,j}}{2^j} & = \; \frac{2 + E_{k,0}}{2^{j+1}} + \frac{E_{k,j+1}}{2^{j+1}} \\ E_{k,0} - \frac{E_{k,j}}{2^j} & = \; \sum_{r=0}^{j-1}\left(\frac{E_{k,r}}{2^r} - \frac{E_{k,r+1}}{2^{r+1}}\right) \; = \; \sum_{r=0}^{j-1}\frac{2 + E_{k,0}}{2^{r+1}} \; = \; \big(2 + E_{k,0}\big)(1 - 2^{-j}) \end{aligned} with the last identity being valid for 0 j k 0 \le j \le k . Thus, putting j = k j=k , we obtain E k , 0 = ( 2 + E k , 0 ) ( 1 2 k ) E k , 0 = 2 ( 2 k 1 ) \begin{aligned} E_{k,0} & = \; \big(2 + E_{k,0}\big)(1 - 2^{-k}) \\ E_{k,0} & = \; 2(2^k - 1) \end{aligned} and E k , 0 E_{k,0} is the expected number of tosses to get a sequence of k k tails in a row. We want E k , 0 E_{k,0} to be a perfect number, which occurs when k = 2 k=\boxed{2} , since E 2 , 0 = 6 E_{2,0} = 6 . Since the even perfect numbers are of the form 2 p 1 ( 2 p 1 ) 2^{p-1}(2^p-1) where p p and 2 p 1 2^p-1 are both prime, it is clear that k = 2 k=2 is the only solution.

David Vreken
Nov 2, 2019

Let E E be the expected number of flips to get k k tails in a row. If your first flip in a new sequence is tails, you have to start over for an added expected value of 1 + E 1 + E , which will happen 1 2 \frac{1}{2} of the time. If your first flip in a new sequence is heads and your second flip is tails, you have to start over for an added expected value of 2 + E 2 + E , which will happen 1 4 \frac{1}{4} of the time. Continue with this reasoning until your first k 2 k - 2 flips in a new sequence are heads and your second flip is tails, then you have to start over for an added expected value of k 1 + E k - 1 + E , which will happen 1 2 k 1 \frac{1}{2^{k - 1}} of the time. And if your first k 1 k - 1 flips in a new sequence is tails, then there is a 1 2 \frac{1}{2} chance of getting the k k tails in a row and a 1 2 \frac{1}{2} chance of having to start over, for an added expected number of 1 2 k + 1 2 ( k + E ) \frac{1}{2}k + \frac{1}{2}(k + E) , which will happen 1 2 k 1 \frac{1}{2^{k - 1}} of the time. Therefore,

E = 1 2 1 ( 1 + E ) + 1 2 2 ( 2 + E ) + . . . + 1 2 k 1 ( k 1 + E ) + 1 2 k 1 ( 1 2 k + 1 2 ( k + E ) ) E = \frac{1}{2^1}(1 + E) + \frac{1}{2^2}(2 + E) + ... + \frac{1}{2^{k - 1}}(k - 1 + E) + \frac{1}{2^{k - 1}}(\frac{1}{2}k + \frac{1}{2}(k + E))

which solves to

E = 2 k 1 1 + 2 k 2 2 + . . . + 2 1 ( k 1 ) + 2 k E = 2^{k - 1} \cdot 1 + 2^{k - 2} \cdot 2 + ... + 2^1 \cdot (k - 1) + 2k

This can be shown inductively to be

E = 2 ( 2 k 1 ) E = 2(2^k - 1)

E E is necessarily even, and all even perfect numbers are in the form of 2 p 1 ( 2 p 1 ) 2^{p - 1}(2^p - 1) . By examining each equation, we can conclude that p 1 = 1 p - 1 = 1 and p = k p = k , which solves to p = k = 2 p = k = \boxed{2} (for an perfect expected value of 6 6 ).

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...