1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. 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. Tangerine

    Tangerine Where the Lights Are
    is a Smogon IRC SOPis a Team Rater Alumnusis a Forum Moderator Alumnusis a Smogon Media Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus

    Joined:
    May 4, 2007
    Messages:
    3,155
    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 stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    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. Tangerine

    Tangerine Where the Lights Are
    is a Smogon IRC SOPis a Team Rater Alumnusis a Forum Moderator Alumnusis a Smogon Media Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus

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

Users Viewing Thread (Users: 0, Guests: 0)