Skip to content

Instantly share code, notes, and snippets.

@secretGeek
Last active June 4, 2019 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save secretGeek/5ecad391916efa4a3acaa94685d4e41b to your computer and use it in GitHub Desktop.
Save secretGeek/5ecad391916efa4a3acaa94685d4e41b to your computer and use it in GitHub Desktop.

(my possibly incorrect line of thinking in relation to this tweet... https://twitter.com/secretGeek/status/1135831731347398657 )

First thing I think is:

we're not trying to work out the probability of being caught exactly once, or exactly twice etc. So we use an old statistics trick and turn it around, asking:

What is one minus the probability that he will be caught exactly 0 times?

To set about answering this, we start by saying, how often does he drink?

He drinks 12 times out of 260 work days ("once a month on average"), i.e. he is drunk this much:

12/260 * 100 = 4.61538461538462%

And conversely, he is sober this much:

100 - 4.61538461538462 = 95.3846153846154%

If we test him once, he has a 0.9538 chance of being safe (expressed as a fraction instead of a perfect... I find those easier)

If we test him on two random days we have a 0.9538 TIMES 0.9538 of him being safe both times.

And if we test him on 52 random days we have a (0.9538 to the power of 52 ) chance of him being safe.

(0.9538 to the power of 52 ) = 0.08546347373 (according to google)

So that's the chance of him being safe (expressed as a fraction, not a percent)

If we do "One minus" this number we get its "converse" which is the chance of him not being safe (i.e. caught).

1 - 0.08546347373 = 0.91453652627

...as a fraction, or:

91.4% as a percent.

So my guess, if my logic above is correct (which is a highly suspicious thing....)

is that there's a 91.4% chance he'll get caught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment