Thread Rating:

Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 20th, 2020 at 2:18:51 PM permalink
If you flip a fair coin 40 times, what is the probability of getting BOTH a streak of 5 heads and a streak of 5 tails?

“A streak” meaning at least 1 and “5” meaning at least 5. The head and tail streaks do not have to be adjacent.

Integer answers only.
Last edited by: Ace2 on Apr 20, 2020
It’s all about making that GTA
GMan
GMan
  • Threads: 2
  • Posts: 81
Joined: Jan 5, 2013
April 20th, 2020 at 2:49:01 PM permalink
The probability of a streak of at least 5 consecutive successes in 40 trials is 46.79%
G Man
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 20th, 2020 at 2:59:46 PM permalink
Quote: GMan

The probability of a streak of at least 5 consecutive successes in 40 trials is 46.79%

I disagree with the answer and the non-integer format
It’s all about making that GTA
Wizard
Administrator
Wizard 
  • Threads: 1513
  • Posts: 26961
Joined: Oct 14, 2009
April 20th, 2020 at 4:06:11 PM permalink

111,898,752,105 / 549,755,813,888 = apx. 0.203543
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 20th, 2020 at 5:00:54 PM permalink
Quote: Wizard


111,898,752,105 / 549,755,813,888 = apx. 0.203543

That’s reasonably close, but I disagree. My answer may be wrong, but I’m fairly confident it’s not. I confirmed it with a simulation
It’s all about making that GTA
ssho88
ssho88
  • Threads: 57
  • Posts: 675
Joined: Oct 16, 2011
April 20th, 2020 at 5:52:35 PM permalink
What do you mean by "BOTH a streak of 5 heads and a streak of 5 tails?" ?

Could you please give some examples that comply and some example that not comply to the above rules ?
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 20th, 2020 at 6:00:43 PM permalink
Quote: ssho88

What do you mean by "BOTH a streak of 5 heads and a streak of 5 tails?" ?

Could you please give some examples that comply and some example that not comply to the above rules ?

In 40 flips you must see at least one instance of 5 or more consecutive heads and also at least one instance of 5 or more consecutive tails. Does that make it clearer?

Listing 40 character examples isn’t very practical.
It’s all about making that GTA
ssho88
ssho88
  • Threads: 57
  • Posts: 675
Joined: Oct 16, 2011
April 20th, 2020 at 6:46:50 PM permalink
Prob = [ 2* ( 40!/31!/1! + 40!/30!/2! + 40!/29!/3! + 40!/28!/4! + 40!/27!/5! + 40!/26!/6! + 40!/25!/7! + 40!/24!/8! + 40!/23!/9! + 40!/22!/10! + 40!/21!/11! + 40!/20!/12! + 40!/19!/13! + 40!/18!/14! + 40!/17!/15! ) + 40!/16!/16! ] * 0.5^40. Please read the [ and ( carefully.

To simply above, Prob = [ 2 * Σ(40!/(32-x)!/x!) + 40!/16!/16! ]* 0.5^40, where x varies from 1 to 15, Σ is summation symbol

Is it correct ? I am not sure.


Edited.

Sorry, I don't think my above answer is correct.
Last edited by: ssho88 on Apr 20, 2020
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 20th, 2020 at 6:50:45 PM permalink
Quote: ssho88


Is it correct ? I am not sure.

Is what correct?
Last edited by: Ace2 on Apr 20, 2020
It’s all about making that GTA
Wizard
Administrator
Wizard 
  • Threads: 1513
  • Posts: 26961
Joined: Oct 14, 2009
April 20th, 2020 at 9:18:57 PM permalink
Quote: Ace2

]That’s reasonably close, but I disagree. My answer may be wrong, but I’m fairly confident it’s not. I confirmed it with a simulation




I made a mistake. My new answer is 107,094,548,225 / 549,755,813,888 = apx. 0.194804
Last edited by: Wizard on Apr 20, 2020
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ssho88
ssho88
  • Threads: 57
  • Posts: 675
Joined: Oct 16, 2011
April 20th, 2020 at 10:16:18 PM permalink
Quote: Wizard


I made a mistake. My new answer is 107,094,548,225 / 549,755,813,888 = apx. 0.194804




Through combinations analysis or simulation ?
ssho88
ssho88
  • Threads: 57
  • Posts: 675
Joined: Oct 16, 2011
April 20th, 2020 at 10:47:23 PM permalink
Quote: Ace2

I disagree with the answer and the non-integer format



Results through a simulation(10 million trials), prob = 19.489%.

Still thinking how to solve it arithmetically.
Last edited by: ssho88 on Apr 20, 2020
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 21st, 2020 at 6:38:26 AM permalink
Quote: Wizard


I made a mistake. My new answer is 107,094,548,225 / 549,755,813,888 = apx. 0.194804

That is the correct answer. Please show your method
It’s all about making that GTA
Wizard
Administrator
Wizard 
  • Threads: 1513
  • Posts: 26961
Joined: Oct 14, 2009
Thanked by
IndyJeffrey
April 21st, 2020 at 7:16:13 AM permalink
Quote: Ace2

Please show your method





After the first flip, there are 10 possible states the player can be in:

He can have no runs completed and a streak going of 1 to 4 of the same side going.
He can have completed his first streak and still be in it with 5 or more of the same side.
He can have completed his first streak and have a streak going of 1 to 4 of the other side.
He can have completed both streaks.

In the matrix below, the first number in the left column and top row is the number of the same side in the current streak. The second number is either 0 or 5, depending on whether you've completed the streak of the other side.

The body of the matrix is the probability of going from one state (left column) to new state (top row) with each flip.

It is important to note I start after the first flip, in the 1,0 state.

1,0 2,0 3,0 4,0 5,0 1,5 2,5 3,5 4,5 5,5
1,0 0.5 0.5 0 0 0 0 0 0 0 0
2,0 0.5 0 0.5 0 0 0 0 0 0 0
3,0 0.5 0 0 0.5 0 0 0 0 0 0
4,0 0.5 0 0 0 0.5 0 0 0 0 0
5,0 0 0 0 0 0.5 0.5 0 0 0 0
1,5 0 0 0 0 0.5 0 0.5 0 0 0
2,5 0 0 0 0 0.5 0 0 0.5 0 0
3,5 0 0 0 0 0.5 0 0 0 0.5 0
4,5 0 0 0 0 0.5 0 0 0 0 0.5
5,5 0 0 0 0 0 0 0 0 0 1


As mentioned, I start after the first flip, so need 39 more. I then multiply this matrix by itself 39 times. This is not hard in Excel. If we call this matrix M, then M^39 = M^32 * M^4 * M^2 * M.

The answer will be in the top right cell of M^39 (probability of being in state 5,5).

M^39=

1,0 2,0 3,0 4,0 5,0 1,5 2,5 3,5 4,5 5,5
1,0 0.134349 0.069699 0.036159 0.018759 0.282331 0.140987 0.070354 0.03508 0.017478 0.194804
2,0 0.124617 0.06465 0.03354 0.0174 0.282658 0.141344 0.070634 0.035274 0.017603 0.212281
3,0 0.105858 0.054918 0.028491 0.014781 0.28258 0.14167 0.07099 0.035553 0.017796 0.247362
4,0 0.069699 0.036159 0.018759 0.009732 0.28104 0.141593 0.071317 0.03591 0.018076 0.317715
5,0 0 0 0 0 0.275337 0.140053 0.071239 0.036237 0.018432 0.458703
1,5 0 0 0 0 0.265961 0.135284 0.068813 0.035003 0.017804 0.477135
2,5 0 0 0 0 0.247529 0.125908 0.064044 0.032577 0.016571 0.513371
3,5 0 0 0 0 0.211292 0.107476 0.054669 0.027808 0.014145 0.584611
4,5 0 0 0 0 0.140053 0.071239 0.036237 0.018432 0.009376 0.724663
5,5 0 0 0 0 0 0 0 0 0 1


To express the probability in fraction form, I multiplied the 0.194804 by 2^40.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
April 21st, 2020 at 10:12:51 AM permalink
Thanks, Wizard. I didn't realize you could get to an integer solution for this problem from a Markov chain. I found another way to solve this.

In 40 flips (2^40 = 1,099,511,627,776 permutations) we know that the number of strings with no streaks of 5+ heads is given by the (40 +2) 42nd "Pentanacci" number which is 585,029,621,920. Pentanacci meaning the Fibonacci sequence of the 5th order, where the previous 5 (not 2) terms are summed. Subtract that from total permutations to get 514,482,005,856 strings where there is at least 1 streak of 5+ heads. You can say the same thing about tails.

I found a pattern for strings with no streaks of 5+ heads OR tails. This number of strings is obtained by taking the (40+1) 41st "Tetranacci" number which is 142,368,356,257 and multiplying by 2 to get 284,736,712,514. Tetranacci meaning the Fibonacci sequence of the (5 - 1) 4th order, where the previous 4 terms are summed. Subtract that from total permutations to get 814,774,915,262 strings where there is at least 1 streak of 5+ heads OR tails.

Since we know 514,482,005,856 strings have at least 1 streak of 5+ heads and 514,482,005,856 strings have at least 1 streak of 5+ tails, sum those two figures to get 1,028,964,011,712 strings where there is at least 1 streak of 5+ heads OR tails…however the strings with BOTH are double counted here.

Therefore, 1,028,964,011,712 minus 814,774,915,262 (no double counting) equals 214,189,096,450 strings out of 1,099,511,627,776 (19.48%) with BOTH streaks.
It’s all about making that GTA
CasinoResearch
CasinoResearch
  • Threads: 3
  • Posts: 27
Joined: Mar 29, 2020
April 21st, 2020 at 1:50:30 PM permalink
Ace2, what is your math background? My initial guess would have been a much different method, but I trust your answer over mine.
Wizard
Administrator
Wizard 
  • Threads: 1513
  • Posts: 26961
Joined: Oct 14, 2009
April 28th, 2020 at 8:46:18 PM permalink
Here is my solution in PDF form.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
  • Jump to: