Probability Calculator for 2HKOs

Tangerine

Where the Lights Are
is a Team Rater Alumnusis a Forum Moderator Alumnusis a Live Chat Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
#1
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.
 

david stone

Fast-moving, smart, sexy and alarming.
is a Site Staff Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus
#2
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.
 

Tangerine

Where the Lights Are
is a Team Rater Alumnusis a Forum Moderator Alumnusis a Live Chat Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
#3
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.
yeah, i fixed that for the last post (since Colin told me over IRC)