Southperry.net
Rolling dice problem - Printable Version

+- Southperry.net (https://www.southperry.net)
+-- Forum: Social (https://www.southperry.net/forumdisplay.php?fid=14)
+--- Forum: Rubik's Cube (https://www.southperry.net/forumdisplay.php?fid=58)
+--- Thread: Rolling dice problem (/showthread.php?tid=46015)



Rolling dice problem - Shidoshi - 2011-08-16

Say you have a 6 sided die and you want to generate a string of 6 non-repeating numbers. To do this, for each of the the six numbers you roll the dice, if the number it rolls hasn't appeared yet in the string you keep it, otherwise you reroll it.

So say, you roll for the first time and you get 4, it hasn't come out yet (because it's the first roll anyway) so you keep it.
Next roll, if the number 4 comes up you reroll, otherwise you keep the number and it's the second number, say 2.
For the 3rd roll, you reroll if the numbers {2;4} come up, and so on.


My question is, how many times would you need to roll the dice on average to get that string of numbers?

So far I've come that the number would be the quintuple sum:

(sum i=1 to infinity)(sum j=1 to infinity)(sum k=1 to infinity)(sum l=1 to infinity)(sum m=1 to infinity)[(5/6^i)*(4/6^j)*(3/6^k)*(2/6^l)*(1/6^m)*(1+i+j+k+l+m)] corrected

But I have no idea how to solve those, seems like I would need to break them up into 5 separate sums and then analyze the product of sums in each of them. But I'm kind lost on how to evaluate the infinite sum of i*(a^i), where |a|>1

Found the reduced form of that kind of sum: a/((a-1)^2)

Now it's just handwork and I'll get this done, brb.

Does anyone have any light for me?

This is just some random fun problem I came up myself.

Basically it breaks down to:

sum [(1/6+Z/(1-Z))*(1/((1-5/6)(1-4/6)*(1-3/6)*(1-2/6)*(1-1/6))] for Z={1/6;2/6;3/6;4/6;5/6}

So my math says it should be on average 628.56 rolls, seems a little too many rolls to see all 6 sides of the dice.


Rolling dice problem - Yokuyin - 2011-08-16

Sounds like a Geometric Distribution to me.

The Geometric Distribution gives the probability that with success rate p, the kth trial is the first success.
The formula is P(k) = p*(1-p)^(k-1). (basically, k-1 failures times 1 succes, with only 1 possible configuration, namely FFF...FFS)
The mean of the Geometric Distribution is 1/p. [namely, (Sum of k=1 to inf) k*p*(1-p)^(k-1) = 1/p ]

In this situation, we have 6 independent Geometric Distributions with p=1, 5/6, 4/6, 3/6, 2/6 and 1/6. So the average amount of rolls would be 1 + (6/5) + (6/4) + (6/3) + (6/2) + (6/1) = 14.7


Rolling dice problem - Shidoshi - 2011-08-16

But you can only start trying for the next position when you've got a good number for the former, so they are not independent.

Nevermind, what you said makes sense.
In my case I was just trying to use the expectancy formula, multiplying the number of rolls made by the probability of needing that many rolls, don't know where I went wrong.