## Introduction

Flip 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 chances and tries 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.

<aside> 💡 With a growing number of potential results, the solitary tragic ending of all tails gets a shrinking slice of the possible outcomes pie.

</aside>

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:

The shadow of success

$$misadventure=failure^{tries}\\ \\ failure=misadventure^{\frac{1}{tries}} \\ tries=\frac{\log(misadventure)}{\log(failure)}$$

Weighted coin tosses

### 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 = \frac{log(misadventure)}{log(failure)}=\frac{log(1/20)}{log(50\%)}=4.3\ tries$$

### Example 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 = failure^{tries} = 90\%^{10} = 34.9\%\ misadventure$$

35% 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=\frac{log(misadventure)}{log(failure)}=\frac{log(1/20)}{log(90\%)}=28.4 \ tries$$

And 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.