Estimated wait time for a library book

258 Views Asked by At

A library has 20 copies of a book that circulates for 3 weeks. All copies are out and there 40 people on reserve ahead of me. How do I estimate the wait time?

2

There are 2 best solutions below

0
On

If we assume that all books were given away just as you joined the queue (highly unlikely), you'd have to await further two full cycles ($40/20$) until you are first and then wait another cycle for the books to be returned, making a total of $3$ cycles, i.e. $9$ weeks.

This is extremely unrealistic, though. You should probably assume a certain distribution with expectation $3$ (in weeks) i.i.d. per book and see what the expected time until $60$ "returns" happen, noting that after each return, the distribution "recovers" per book.

0
On

Let $t=0$ be the time you arrive. If all books are out, then they were taken out at some point in the interval $(-3,0)$ where the units are weeks. We should assume they were randomly taken out, making this a uniform distribution. The expected times the books were taken out can be ordered $-3 + n\dfrac{3}{21}$ for $n=1,...,20$ (this is not so obvious, see below for explanation). So they will be returned 3 weeks later: $t_n = n\dfrac{3}{21}=\dfrac{n}{7}$ weeks, or just $n$ days from today.

Each of the books will be taken out $2$ more times (assuming the same day they were given back) and thus be returned $6$ weeks later. You will be taking out the first book that is returned (the one expected in one day) albeit 6 weeks after: $6+t_1=6+\dfrac{1}{7}$ weeks or $43$ days.


Now to elaborate on the "not so obvious" part:

Consider the problem of choosing two random numbers in $(x,y)$. For $t\in (x,y)$, $$P(\text{min}\{a,b\}>t)=P(a>t)P(b>t) = \left(\dfrac{y-t}{y-x}\right)^2$$

So

$$P(\text{min}\{a,b\}\le t)= 1- \left(\dfrac{y-t}{y-x}\right)^2$$

So the $p.d.f.$ of the variable $Z=\text{min}\{a,b\}$ is $f(t) = 2\dfrac{y-t}{(y-x)^2}$, giving

$$E(Z) = \dfrac{2}{(y-x)^2}\int_x^y t(y-t) \ dt = \dfrac{2x+y}{3}$$

Now this might be intuitively convincing, since $\dfrac{2x+y}{3} = x+\dfrac{y-x}{3}$, i.e. one-third the way between $x$ and $y$. The other point, we would similarly expect to be two-thirds the way.

Had we picked $n$ points, we'd want them to be evenly spaced apart: $x+k\dfrac{y-x}{n+1}, k=1,2,...,n$. And letting $x=-3, y=0, n=20$ we get the result up above.