Not sure if this counts as a "simple" question, but I'm trying to figure out what the odds are of two people leading with the same Pokemon (trying to solve
this question on Pokebase).
The way
the moveset file is formatted makes me think that the game randomly picks a Pokemon that has moves assigned to it, and then chooses four of the available moves randomly (if it has more than four moves assigned), meaning that the odds are 1 / # of Pokemon (not squared, because the first player's Pokemon can be anything, and then the second player's mon just needs to be the same). Assuming this and searching for randomBattleMoves and randomDoubleBattleMoves shows 460 and 452 available Pokemon, respectively, which I would be satisfied with if I knew for a fact that every Pokemon was weighted equally.
However, I feel like I remember looking through an older version of this file a few years ago and seeing that it was sorted by set, ie, several predetermined sets that the game could choose from for any given Pokemon. If that's the case, then naturally, Pokemon with more sets available are slightly more likely to be chosen than Pokemon with fewer sets.
Additionally, I also know that in Gens 6 and 7, the game would ensure that you didn't end up with a team with more than one mega or Z-crystal. I wouldn't think the same applies this Gen for GMax factor, but it would be nice to know for sure.
I'm pretty sure that 1/460 for singles and 1/452 for doubles are at least extremely close to the real answer, but I'd like confirmation.