I tried, but got different numbers. How did you calculate this?
Those two particular examples I simply lifted from page 8 of the the whitepaper. For q=0.3 (an attacker with 30% of the hashrate), the probability (P) they overturn 10 confirmations (z=10) is 0.0416605, which is 4.16605%.
The equation itself is also given in the whitepaper, but rather than calculate it manually you can just plug your numbers in here:
https://web.archive.org/web/20181231045818/https://people.xiph.org/~greg/attack_success.html