%I #12 Nov 10 2019 14:43:51
%S 0,0,33333333333,97777777778,188000000000,296266666667,413555555556,
%T 530844444444,640314074074,736230320988,815361224691,876907483128,
%U 922041405981,953224843588,973494078033,985863508285,992931754142,996701485266,998570643615,999428257446,999790361064,999930120355,999979036106,999994409628,999998695580,999999739116,999999956519,999999994203,999999999420,999999999961,999999999999,1000000000000
%N Inventory application: Numerator of the probability (rounded to the nearest trillionth: (10^-12)-th) of at least one shortage per month when n customers each request one item on one independently-chosen random day of a 30-day month, but when only exactly one such item is available per day.
%C A shortage occurs each time a customer cannot immediately be provided the item (that is, on the day it is requested). The denominator is always 10^12 here. Inspired by just-in-time inventory considerations for pharmacies, where new prescriptions and refills are usually for 30-day supplies, many medications are expensive and it is important to minimize cost of inventory and inconvenience of shortages to patients, pharmacists and supply clerks. Of course similar sequences can be computed for probabilities of at least (or exactly) m shortages per month under the same conditions and/or with higher item availabilities.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BirthdayProblem.html">Birthday Problem.</a>
%F a(n) = round(10^12 * (1. - 30!/ ((30-n)! * 30^n) )) for 0 <= n <= 30. This corresponds, with d=30, to P_2(n, d) at the MathWorld Birthday Problem link. Clearly the probability is 1 and so a(n) = 10^12 here for all n > 30.
%e a(2) = 33333333333, so if only two customers each request the item on random days during the month, there is only a .033(3333...) or ~3.3% probability that they would do so on the same day - causing a shortage for the second customer. However, "collisions" of needs/wants go up rapidly with the number of customers.
%e a(7) = 530844444444, so 7 = A033810(30) is the least number of customers for which the probability of at least one shortage during the month, 0.530844444444, exceeds 0.5 or 50%. This corresponds to the solution of the Birthday Problem, where A014088(2) = 23 = A033810(365), on a planet (or moon) with a 30-day "year".
%o (PARI) a(n) = if(n>30, 10^12, round(10^12*(1.-30!/((30-n)!*30^n)))) for(k=0,31,print1(a(k),","))
%Y Cf. A014088, A033810.
%K frac,nonn
%O 0,3
%A _Rick L. Shepherd_, Oct 24 2004
|