If you’ve ever watched an Ocarina of Time 100% speedrun, or played the game yourself, you’ll probably know about Dampe. As a gravedigger in Kakariko graveyard, he’ll offer to dig up graves for you when you go to him as child Link to get a random treasure. If you’re mildly lucky, you’ll get enough rupees to try again. If you’re really lucky, you’ll get the heart piece.
The latter is obviously part of the 100% definition of the game, so hundo speedruns sooner or later have to face dampe and gamble on the 10% chance of him digging up the heartpiece.

As one of the few major rng-dependent1 events in the run he’s kind of notorius, especially when he kills multiple runs in a row by needing more than 10 attempts to finally get the heart piece.
The math itself is pretty straight forward: In a speedrun, runners use a method to reset Dampe to a specific plot, allowing them to dig on the same grave spot over and over again, theoretically ad infinitum. While this method is not as “safe” as the intended method, which is capped at 15 tries maximum, it’s significantly faster unless you get “bad Dampe rng”. Each time Dampe digs, there’s a 10% chance to get the heartpiece, which means in mathy terms we can define \(p = 0.1\) and \(k\) as the number of tries until success, giving us:

$$P(k = 1) = p = 0.1$$

Second try Dampe would be the probability of “failing” the first attempt and then succeed afterwards, or:

$$P(k = 2) = (1-p) \times p = 0.9 \times 0.1 = 0.09$$

And in general terms:

$$P(k) = (1-p)^{k-1} \times p$$

Which, conveniently, is known as the geometric distribution. In R, we can calculate individual probabilities using dgeom(x, prob = .1) to get the probability for “failing x times before success”, meaning we need to use k = x - 1 to get the number of attempts it took to get the heartpiece, include the last dig.

So, with a lot of talk about odds and chances and whatnot every time Dampe is misbehaving again, I thought I’d take the opportunity to make a little lookup table to see just how unlikely your latest 61st try Dampe really was.

Here’s what’s included:

  • Attempt: How often you had to let Dampe dig until the heart piece, \(k\)
  • Probability: The probability for \(k\), as a singular outcome
  • Odds (Singular): \(\frac{1}{\text{Probability}}\), the probability for that outcome in human readable terms
  • Probability (cumulative): Probability of \(1\) through \(k\) tries, i.e. the probability for getting \(k\) or lower tries

(So, in statsy terms, I’m basically just printing the pmf and cdf for \(k = 1\) through \(k = 105\) in a table. Yip.)

AttemptProbabilityOddsProbability (cumulative)
10.10000001 in 100.1000000
20.09000001 in 120.1900000
30.08100001 in 130.2710000
40.07290001 in 140.3439000
50.06561001 in 160.4095100
60.05904901 in 170.4685590
70.05314411 in 190.5217031
80.04782971 in 210.5695328
90.04304671 in 240.6125795
100.03874201 in 260.6513216
110.03486781 in 290.6861894
120.03138111 in 320.7175705
130.02824301 in 360.7458134
140.02541871 in 400.7712321
150.02287681 in 440.7941089
160.02058911 in 490.8146980
170.01853021 in 540.8332282
180.01667721 in 600.8499054
190.01500951 in 670.8649148
200.01350851 in 750.8784233
210.01215771 in 830.8905810
220.01094191 in 920.9015229
230.00984771 in 1020.9113706
240.00886291 in 1130.9202336
250.00797661 in 1260.9282102
260.00717901 in 1400.9353892
270.00646111 in 1550.9418503
280.00581501 in 1720.9476652
290.00523351 in 1920.9528987
300.00471011 in 2130.9576088
310.00423911 in 2360.9618480
320.00381521 in 2630.9656632
330.00343371 in 2920.9690968
340.00309031 in 3240.9721872
350.00278131 in 3600.9749684
360.00250321 in 4000.9774716
370.00225281 in 4440.9797244
380.00202761 in 4940.9817520
390.00182481 in 5490.9835768
400.00164231 in 6090.9852191
410.00147811 in 6770.9866972
420.00133031 in 7520.9880275
430.00119731 in 8360.9892247
440.00107751 in 9290.9903023
450.00096981 in 10320.9912720
460.00087281 in 11460.9921448
470.00078551 in 12740.9929303
480.00070701 in 14150.9936373
490.00063631 in 15720.9942736
500.00057261 in 17470.9948462
510.00051541 in 19410.9953616
520.00046381 in 21560.9958254
530.00041751 in 23960.9962429
540.00037571 in 26620.9966186
550.00033811 in 29580.9969567
560.00030431 in 32860.9972611
570.00027391 in 36520.9975350
580.00024651 in 40570.9977815
590.00022191 in 45080.9980033
600.00019971 in 50090.9982030
610.00017971 in 55650.9983827
620.00016171 in 61840.9985444
630.00014561 in 68710.9986900
640.00013101 in 76340.9988210
650.00011791 in 84820.9989389
660.00010611 in 94250.9990450
670.00009551 in 104720.9991405
680.00008601 in 116350.9992264
690.00007741 in 129280.9993038
700.00006961 in 143640.9993734
710.00006271 in 159600.9994361
720.00005641 in 177330.9994925
730.00005081 in 197040.9995432
740.00004571 in 218930.9995889
750.00004111 in 243260.9996300
760.00003701 in 270280.9996670
770.00003331 in 300310.9997003
780.00003001 in 333680.9997303
790.00002701 in 370760.9997573
800.00002431 in 411950.9997815
810.00002181 in 457720.9998034
820.00001971 in 508580.9998230
830.00001771 in 565090.9998407
840.00001591 in 627880.9998567
850.00001431 in 697640.9998710
860.00001291 in 775160.9998839
870.00001161 in 861280.9998955
880.00001041 in 956980.9999060
890.00000941 in 1063310.9999154
900.00000851 in 1181460.9999238
910.00000761 in 1312730.9999314
920.00000691 in 1458590.9999383
930.00000621 in 1620650.9999445
940.00000561 in 1800730.9999500
950.00000501 in 2000810.9999550
960.00000451 in 2223120.9999595
970.00000401 in 2470130.9999636
980.00000361 in 2744590.9999672
990.00000331 in 3049540.9999705
1000.00000301 in 3388380.9999734
1010.00000271 in 3764870.9999761
1020.00000241 in 4183180.9999785
1030.00000221 in 4647980.9999806
1040.00000191 in 5164420.9999826
1050.00000171 in 5738250.9999843

  1. Random number generator; in speedrunning terms it’s become synonymous with ‘random event’ or ‘specific outcome of an event determined by [pseudo] random number generation’. I know it’s kind of weird to use “rng” as an adjective or catch-all term, but oh well. Context and such. ↩︎