This is a simple command line program written in Python for calculating probability of hatching an egg with fixed number of perfect IVs.
The mechanism of IV inheritance in Pokemon (up to 7th gen) is quite simple. Parnets can pass 3 or 5 (if one holds destiny knot) of their IVs to the offspring. IVs to be passed are selected randomly, with equal probability, and do not overlap (eg. passing Attack from both parents is impossible). Passed IVs get value from one of a parents with an equal probability (for each passed attribute, not as a whole). The last remaining IV is randomized from {0, 1, ..., 31}, each value has the same probability.
The program assumes that destiny knot is held by a parent. It uses brute force technique to iterate over all possible offspring IVs. Based on gathered data, some statistics are printed.
Install latest python3
and run
$ python breeding.py 101111 111110
Odds of getting fixed number of perfect IVs
6 1.0417%
5 33.8542%
4 48.9583%
3 16.1458%
Expected number of perfect IVs: 4.1979
IV Spread distribution
(1, 1, 1, 1, 1, 1) 1.0417%
(1, 1, 1, 1, 1, 0) 8.8542%
(1, 1, 1, 1, 0, 1) 4.0365%
(1, 1, 1, 1, 0, 0) 4.0365%
(1, 1, 1, 0, 1, 1) 4.0365%
(1, 1, 1, 0, 1, 0) 4.0365%
(1, 1, 0, 1, 1, 1) 4.0365%
(1, 1, 0, 1, 1, 0) 4.0365%
(1, 0, 1, 1, 1, 1) 8.8542%
(1, 0, 1, 1, 1, 0) 16.6667%
(1, 0, 1, 1, 0, 1) 4.0365%
(1, 0, 1, 1, 0, 0) 4.0365%
(1, 0, 1, 0, 1, 1) 4.0365%
(1, 0, 1, 0, 1, 0) 4.0365%
(1, 0, 0, 1, 1, 1) 4.0365%
(1, 0, 0, 1, 1, 0) 4.0365%
(0, 1, 1, 1, 1, 1) 4.0365%
(0, 1, 1, 1, 1, 0) 4.0365%
(0, 0, 1, 1, 1, 1) 4.0365%
(0, 0, 1, 1, 1, 0) 4.0365%
Application can also calculate expected number of eggs that will need to be hatched for getting the desired offspring
$ python breeding.py 101111 111110 111111
Odds of getting fixed number of perfect IVs
6 1.0417%
5 33.8542%
4 48.9583%
3 16.1458%
Expected number of perfect IVs: 4.1979
IV Spread distribution
(1, 1, 1, 1, 1, 1) 1.0417%
(1, 1, 1, 1, 1, 0) 8.8542%
(1, 1, 1, 1, 0, 1) 4.0365%
(1, 1, 1, 1, 0, 0) 4.0365%
(1, 1, 1, 0, 1, 1) 4.0365%
(1, 1, 1, 0, 1, 0) 4.0365%
(1, 1, 0, 1, 1, 1) 4.0365%
(1, 1, 0, 1, 1, 0) 4.0365%
(1, 0, 1, 1, 1, 1) 8.8542%
(1, 0, 1, 1, 1, 0) 16.6667%
(1, 0, 1, 1, 0, 1) 4.0365%
(1, 0, 1, 1, 0, 0) 4.0365%
(1, 0, 1, 0, 1, 1) 4.0365%
(1, 0, 1, 0, 1, 0) 4.0365%
(1, 0, 0, 1, 1, 1) 4.0365%
(1, 0, 0, 1, 1, 0) 4.0365%
(0, 1, 1, 1, 1, 1) 4.0365%
(0, 1, 1, 1, 1, 0) 4.0365%
(0, 0, 1, 1, 1, 1) 4.0365%
(0, 0, 1, 1, 1, 0) 4.0365%
Wanted offspring
(1, 1, 1, 1, 1, 1) 1.0417%
Expected number of hatched eggs: 96.0000