Truth Spinner Probabilities

dannyb21892 Jan 18th, 2017 (edited) 666 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Truth spinner is the statue at the start of shadow temple which you push to face the correct skull in order to open a door. There are three possible correct skulls. I asked the #hacking room of the OoT discord to look into the selection process for the correct skull, which we know to occur whenever you load the room. Thanks to mzxrules and Ecksters for checking it out. Here is what was found.
  3. Torch 1 is the one nearest the shadow temple exit.
  4. Torch 2 is the one nearest the door toward hover boots and the catacombs.
  5. Torch 3 is the one in the center.
  7. The algorithm is as follows:
  9. Generate a random number x from 0 to 3, exclusive.
  10. If x<1 select torch 1
  11. else Generate a random number y from 0 to 3, exclusive.
  12. If y<2 select torch 2
  13. else Generate a random number z from 0 to 3, exclusive.
  14. If z<3 select torch 3 (this check always passes)
  16. At first glance, this methodology might seem to guarantee even third chances for all three torches. After all, it divides the uniform distribution of random numbers into three equally sized bins, and assigns a unique outcome to each bin.  This is likely exactly what the developers thought as well. But they fucked up. They chose a new random number each time a torch failed to be selected. That messes up the distribution because you end up having to deal with conditionals. Here's how the probability works out:
  18. Torch 1
  19. P(torch 1) = P(x<1) = 1/3.  
  20. Therefore torch 1 has 33.3% chance to be chosen.
  22. Torch 2
  23. To get here, we know the check on torch 1 failed, which means x>1. Then they randomly choose y.
  24. P(torch 2 given not torch 1) = P(y<2) * P(x>1) = 2/3 * 2/3 = 4/9.
  25. Therefore torch 2 has a 44.4% chance to be chosen.
  27. Torch 3
  28. To get here, we know the checks on both torch 1 and 2 failed, which means x>1 and y>2. Then they randomly choose z.
  29. P(torch 3 given neither torch 2 nor torch 1) = P(z<3) * P(y>2) * P(x>1) = 1 * 1/3 * 2/3 = 2/9.
  30. Therefore torch 3 has a 22.2% chance to be chosen.
  32. If the devs had just not chosen a new random number between checks and stuck with the first one, they would have guaranteed even thirds for all three skulls. That would have looked like this:
  34. Generate a random number x from 0 to 3, exclusive.
  35.     If x<1 select torch 1
  36.     elseif x<2 select torch 2,
  37.     else select torch 3
  39. TL;DR : Push truth spinner counter-clockwise.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand