You forgot to account for permutations of k copies of x . The correct definition of P(i) is
P(i) = (ni)C(k-1) * k! * (nk)! / n! = (ni)C(k-1) / nCk. ^^
I will go to Mathematica:
In[1]:= FullSimplify[Sum[i Binomial[ni, k-1]/Binomial[n, k], {i, 1, n}], 0 <= k <= n] 1 + n Out[1]= ----- 1 + k
To elaborate on my comment below: suppose that all elements are different, let X be a set of matches, and Y a set of inconsistencies. By assumption | X | = k and | Y | = nk. The expected number of readings is equal to the sum over the elements e of the probability of reading e.
Given the many elements of S, each element of S comes before everyone else with a probability of 1 / | S |.
An element x in X is read if and only if it occurs before every other element of X, which is a 1 / k probability. The total contribution of elements to X is | X | (1 / k) = 1.
An element y in Y is read if and only if it comes before each element from X, which is the probability 1 / (k + 1). The total contribution of elements to Y is | Y | (1 / (k + 1)) = (nk) / (k + 1).
We have 1 + (nk) / (k + 1) = (n + 1) / (k + 1).
source share