As per basic probability theorem getting equal number of heads and tails when coin is tossed $10000$ times is = $\frac{\binom{n}{r}}{2^n} = \frac{\binom{10000}{5000}}{2^{10000}}$
This value is not equal to or close to $0.5$
But if one does the same experiment simulation, then probability will be close to $0.5$ (with $10000$ tosses)
Can you explain why is there a difference in probability ?