Calculate odds of given Pokemon IV % given 3 possible 0-15 scores

304 Views Asked by At

In the game Pokemon Go, pokemon have three internal values that are scored from $0-15$.

A "perfect" pokemon has scores of $15, 15, 15$ and an "IV" score of $100$% (since the values are maxed out) while the world's worst pokemon has scores of $0,0,0$ or an IV score of $0$%.

What formula can I use to calculate the probablity of any given outcome of IV score?

For instance, there's only one way to get a perfect score, so the probability is $$\frac{1}{16\cdot16\cdot16}$$

But there are multiple ways to get a score of $18$ or $28$.

2

There are 2 best solutions below

0
On BEST ANSWER

There are $16^3$ score combinations. The sums of 3 discrete uniform distributions. Personally I would just compute and go with a table. The table below shows whats the $Pw. = \sum \text{Scores}$ and the probability of getting it. Is that what you're asking?

As a side note, multiply the results by $16^3$ to get the number of cases times $100$.

Pw.| Probablity in %
—————————————————————
3  | 0.0244140625
4  | 0.0732421875
5  | 0.146484375
6  | 0.244140625
7  | 0.3662109375
8  | 0.5126953125
9  | 0.68359375
10 | 0.87890625
11 | 1.0986328125
12 | 1.3427734375
13 | 1.611328125
14 | 1.904296875
15 | 2.2216796875
16 | 2.5634765625
17 | 2.9296875
18 | 3.3203125
19 | 3.662109375
20 | 3.955078125
21 | 4.19921875
22 | 4.39453125
23 | 4.541015625
24 | 4.638671875
25 | 4.6875
26 | 4.6875
27 | 4.638671875
28 | 4.541015625
29 | 4.39453125
30 | 4.19921875
31 | 3.955078125
32 | 3.662109375
33 | 3.3203125
34 | 2.9296875
35 | 2.5634765625
36 | 2.2216796875
37 | 1.904296875
38 | 1.611328125
39 | 1.3427734375
40 | 1.0986328125
41 | 0.87890625
42 | 0.68359375
43 | 0.5126953125
44 | 0.3662109375
45 | 0.244140625
46 | 0.146484375
47 | 0.0732421875
48 | 0.0244140625
0
On

Consider a Pokémon with scores of $x,y,z$, each integers between $0$ and $15$, inclusive.

I will assume (correct me if I am wrong) that the "IV" percentage corresponds to the sum $x+y+z$ as a percentage of $45$, which would be the maximum sum possible.

It is equally probably for a Pokémon's three scores sum to $n$ (between $0$ and $45$, inclusive) as it is for its scores to sum to $45-n$. This is easy to see; for each distinct set of values $x, y, z$ that sum to $n$, the values $15-x,15-y,15-z$ sum to $45-n$; furthermore, $15-x$ can't obviously equal $x$ for any integer $x$. So, really, we only need to consider values of $n$ from $0$ to $22$.

Consider two values: $x+y = z'$, the sum of two of the scores, and $z$, the remaining score, between $0$ and $15$, inclusive. Then, say a Pokémon has a total score of $n$ (which we will restrict to $22$ or less due to the reasoning above).

Case 1:

$n < 15$. There are $n+1$ ways to write $n$ as a sum of $z$ and $z'$ (consider taking $n$ from $0$ to $n$ and finding $z'$ such that $z+z' = n$ in each case). Now, for each value of $z'$ (each of which must also be between $0$ and $n$, inclusive), there are similarly $z' + 1$ ways to partition that number into $x$ and $y$. Thus, for $n \leq 15$, there are $\sum_{i=0}^ni+1 = n+1 + \frac{n(n+1)}{2} = \frac{(n+1)(n+2)}{2}$ ways for that value to be achieved.

Case 2:

$15 \leq n \leq 22$. There are just $16$ ways to partition this number into $z'$ and $z$ since you have only $16$ distinct values of $z$ to work with. $z$ runs from $0$ to $15$, so $z'$ runs from $n-15$ to $n$. (We can do it this way since $n$ is at most $22$.) Now, there are $n-15+1$ values of $z'$ greater than or equal to $15$ (specifically the integers between $15$ and $n$, inclusive) and $30-n$ values of $z'$ less than $15$, specifically the integers between $n-15+1$ and $15$, inclusive.

Then, for each $z' \geq 15$, there $30-z'+1$ ways to partition $z'$ into $x$ and $y$. (Since $x,y \leq 15$, we can only make partitions where $x$ and $y$ run from $z'-15$ to $15$). Thus, there are $\sum_{i=15}^n30-i+1 = 31(n-15+1)-\frac{n(n+1)}{2}+\frac{14\cdot 15}{2} = \frac{n(61-n)}{2}-329$ partitions of $n$ ($15 \leq n \leq 22$) into $x$, $y$, and $z$ where $x+y \geq 15$

Similarly, for each $z' < 15$, there are $z' + 1$ ways to partition it, so we have $\sum_{i=n-15}^{14}i+1 = \sum_{i=0}^{14}i+1 - \sum_{i=0}^{n-15-1}i+1 = \frac{15 \cdot 16}{2} - \frac{(n-14)(n-15)}{2} = 120 - \frac{(n-14)(n-15)}{2}$ partitions of $n$ ($15 \leq n \leq 22$) into $x$, $y$, and $z$ where $x+y < 15$.

Putting it all together, we see that, for $n < 15$, there are $\frac{(n+1)(n+2)}{2}$ ways for such values to sum to $n$. If $15 \leq n \leq 22$, there are $\frac{n(61-n) - (n-14)(n-15)}{2} - 209 = n(45-n)-314$ ways for values to sum to $n$.


Finally, we tie it all back together by saying that if $23 \leq n \leq 45$, then the probability of $n$ is the same as the probability of $45-n$. Thus, we want to do these calculations for $n$ if $n \leq 22$ and for $45-n$ otherwise. Notice, though, that $n(45-n) - 314$ is equivalent to the same equation when you replace $n$ with $45 - n$, so that removes one of the cases.

Now, given a certain IV percentage $p$ ($0 \leq p \leq 100$), if the sum of a Pokémon's 3 scores can be given by $ k = \lfloor 45\frac{p}{100} \rfloor$, then, define we can define $\mathbb{P}(k) = \begin{cases} \frac{1}{2 \cdot 16^3}(k+1)(k+2) & k \leq 15 \\ \frac{1}{16^3}k(45-k)-314 & 16 \leq k \leq 29 \\ \frac{1}{2 \cdot 16^3}(46-k)(47-k) & k \geq 30 \end{cases}$.