Creating Loops with Ropes

Consider a scenario where you have N ropes inside a bucket. You randomly select one rope end, then pick another end and tie them together. What is the expected number of loops formed in the bucket through this process?

Answer Panel