Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
The Investor
23 May 10 21:39
Joined:
Date Joined: 05 Jun 06
| Topic/replies: 29 | Blogger: The Investor's blog
Ok, I posted this on the football forum 4 and a half hours ago and nobody has solved it.

Anyone here want to have a go:

If you toss a fair coin 20 times, what is the chance that you get a run of at least 5 heads at any time?
Pause Switch to Standard View Probability Problem - Coin Tossing
Show More
Loading...
Report CLYDEBANK29 May 23, 2010 9:55 PM BST
1-(.96875 to the power of 16)
Report The Investor May 23, 2010 10:01 PM BST
That's not correct. How did you get that answer?

Where does 31/32=.96875 come in?
Report CLYDEBANK29 May 23, 2010 10:07 PM BST
I was figuring you got 16 bites at the cherry.  Each bite having a 1 in 32 chance of coming in.
Report The Investor May 23, 2010 10:18 PM BST
Yes, so you take the chance of no run of five heads from toss 1-5, 2-6, ..., 16-20, and then do the calculation above.

But this overestimates the probability as there is a lot of overlap (The outcome of the sequence that occurs in toss 1-5, 2-6 etc are not independent).

For instance if in the first 'bite at the cherry' you get HTHHH, then you can already rule out the possibility of 5 heads on tosses 2-6.
Report mrjg May 23, 2010 10:20 PM BST
20/1
Report The Investor May 23, 2010 10:26 PM BST
For instance, if you tossed the coin only six times, according to your method, it would be

1-(.96875^2)=0.062

The correct answer is 3/64 = 0.047
Report The Investor May 23, 2010 10:34 PM BST
For six tosses it's easy, just count the possible ways of it happening: HHHHHH, HHHHHT and THHHHH. 3 from 64. Counting like that isn't an option with 20 tosses though :D

mrjg, that's not correct.

Anyone else want to try ;)
Report CLYDEBANK29 May 23, 2010 10:47 PM BST
Investor I was guessing that in the scenario HTHHH although it ruled out the 2-6 turn it increased the chances of the 1-5 by an equal percentage, one therefore offsetting the other.  I knew if that wasn't the case I had no hope of working it out.
Report The Investor May 23, 2010 10:52 PM BST
That's not the case.

For instance if the first 5 tosses happen to be HHHHH, the chance of a sequence of 5 heads on tosses 2-6 becomes 0.5

Good effort though :)
Report Cosmic Horizon May 23, 2010 11:30 PM BST
I don't know.  Although my numerical abilities reside in the top 1% of the population I did only do CSE maths.  Do you use the binomial theorem or something?
Report ROB_D May 23, 2010 11:39 PM BST
0.0148??? my mates is ****
Report ROB_D May 23, 2010 11:39 PM BST
maths even lol (getttin tired lol)
Report ROB_D May 23, 2010 11:42 PM BST
no thts defo not right igno9re me investor
Report Eldrick May 23, 2010 11:57 PM BST
set up markov chain, states S_N={0,1,2,3,4,5} where S_N is the maximum number of consecutive heads seen anywhere in first N tosses

initial state x_0 = [1 0 0 0 0 0]^T

write state after N tosses as x_N

transition matrix P

.5 .5 0 0 0 0
.5 0 .5 0 0 0
.5 0 0 .5 0 0
.5 0 0 0 .5 0
.5 0 0 0 0 .5
0 0 0 0 0  1

then x_N = P^N.x_0

Diagonalise P = EDE* (E is matrix of eigenvectors, D is diagonal with entries given by eigenvalues)

Then P^N = EDE* EDE* ... EDE* = E(D^N)E*

x_20 = E(D^20)E*.x_0

diagonalising P might be a bit tedious, determinant of a 6*6 matrix, mmm nice. you can simplify the workings a good bit though, maybe the eigenvalues can be done by inspection
Report The Investor May 24, 2010 12:16 AM BST
I don't really get how that works Eldrick.

Can you use it to get the answer for the problem?
Report getting better May 24, 2010 2:46 AM BST
May have a look at this later, have just finished dinner
Report senlac May 24, 2010 2:59 AM BST
You would expect that the 5 consecutive heads would turn up
once in 64 tosses. As you have only 16 tosses available , ie
one quarter of the tosses , then you should expect to have
a chance 4 times less. That is one in 256.
Report The Investor May 24, 2010 3:19 AM BST
Senlac, After what Eldrick posted, it would be hilarious if that was correct, but it isn't ;)



Off to bed now. I hope to see the correct answer posted when I get up :D
Report ooO{Alpha Centauri}Ooo May 24, 2010 9:00 AM BST
Correct answer = 0.2499
Report vic May 24, 2010 10:35 AM BST
Answer = 50%. 16 sequences(0-5,2-6 etc) * 0.03125(0.5^5)
Report I am the one and only223 May 24, 2010 10:50 AM BST
Monte Carlo says 0.25

Maybe the maths boils down to 20/5 !
Report Mr Ed May 24, 2010 11:16 AM BST
1048576 combinations
262008 contain a run of 5+ heads
Almost exactly 1/4

.24987
Report ooO{Alpha Centauri}Ooo May 24, 2010 11:17 AM BST
Correct answer =  0.2499

http://www.win.tue.nl/~iadan/blockq/rows.pdf
Report Mr Ed May 24, 2010 11:20 AM BST
.24987030029296875 to be more accurate
Report starfish and coffee May 24, 2010 11:38 AM BST
2H in a row = 4.75 per 20 throws =19 chances x 0.5 x 0.5
3 in a row = 2.25 =18x0.5x0.5x0.5 
4 in a row = 1.06 =17x0.5x0.5x0.5x0.5
5 in a row = 0.50
6 in a row = 0.23
7 in a row = 0.11
8 in a row = 0.05
9 in a row = 0.0234
10 in a row = 0.0107
This makes sense. The likelihood reduces by 50% each time just as it would for a straight sequence, plus a little bit more for the reduced opportunities for it to happen
Report zipper May 24, 2010 11:45 AM BST
Each  toss is  evens .. heads  to get  5  in  a row  its   ev x ev x ev x ev x ev  = 32/1  ..
Report starfish and coffee May 24, 2010 12:21 PM BST
Its not a matter of looking at the 1048576 combinations.
You're only looking at 16 sequences of 5 throws and whether the sequence is HHHHH, of which the chance is 1 in 32.
Report Mr Ed May 24, 2010 12:53 PM BST
that is what I did.
Report The Investor May 24, 2010 1:16 PM BST
Mr Ed, how did you find 262008 contain a run of 5+ heads?
Report The Investor May 24, 2010 3:37 PM BST
Very close I am the one and only223. What program did you use to do the simulation?
I think it's just a coincidence that it's almost exactly 0.25

Alpha centauri, I'm guessing you just found the answer at the link you provided, or did you solve it yourself first?

Mr Ed, did you solve it, or find the answer online?
Report supernap. May 24, 2010 4:12 PM BST
Evens
Report starfish and coffee May 24, 2010 4:18 PM BST
Investor/Ed: why is it not Evens?
Report The Investor May 24, 2010 4:51 PM BST
Starfish, ask yourself what the answer would be for at least 5 heads in 36 tosses, and you should understand why evens is wrong.

I'm guessing you arrived at evens by taking the 1/32 chance 5 heads in 5 tosses x 16?

As shown earlier if you get HTHHH on your first chance of sixteen (tosses 1-5), then it is already impossible to get HHHHH on your second chance (tosses 2-6).

Even if this wasn't the case, evens would still be incorrect though.

If the question was carry out a sequence of 5 coin tosses (independent trials) 16 times, what is the probability of getting HHHHH at least once, the answer would be 1-(31/32)^16 = 0.398 not 0.5

0.5 would be the correct answer if you did 16 trials and eliminated each outcome as it occurred. For instance if you get HTHTT on the first trial and HHTTT on the second and HTHTT again on the third you would ignore the third and continue until you have sixteen distinct sequences.
Report The Investor May 24, 2010 4:53 PM BST
The first line should read a run of at least five tosses...
Report I am the one and only223 May 24, 2010 4:54 PM BST
Very close I am the one and only223. What program did you use to do the simulation?

Just wrote a quick and dirty VB macro:

Sub monte()
Randomize Time
heads5 = 0
trials = 1000000
For this_trial = 1 To trials
    heads = 0
    For this_toss = 1 To 20
        If Rnd() > 0.5 Then
            heads = heads +; 1
        Else
            heads = 0
        End If
        If heads = 5 Then
            heads5 = heads5 +; 1
            Exit For
        End If
    Next
Next
Debug.Print heads5 / trials
End Sub
Report I am the one and only223 May 24, 2010 4:55 PM BST
Without the semi colons though!
Report starfish and coffee May 24, 2010 5:07 PM BST
thanks for the explanation Investor
Report Mr Ed May 24, 2010 5:09 PM BST
I ran a little program, but didnt use any random element.

20 for..next loops and check how many give 5 consecutive Heads or Tails (0s or 1s)

I used vb6
Report ooO{Alpha Centauri}Ooo May 24, 2010 5:11 PM BST
no I didn't work it out, the formula looked complicated enough to be right
Report The Investor May 24, 2010 5:17 PM BST
When I first saw this, I was very surprised at how difficult it was.
Report pots May 24, 2010 7:36 PM BST
(1/2)^5 * 20!/(20!*15!)
Report pots May 24, 2010 7:37 PM BST
sry

(1/2)^5 * 20!/(5!*15!)
Report rockinstallion May 25, 2010 1:55 AM BST
Read somewhere that the formula to calculate a winning/losing sequence of at least a certain length is
[(N-k)*(1-sr) +1] * [sr^k]

Where N = number of tests = 20
      k = length of sequence = 5
      sr = strike rate (as decimal) = 0.5

8.5 * 0.3125 = 0.265625
Report rockinstallion May 25, 2010 2:07 AM BST
Make that 8.5 * 0.03125 = 0.265625
Report Avocado May 25, 2010 8:24 AM BST
The Investor, I'll take your word for it, tossing seems to be your forte.
Report The Lanterne Rouge May 25, 2010 10:39 AM BST
In 20 tosses there are 16 sets of 5 consecutive tosses. The chance of a single set not being 5 heads is 31/32 which equals 0.96875.  The chance of all 16 sets not being 5 heads is 0.96875 to the power of 16.

The chance of at least one run of 5 consecutive heads is, as stated by CLYDEBANK, 1 - (0.96875 to the power of 16).
Report The Investor May 25, 2010 8:19 PM BST
The Lanterne Rouge, that's incorrect, as the 16 sets are not independent.

The answer Mr Ed and Alpha Centauri gave is correct.

rockinstallion, that seems to be a decent approximation formula as it is close to the correct answer.
Report JPL66 May 26, 2010 1:25 AM BST
I agree that Mr Ed and Alpha Centauri are correct.

I've noticed that the maths of this is linked to Fibonacci-like sequences.  Consider the number of ways of throwing N coins that DON'T contain 5 heads in a row:

1,2,4,8,16,30,61,120,236,464,912,1793,355,6930,13624...

Each number in the sequence is the sum of the five previous ones.  (The reason for this should be fairly obvious if you consider that any sequence not containing 5 heads in a row has to end in exactly 0, 1, 2, 3 or 4 heads.)

This is a kind of generalisation of the Fibonacci sequence (summing the previous 5 numbers rather than the previous 2).  For sequences that don't contain TWO heads in a row (rather than 5) the numbers are the ordinary Fibonacci numbers 1,2,3,5,8,13...
Report DFCIRONMAN May 26, 2010 1:52 AM BST
The "correct" answer is ....nobody knows!

If you would stake your life on the probablility of there being at least 5 in a row ............well ....you is nutsssssssssss
Report The Lanterne Rouge May 26, 2010 2:31 AM BST
As you correctly point out the 16 sets are not independent and I am now convinced that I was wrong.

Cheers, The Lanterne Rouge.
Report none101 May 26, 2010 3:07 AM BST
a lot of stupid posts here.

The odds of 5 heads coming up in a row when tossing a single coin 20 times are the same odds of it being 2, 12 or even 20 heads in a row.

The coin has no memory of the previous action and each flip the odds are always going to be the same as if its the very first coin flip.

So the answer to the original posters question is....evens.
Report Puff The Magic Dragon May 26, 2010 9:57 AM BST
Strange, I get 0.265 from monte carlo, in agreement with rockingstallion. It seems to me that the markov argument put forward by alphacenturi calculates the odds of getting exactly 5 in a row rather than 'at least' five in a row.
Report Puff The Magic Dragon May 26, 2010 11:47 AM BST
On seconds thoughts, having fixed a silly mistake, 0.249 is correct
Report tier May 26, 2010 1:29 PM BST
it is 50-50 chance like everything else: five heads will come or they will not!
Report Soren24 May 26, 2010 1:57 PM BST
id say 1.56%
Report The Investor May 26, 2010 2:23 PM BST
none101 Joined: 20 Sep 08
Replies: 12 26 May 10 03:07 
a lot of stupid posts here.

The odds of 5 heads coming up in a row when tossing a single coin 20 times are the same odds of it being 2, 12 or even 20 heads in a row.

The coin has no memory of the previous action and each flip the odds are always going to be the same as if its the very first coin flip.

So the answer to the original posters question is....evens.
-------------

Is that a serious response? Create a simpler version of the problem and you can see this is nonsense.

If you toss a coin 5 times:

Chance of at least 5 heads in a row: 1/32
Chance of at least 4 heads in a row: 2/32+1/32=3/32
Chance of at least 3 heads in a row: 5/32+3/32= 8/32
Chance of at least 2 heads in a row: 11/32+8/32=19/32
Chance of at least 1 heads in a row: 12/32+19/32=31/32
Chance of exactly 0 heads in a row: 1/32
Report The Investor May 26, 2010 2:29 PM BST
rockingstallion,

Just tried your formula with a run of at least 6 heads out of 100 tosses, and it gives:

=((100-6)*(1-0.5)+1)*(0.5^6)= 0.75
exactly.

The correct answer should be around 0.54, so my guess is that the formula is ok as long as you are not working with large numbers. For at least 5 heads out of 6 tosses, it gives exactly the correct answer.
Report I am the one and only223 May 26, 2010 5:46 PM BST
The formula will work fine for 5 heads in a row from 6 up to 10 tosses.  But then it will start counting some series twice.  Like for 11 tosses HHHHHTHHHHH will be counted twice.  So you need to multiply by the chance of there NOT being a series of 5 previously.  Y ou can reproduce this on a spreadsheet:

A1 = 1/2^5   (the chance of the first 5 tosses being heads)

A2 to A6 = 1/2^6     (the chance of the next groups of 6 being THHHHH)

B7 = 1-SUM($A$1:A1)  ( the chance that there hasn't previously been a grouping HHHHH)

A7 = (1/2^6 ) * B7   (the chance of the next groups of 6 being THHHHH times the chance that previous groups haven't)

Copy the range A7:B7 to A8:B16

and the answer is the sum of A1:A16 = .2498703
Report The Investor May 26, 2010 7:55 PM BST
That's very impressive I am the one and only223, as the answer is exactly correct.

What answer would you obtain using that method for a run of at least 6 heads in 100 tosses?
Report I am the one and only223 May 26, 2010 8:01 PM BST
What answer would you obtain using that method for a run of at least 6 heads in 100 tosses?

How does .54609 sound ?
Report The Investor May 26, 2010 8:45 PM BST
Yes, I get 0.546093619 using your method, just wanted to make sure I was doing it right.

http://mathforum.org/
library/drmath/view/
56637.html

gives Prob(at least 1 run of 6 heads) =  0.544507, but that is using an approximation formula. It seems pointless to use it when working it out in excel in the way you described gives the correct answer and is also easier :D

Alpha Centauri gave http://www.win.tue.nl/~iadan/blockq/rows.pdf, which also gives the exact answer (this is from Henk Tijms book Understanding Probability), but I'm having some difficulty understanding how that works. It's a recursion, so I guess you need to do some programming, rather than just putting some numbers in a spreadsheet?
Report I am the one and only223 May 26, 2010 9:38 PM BST
Just done a monte carlo on the 6 heads in 100, and got 0.5459615, which is pretty close to what the spreadsheet says.  Although some precision might be lost there because of the number of dependent calcs.

I don't understand what the code is doing on the page you refer to - I'm strictly a VBA coder!
Report rockinstallion May 26, 2010 11:51 PM BST
I stand corrected, thanks fellas. Should have realised that I was double-counting some sequences.
Report The Investor May 27, 2010 12:44 AM BST
B7 = 1-SUM($A$1:A1)  ( the chance that there hasn't previously been a grouping HHHHH)

Shouldn't this read the chance that there hasn't previously been a grouping of THHHHH, or am I misunderstanding something? I think Cell B7 should contain the chance of 1-either of the two highlighted below in bold occurring?

0.03125   Chance of HHHHH on toss 1-5
0.015625  Chance of THHHHH on toss 1-6
0.015625  Chance of THHHHH on toss 2-7

0.015625  Chance of THHHHH on toss 3-8
0.015625  Chance of THHHHH on toss 4-9
0.015625  Chance of THHHHH on toss 5-10
0.015136719
0.014892578
0.014648438
0.014404297
0.014160156
0.013916016
0.013679504
0.013446808
0.013217926
0.012992859

Total:
0.2498703
Report I am the one and only223 May 27, 2010 1:35 AM BST
A7 contains the chance of THHHHH on tosses 6 to 11.

So the only duplication possible is where tosses 1 to 5 are all heads.  B7 is the chance that this hasn't happened, which is (1 - A1) in effect. So multiplying by B7 gives the chance that 1 to 5 are all combinations except HHHHH followed by 6 to 11 being THHHHH.

For A7, THHHHH on toss 1 to 6 is impossible because toss 6 has to be T.  Similarly THHHHH can't have happened on toss 2 to 7 because again toss 6 would have to be T.

Hope I'm making sense, because it's getting late and I'm tired and I know for sure I'm not infallible!
Report The Investor May 27, 2010 2:14 AM BST
Yes thanks, I get what you mean now.

What confused me when you said "( the chance that there hasn't previously been a grouping HHHHH)", was that it sounds like you mean any sequence of HHHHH, such as the one included in THHHHH, but I see you to exclude HHHHH on tosses 1-5 specifically.
Report The Investor May 27, 2010 2:37 AM BST
DFCIRONMAN Joined: 04 Dec 04
Replies: 5969 26 May 10 01:52 
The "correct" answer is ....nobody knows!

If you would stake your life on the probablility of there being at least 5 in a row ............well ....you is nutsssssssssss

---------------------

And to the questions what is the chance of getting heads if you throw a fair coin once, you would also answer 'nobody knows' I presume...
Report Avocado May 27, 2010 5:27 AM BST
It's sheerly random. You could get ten heads or tails in a row or you could get heads then tails alternating all the way through.
Report JPL66 May 27, 2010 7:01 AM BST
Here's a different way to calculate the same answer (0.546093619249946) for at least 6 consecutive heads in a 100 tosses.

For N tosses of a coin, the number of outcomes that DON'T include 6 consecutive heads for N tosses can be calculated on a spreadsheet as follows:

- For N from 0 to 5, it's just 2^N
- For N>5, it's the sum of the six previous values

For N=100 that gives 5.7539469600523E+;29 outcomes that don't include 6 or more consecutive heads.

Subtract from 2^100 and divide by 2^100 to find the probability that a random outcome will contain six or more consecutive heads i.e. 0.546093619249946
Report Avocado May 27, 2010 7:44 AM BST
Id there a point to this investigation and what does it have to do with betting? Are you talking about betting on even money shots?
Report The Investor May 27, 2010 7:41 PM BST
Nice solution JPL66, well done.

Avocado Joined: 06 May 10
Replies: 1132 27 May 10 05:27 
It's sheerly random. You could get ten heads or tails in a row or you could get heads then tails alternating all the way through.


A specific sequence in say ten tosses
HHHHHHHHHH is indeed just as likely as the more random looking HTTHHTHTHT, but it's fairly obvious that a run of at least two heads will be more likely than at least three heads, and those in turn will be more likely than a run of at least four heads and so on.

Id there a point to this investigation and what does it have to do with betting? Are you talking about betting on even money shots?


Someone that has an understanding of probability theory, will increase their chance of betting profitably. Although it is possible to make money using only simple arithmetic and some creative thinking.

Here's an example of using this kind of problem solving on a much simpler betting problem. Let's say two football teams are playing and they are of equal strength (The chance of team A scoring the next goal = the chance of team B scoring the next goal), there are only 5 minutes left to play and the score is 0-0. How do you think the chances of the game ending in 2-0,1-1 and 0-2 should relate to each other?

If these two teams played a game against each other that finishes after two goals are scored, rather than after 90 minutes, the chances of the scorelines should be 2-0 =25%,1-1=50%, 0-2=25%, assuming that the likelihood of a team scoring the next goal does not change after they or their opponent score.

You can take this further, and use it to test whether odds are correct (in line with each other).
Report Avocado May 28, 2010 4:58 AM BST
If the two teams are equally matched then no bet for me. I'm not sure mathematical systems really work for football, it's more just about your observations of the markets and the teams in general.
Report Avocado May 28, 2010 5:02 AM BST
As for accurately calculating the odds of a team winning a football match, that is virtually impossible because so much depends on how the teams perform on the day rather than what they've done in the past.

Mathematical theory does not apply to a game that is, at times, sheerly random. My theory for betting on football is just bet on whatever you think to be most profitable and expect to lose sometimes because that's the nature of the game, luck can go for or against you.
Report I am the one and only223 May 28, 2010 10:15 AM BST
Avocado Joined: 06 May 10
Replies: 1157 28 May 10 05:02 
As for accurately calculating the odds of a team winning a football match, that is virtually impossible because so much depends on how the teams perform on the day rather than what they've done in the past.


Well of course accurately calculating the odds on most sporting events is difficult.  You have to analyse previous form and come up with your best guess at the probability of the various outcomes and therefore the odds. But if Manchester Utd play one of the bottom clubs in the league at Old Trafford, you can't say it mostly depends on who has the most luck on the day.  They will win 80% to 90% of the time and that will be reflected in the odds.

By the way, 1157 is an impressive number of replies for somebody who only joined 3 weeks ago!
Report Avocado May 28, 2010 10:29 AM BST
I'm a prolific poster. Manchester United at home is certainly no certainty, they are a poor side.
Report Rockinron May 29, 2010 10:29 PM BST
Quite simply in reality the odds never change - each time you toss whether heads or tails same answer 50/50 !

You could toss a coin 20 times ...it could come up heads 20 times or tails 20 times .

From my own experience in a casino ...I was using martingdale system on roulette ....betting red
I had 19 consecutive blacks against me a zero then another 6 blacks ! Wiped out !
Another time ...same casino I saw - it nearly caused a riot 5 consecutice zeros !
Report The Investor May 30, 2010 1:20 AM BST
- For N>5, it's the sum of the six previous values

JPL66, I know this is correct, but how did you work that out?
Report alexz May 30, 2010 4:53 PM BST
the answer is evens.
Report The Investor May 30, 2010 5:01 PM BST
A few people have said evens now... What is the reasoning behind that answer? Confused
Report alexz May 30, 2010 5:05 PM BST
sorry I'm wrong,didn't think about it long enough.I assumed 16  x 1/32
Report zipper May 30, 2010 6:22 PM BST
You  guys  are  full  of    bull  .. now  lestern  up   ever    toss   of  the  coin   is   evens   .. it  dont    matter  if  the  coin  came   down    10,000    on  heads  .,.  the  next  throw  is  still  evens   heads   or  tails  ....... god  your  hard  work  .
Report The Investor May 30, 2010 6:37 PM BST
zipper, of course you're correct, but that has absolutely nothing to do with the question, did you actually read it!

If I say to you toss a fair coin three times, what is the chance you get a run of three heads, are you going to tell me it's 1/8, or are you also going to answer that with 'it doesn't matter how many times heads has come up, it's evens'...
Report dukeofpuke May 31, 2010 12:42 AM BST
ok this might scramble your brains

but the question is 20 coin tosses

but it does not say how many coin tosses of 20

it could 1 million or infinity

so the answer to the latter would be infinity

but if you mean the first 20 only

then the odds are infinity because you are counting the first 20 coin tosses per say person or an infinite number of people coin tosses of 20

if you want only the average of 20 coin tosses against infinity there is no average as its infinite

if its only 1 sequence of 20 tosses per person then work it out Laugh
Report dukeofpuke May 31, 2010 12:48 AM BST
the answer is in the question 'if you'

so you have one sequence of 20

it maybe 0-20 1-20 2-20 etc

come on its easy
Report dukeofpuke May 31, 2010 12:52 AM BST
if you had an infinite number of coins that are tossed

and an infinite number of coin tosses of 20

the answer is infinite
Report JPL66 May 31, 2010 3:07 AM BST
- For N>5, it's the sum of the six previous values

JPL66, I know this is correct, but how did you work that out?


Define S(N) as the number of sequences of N outcomes that DON'T have six heads in a row.  Clearly these fall into six separate groups:

- Sequences ending in zero heads i.e. a sequence of (N-1) that doesn't have 6 or more heads, followed by a tail (T)
- Sequences ending in one heads i.e. a sequence of (N-2) that doesn't have 6 or more heads, followed by TH
- Sequences ending in two heads i.e. a sequence of (N-3) that doesn't have 6 or more heads, followed by THH
- Sequences ending in three heads i.e. a sequence of (N-4) that doesn't have 6 or more heads, followed by THHH
- Sequences ending in four heads i.e. a sequence of (N-5) that doesn't have 6 or more heads, followed by THHHH
- Sequences ending in five heads i.e. a sequence of (N-6) that doesn't have 6 or more heads, followed by THHHHH

The first of these groups has S(N-1) in it, the second S(N-2) and so on.

So S(N) = S(N-1) +; S(N-2) +; ... +; S(N-6)
for all N greater than 5
Report The Investor June 1, 2010 1:31 AM BST
Thanks JPL66, while trying to work that out, I accidentally found another way to solve it too :)

This involves solving a series of simple problems that give the answer for the complex one.
Solve it in one step increments. So if you are interested in the probability of at least 5 consecutive heads in 20 tosses, first solve the number of occurrences without a run of 5 consecutive heads in 0 tosses, then 1 toss, 2 tosses, 3 tosses, .... 20 tosses.


When NH, number of outcomes without a run of 5 heads = N(x) = N(x-1)*2-N(x-1-H)

So for N=20 and H=5, first find the number of outcomes without H consecutive heads for N=0 and H=5, then N=1 and H=5,... N=20 and H=5

N(0)=2^0=1
N(1)=2^1=2
[...]
N(5)=2^5-1=31
N(6)= N(5)*2-N(5-H)
N(7)= N(6)*2-N(6-H)
N(8)=N(7)*2- N(7-H)
[...]
N(20)=N(19)*2-N(19-H)

And for N=100 and H=6, first find the number of outcomes without H consecutive heads for N=0 and H=6, then N=1 and H=6,... N=100 and H=6

N(0)=2^0=1
N(1)=2^1=2
[...]
N(5)=2^5=32
N(6)= 2^6-1=63
N(7)= N(6)*2-N(6-H)
N(8)=N(7)*2- N(7-H)
[...]
N(20)=N(19)*2-N(19-H)
Report The Investor June 1, 2010 1:34 AM BST
Oops, forgot it messes up with some of the symbols on this forum, so I'll try again:

When N less than H, number of outcomes without a run of 5 heads= N(x) = 2^x
When N equals H, number of outcomes without a run of 5 heads = N(x) = 2^x-1
When N greater than H, number of outcomes without a run of 5 heads = N(x) = N(x-1)*2-N(x-1-H)
Report The Investor June 1, 2010 1:40 AM BST
N = number of tosses
H = minimum length of run of heads

"5 heads" in the previous post can be replaced by "H heads" in all three instances, to make the formulas generally applicable to all possible values of N and H.
Report mr winkle June 1, 2010 2:00 AM BST
After the coin tossing is solved, could somebody explain this, because it puzzles me. Confused

It's a card trick with no skill required.

Apparently,  maths do the trick for you,. but as I'm not a  mathematician, I don't understand why it works every time.

It looks lengthy, but it’s not really.

It can be done from start to finish in under two minutes.

Take a standard deck of 52 cards and spread them face down on a table. Ask somebody to remove 3 cards of their choice and to write them down somewhere.

While they do this, you make 4 stacks of cards on the table, all face down.

Going from left to right :

you make the first stack 10 cards

the 2nd and 3rd stacks are 15 cards each

The 4th stack is the remaining 9 cards

You ask your 'client' to place any card of his 3 cards, face down ,  top of the pile on your left. 

You then invite him to cut any number of cards from pile 2, and place them on top of his card on pile 1.

The you ask him to put one of his 2 remaining cards on top of the remains of pile 2.

Then ask him to cut as many cards as he wants from pile 3, and put them on top of his card on pile 2. 

Then ask him to place his final card on the remains of pile 3.

You then place pile 4 on top pile 3, pick this pile up and place it on top pile 2, and pick those up and place them on top of pile 1.

You now have all 52 cards in your hand.

Take the top 4 cards and put them on the bottom of the deck.

Now tell your  'client ‘ you ‘e going to deal the whole deck alternately into two stacks on the table, the first card face up is stack 1,  the second card face down is stack 2.

Ask him to stop you any time he sees one of his  3 cards. When you have dealt 26 face up and 26 face down (he will not have stopped you as he will not have seen any of his 3 cards) place the face up stack of  26 cards to one side.

Take the face down stack of 26 and do the same again. First card face up is pile 1, second card face down is pile 2.  When you have dealt all 26 cards (he still won't see one of his cards) put the 13 face up cards to one side.

Take the face down stack of 13 and do the same again, face up, then face down in 2 stacks.

He still won't see any of his 3 cards. 

Place the 7 face up cards to one side.

Take the last 6 face down cards and do the same again in 2 piles.

Up, down, up, down, up, down.


Put the 3 face up cards to one side, (they’re not his) and ask him to turn over the last 3 face down cards, which will be the cards he chose  at the start.

I’ve done this trick loads of times,  and it makes no difference how the stacks are cut at the start, the last 3 cards are always the 3 the ‘client ‘chose at the start.

But I don’t know why. Sad
Report The Investor June 1, 2010 3:51 AM BST
It's sleight of hand.
You would get the same effect if you told the client to put one of his cards on top of pile 1, one on top of pile 2 and one on top of pile 3, then put pile 2 top of pile 1, pile 3 on top of pile 2 and pile 4 on top of pile 3. Put the top 4 cards on the bottom

The relative positions of the three chosen cards are always the same after each time that you remove the cards in uneven places:

6,22,38
8,16,24
2,6,10
2,4,6

Counting from the top,

the first card selected (that the client places on pile one), will always end up as the 38th card (52 minus 10 minus 4),

the second card will always end up as the 22nd card(52 minus 10 minus 15 minus 1 minus 4)

the third card will always end up as the 6th card (52 minus 10 minus 15 minus 15 minus 2 minus 4)

When 26 cards get weeded out, the order of the remaining cards reverses. So the third card will now become 24th, the second will be in the 16th place and the first card will be in the 8th place.

When another 13 cards get weeded out, the  first card will have cards in positions 2,4, and 6 below it, so it will be in position 13-3=10. Card 2 will be in position 6, and card three will have one card above it, so in position 2.

Seven cards get weeded out, and again the order reverses, card 1 will be in position 2, card 2 will be in position 4, and card 3 will be in position 6.

Finally, the uneven cards are removed, and you are left with the original three cards!
Report FortyTwo June 1, 2010 10:01 AM BST
whats does that have to do with sleight of hand?
Report tier June 1, 2010 12:21 PM BST
to the coin tossing people...arent you all forgetting that coin has edge also? it is small but the chance is there that neither heads or tails will come but the coin will fall and stay on its edge ;)
Report The Investor June 1, 2010 2:31 PM BST
FortyTwo Joined: 16 Jan 06
Replies: 3 01 Jun 10 10:01 
whats does that have to do with sleight of hand?


Because these parts of what mr winkle wrote:

You then invite him to cut any number of cards from pile 2, and place them on top of his card on pile 1.

Then ask him to cut as many cards as he wants from pile 3, and put them on top of his card on pile 2.


Are intended to confuse the client. These steps are completely unnecessary, as they don't change anything.
Their sole purpose is to obfuscate the method being used and divert attention from what is really happening.
Report mr winkle June 1, 2010 3:29 PM BST
The Investor

Thanks for the reply.

I do lots of cards tricks which do involve proper sleight of hand, double lifts etc, but this has always puzzled me.

Didn't mean to keep you up until almost 4-00 a.m.

I was sound asleep by then.
Report FortyTwo June 1, 2010 4:32 PM BST
Surely any sleight of hand would have to be carried out by the person performing the trick and not by the "client"?
Report The Investor June 1, 2010 4:38 PM BST
That's ok, I'm a night owl :)

Ok, FortyTwo, I should have said it's a trick, rather than sleight of hand.
Report FortyTwo June 1, 2010 4:58 PM BST
Sorry for my pedantry Investor, just a little bored today :)
Report The Investor June 2, 2010 1:03 AM BST
Don't worry about it FortyTwo ;)
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com