Skip to content

PatrickHorlaville/Donuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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!)

Releases

No releases published

Packages

No packages published