Help me run the numbers on a perfect IV ditto

pokemon-sun-moon

So I am currently playing Pokémon Sun version and am attempting to collect a ditto with perfect IVs. I’m using the SOS battle method with an Alola raticate that knows hidden power. It has only one resistance which is dark type because I know a hidden power from a Pokémon with perfect IVs is a dark move. So I’m calling any ditto using a hidden power (dark) a pseudo perfect ditto. Only after I check it in the computer do I know if it’s truly perfect.

So my question is this. Given that every ditto caught is guaranteed to have at least 4 perfect IVs and guaranteed to have a dark type hidden power, what is the possibility space? How many pseudoperfect ditto can I expect on average to catch in order to find a true perfect ditto?

Best Answer

Note: This answer does not go into the base power calculation of hidden power, as gen 6 and above normalized hidden power's base power to 60.

The type of hidden power is determined by the least significant bit (or odd/even-ness) of each of your IVs by the formula

let a, b, c, d, e, f = HP, Atk, Def, SpA, SpD, Spd IV mod 2
type = Floor( (a+2*b+4*c+8*d+16*e+32*f) * 15 / 64 )

where the resulting number type is an integer from 0-15, and the type number is mapped to a hidden power type. Since we are looking at hidden power dark, we want a type of 15, which is only possible when a,b,c,d,e,f are all odd, or the pokemon's HP, Attack, Defense, Special Attack, Special Defense, Speed IVs are all odd.

Given that you are chaining pokemon, 4/6 of your IVs are 31, or odd. This leaves 2 IVs that are evenly distributed over [0-31]. Since you know the pokemon's hidden power type is dark, the non-perfect IVs are (1,3,5,7.... 31). There is a 1/16 chance for each of the two IVs to be 31, or 1/16*1/16 = 1/256 chance that both are 31 (0.390625%) and you have a perfect pokemon.