# Is there a way to really solve it?

If I win when I flip more consecutive heads than I've ever flipped tails, what's my probability of winning? Note by Sumukh Bansal
2 years, 10 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

This is a tricky one. I counted the number of allowable strings of length $n$ starting at $n = 1$ and obtained the sequence $1,0,1,0,1,1,1,2,3,4,6,10,15, ....$, which matches this OEIS sequence. So the desired probability of winning is

$P = \dfrac{1}{2} + \dfrac{1}{2^{3}} + \dfrac{1}{2^{5}} + \dfrac{1}{2^{6}} + \dfrac{1}{2^{7}} + \dfrac{2}{2^{8}} + \dfrac{3}{2^{9}} + \dfrac{4}{2^{10}} + \dfrac{6}{2^{11}} + \dfrac{10}{2^{12}} + .....$.

Now the sequence of numerators is Fibonacci-like in that the ratio of successive terms approaches the golden ratio $\phi$. This allows us to estimate that $0.798 \lt P \lt 0.799$.

Edit: As Milo Koumouris has pointed out, my initial calculation was incorrect; the estimate should actually be $P \approx 0.7112$.

- 2 years, 10 months ago

Thanks Sir

- 2 years, 10 months ago

Wow - I didn't expect this! Nice... Is there away to prove the link?

- 2 years, 10 months ago

While I've confirmed the match up to $n = 13$ I haven't been able to prove it yet. It involves recurrence relations, but seems quite complicated. I'll keep working at it.

- 2 years, 10 months ago

Also, would there be a way to calculate the exact value of $P$? It's pretty easy to do for most recurrences, but do you think it can be done for this one?

- 2 years, 10 months ago

Also, regarding your approximation, since (from observation) $\dfrac{a(n+1)}{a(n)}<\phi \;\; \forall \;\; n\geq 12$, shouldn't $P<\sum_{k=1}^{12}\dfrac{a(k)}{2^k}+\dfrac{a(13)}{2^{13}\left(1-\frac{\phi }{2}\right)}=\dfrac{1439}{2048}+\dfrac{15}{8192\left(1-\frac{\sqrt{5}+1}{4}\right)}\approx 0.7122$? I feel like I missed some information about the sequence when I made the assumption - would it be possible for you to show how you got your approximation?

- 2 years, 10 months ago

Sorry for the slow reply. Yes, you're calculation is correct; I should have triple-checked mine. :/

- 2 years, 10 months ago

I believe that

$P=1-\left(\prod_{n=1}^{\infty }\left(1-\left(\dfrac{1}{2}\right)^n\right)\right)=0.7112119049133975787211002780707692\ldots$

Based on the assumption that the ratio between successive terms of $a(n)$ is monotonically increasing and upper-bounded by $\phi$ for all $n\geq 13$, we can design an approximation technique for $P$:

$\sum_{k=1}^M\left(\dfrac{a(k)}{2^k}\right)+\dfrac{a(M+1)}{2^{M+1}\left(1-\left(\frac{a(M+2)}{2a(M+1)}\right)\right)}

On the OEIS link, there are only $60$ terms provided, so setting $M=58$ and $N=59$ yields

$\dfrac{3467710474555566700753916705}{4875776756717555040447889408}

which implies

$0.7112119048\ldots

and hence we can confirm $P$ rounded to $7$ decimal places as $0.7112119$. Upon searching this value, I found this link to an almost identical problem, with an answer of $0.7112119\ldots$, found by evaluating the product

$P=1-\left(\prod_{n=1}^{\infty }\left(1-\left(\dfrac{1}{2}\right)^n\right)\right)$

So thanks to the much smarter people who actually did the work, came up with this, and proved it, I believe it wouldn't be too hard to use their solutions and verify that this is indeed the answer.

- 2 years, 10 months ago

Great work! With several approaches to the problem yielding the same value I think that it's safe to conclude that the answer is verified. The formula you have for $P$ is surprisingly elegant. :)

- 2 years, 10 months ago

Thanks! Although I didn't really do any work - the others on stack exchange solved it, and you were the one that initially found the recurrence relation. I am surprised too by how simple the formula is... do you think $P$ can be expressed in closed form? Something tells me it can't, but I'm not sure how one would go about proving it.

- 2 years, 10 months ago

I would doubt that there is a closed form. It appears to be related to the Pentagonal Number Theorem.

- 2 years, 10 months ago

- 2 years, 10 months ago

Dunno if this is right but....

Define $P_n$ as the probability of winning starting right after you flipped a total of $n$ tails.

$P_n=\left(\dfrac{1}{2}\right)^{n+1}+\left(1-\left(\dfrac{1}{2}\right)^{n+1}\right)P_{n+1}$

$\Leftrightarrow (2^n-1)P_n=2^nP_{n-1}-1$

Pretty obvious that $P(\infty)=0.$

Aaaand I dunno if this is solvable x'D

- 2 years, 10 months ago

0.5

- 2 years, 9 months ago

Since there is no way to lose, and it is possible to win given any previous sequence of tosses, the reasoning to solve this problem changes. The only way to 'not win' is to toss an endless sequence, since the game can only terminate in a win. There are clearly infinitely many of these endless games, but since the probability of one of these endless games is infinitesimally small ($(\dfrac{1}{2})^N$ as $N\rightarrow \infty$), it would be sufficient to prove that the infinite number of these endless games is not an exponential divergence. I'm not really sure how to address this...

- 2 years, 10 months ago