OFFSET
3,1
COMMENTS
Gives the number a(n) of elevators in an ideal system needed for a building with n floors to have a probability greater than or equal to 0.4 that the first elevator arriving to a given floor will be on its way down.
Also the least positive integer n such that 1/2 + (1/2)(1-2p)|1-2p|^(n-1) >= 0.4.
1/2 + (1/2)(1-2p)|1-2p|^(n-1) approaches 1/2 as n goes to infinity.
REFERENCES
George Gamow and Marvin Stern, Puzzle-Math, (New York: Viking Press, 1958).
Donald E. Knuth, Fundamental Algorithms, Volume 1 of The Art of Computer Programming (Reading, Massachusetts: Addison-Wesley, 1968).
Donald E. Knuth, Selected Papers on Fun and Games, (Stanford, California: CSLI Publications, 2011), pages 79-86.
FORMULA
a(n) = ceiling((log_10 5)/(log_10 (1+2/(n-2)))) for integer n >= 3.
EXAMPLE
For n=20, a(20) = ceiling((log_10 5)/(log_10 (1+2/(20-2))))= ceiling((log_10 5)/(log_10 (10/9))) = 16.
MATHEMATICA
a[n_] := Print[Ceiling[(Log10[5])/(Log10[1+2/(n-2)])]]
For[i = 3, True, i++, a[i]]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Luke Botta, Jan 03 2017
STATUS
approved