Here is an exercise from Introduction to Probability (Blitzstein, Hwang):
There are 100 shoelaces in a box. At each stage, you pick two random ends and tie them together. Either this results in a longer shoelace (if the two ends came from different pieces), or it results in a loop (if the two ends came from the same piece). What are the expected number of steps until everything is in loops, and the expected number of loops after everything is in loops?
Hint: For each step, create an indicator r.v. for whether a loop was created then, and note that the number of free ends goes down by 2 after each step.
As it proposed, I've created an indicator r.v.:
\begin{equation} L_i=\begin{cases} 1, & \text{if loop created on i-th step}.\\ 0, & \text{otherwise}. \end{cases} \end{equation}
I guess that in this problem it is not required to take into account shoelaces lengths and probability to pull "long" lace created from several laces is the same as for "short" laces. Therefore, we can treat all shoelaces equally. In other words, on each step we just loose one lace from the box: either it forms a loop and is removed from the box or it "merges" into another lace. Anyway, each step means minus one shoelace from the box.
If this reasoning is correct, on each step the probability to create a loop is equal to probability to pull one of shoelaces twice, or:
$$ P(L_i=1)=\frac{1}{(100-i + 1)^2} $$
Then, the expected number of loops: $$ E(X)=E(L_1 + L_2 + ... + L_{100})=\sum_{i=1}^{100}\frac{1}{(100 - i + 1)^2}=\sum_{k=0}^{99}\frac{1}{(100 - k)^2} $$
And therefore, expected number of steps until everything is in loops is equal to 100 i.e. the number of shoelaces at the beginning because on each step we loose exactly one shoelace.
Do you think these answers are correct, or at least "close" to the correct solution?
Note: The authors provided an answer for this exercise, but I do not want to look it up because don't want to accidentally discover right answer if my solution is wrong.
Ok, as @user125932 correctly noted my reasoning was wrong and we need to pick random ends of shoelaces. Here is an explanation from the textbook:
Or using my indexes: $$P(L_i = 1)=\frac{(100 - i + 1)}{\binom{2(100 - i + 1)}{2}}$$