On which place should you stand in a line, to get a bonus.

61 Views Asked by At

Customers are going inside a store, the first customer whose birthday matches the birthday of someone that has already entered the store will get a bonus discount. Where on the line to stand to get the biggest chance to win a bonus?

1

There are 1 best solutions below

7
On BEST ANSWER

I will use an year with $N=365$ days, every day being equally probable as a birthday for each of the customers in the line.

The $k$.th customer has a chance to get the price equal to $p_k$, say, as a matter of notation. Then $p_k$ is combinatorially obtained by counting the day configurations $(d_1, \dots,d_{k-1},d_k)$ with different values on the first $(k-1)$ places, and with $d_k$ repeating one of these $(k-1)$ places, and we divide by the number $N^k$ of all day configurations with $k$ places, so

Corrected version, thanks lulu and Daniel Schepler

$$ \begin{aligned} p_1 &=0\ ,\\ p_2 &=\frac 1N\ ,\\ &\qquad\text{ and for }k\ge 3\\ p_k &= \frac 1{N^k}\cdot N(N-1)\dots(N-k+2)\cdot(k-1) \\ &= \left(1-\frac 1N\right) \dots \left(1-\frac {k-2}N\right)\cdot \frac {k-1}N\ . \end{aligned} $$ The maximal value is in the script below obtained for $k=20$, p(20) ~ 0.0323198575


Here is numerically the list of the probabilities for the first customers:

sage: N = 365
sage: for k in [2..40]:
....:     pk = binomial(N, k-1)*factorial(k-1)*(k-1) / N^k
....:     print "p(%2s) ~ %.10f" % (k, pk.n())
....:     

p( 2) ~ 0.0027397260
p( 3) ~ 0.0054644399
p( 4) ~ 0.0081517466
p( 5) ~ 0.0107796612
p( 6) ~ 0.0133269099
p( 7) ~ 0.0157732194
p( 8) ~ 0.0180995893
p( 9) ~ 0.0202885415
p(10) ~ 0.0223243438
p(11) ~ 0.0241932006
p(12) ~ 0.0258834105
p(13) ~ 0.0273854864
p(14) ~ 0.0286922368
p(15) ~ 0.0297988078
p(16) ~ 0.0307026855
p(17) ~ 0.0314036600
p(18) ~ 0.0319037526
p(19) ~ 0.0322071082
p(20) ~ 0.0323198575
p(21) ~ 0.0322499516
p(22) ~ 0.0320069725
p(23) ~ 0.0316019267
p(24) ~ 0.0310470236
p(25) ~ 0.0303554461
p(26) ~ 0.0295411162
p(27) ~ 0.0286184621
p(28) ~ 0.0276021901
p(29) ~ 0.0265070651
p(30) ~ 0.0253477052
p(31) ~ 0.0241383910
p(32) ~ 0.0228928941
p(33) ~ 0.0216243263
p(34) ~ 0.0203450104
p(35) ~ 0.0190663743
p(36) ~ 0.0177988675
p(37) ~ 0.0165519018
p(38) ~ 0.0153338129
p(39) ~ 0.0141518433
p(40) ~ 0.0130121455

sage code was used.