(note: You can also view this post as a
Notion, it's a bit easier to look at)
Introduction to ConfidenceFlip five coins: Did you get a head? The answer that question is yes. Yes you did. And I'll wager being wrong about that around
once out of every 32 tries. The interplay between chance and try creates in a fuzzy way
when a success will appear. The developer's expression of artistry is then to place those successes along a timeline that fits into their universe.
The Amazing Shrinking Failure Rate
One toss of a coin does not directly affect another, but as we continue adding more tosses to an experiment the number of possible outcomes explodes. With a growing number of potential results, the solitary tragic ending of all tails gets a shrinking slice of the possible outcomes pie.
So we have the coin's chance of success/failure and a number of tries. And from those two we can work out the chance of an all-tails misadventure. These three values form a relationship so any two define the third:
misadventure = failuretries failure = misadventure1/tries tries = log(misadventure)/log(failure) | |
Example 1: How many animals should I take?
Let's say we're playing
Rimworld and want to take just enough animals on our trip to assure getting a male and a female for breeding. How many is enough?
We know the chance of an animal being male or female is 50%, and we want to set the chance of a misadventure low. How low? This is
an executive decision, and I like to use 95% certainty when no other option seems of particular merit. So 5% misadventure, 1 in 20 chances to be wrong. Roll 1d20.
tries = log(misadventure) / log(failure) = log(1/20) / log(50%) = 4.3 triesExample 2: Is that gamble worth it?
An NPC offers a gambler's prize: Pay up front for a try and there's a 10% chance to get what I want each time. I can currently afford ten tries. We know the chance of failure (90%) and the number of tries (10) so we can work out the chance of a misadventure.
misadventure = failuretries = 90%10 = 34.9% misadventure35% misadventure leaves 65% success, a bit better than a coin flip but not at all a reasonably certain outcome. Well below that 95% certainty I like so much, so I'll pass on it.
How many tries would it take for me to reconsider?
tries = log(misadventure) / log(failure) = log(1/20) / log(90%) = 28.4 triesAnd now we're getting to it: After 28 tries I'm reasonably certain to have the prize. And the cost of the prize at my chosen level of aversion to misadventure is 28 tries.
Example 3: What should the drop chance be?
Let's say we want to make a loot drop that costs ten tries before it's 95% reasonable to say the loot has dropped. Lady Luck is of course free to drop it sooner, but we define the size of her dance floor. So we have the tries (10) and the chance of misadventure (100% - 95% reasonable = 5%), and can then work out the drop chance failure:
failure = misadventure1/tries = 5%1/10 = 74.1% failureThe drop chance is what remains after 74% failure, 26% chance to drop.
Loot Drop Tables
Thus far we've designed a loot drop, and we'd like to offer several possible loot drops in a spin-the-wheel style loot table. So let's design three loot drops for our table, and call them Copper, Silver and Gold.
I want Copper to be a cheap prize that costs only a trifling few tries to get. Silver is more expensive, costing a bunch of tries. And I'm jealously guarding my masterwork treasure, Gold, which has a high ceiling of many tries before it can be said with confidence that it has dropped.
Prize | Cost in tries | Confidence | calculated drop chance |
Copper | 4 | 95% | 53% |
Silver | 8 | 95% | 31% |
Gold | 20 | 95% | 14% |
As long as the sum of Drop Chances is less than 100%, there's room for more loot drops in the table. Whatever remains between the sum and 100% is the chance that nothing will drop.
An imperfect estimate of cost for using the table is each entry in the loot table counts as one try. So rolling against the above table is worth three tries. But that doesn't account for the possibility that were they taken individually, there could have been several prizes awarded (or none at all). I suspect the solution is a combinatorial problem. Got any ideas on how to improve the costing?