I have a Python file that simulates 10 000 hypothetical soccer matches between two teams. This is done by generating two sets of 10 000 random numbers between 0 to 1 (10 000 for each team). This is then passed through a Poisson inverse function for each team, which uses the expected goals per team for the match (a value that considers expected goals scored and received per match), to calculate goals per team for each one of the 10 000 matches. I then count the percentage of wins, ties and losses, which will vary depending on the teams considered and their expected goals per match.
I have noticed that if I run this code for a particular team playing against itself, or two teams that have the exact same number of expected goals for a match against each other, the percentage of wins, ties and losses is not consistent, within a margin of error of about 2 %. Roughly speaking, I have not calculated this. This means that a team will for example win against itself 38 % of the time and lose against itself 37 % of the time. I would expect the same percentage of wins/losses for the same team agsinst itself. The discrepancy is in the counts, and is not explained by rounding up the percentages. I am trying to get a better understanding of what is going on, to take this into consideration in the code. Does this have to do with the way Python generates random numbers? Or is there an intrinsic aspect of the Poisson inverse that causes this? In any case, what could be going on here? I have the feeling that there is a very simple explanation that I am overseeing.