Friday, March 26, 2010

Pokemon Catch Rate

I can't actually believe that they had this.

It's the exact formula to determine the catch rate for a pokemon.

Try it sometime :)


The exact formula is as follows:

Image:Catch formula 1.png

Where

  • HPmax is the number of hit points the Pokémon has at full health,
  • HPcurrent is the number of hit points the Pokémon has at the moment,
  • rate is the catch rate of the Pokémon,
  • bonusball is the multiplier for the Poké Ball used, and
  • bonusstatus is the multiplier for any status ailment the Pokémon has (2 for sleep and freeze, 1.5 for paralyze, poison and burn).

Given this formula, the maximum value for a (if the Pokémon could have 0 HP) would be catch rate × bonusball × bonusstatus. The minimum value for a (for a Pokémon with full health) would be × catch rate.

If a is greater than or equal to 255, then the Pokémon is caught. If not, then calculate b as follows:

Image:Catch formula 2.png

Then generate 4 random numbers between 0 and 65535, inclusive. If the random numbers are less than or equal to b, then the Pokémon is caught; otherwise the ball shakes n times, where n is the number of random numbers that are less than b. Note that b ≥ 65535 if a ≥ 255.

Therefore, the probability p of catching a Pokémon, given the values a and b calculated above, is:

Image:Catch formula 3.png

The second expression for p may be expanded as follows:

Image:Catch formula 3 expansion.png

Since (216 - 1)4 ≈ 264, we can approximate p with the following expression:

Image:Catch formula 3 approximation.png

The percentage error in this approximation approaches 0 as a approaches 255, and does not exceed 0.02%.

For a constant probability p, the probability P that a player can capture the Pokémon with no more than r tries is:

Image:Catch formula 4.png

Note that this is the cumulative probability function for a geometric distribution. The expected value of r is 1/p, that is to say, on average, a Pokémon that can be caught with probability p will be caught with 1/p tries.

The inverse problem, the number of tries, r, needed to have a probability P of capturing a Pokémon is:

Image:Catch formula 5.png
Henceforth: I think some mathematician pokemon fans have far too much time.

1 comment: