Started By
Message

Probability question, help

Posted on 11/13/14 at 10:19 am
Posted by TigerDik86
Baton Rouge
Member since Oct 2011
2982 posts
Posted on 11/13/14 at 10:19 am
Coffee must not have kicked in yet.

Need help on how to solve the below problem. If, someone wouldn't mind showing me how to solve, I'd greatly appreciate it.

quote:

You are going to play a game where you bet a dollar and get to flip a coin ten times. If you get four heads in a row, you win. If you make the tenth flip without getting four heads in a row, you lose. Run this game ten thousand times. Approximately what is the probability that you will win?


Here's where I'm at. I've run the simulation in Excel 10k times. However, I don't know the =IF statement that can find 4 "Heads" in a row. Each game is per row and each flip is per column. What if statement can I use to find 4 heads in a row? After that, I'll know how to find the percentage.

TIA

Mashed Potatoes for your troubles.

Posted by SouthOfSouth
Baton Rouge
Member since Jun 2008
43456 posts
Posted on 11/13/14 at 10:22 am to
Always bet cause it's fun and worst case you only lose a dollar.
Posted by Powerman
Member since Jan 2004
162191 posts
Posted on 11/13/14 at 10:23 am to
quote:

Run this game ten thousand times
quote:

Approximately what is the probability that you will win?

Do you just have to win one out of 10K times?

That would easily be ~100%
Posted by WG_Dawg
Hoover
Member since Jun 2004
86438 posts
Posted on 11/13/14 at 10:24 am to
quote:

Do you just have to win one out of 10K times?

That would easily be ~100%


Uh, no it wouldn't.
Posted by TexasTiger01
Lake Houston
Member since Nov 2013
3215 posts
Posted on 11/13/14 at 10:24 am to
Posted by Powerman
Member since Jan 2004
162191 posts
Posted on 11/13/14 at 10:25 am to
I'm a bit rusty on probability...not sure that the problem will be found using a simple excel formula.

But this should be based on conditional probability. Certain things have to happen in sequence.
Posted by CSB
Member since May 2014
1202 posts
Posted on 11/13/14 at 10:26 am to
quote:

Uh, no it wouldn't.



uh, yes it would.
Posted by Powerman
Member since Jan 2004
162191 posts
Posted on 11/13/14 at 10:26 am to
quote:



Uh, no it wouldn't.


Flipping 4 consecutive heads when you run the experiment 10K times is pretty much certain
Posted by CptBengal
BR Baby
Member since Dec 2007
71661 posts
Posted on 11/13/14 at 10:32 am to
quote:

If you get four heads in a row, you win. If you make the tenth flip without getting four heads in a row, you lose.


conditional probability for 2 heads in a row

P(A|B) = P(A intersect B)/P(B)

ETA: Expand for four heads in a row updating the probability of B for each consecutive flip.

that is the probability for 1 experiment. You will run the experiment of 10 flips, 10k times.
This post was edited on 11/13/14 at 10:33 am
Posted by Rouge
Floston Paradise
Member since Oct 2004
136793 posts
Posted on 11/13/14 at 10:33 am to
1:16
Posted by TigerDik86
Baton Rouge
Member since Oct 2011
2982 posts
Posted on 11/13/14 at 10:35 am to
quote:

CptBengal


Thank you guys!
Posted by Hermit Crab
Under the Sea
Member since Nov 2008
7162 posts
Posted on 11/13/14 at 10:35 am to
I just did it and set 1 as heads and 0 as tails, did an if statement that if the previous 4 numbers totaled 4 then true, if not then false did that all the way down the 10 attempts. then expanded that out to 10000 attempts. got it on 2,458 of the 10,000
Posted by TigerDik86
Baton Rouge
Member since Oct 2011
2982 posts
Posted on 11/13/14 at 10:36 am to
quote:

Powerman

Each game = 10 flips
4 heads in a row = win
whats the probability of winning over 10k games
Posted by WG_Dawg
Hoover
Member since Jun 2004
86438 posts
Posted on 11/13/14 at 10:37 am to
quote:

Flipping 4 consecutive heads when you run the experiment 10K times is pretty much certain




I realize the ~ that he posted makes him correct, since ~ gives you a margin of error, but no it would not be a solid 100%.

I don't care if you run it one billion times...every single time you flip a coin it's 50/50. That is a fact. Of course the odds are extremely great you'd get 4 heads in a row after enough tests...but it is aboslutely not a 100% certainty.
Posted by McVick
Member since Jan 2011
4466 posts
Posted on 11/13/14 at 10:46 am to
Always switch to the other door
Posted by tokenBoiler
Lafayette, Indiana
Member since Aug 2012
4409 posts
Posted on 11/13/14 at 10:53 am to
Does your homework need to be in Excel? Here's a quick and dirty Python solution:

quote:


import random
def flip():
..return random.choice(('h','t'))

def flip10():
..out=''
..for a in range(10):
....out += flip()
..return out

def check4(s):
..return 'hhhh' in s

count = 0
for a in xrange(10000):
..if check4(flip10()):
..count += 1

print float (count) / float (10000)



leading dots here represent spaces in the python program.

Answer is about .24

I don't know Excel, but I'm guessing the same approach would work there -- build a string of 'h' and 't' for each run of 10, then look for a substring of 'hhhh'

Posted by ugasickem
Allatoona
Member since Nov 2010
10751 posts
Posted on 11/13/14 at 11:00 am to
I just did it. missed on the first 10. The 2nd 10, got 4 heads in a row on my first 4 flips.
Posted by Powerman
Member since Jan 2004
162191 posts
Posted on 11/13/14 at 11:11 am to
quote:


I realize the ~ that he posted makes him correct, since ~ gives you a margin of error, but no it would not be a solid 100%.

I don't care if you run it one billion times...every single time you flip a coin it's 50/50. That is a fact. Of course the odds are extremely great you'd get 4 heads in a row after enough tests...but it is aboslutely not a 100% certainty.


Correct. Mathematically it can't be exactly equal to 100% because there is an absurdly small non zero probability of it not happening. But it's almost infinitely small.
Posted by LOCO5150
NWA
Member since Sep 2011
4867 posts
Posted on 11/13/14 at 11:12 am to
If you were to get 8 heads in a row in a single 10 flip sequence wouldn't that change the overall win/loss % based on the formula you have set up in excel for calculating a win for only 4 in a row?
Posted by CSB
Member since May 2014
1202 posts
Posted on 11/13/14 at 11:21 am to
The 5th-10th coin flips need to be conditional on the first 4 for the equation to work. Simple programming.
first pageprev pagePage 1 of 3Next pagelast page

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram