I'm writing an application and need to have it calculate the chances of rolling, for example a 4, 5 or 6 on a dice with the ability of a reroll. The current math I have is;
3/6 + (3/6 * 3/6) = 0.75 * 100 = 75%.
The problem I have is when I'm trying to have it calculate the chances of rolling a 3, 4, 5 or 6 with the reroll;
4/6 + (4/6 * 4/6) = 1.1111 * 100 = 111.11%
Which is ofcourse incorrect as you could still roll two 2's. What would be the correct calculation that I would need to use?
I have a 1 die and need to roll a 5 or a 6, but whenever I fail to do so I may reroll that die 1 time to have another shot at the 5 or 6, how would I put this into a mathmatical formula?
Does that make more sense?
. No doubt I have the wrong notation but P(5,6) means the chance of getting a 5 or a 6 and P'(5,6) means the chance of not getting a 5 or a 6. n is the number of rolls you can have. In your case: