Take the 2-minute tour ×
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.

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|improve this question

1 Answer 1

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|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

 
discard

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.