How are you precisely defining "kill range"? Are you defining it as a 100% chance to KO with Thunderbolt or 75% or some other value? (after factoring in crits and misses ofc). If you want I could run a simulation and do a parameter search for the optimal strategy for each one, but that might take a bit for me to set up and run.
Tbolt seems to be a 4HKO, with only a 5% chance to 3HKO, so would notbe very impactful I think.
Damages can be simplified to simple ratios, this is not a case I think where the complexity of damage rolls is particularly impactful, like it could be for example in Starmie vs dragonite.
An additional note is that psychic has an advantage of having a spdef drop. My though was that since Gengar can have either Night Shade, Tbolt, and Psychic. We take TBolt as the average to simplify.
If it means arriving at the solution is faster, we should be able to make simplifying assumptions. Then again, maybe the fastest solution is running a monte-carlo sim against the pokemon showdown backend, in which case no simplifying assumptions are needed, and even stuff like 1/256 misses are accounted for.
That said, strategy wise we do need to pre-define a strategy in order to simplify the simulation.
So we assume gengar runs tbolt.
So far gengar's strategy vs a tauros with a chance to OHKO is undefined.
Additionally, 2HKOs can also be non-guaranteed, this is still undefined
Finally, as mentioned before, Behaviourvs guaranteed 2HKOs is also undefined.
We can make a simplifying assumption here, or we can let them be undefined, and divide the sample size into X and try each strategy combination.
The combination of gengar strategies is then 2^3. Which isn't unreasonable I think.
I'm pretty sure that once hooked up correctly, an average computer can run a million simulations in a couple of minutes. So even, dividing the sample size by 8 would still give a pretty accurate answer. Even accounting for small decisions like OHKoing.
Furthermore the calculation will be more useful in this manner, as it will provide answers for the correct strategy when playing tauros vs Gengar.
Finally, the cost of coding 1 undefined condition is almost the same as the cost of coding 3 undefined conditions. Since we already have one, we might as well add 2 more. This way we also develop a tool for dealing with undefined conditions, which will certainly be helpful for other calculations.
Shellnuts Fire away, looking forward to see what you cook up.
I'll try to define an even simpler sim example if needed. Might work as a good stepping stone.