There are n! combinations which contain n! x n cords.

As we have seen the chance of a cord being in a loop of size r is 1/n, so there are n! such cords. Each such loop has r cords and so the number of such loops is n!/r. The total number of loops is the sum of n!/r for 1<=r<=n. Dividing by n! gives the average number of loops per combination which is 1 + ½ + 1/3 + … + 1/n.

Let e(r) be the expected number of loops of length r where r <= n. Each such loop contains r cords. So the expected number of cords which are in a loop of length r is re(r). The probability of a random cord being part of a loop of length r is re(r)/n.

We can calculate this probability a different way. Starting with our random cord:

It will be in a loop of length 1 if it connects to itself, the probability is 1/n.

It will be in a loop of length 2 if it connects to a different cord which then connects to the first, probability (n-1)/n x 1/(n-1) = 1/n.

In general the probability of being in a loop of length r is (n-1)/n x (n-2)/(n-1) x (n-3)/(n-2) x … x (n+1-r)/(n+2-r) x 1/(n+1-r) = 1/n.

So the probability of a random cord being in a loop of length r is always 1/n. Interestingly this doesn’t depend on r (except that r must be less than n).

Before we showed that this probability was re(r)/n, so we have re(r)/n = 1/n and so e(r) = 1/r. The expected number of loops of length r is 1/r. This time the answer doesn’t depend on n (except that r must be less than n).

The expected number of loops is the sum of the expected number of loops of each size which is

e(1) + e(2) +e(3) + … + e(n) = 1 + ½ + 1/3 + … + 1/n

Do those numbers seem reasonable? Intuitively (and wrongly) I myself would guess that one would have more loops than that, on average!

]]>