The other day I was grading final exams for a course I was teaching. At one point we had all $n$ exams stacked up and needed to search the stack of exams for $k$ specific students’ exams. I therefore started at the top of the pile and started flipping through the exams looking for them. Through quite a coincidence I found $k-1$ of the exams pretty close to the top, but the very last exam was fourth from the bottom. It therefore took quite a lot of time to find them all!
That got me thinking about how many exams, in expectation, I would have to look at to find all $k$ of the exams I was looking for. For example, if I’m looking for a single exam $(k = 1)$, then on expectation I’d look at $\frac{n}{2}$ exams because that one exam has an equal chance of being anywhere in the pile. At the other extreme, if I’m looking for all $n$ exams $(n = k)$, then I’ll have to look at all $n$ exams to find them all.
There’s clearly some sort of “interpolation” between these two extreme cases, but I’m not sure how to work out the math on this.
My current progress is as follows: I believe (?) the probability that all $k$ of the exams in question occur in the first $r$ exams in the stack is given by counting all permutations formed by picking $k$ slots from the first $r$ positions, and for each one permuting the $k$ exams in question in those slots and the $n - k$ other exams outside those slots:
$$\frac{\binom{r}{k}k!(n - k)!}{n!} = \frac{(n - k)!r!}{n!(r - k)!}$$
I imagine that there’s some way to go from this expression to a proper expected value, and ideally from there to some nice asymptotic approximation that works for large $n$ and small $k$, but I’m not sure how to do either of those.
Any advice about how to proceed?