Source: Reader Rich Polster.
P(n) = (1/1000)(999/1000)^n
To find the expected value of n, we use the summation:
E(n) = sum [n*P(n)] 1->infinity
E(n) = 1000
The probability Q(x) that the x-th car matches for the first time my own car or one of the cars previously identified (all of them being different) is defined by: x=1 Q(1) = 1/1000 x=2 Q(2) = 2 * 999/1000 * 1/1000 x=3 Q(3) = 3 * 999/1000 * 998/1000 * 1/1000 x=4 Q(4) = 4 * 999/1000 * 998/1000 * 997/1000 * 1/1000 ....... x any Q(x) = x * 999/1000 *........* (1000-x+1)/1000 * 1/1000 ..... For x>1000 Q(x) = 0 We can check that for x=1 to 1000 sum(Q(x)) = 1 The average number N2 of the cars which pass before I see a duplicated three- digit number is equal to: N2 = Q(1) +2Q(2) + 3Q(3) + 4Q(4)+....xQ(x)+.... - 1 = sum(xQ(x)) - 1 = 38.3032..