Open Side Menu Go to the Top
Register
Coin Toss Game Coin Toss Game

11-29-2017 , 05:33 PM
Quote:
Originally Posted by whosnext
I do not know what your formula is purported to show.

If this is a formula for the expected number of lead changes with a fair coin (50% heads) as discussed in this thread, it is clearly wrong.

Examples of demonstrably correct percents are given above which your formula does not agree with.
It does agree with what you posted, up to 3, and then runs into problems with double precision rounding.

Quote:
Originally Posted by whosnext
Since this is easy to code up the brute force scenarios:

For 4 rounds, the distribution of the number of lead changes is:

16 have 0
220 have 1
20 have 2
0 have 3
0 have 4

Which yields an EV of 260/256 = 1.015625

R function that I have gives EV(4) = 1.0
My formula:

SUM from i = 1 to 4
i = 1
(1/2)^1 = 1/2

i =2
(1/2)^2 = 1/4

i = 3
(1/2)^3 + (2 choose 2)*(1/4)^2*(1/2)^1 = 5/32

i = 4
(1/2)^4 + (3 choose 2)*(1/4)^2*(1/2)^2 = 7/64

Total = 1/2 + 1/4 + 5/32 + 7/64 = 65/64 ( = 260/256)
Coin Toss Game Quote
11-29-2017 , 06:18 PM
I get as a result of enumerating all possibilities:

10 1.3805
100 3.31742
1000 9.41951

Does the formula agree with this? My program agrees with the OP for 1-8.
Coin Toss Game Quote
11-29-2017 , 06:25 PM
Quote:
Originally Posted by browni3141
I get as a result of enumerating all possibilities:

10 1.3805
100 3.31742
1000 9.41951

Does the formula agree with this? My program agrees with the OP for 1-8.
Yes, Nick's formula gives those results.
Coin Toss Game Quote
11-29-2017 , 06:31 PM
Quote:
Originally Posted by whosnext
Yes, Nick's formula gives those results.
Thanks, I was a little confused by the various results given in the thread and wasn't sure what was correct without verifying everything.

Actually I was just too lazy, sorry.

Is there still an unsolved problem here that people are interested in?
Coin Toss Game Quote
11-29-2017 , 07:03 PM
Quote:
Originally Posted by TiltedDonkey
It does agree with what you posted, up to 3, and then runs into problems with double precision rounding.



My formula:

SUM from i = 1 to 4
i = 1
(1/2)^1 = 1/2

i =2
(1/2)^2 = 1/4

i = 3
(1/2)^3 + (2 choose 2)*(1/4)^2*(1/2)^1 = 5/32

i = 4
(1/2)^4 + (3 choose 2)*(1/4)^2*(1/2)^2 = 7/64

Total = 1/2 + 1/4 + 5/32 + 7/64 = 65/64 ( = 260/256)
I have not looked into this, but many formulas can give the correct result for small inputs.

The lead change question only becomes interesting (i.e., tricky) when the number of rounds leaves the range of "small" numbers.

My gut tells me that your formula is incorrect for number of rounds greater than 4 (or something like that). It would be hard to believe that the disparity in results is due to lack of precision.


Edit to add:

The following results are known to be correct (here I give them as fractions to help avoid any precision problems).

E(1) = 2 / 4
E(2) = 12 / 16
E(3) = 58 / 64
E(4) = 260 / 256
E(5) = 1,126 / 1,024
E(6) = 4,788 / 4,096
E(7) = 20,140 / 16,384
E(8) = 84,120 / 65,536
E(9) = 349,606 / 262,144
E(10) = 1,447,556 / 1,048,576


Last edited by whosnext; 11-29-2017 at 07:23 PM. Reason: added edit at bottom
Coin Toss Game Quote
11-29-2017 , 07:06 PM
Quote:
Originally Posted by browni3141
Thanks, I was a little confused by the various results given in the thread and wasn't sure what was correct without verifying everything.

Actually I was just too lazy, sorry.

Is there still an unsolved problem here that people are interested in?
I am not sure it is properly called an "unsolved" problem, but it may be of interest to find a "simpler" formula in addition to Nick's formula posted above. TiltedDonkey has presented an alternative formula that may or may not be correct.
Coin Toss Game Quote
11-29-2017 , 11:16 PM
I got this result independently. It is the expected number of lead changes as a function of the number of rounds, n:



I'm not aware of whether or not there is a formula for this type of series.
Coin Toss Game Quote
11-30-2017 , 12:19 AM
Quote:
Originally Posted by browni3141
Thanks, I was a little confused by the various results given in the thread and wasn't sure what was correct without verifying everything.

Actually I was just too lazy, sorry.

Is there still an unsolved problem here that people are interested in?
If a player has a given lead, what is the expected number of rounds until the other player is in the league? Standard deviations would be nice.
Coin Toss Game Quote
11-30-2017 , 02:25 AM
Quote:
Originally Posted by browni3141
I got this result independently. It is the expected number of lead changes as a function of the number of rounds, n:



I'm not aware of whether or not there is a formula for this type of series.
Very nicely done!

As far as I can determine, the formula above gives identical results to Nick's formula previously posted in this thread.

(For large number of rounds, Nick's formula is recommended as it does not encounter any overflows.)

To repeat: very very good stuff in this thread. Kudos to all.
Coin Toss Game Quote
11-30-2017 , 09:54 AM
Quote:
Originally Posted by whosnext
I have not looked into this, but many formulas can give the correct result for small inputs.

The lead change question only becomes interesting (i.e., tricky) when the number of rounds leaves the range of "small" numbers.

My gut tells me that your formula is incorrect for number of rounds greater than 4 (or something like that). It would be hard to believe that the disparity in results is due to lack of precision.


Edit to add:

The following results are known to be correct (here I give them as fractions to help avoid any precision problems).

E(1) = 2 / 4
E(2) = 12 / 16
E(3) = 58 / 64
E(4) = 260 / 256
E(5) = 1,126 / 1,024
E(6) = 4,788 / 4,096
E(7) = 20,140 / 16,384
E(8) = 84,120 / 65,536
E(9) = 349,606 / 262,144
E(10) = 1,447,556 / 1,048,576

Quote:
Originally Posted by whosnext
I am not sure it is properly called an "unsolved" problem, but it may be of interest to find a "simpler" formula in addition to Nick's formula posted above. TiltedDonkey has presented an alternative formula that may or may not be correct.
Quote:
Originally Posted by browni3141
I got this result independently. It is the expected number of lead changes as a function of the number of rounds, n:



I'm not aware of whether or not there is a formula for this type of series.
Yeah, mine was wrong. Well done.
Coin Toss Game Quote

      
m