Thread Rating:

Poll

21 votes (45.65%)
14 votes (30.43%)
6 votes (13.04%)
3 votes (6.52%)
12 votes (26.08%)
3 votes (6.52%)
6 votes (13.04%)
5 votes (10.86%)
12 votes (26.08%)
10 votes (21.73%)

46 members have voted

Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
February 3rd, 2022 at 6:02:20 PM permalink
Quote: Ace2

Avg rolls to get two consecutive 7s is: 6^1 + 6^2 = 42
link to original post



Interesting. It leads me to a another puzzle...

What is the expected number of flips of a coin to get two consecutive heads? What if the probability of heads is p? Please don't just reference Ace2's answer as something "previously solved."
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 3rd, 2022 at 6:11:57 PM permalink
For an event with probability p, the expected number of trials to get c consecutive occurrences of the event is the sum of (1/p)^n from n= 1 to c.

It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 3rd, 2022 at 6:13:05 PM permalink
Quote: Wizard

Interesting. It leads me to a another puzzle...

What is the expected number of flips of a coin to get two consecutive heads? What if the probability of heads is p? Please don't just reference Ace2's answer as something "previously solved."



Let E(n) be the expected number of tosses needed to get to 2 consecutive heads from n consecutive heads
E(2) = 0
E(1) = 1 + p E(2) + (1 - p) E(0) = 1 + (1 - p) E(0)
E(0) = 1 + p E(1) + (1 - p) E(0)
p E(0) = 1 + p E(1)
E(0) = 1/p + E(1) = 1/p + 1 + (1 - p) E(0)
p E(0) = (p + 1) / p
E(0) = (p + 1) / p^2 = 1/p + (1/p)^2

For p = 1/2, the expected number is 1 / (1/2) + (1 / (1/2))^2 = 2 + 4 = 6.

Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
February 3rd, 2022 at 6:13:53 PM permalink
Quote: Ace2

For an event with probability p, the expected number of trials to get c consecutive occurrences of the event is the sum of (1/p)^n from n= 1 to c.

link to original post



I don't dispute this is true. In fact, I can see it is true for n = 1 and n = 2. However, for full credit, you have to prove it.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 3rd, 2022 at 6:23:35 PM permalink
For an event with probability p, the expected number of trials to get c consecutive occurrences of the event can also be expressed as : ((1/p)^(c+1) -1) / (1/p - 1) -1

So, for instance, to roll three consecutive 7s with a pair of dice the avg number rolls is: (6^4 -1) / 5 - 1 = 258

The formula is reduced for a 50/50 coin flip. To get, for example, seven consecutive heads the avg number of flips is simply 2^8 -2 = 254

Last edited by: Ace2 on Feb 3, 2022
It’s all about making that GTA
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 3rd, 2022 at 6:52:49 PM permalink
Going along with the current theme of this thread, how many rolls would it take, on average, to roll 18 consecutive yo’s ?
It’s all about making that GTA
Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
February 3rd, 2022 at 7:01:20 PM permalink
Quote: Ace2

Going along with the current theme of this thread, how many rolls would it take, on average, to roll 18 consecutive yo’s ?
link to original post



Good one!

I get 41,660,902,667,961,000,000,000 (please forgive the Excel limit for significant digits)

Assuming one roll per second per person (24/7) and a global population of 8 billion, it would take, on average, 165,019 years to see this happen.
Last edited by: Wizard on Feb 11, 2022
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 3rd, 2022 at 7:09:51 PM permalink
Quote: Wizard

Quote: Ace2

Going along with the current theme of this thread, how many rolls would it take, on average, to roll 18 consecutive yo’s ?
link to original post



Good one!

I get 41,660,902,667,961,000,000,000 (please for the Excel limit for significant digits)

Assuming one roll per second per person (24/7) and a global population of 8 billion, it would take, on average, 165,019 years to see this happen.
link to original post

Agreed.

(18^19 -1) / 17 - 1 =- 4.17 x 10^22 rolls

In this case you could just call it 18^19 / 17.

Those two “minus 1s” don’t have much of a relative effect on a 23 digit answer!
It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
Thanked by
aceside
February 3rd, 2022 at 7:41:19 PM permalink
Quote: Wizard

Quote: Ace2

For an event with probability p, the expected number of trials to get c consecutive occurrences of the event is the sum of (1/p)^n from n= 1 to c.

link to original post



I don't dispute this is true. In fact, I can see it is true for n = 1 and n = 2. However, for full credit, you have to prove it.
link to original post



Let E(k) be the number of trials needed to get c consecutive occurrences given k consecutive occurrences

E(c) = 0
E(c-1) = 1 + (1 - p) E(0)
E(c-2) = 1 + p E(c-1) + (1 - p) E(0)
= 1 + p (1 + (1 - p) E(0)) + (1 - p) E(0)
= 1 + p + p (1 - p) E(0) + (1 - p) E(0)
= (1 + p) + (p + 1)(1 - p) E(0)
= (1 + p) + (1 - p^2) E(0)
E(c-3) = 1 + p E(c-2) + (1 - p) E(0)
= 1 + p ((1 + p) + (1 - p^2) E(0)) + (1 - p) E(0)
= 1 + p + p^2 + (p - p^3) E(0) + (1 - p) E(0)
= 1 + p + p^2 + (1 - p^3) E(0)
...
E(c-k) = 1 + p + p^2 + ... + p^(k-1) + (1 - p^k) E(0)
...
E(1) = (1 + p + p^2 + ... + p^(c-2)) + (1 - p^(c-1)) E(0)
E(0) = 1 + p E(1) + (1 - p) E(0)
= 1 + p (1 + p + p^2 + ... + p^(c-2)) + E(0) (p - p^c + 1 - p)
= 1 + p (1 + p + p^2 + ... + p^(c-2)) + E(0) (1 - p^c)
p^c E(0) = 1 + p (1 + p + p^2 + ... + p^(c-2))
= 1 + p + p^2 + ... + p^(c - 1)
= (1 - p^c) / (1 - p)
E(0) = (1 - p^c) / (p^c (1 - p))
= ((1 - p^c) / (1 - p)) / p^c
= (p^(c-1) + p^(c-2) + ... + 1) / p^c
= 1/p + 1/p^2 + ... + 1/p^c

Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
Thanked by
acesideteliot
February 4th, 2022 at 11:22:57 AM permalink
For a 50/50 coin flip, Fibonacci can also be used for the calculation

The expected number of flips to get c consecutive heads is the c+3 number of the Fibonacci series of order c, plus 1

So, for example, the expected number of flips to get six consecutive heads is the 9th “Hexanacci” number (125) plus 1 is 126.
It’s all about making that GTA
aceside
aceside
  • Threads: 2
  • Posts: 443
Joined: May 14, 2021
February 4th, 2022 at 1:24:07 PM permalink
Quote: ThatDonGuy

Quote: Wizard

Quote: Ace2

For an event with probability p, the expected number of trials to get c consecutive occurrences of the event is the sum of (1/p)^n from n= 1 to c.

link to original post



I don't dispute this is true. In fact, I can see it is true for n = 1 and n = 2. However, for full credit, you have to prove it.
link to original post



Let E(k) be the number of trials needed to get c consecutive occurrences given k consecutive occurrences

E(c) = 0
E(c-1) = 1 + (1 - p) E(0)
E(c-2) = 1 + p E(c-1) + (1 - p) E(0)
= 1 + p (1 + (1 - p) E(0)) + (1 - p) E(0)
= 1 + p + p (1 - p) E(0) + (1 - p) E(0)
= (1 + p) + (p + 1)(1 - p) E(0)
= (1 + p) + (1 - p^2) E(0)
E(c-3) = 1 + p E(c-2) + (1 - p) E(0)
= 1 + p ((1 + p) + (1 - p^2) E(0)) + (1 - p) E(0)
= 1 + p + p^2 + (p - p^3) E(0) + (1 - p) E(0)
= 1 + p + p^2 + (1 - p^3) E(0)
...
E(c-k) = 1 + p + p^2 + ... + p^(k-1) + (1 - p^k) E(0)
...
E(1) = (1 + p + p^2 + ... + p^(c-2)) + (1 - p^(c-1)) E(0)
E(0) = 1 + p E(1) + (1 - p) E(0)
= 1 + p (1 + p + p^2 + ... + p^(c-2)) + E(0) (p - p^c + 1 - p)
= 1 + p (1 + p + p^2 + ... + p^(c-2)) + E(0) (1 - p^c)
p^c E(0) = 1 + p (1 + p + p^2 + ... + p^(c-2))
= 1 + p + p^2 + ... + p^(c - 1)
= (1 - p^c) / (1 - p)
E(0) = (1 - p^c) / (p^c (1 - p))
= ((1 - p^c) / (1 - p)) / p^c
= (p^(c-1) + p^(c-2) + ... + 1) / p^c
= 1/p + 1/p^2 + ... + 1/p^c


link to original post


A couple of months ago, I also derived the streak calculator for blackjack. Firstly, we define p=win probability, q=loss probability, r=tie probability (thus p+q+r=1), and then we have the average number of hands required for an N success in a row on the p-side event of blackjack outcome.

R=P/(1-r-Pxq),
where P={1-[p/(1-r)]^N}/{1-[p/(1-r)]}.
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 5th, 2022 at 2:05:27 PM permalink
As you may already know, there is a Super Bowl bet for the number of field goals scored. The line is listed as:

Over 3.5 +120
Under 3.5 -140

Assuming the number of field goals scored per game follows a normal distribution and that +130/-130 is the fair line for this bet, what is the average number of field goals scored?
It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 5th, 2022 at 3:02:14 PM permalink

-140 vs +120 means that 3.5 is at the 7/13 point of the total - i.e. 7/13 of the area under the normal distribution curve is to the left of 3.5.

Of course, 1/2 of the area is to the left of the mean, so the difference between the mean and 3.5 makes up 1/26 of the total.

This is about 0.096 standard deviations from the mean, so the mean = 3.5 - 0.096 = 3.404

charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 5th, 2022 at 3:08:03 PM permalink
Quote: Ace2

...Assuming the number of field goals scored per game follows a normal distribution and that +130/-130 is the fair line for this bet, what is the average number of field goals scored?
link to original post

I have had to use a different distribution as, say, you used a normal distribution then it would be possible to have a negative number of field goals! Thus...
I created a spreadsheet using BINOM.DIST(G5,$G$2,$G$1,FALSE). This essentially assumes you have a number of discrete time periods and at each time period have a fixed chance of the event happening. Using N=1000 and Pr= 0.003368 gives the chances of 3 or fewer at 56.52% which is about 13/23. Thus the average number of field goals would be 3.368. I suspect if you increase N then the number converges to something similar. To get the same expected loss of each bet (-140 +120) it would be about 3.38.
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 5th, 2022 at 3:52:51 PM permalink
Quote: ThatDonGuy


-140 vs +120 means that 3.5 is at the 7/13 point of the total - i.e. 7/13 of the area under the normal distribution curve is to the left of 3.5.


link to original post



Would you elaborate? I don’t see how you got to 7/13, which does not factor into my calculation
Last edited by: Ace2 on Feb 5, 2022
It’s all about making that GTA
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 5th, 2022 at 4:24:38 PM permalink
^ Ace2 and ThatDonGuy
I see your logic and, while I disagree with the approach, interestingly if I were using it would get a very similar answer. My thought would be if the average were Np then the SD would be SQRT(Npq). As N tends to infinity, q tends to 1, so SQRT(Npq) = SQRT(Average).
Now the probability of being under 3.5 is 13/23, rather than 7/13, since the bookie is gambling 100 and you are gambling 130 (or the other way round for over). The total value is 230 so to be a fair bet you would win 130 times and the bookie 100 times (or vice versa).

It transpires to get this percentage on a normal curve this is 1/6 SD above mean (I've used data at https://www.mathsisfun.com/data/standard-normal-distribution-table.html )

Solving 3.5 = Av + 1/6 SQRT(Average) means Average = 3.202.

As I said in my reply this includes a finite chance of negative field goals! So perhaps one has to factor this out somehow.
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 5th, 2022 at 4:56:30 PM permalink
Quote: charliepatrick

^ Ace2 and ThatDonGuy

I see your logic and, while I disagree with the approach, interestingly if I were using it would get a very similar answer. My thought would be if the average were Np then the SD would be SQRT(Npq). As N tends to infinity, q tends to 1, so SQRT(Npq) = SQRT(Average).
Now the probability of being under 3.5 is 13/23, rather than 7/13, since the bookie is gambling 100 and you are gambling 130 (or the other way round for over). The total value is 230 so to be a fair bet you would win 130 times and the bookie 100 times (or vice versa).

It transpires to get this percentage on a normal curve this is 1/6 SD above mean (I've used data at https://www.mathsisfun.com/data/standard-normal-distribution-table.html )

Solving 3.5 = Av + 1/6 SQRT(Average) means Average = 3.202.

As I said in my reply this includes a finite chance of negative field goals! So perhaps one has to factor this out somehow.

link to original post

That’s more like what I was thinking, though I got to a precise answer

And the answer is very close to the actual 2021 average field goals of 3.213, which makes me more confident of this calculation
Last edited by: Ace2 on Feb 5, 2022
It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 5th, 2022 at 4:56:33 PM permalink
Quote: Ace2

Quote: ThatDonGuy


-140 vs +120 means that 3.5 is at the 7/13 point of the total - i.e. 7/13 of the area under the normal distribution curve is to the left of 3.5.


link to original post



Would you elaborate? I don’t see how you got to 7/13, which does not factor into my calculation

link to original post



I assumed -140 vs +120 meant that the -140 event would happen 140 / (140 + 120) = 7/13 of the time.

Hmmm...now that I think about it, that doesn't make much sense, does it? That would mean that if the odds were -260/+240, then the -260 event would happen 26/50 = 52% of the time, when of course it is expected to happen far more often than that.

I have a feeling it should be calculated like this: let f be the amount bet on the favorite, and u the amount bet on the underdog, so that both bets return the same.
Favorite wins: 5/7 f - u
Underdog wins: 6/5 u - f
5/7 f - u = 6/5 u - f
12/7 f = 11/5 u
60 f = 77 u
f = 77, u = 60
The favorite should win 77 / 137 of the time - correct?

Oops - just saw the other responses...

Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 5th, 2022 at 5:07:16 PM permalink
Quote: ThatDonGuy

Quote: Ace2

Quote: ThatDonGuy


-140 vs +120 means that 3.5 is at the 7/13 point of the total - i.e. 7/13 of the area under the normal distribution curve is to the left of 3.5.


link to original post



Would you elaborate? I don’t see how you got to 7/13, which does not factor into my calculation

link to original post



I assumed -140 vs +120 meant that the -140 event would happen 140 / (140 + 120) = 7/13 of the time.

Hmmm...now that I think about it, that doesn't make much sense, does it? That would mean that if the odds were -260/+240, then the -260 event would happen 26/50 = 52% of the time, when of course it is expected to happen far more often than that.

I have a feeling it should be calculated like this: let f be the amount bet on the favorite, and u the amount bet on the underdog, so that both bets return the same.
Favorite wins: 5/7 f - u
Underdog wins: 6/5 u - f
5/7 f - u = 6/5 u - f
12/7 f = 11/5 u
60 f = 77 u
f = 77, u = 60
The favorite should win 77 / 137 of the time - correct?

Oops - just saw the other responses...


link to original post

I agree with 77/137 based on the +120/-140 actual line, which would make the fair line 77/60 or +128.33/-128.33, but I wanted to remove that part of the calculation.

So, as mentioned, you can assume a fair line of +130/-130, which gives the under a 130/230 chance of winning and the over a 100/230 chance
Last edited by: Ace2 on Feb 5, 2022
It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 9th, 2022 at 6:49:08 AM permalink
Here's an "easy" math problem from the 2012 Harvard Math Tournament's "theme" round (the theme for half of the questions was Rock, Paper, Scissors - well, one question was Rock, Paper, Scissors, Lizard, Spock) - what surprised me was, this was rated as the hardest problem in that round:

A 4-player game of Rock, Paper, Scissors is played as follows:
In each turn, each player still in the game "throws" Rock, Paper, or Scissors normally.
If all of the players throw the same thing, no one is eliminated.
If at least one throws Rock, at least one throws Paper, and at least one throws Scissors, no one is eliminated.
If two of the three are thrown, the players who threw the one that would normally lose are eliminated.
For example, if there are four players remaining, and they throw Rock, Rock, Scissors, Rock, then, since "Rock breaks Scissors," the player who threw Scissors is eliminated; if they throw Paper, Paper, Scissors, Paper (or Scissors, Scissors, Paper, Paper), then, since "Scissors cut Paper," the players who threw Paper are eliminated.
What is the expected number of turns before all but one player are eliminated?
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 9th, 2022 at 10:01:27 AM permalink
45/14 =~ 3.2 turns

Where states f, g and h represent 2, 3 and 4 players remaining respectively

h = 1 + 13/27h + 2/9f + 4/27g
g = 1 + 1/3g + 1/3f
f = 1 + 1/3f

Solve for h
Last edited by: Ace2 on Feb 9, 2022
It’s all about making that GTA
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 9th, 2022 at 2:11:31 PM permalink
Rock-Paper-Scissors

Let "Person 1" always pick Rock, then consider the other player(s)
S1 = 0 (i.e. if you're down to one player, no further turns required)
S2
If player 2 picks Rock, play again, otherwise there's a winner chosen (Paper, Scissors).
x = (x+1)/1 + 1/3 + 1/3 (which we'll rewrite from now on as…
3x = (x+1) + 1 + 1.
So 2x=3, x=1.5.
S3
(i) RR, PS, SP each create a replay (y+1),(y+1),(y+1)
(ii) PP SS RP RS PR SR each have 2v1, where half produce one winner and half produce two to go forward.
9y = 3*(y+1)+3*1+3*(1+x) = 3y+3+3+7.5.
So 6y=13.5, y=2.25
S4
(i) RRR(1), RPS(6), PPS(3), SSP(3) each create a replay (z+1)
(ii) PPP(1) SSS(1) each have 3v1, where half produces one winner and half produce three to go forward
(iii) RPP(3), RSS(3) each have 2v2, so always two go forward
(iv) RRS(3), RRP(3) each have 3v1, where half produces one winner and half produce three to go forward
27z = 13(z+1) + 1*1+1*(y+1) + 6*(x+1) + 3*1+3*(y+1) = 13(z+1) + 1+3.25 + 6*2.5 + 3+3*3.25 =13z + 13+4.25+15+12.75 = 13z+45
14z=45, z=45/14 (or 3 3/14)

btw is there an official solution for the Field Goals problem? - many thanks.
Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
February 9th, 2022 at 2:17:41 PM permalink
Quote: charliepatrick

btw is there an official solution for the Field Goals problem? - many thanks.
link to original post



I'm pretty confident my method is mathematically sound.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 9th, 2022 at 3:06:39 PM permalink
Quote: Wizard

..I'm pretty confident my method is mathematically sound...link to original post

Please forgive me, but did I miss it as I couldn't find it on the last few pages of this thread? Thanks
Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
Thanked by
charliepatrick
February 9th, 2022 at 3:43:01 PM permalink
Quote: charliepatrick

Quote: Wizard

..I'm pretty confident my method is mathematically sound...link to original post

Please forgive me, but did I miss it as I couldn't find it on the last few pages of this thread? Thanks
link to original post



Maybe we're not talking about the same field goal problem. I'm referring to the one on establishing a fair line on the under 3.5 field goals in the Super Bowl.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 13th, 2022 at 9:09:12 AM permalink
If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
Last edited by: Ace2 on Feb 13, 2022
It’s all about making that GTA
aceside
aceside
  • Threads: 2
  • Posts: 443
Joined: May 14, 2021
February 13th, 2022 at 3:50:26 PM permalink
I used an online calculator to find out
55986
unJon
unJon
  • Threads: 14
  • Posts: 4571
Joined: Jul 1, 2018
February 13th, 2022 at 6:29:55 PM permalink
Quote: aceside

I used an online calculator to find out

55986

link to original post



That doesn’t make sense since the maximum number is 31.
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 14th, 2022 at 8:51:05 AM permalink
Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374

unJon
unJon
  • Threads: 14
  • Posts: 4571
Joined: Jul 1, 2018
February 14th, 2022 at 8:55:11 AM permalink
Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post



Sorta close to:
2pi^2
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 14th, 2022 at 9:52:54 AM permalink
Quote: Ace2

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



33,102,287,213 / 55,057,397,395, or just over 3/5.

Another brute force solution:
It is easier to calculate the probability of not being able to do it, then subtract that result from 1.
There are 29 unordered 6-tuples of {0, 1, 2, 3, 4, 5} that add up to 18; each one represents a distribution of the rolls.
For example, {4, 4, 4, 3, 3, 0} indicates three numbers rolled 4 times and 2 numbers rolled 3 times.
For each one, calculate the number of specific ways the counts can be assigned to numbers, then calculate the number of ways of getting each particular set.
In this case, there are 6 choices for the zero-rolls number, and for each one, C(5,2) = 10 for the pair of 3-rolls numbers.
Each one has C(18,4) x C(14,4) x C(10,4) x C(6,3) x C(3,3) permutations of the 18 dice.
Calculate each of the 29 values, then add them up and divide by 6^18.

Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 10:41:15 AM permalink
Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post

Yes there is a very straight-forward Poisson method for expected number of rolls.

But not for the extra credit problem. To my knowledge, the Poisson method will only work if the formula is integrated over all time, so any problem that specifies a number of trials is not suitable for it.
Last edited by: Ace2 on Feb 14, 2022
It’s all about making that GTA
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 11:04:27 AM permalink
Quote: ThatDonGuy

Quote: Ace2

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



33,102,287,213 / 55,057,397,395, or just over 3/5.

Another brute force solution:
It is easier to calculate the probability of not being able to do it, then subtract that result from 1.
There are 29 unordered 6-tuples of {0, 1, 2, 3, 4, 5} that add up to 18; each one represents a distribution of the rolls.
For example, {4, 4, 4, 3, 3, 0} indicates three numbers rolled 4 times and 2 numbers rolled 3 times.
For each one, calculate the number of specific ways the counts can be assigned to numbers, then calculate the number of ways of getting each particular set.
In this case, there are 6 choices for the zero-rolls number, and for each one, C(5,2) = 10 for the pair of 3-rolls numbers.
Each one has C(18,4) x C(14,4) x C(10,4) x C(6,3) x C(3,3) permutations of the 18 dice.
Calculate each of the 29 values, then add them up and divide by 6^18.


link to original post

Disagree. I get a very different answer, which is supported by a simulation
It’s all about making that GTA
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 11:09:37 AM permalink
Quote: unJon

Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post



Sorta close to:
2pi^2
link to original post

I think that's a coincidence. Hats off to you if you can prove otherwise (possibly with the infinite sum for (pi)^2 / 6 ). That 6 is the only potential link I see to this problem
It’s all about making that GTA
aceside
aceside
  • Threads: 2
  • Posts: 443
Joined: May 14, 2021
February 14th, 2022 at 11:57:50 AM permalink
Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post


This is an easy math thread. Can you help show a little more detailed process so that a non-math degree student can understand the whole derivation?
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 14th, 2022 at 12:07:05 PM permalink
Quote: aceside

Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post


This is an easy math thread. Can you help show a little more detailed process so that a non-math degree student can understand the whole derivation?
link to original post



You mean me? Sure.

Let E(p1, p2, p3, p4, p5, p6) be the expected number of rolls needed to get 6 of at least one number, given p1 1s, p2 2s, p3 3s, p4 4s, p5 5s, and p6 6s have already been rolled.
If any of the p# values = 6, E() = 0.
Otherwise, E(p1, p2, p3, p4, p5, p6) = 1 + 1/6 E(p1 + 1, p2, p3, p4, p5, p6) + 1/6 E(p1, p2 + 1, p3, p4, p5, p6) + 1/6 E(p1, p2, p3 + 1, p4, p5, p6) + 1/6 E(p1, p2, p3, p4 + 1, p5, p6) + 1/6 E(p1, p2, p3, p4, p5 + 1, p6) + 1/6 E(p1, p2, p3, p4, p5, p6 + 1)
The 1 at the start is for the next roll.
Start with E(5, 5, 5, 5, 5, 5) and work backward:
E(5, 5, 5, 5, 5, 5) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + 0) = 1
E(5, 5, 5, 5, 5, 4) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + E(5, 5, 5, 5, 5, 5)) = 7/6
E(5, 5, 5, 5, 5, 3) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + E(5, 5, 5, 5, 5, 4)) = 43/36
and so on, down to E(0, 0, 0, 0, 0, 0), which is the solution as this is the starting point.

ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 14th, 2022 at 12:15:12 PM permalink
Quote: Ace2

Quote: ThatDonGuy

Quote: Ace2

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



33,102,287,213 / 55,057,397,395, or just over 3/5.

Another brute force solution:
It is easier to calculate the probability of not being able to do it, then subtract that result from 1.
There are 29 unordered 6-tuples of {0, 1, 2, 3, 4, 5} that add up to 18; each one represents a distribution of the rolls.
For example, {4, 4, 4, 3, 3, 0} indicates three numbers rolled 4 times and 2 numbers rolled 3 times.
For each one, calculate the number of specific ways the counts can be assigned to numbers, then calculate the number of ways of getting each particular set.
In this case, there are 6 choices for the zero-rolls number, and for each one, C(5,2) = 10 for the pair of 3-rolls numbers.
Each one has C(18,4) x C(14,4) x C(10,4) x C(6,3) x C(3,3) permutations of the 18 dice.
Calculate each of the 29 values, then add them up and divide by 6^18.


link to original post

Disagree. I get a very different answer, which is supported by a simulation
link to original post



You're right; my methodology is correct, but my last division was by (6^18 - the sum) instead of by 6^18.

33,102,287,213 / 88,159,684,608, or 0.375481

Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 1:32:09 PM permalink
Quote: ThatDonGuy

Quote: aceside

Quote: ThatDonGuy

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



I assume there's a Poisson-based way to solve this, but for now, I used a Markov chain to get:
2,597,868,106,693,535,971 / 131,621,703,842,267,136
or about 19.7374


link to original post


This is an easy math thread. Can you help show a little more detailed process so that a non-math degree student can understand the whole derivation?
link to original post



You mean me? Sure.

Let E(p1, p2, p3, p4, p5, p6) be the expected number of rolls needed to get 6 of at least one number, given p1 1s, p2 2s, p3 3s, p4 4s, p5 5s, and p6 6s have already been rolled.
If any of the p# values = 6, E() = 0.
Otherwise, E(p1, p2, p3, p4, p5, p6) = 1 + 1/6 E(p1 + 1, p2, p3, p4, p5, p6) + 1/6 E(p1, p2 + 1, p3, p4, p5, p6) + 1/6 E(p1, p2, p3 + 1, p4, p5, p6) + 1/6 E(p1, p2, p3, p4 + 1, p5, p6) + 1/6 E(p1, p2, p3, p4, p5 + 1, p6) + 1/6 E(p1, p2, p3, p4, p5, p6 + 1)
The 1 at the start is for the next roll.
Start with E(5, 5, 5, 5, 5, 5) and work backward:
E(5, 5, 5, 5, 5, 5) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + 0) = 1
E(5, 5, 5, 5, 5, 4) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + E(5, 5, 5, 5, 5, 5)) = 7/6
E(5, 5, 5, 5, 5, 3) = 1 + 1/6 x (0 + 0 + 0 + 0 + 0 + E(5, 5, 5, 5, 5, 4)) = 43/36
and so on, down to E(0, 0, 0, 0, 0, 0), which is the solution as this is the starting point.


link to original post

So there are 6^6 = 46,656 states, correct?
It’s all about making that GTA
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 2:07:49 PM permalink
Quote: ThatDonGuy

Quote: Ace2

Quote: ThatDonGuy

Quote: Ace2

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post



33,102,287,213 / 55,057,397,395, or just over 3/5.

Another brute force solution:
It is easier to calculate the probability of not being able to do it, then subtract that result from 1.
There are 29 unordered 6-tuples of {0, 1, 2, 3, 4, 5} that add up to 18; each one represents a distribution of the rolls.
For example, {4, 4, 4, 3, 3, 0} indicates three numbers rolled 4 times and 2 numbers rolled 3 times.
For each one, calculate the number of specific ways the counts can be assigned to numbers, then calculate the number of ways of getting each particular set.
In this case, there are 6 choices for the zero-rolls number, and for each one, C(5,2) = 10 for the pair of 3-rolls numbers.
Each one has C(18,4) x C(14,4) x C(10,4) x C(6,3) x C(3,3) permutations of the 18 dice.
Calculate each of the 29 values, then add them up and divide by 6^18.


link to original post

Disagree. I get a very different answer, which is supported by a simulation
link to original post



You're right; my methodology is correct, but my last division was by (6^18 - the sum) instead of by 6^18.

33,102,287,213 / 88,159,684,608, or 0.375481


link to original post

I agree!

My method was:

The probability (a) of any single number hitting six or more times is ~0.0652651. You get this by calculating the chance it hits 0-5 times and taking the complement. There are c(6,1) = 6 ways to choose the number

The probability (b) of any pair of numbers hitting six or more times is ~0.00107418. There are only 16 distinct ways this can happen. There are c(6,2) = 15 ways to choose the pair

The probability (c) of any trio of numbers hitting six times is ~0.000000168897. There are c(6,3) = 20 ways to choose the trio

Using inclusion-exclusion:

6a - 15b + 20c =~ 0.375481

Last edited by: Ace2 on Feb 14, 2022
It’s all about making that GTA
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 14th, 2022 at 2:12:23 PM permalink
Quote: Ace2

So there are 6^6 = 46,656 states, correct?
link to original post

I doubt it, as some of the states are logically the same; for instance you have
555555
555554 (as, for the times it takes to finish, it doesn't matter exactly which of the six numbers has 4 gone).
555544
555444
554444
544444
444444
etc.
000011
000001
000000

Using brute force in a spreadsheet I get 19.737384. It took 7^6 states as 000000 thru 666666, essentially looking up the six possible states one could get to and summing them /6+1 for this state.
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 14th, 2022 at 2:32:57 PM permalink
Take the integral from zero to infinity of:

[{(x/6)^5/120 + (x/6)^4/24 + (x/6)^3/6 + (x/6)^2/2 + (x/6) + 1} * e^(-x/6)]^6

= 2597868106693535971 / 131621703842267136

=~ 19.74 rolls

Using the very useful property that the average time for x to occur equals the sum of the probabilities that x has not occurred over all time. The above formula sets all six numbers to 0-5 occurrences.

I think this is analogous to the geometric series which tells us, for example, that the expected rolls for any single die number to appear is: 1 / (1 - 5/6) = 6 = (5/6)^0 + (5/6)^1 + (5/6)^2 + (5/6)^3...which is the sum of probabilities it has not occurred over all time

It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 14th, 2022 at 3:29:34 PM permalink
Quote: Ace2

So there are 6^6 = 46,656 states, correct?
link to original post


Actually, there are twice as many, but the other 46,656 states are the ones where one of the numbers has been rolled 6 times, so the expected number of rolls needed for each of those is zero.
For example:
P(5, 5, 5, 5, 5, 5) = 1 + 1/6 P(6, 5, 5, 5, 5, 5) + 1/6 P(5, 6, 5, 5, 5, 5) + 1/6 P(5, 5, 6, 5, 5, 5) + 1/6 P(5, 5, 5, 6, 5, 5) + 1/6 P(5, 5, 5, 5, 6, 5) + + 1/6 P(5, 5, 5, 5, 5, 6) = 1 + 0 + 0 + 0 + 0 + 0 + 0 = 1.
Wizard
Administrator
Wizard
  • Threads: 1491
  • Posts: 26433
Joined: Oct 14, 2009
February 14th, 2022 at 7:08:34 PM permalink
Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post




2597868106693535971 / 131621703842267136 = Approximation: 19.73738396371749

The expression is the integral from 0 to infinity of (exp(-x/6)*(1+x/6+x^2/72+x^3/1296+x^4/31104+x^5/933120))^6 dx.


p.s. Damn, I see Ace2 already posted the answer. I know I'm late, but can I at least get half credit?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 15th, 2022 at 8:42:09 AM permalink
Quote: Wizard

Quote: Ace2

If you roll a single die until one of the six numbers has appeared six times, what is the expected number of rolls?

Extra credit: What is the probability you can accomplish this in 18 rolls or less?
link to original post




2597868106693535971 / 131621703842267136 = Approximation: 19.73738396371749

The expression is the integral from 0 to infinity of (exp(-x/6)*(1+x/6+x^2/72+x^3/1296+x^4/31104+x^5/933120))^6 dx.


p.s. Damn, I see Ace2 already posted the answer. I know I'm late, but can I at least get half credit?
link to original post

Actually, you deserve at least three times that! So I'm giving you:

(-1/2)! credits
Last edited by: Ace2 on Feb 15, 2022
It’s all about making that GTA
MichaelBluejay
MichaelBluejay
  • Threads: 81
  • Posts: 1616
Joined: Sep 17, 2010
February 23rd, 2022 at 4:57:30 PM permalink
I don't plan to return to the forum but I did want to share this one puzzle. The Austin Chronicle has a "Math Happens" column every week in which they post a puzzle, which I usually do. This week's was more interesting than usual to me, hence why I'm sharing. The object is to derive all the integers from 1-20 using only four 4's for each integer, and only the operators + - x ÷ √ ! and exponent, and not using decimals or 44. For example, 13 could be 4! ÷ √4 + 4/4. I got all of them except 19. Here's the solution for 1-32.

(Updated with the proper link to the solutions that don't use decimals.)
Last edited by: MichaelBluejay on Feb 24, 2022
Presidential Election polls and odds: https://2605.me/p
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 23rd, 2022 at 5:19:33 PM permalink
Quote: MichaelBluejay

...19...

19 = 4! - 4 - 4/4 = 24-4-1. I think including .4 and .4 (recurring) you can do all the numbers 1 thru 100. 4/9 is a very useful number to have!
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 23rd, 2022 at 8:04:33 PM permalink
4*4 + 4 - 4/4 = 19
It’s all about making that GTA
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
February 23rd, 2022 at 8:15:49 PM permalink
Quote: Ace2

4*4 + 4 - 4/4 = 19

Nice try but, I think you're only supposed to use Four 4's!
Ace2
Ace2
  • Threads: 32
  • Posts: 2672
Joined: Oct 2, 2017
February 28th, 2022 at 2:58:39 PM permalink
A forum member recently posted the following (regarding the ALL craps side bet):

"You only need ten rolls to hit the ALL. Its [sic] been hit in 15-17 rolls typically."

The easy math puzzles are:

1) Assuming you win the ALL bet, what's the probability you win with less than 18 rolls?
2) Considering winning bets only, how many rolls does it take, on average, to win the ALL bet
It’s all about making that GTA
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6218
Joined: Jun 22, 2011
February 28th, 2022 at 4:07:17 PM permalink

Since it is limited to winning bets, ignore all rolls of 7.

Also, since it is for 17 rolls or less, assume there are 17 rolls, including any rolls that would come after a winning set.

Find all increasing 7-tuples of numbers in {2, 3, 4, 5, 6, 8, 9, 10, 11, 12}. ("Increasing" means no number is greater than the one to its right.)
Let P(2) be the number of times 2 appears in the 17 rolls, P(3) the number of times 3 appears, and so on.
For example, if the 7-tuple is (2, 3, 4, 5, 6, 8, 9), then P(2) = P(3) = ... = P(9) = 2, and P(10) = P(11) = P(12) = 1; if it is (2, 2, 2, 2, 2, 2, 2),, then P(2) = 8 and P(3) = ... = P(12) = 1.
There are 17! / (P(2)! P(3)! ... P(12)!) permutations of these 17 numbers.
For each permutation, the probability of actually rolling those numbers is (1/30)^P(2) * (2/30)^P(3) * ... * (2/30)^P(11) * (1/30)^P(12).
Calculate this value for each permutation, and add them up to get:
235,436,099,899 / 8,649,755,859,375, or about 1 / 36.7393.



The solution is the integral over x from 0 to positive infinity of:

1-((1 - e^(-x/30))(1 - e^(-x/15))(1 - e^(-x/10))(1 - e^(-2/15*x))(1 - e^(-x/6))(1 - e^(-x/5)))^2 dx

which is 5,401,372,918,634,611 / 105,826,178,618,160, or about 51.04

Last edited by: ThatDonGuy on Feb 28, 2022
  • Jump to: