Here is a problem that bothers me, could some one grand me some help?
There is a sequence of N random integers, {$X_1,X_2,...,X_N$}. Each $X_i$ is uniformly chosen from a integer set {1,...,M}.
For each specific values of the sequence, {$x_1,x_2,...,x_N$}, if there exits repetition, we put the all the duplicated variables in a bag. For example, when N = 6, M = 7, if the sequence is {$x_1=1,x_2=1,x_3=2,x_4=2,x_5=3,x_6=6,x_7=3$}, we put $x_1,x_2,x_3,x_4,x_5,x_7$ in the bag, and the bag size is 6 since we have 6 duplicated variables.
My question is that, what is the average bag size?
I know this can be solved by writing a simple program, but I am wondering if there exits an function relationship between N, M, and the average bag size.
Thank you!