# Varying a percentage based on actual result

I have a desired percentage, 33%, and a 100-sided dice. I also have the number of times the dice has been rolled, and the number of times the dice roll has been successfully under the desired percentage.

How would I go about changing the desired percentage to match the real results? Such that when the dice has been rolled 3 times and succeeded 1 time, the target is the default of 33. Yet when the dice has been rolled 4 times and succeeded 1 time, the target increases (and so becomes easier), and when the dice has been rolled 3 times and succeeded 2 times, the target decreases (and becomes more difficult) by going down to around 16. It's also important that the target never reaches 100% or 0%, ideally capping out at 99% or 1% for a really long string of lucky/unlucky rolls.

If you could post an example with the actual numbers plugged in that would be super helpful, too.

-
So what you want is what weighting future rolls need to return to the mean? You won't get a closed form unless you limit the number of future rolls somehow. – Simon Hayward Nov 30 '12 at 19:37
Basically the target for each dice roll is changed each roll, based on the number of tries vs successes to attempt to return towards the base, which is 33%. So 3 tries 1 success would be 33 for the next roll (normal), 4 tries 1 success would be around 41 (too many tries), 3 tries 2 success would be around 22 (too many successes). – Mortlanka Nov 30 '12 at 20:19

@Mortlanka: I was using current as a percentage, which seemed to be what you were doing. So with 3 tries and 1 success $33-2(33\frac 13-33)=32\frac 13$ then you round – Ross Millikan Dec 1 '12 at 0:41