@zargus,

I believe he means to say that, if we read K numbers, we should choose anyone of them with probability 1/K, to be equally likely to get each one of the K numbers.

THis would be trivial to do if we could keep on storing the numbers read in a list or so, then we use a uniform probability distribution generator to generate a number between 1 and K, let it be S, and we return the number at the index Array[S-1].

The main difficulty here is the space requirement to be O(1)… while we could always return the last number read, that would violate the condition of equal probability…

Bruno