I'd like your thoughts on a problem. (Here, all "randomly chosen" numbers are taken from the same continuous real distribution.) Suppose you have a set *S* of *n* randomly-chosen numbers, and a set *D*, initially empty. Begin by removing the largest number from *S* and placing it in *D*, and adding another random number to *S*. Now take the largest number from *S* that is smaller than the last number you chose, place it in *D*, and replace it with a random number. Repeat until you've taken the smallest number from *S*.

- What is the distribution of numbers in *D*?

- What is the expected value for the size of *D*?

- Bonus question (I know the answer to this one!): Why is Brian thinking about this problem?

I'm about to start in on a Monte Carlo estimator of the problem, but I'd like some theoretical input.

*click*