I have a problem and need help. The problem is: There is an urn with numbered balls that follow the following pattern:
- In urn $2$, we have two $2$ balls and one $1$ ball
- In urn $3$, we have three $3$ balls, two $2$ balls and one $1$ ball
- In urn $4$, we have four $4$ balls, three $3$ balls, two $2$ balls and a $1$ ball...
- The last urn is $20$.
I'll take urn $3$ as an example, to make it easier. In the problem, there is a draw without replacement, where I take the balls from the urn $3$ and put them in another urn X, I take the balls until I reach ball $1$ (it is my stopping condition for the draw). Upon reaching ball $1$, I stop the draw and look at urn X with the balls drawn before reaching ball $1$. In that urn X, I will count the maximum amount of identically numbered balls and call it k. So, for example: from urn $3$, I took balls {$2,3,3,1$}, my urn X will be {$2,3,3$}, so my $k=2$, because the maximum amount of identical balls is two (the two balls $3$).
Well, the challenge is: to calculate the expected value of this variable k
I understand that the problem is a multivariate hypergeometric distribution, but I don't have my sample size fixed. In the example I gave, the sample size would be $3$, but it could have been $1, 2, 4 or 5,$ it all depends on when I stop the draw, that is, when I take my ball $1$.
How can I deal with this problem? I saw some questions about optional stopping theorem, but I couldn't understand the application at all problem
Thank you