Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In this game I'm programming the player has to test a skill number plus a random number between 1 and 12 to see if it's greater or equal to a difficulty number. What I want to do is calculate the success rate of that test as a percentage. So if the skill test is n + random(12) => x, how do I calculate the probable rate of success as a percentage?

share|cite|improve this question
up vote 1 down vote accepted

You need the random to be at least $x-n$. Each count contributes $\frac {100}{12}=8\frac 13 \%$. So the success rate is $(13+n-x)8\frac 13\%$. The $12$ becomes $13$ because the player wins ties.

share|cite|improve this answer
Thanks that helps a lot. – Gerhard Bahnsen Dec 7 '12 at 8:05
@GerhardBahnsen: Then you need to truncate into the range $0\$-100\%$ – Ross Millikan Dec 7 '12 at 17:39
Hi. How would I enter this expression on a scientific calculator. I seem to be entering it in all wrong. Thanks. – Gerhard Bahnsen Dec 9 '12 at 17:45
@GerhardBahnsen: I had a typo in the final expression, with $n,x$ reversed. See if that helps. – Ross Millikan Dec 9 '12 at 20:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.