Quote:jbruckmanI'm attempting to computerize a popular board game in which the player gets to roll a variable number of dice to make skill checks. Upon rolling a 5 or 6, the player has one success. At various times the player will need a different number of successes. (For example, you are allowed to roll 11 dice for 4 successes, which under normal circumstances has a probability of success of 52.74%). My question is this: If you're allowed to re-roll any dice that come up as a 1(but only once), what is the overall probability of success of rolling Nd6 dice for X successes?

The probability of a success roll with a single dice (and single reroll on 1) is p = 2/6 + 2/36 = 14/36.

The probability of having exactly X successes in N dices is combin(N,X) p^X (1-p)^(N-X)

Allow me to further clarify:

Rolling a 5 or a 6 counts as a success. In order to "pass" a check, you must roll at least a certain number of successes. I know how to calculate the probability of doing this for N dice and X successes.

p("passing N d6 with X successes") = Sum(from k = X to k = N) (N Choose k)*((2/6)^k)*((4/6)^(N-k))

Notice that this gives the probability for getting X successes, X+1 successes, X+2... all the way to N successes.

On re-rolling all of the dice you were allotted, you can do the following:

Let the above probability be p.

then p("Failing") = 1-p

and p("passing a full re-roll") = the opposite of failing twice = 1 - ((1-p)^2)

Now, the question I have is this:

If instead of re-rolling ALL N dice you were originally allotted, you could only re-roll dice that showed a 1, you have an advanced compound probability taking place. I understand that rolling X ones, Y not 5's or 6's(these are the not successes), and Z successes(5's or 6's) on your first roll has the probability:

(1/6)^X * (3/6)^Y * (2/6)^Z

What I don't understand is how to sum over all possible combinations here such that in the end I have the total probability of getting the required number of successes(or more) and passing the check. I want the probability of passing this check, given that I could re-roll any 1's that are rolled.

Thank you for taking the time to read this post!

you are allowed to reroll all dices showing 1 once more. After you rerolled those dices, you count the successes. If you achieve X or more, you pass the test.

If that is the case, then your problem is much simpler as you state yourself.

The probability for a success including the single reroll(!) is p = 14/36.

The probability of X successes with N dices is combin(N,X) p^X (1-p)^(N-X), where combin(N,X) is your "N Choose X".

Sum up for all Y >= X, and you have the probability P of passing the test:

P = sum_Y=X to N combin(N,Y) p^Y (1-p)^(N-Y)

Quote:MangoJ

If that is the case, then your problem is much simpler as you state yourself.

The probability for a success including the single reroll(!) is p = 14/36.

The probability of X successes with N dices is combin(N,X) p^X (1-p)^(N-X), where combin(N,X) is your "N Choose X".

Sum up for all Y >= X, and you have the probability P of passing the test:

P = sum_Y=X to N combin(N,Y) p^Y (1-p)^(N-Y)

I'm afraid that this doesn't give the desired results... I'm checking my work against a well-known and rigorously checked source,Of course, if I could contact the author, I wouldn't be here...

I've done the following calculation by hand, 2 dice for 1 success, and your method has returned differing results. I was able to come up with a correct (or nearly correct answer) by doing the following(but I still can't figure it out for N dice and X successes):

Let C(n,k) be n Choose k.

P("pass") = C(2,1)*(2/6)*(4/6) + C(2,2)*(2/6)^2 + (C(2,1)*(1/6)*(3/6)) * (C(1,1)*2/6) + (C(2,2)*(1/6)*(1/6)) * (C(2,1)*(2/6)*(4/6)) + (C(2,2)*(1/6)*(1/6)) * (C(2,2)*(2/6)*(2/6))

Term by term in the sum, this is:

the probability of...

rolling 1 success with 2 dice originally,

rolling 2 successes with 2 dice originally,

rolling 1 one and 1 'fail' (a 2, 3, or 4), and then rolling a success with one die,

rolling 2 ones, and then rolling 1 success with 2 dice,

rolling 2 ones, and then rolling 2 successes with 2 dice.

I see a clear pattern here, but it begins to break down with 3 dice and 2 successes when you've got to start using more complicated combinations, such as you roll one success, and 1 one and 1 fail, or 1 success and 2 ones, etc etc. The fact that three different things can happen with repetition, AND that the number of ones rolled + the number of successes you have originally must always at least equal the number of successes you need makes this problem seem rather daunting...

Thank you again for your help... If in fact this problem is much simpler than I'm making it, I'll be extraordinarily happy.

~J

Quote:jbruckmanI'm afraid that this doesn't give the desired results... I'm checking my work against a well-known and rigorously checked source, http://www.arkhamhorrorwiki.com/Probability Of course, if I could contact the author, I wouldn't be here...

I've done the following calculation by hand, 2 dice for 1 success, and your method has returned differing results. I was able to come up with a correct (or nearly correct answer) by doing the following(but I still can't figure it out for N dice and X successes):

Let C(n,k) be n Choose k.

P("pass") = C(2,1)*(2/6)*(4/6) + C(2,2)*(2/6)^2 + (C(2,1)*(1/6)*(3/6)) * (C(1,1)*2/6) + (C(2,2)*(1/6)*(1/6)) * (C(2,1)*(2/6)*(4/6)) + (C(2,2)*(1/6)*(1/6)) * (C(2,2)*(2/6)*(2/6))

Term by term in the sum, this is:

the probability of...

rolling 1 success with 2 dice originally,

rolling 2 successes with 2 dice originally,

rolling 1 one and 1 'fail' (a 2, 3, or 4), and then rolling a success with one die,

rolling 2 ones, and then rolling 1 success with 2 dice,

rolling 2 ones, and then rolling 2 successes with 2 dice.

I see a clear pattern here, but it begins to break down with 3 dice and 2 successes when you've got to start using more complicated combinations, such as you roll one success, and 1 one and 1 fail, or 1 success and 2 ones, etc etc. The fact that three different things can happen with repetition, AND that the number of ones rolled + the number of successes you have originally must always at least equal the number of successes you need makes this problem seem rather daunting...

Thank you again for your help... If in fact this problem is much simpler than I'm making it, I'll be extraordinarily happy.

~J

I'm getting the same results that are on that site.

I put it in google docs

Going down are the number of dice thrown and across are the numbers needed to pass. cell a1 is the success rate for one dice. Any questions just ask.

Edit to add: make that going down are the number need to pass out of the number of accross dice throw.

Note to self: don't try and do things after bedtime.

Jon

Quote:jbruckman

P("pass") = C(2,1)*(2/6)*(4/6) + C(2,2)*(2/6)^2 + (C(2,1)*(1/6)*(3/6)) * (C(1,1)*2/6) + (C(2,2)*(1/6)*(1/6)) * (C(2,1)*(2/6)*(4/6)) + (C(2,2)*(1/6)*(1/6)) * (C(2,2)*(2/6)*(2/6))

For this I get 203/324. Which is identically to p^2 + 2*p(1-p) where p = 14/36.

However the latter is my original formula for X=1 and N=2:

P = sum_Y=X to N combin(N,Y) p^Y (1-p)^(N-Y)

= sum_Y=1 to 2 combin(2,Y) p^Y (1-p)^(2-Y)

= combin(2,1) p^1 (1-p)^1 + combin(2,2) p^2 (1-p)^0

= 2 p (1-p) + p^2

Hence I believe my formula is correct for all N and X. Am I still confused ?

Edit: Got you.

Quote:

I was using 14/36 and 12/36

Better use 14/36 and 22/36 for p and 1-p.