1. Our third apparel sale is live. New design + reprint of the athletic design. Support us and get a shirt!
2. Watch our World Cup of Pokemon Post-R1 Smogcast with some of Smogon's top players!
3. Welcome to Smogon Forums! Please take a minute to read the rules.

Probability Calculator for 2HKOs

Discussion in 'Archives' started by Tangerine, Nov 26, 2009.

1. TangerineWhere the Lights Are

Joined:
May 4, 2007
Messages:
3,160
2HKO Probability Calculator
http://tangerine.colinjf.com/probcalc.py

Web Interface version, which should be accurate. Fill it in, and give it a whirl.

Description:
The Calculator aims to calculate the probability of a 2HKO with regards to the Random Number component used in the Damage Formula. You can put in different moves, and different "effects", to see the actual 2HKO probability rather than just guesstimating.

Implementation:
Calculates the Damage of the 2 moves, applies the Random Number component, applies the rest of the modules, and then sums up the conditional probabilities.

It is done on Python and CGI.

How to Use:
Take note of the variables it asks for. If you don't know what they do, then take note of the Damage Formula. Plug in Numbers, and give it a whirl.
2. david stoneFast-moving, smart, sexy and alarming.

Joined:
Aug 3, 2005
Messages:
5,152
You can find the 100% accurate probability distribution of the random number fairly easily.

Rather than using n / 100, where n is 85 through 100 with unequal probability, use 100 * n / 255 / 100, where n is a number between 217 and 255 with equal probability. In other words, there are 39 possible values for the RNG. If it uses 217 through 219, it is the equivalent of .85, so the odds of that are 3/39. If you use fractions out of 39, you should get your probabilities to sum to 100%. Then your only issue is inaccuracies due to using floats.
3. TangerineWhere the Lights Are

Joined:
May 4, 2007
Messages:
3,160
yeah, i fixed that for the last post (since Colin told me over IRC)