Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 860 Bytes

README.md

File metadata and controls

6 lines (4 loc) · 860 Bytes

Donuts

You sell donuts but only in boxes of 7 or 13 donuts. Some customer makes an order of n donuts, n being a random variable between 0 and 100. What is the probability that you can fulfill their order?

I wrote a function that solves this problem by simply finding all the multiples of 7 and 13 between 0 and 100. Then you can divide that number by 101 to find the ratio of orders between 0 and 100 that you can take, which is effectively the probability I'm looking for if n is a random variable.

We can then perform analog computations for different multiples and different ranges. The bigger the range, the higher the probability, since higher numbers can be constructed in many more different ways that smaller numbers (P.S.: I do not know if that is true, but I hope that provocative thought provokes a mindful reflection on this question for you!)