A Bucket Of Shoelaces

Anton has a bucket of 5 shoelaces:

He randomly selects two distinct "ends" of a shoelace (from all ends -- there are 10 in the beginning) and ties them together to form a longer shoelace. Sometimes, he happens to choose ends of the same shoelace (or chain of shoelaces), and when he ties them together it forms a loop (which has no ends).

By the nature of this process, at the end, he will only have loops (at least 1, and no more than 5). What is the expected value for the number of loops Anton will have in the end?

Give your answer to 3 decimal places.


The answer is 1.7873.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Peter Macgregor
May 11, 2016

Relevant wiki: Expected Value - Problem Solving

We can set up a recurrence relation for the expected number of loops. Let E(n) be the expected number of loops for n shoelaces. I imagine the laces are black. Now let us introduce one more lace (I imagine it is red) and start with our bucket of n+1 laces. The probability that the red lace ends up looped with just itself is p = 1 2 n + 1 p=\frac{1}{2n+1} . This follows because one end of the red lace must be tied to one of the other 2n+1 ends in the bucket. Each end is equally likely and just one of those ends is the other red end! If the red lace does not form a one lace loop with itself it must be incorporated into one of the loops formed by n laces. These observations lead to the recurrence relation

E ( n + 1 ) = ( 1 p ) E ( n ) + p ( E ( n ) + 1 ) = E ( n ) + p = E ( n ) + 1 2 n + 1 E(n+1)=(1-p)E(n)+p(E(n)+1)=E(n)+p=E(n)+\frac{1}{2n+1}

and obviously E(1) = 1

Now just crank the handle to get E ( 5 ) = 1 + 1 3 + 1 5 + 1 7 + 1 9 = 563 315 = 1.787 E(5)=1+\frac{1}{3}+\frac{1}{5}+\frac{1}{7}+\frac{1}{9}=\frac{563}{315}=\boxed{1.787}

That is a very nice and elegant method.

Indraneel Mukhopadhyaya - 5 years, 1 month ago
Mark Hennings
May 10, 2016

For linguistic ease, I shall refer to a chain of shoelaces that has not formed a loop simply as a shoelace.

Every time two ends are joined, the number of shoelaces decreases by 1 1 , and the number of loops formed either stays the same or else increases by 1 1 , since either two shoelaces are joined into a single one, or else one shoelace is turned into a loop.

Suppose there are n n shoelaces in the bucket to begin with, and let X j X_j be the number of loops formed when the j t h j^\mathrm{th} pair of ends is joined. The random variable X j X_j can only take the values 0 0 and 1 1 . Just before the j t h j^\mathrm{th} pair of ends is joined, there are n + 1 j n+1-j shoelaces and therefore 2 ( n + 1 j ) 2(n+1-j) free ends in the bucket.

Anton picks one of these ends. The probability that X j = 1 X_j=1 is simply the probability that Anton chooses the unique end that is the other end of the shoelace to which Anton's first pick belongs, out of the 2 ( n + 1 j ) 1 2(n+1-j)-1 other ends that he has to choose from. Thus E [ X j ] = P [ X j = 1 ] = 1 2 ( n j ) + 1 1 j n . E[X_j] \; = \; P[X_j = 1] \; = \; \frac{1}{2(n-j) + 1} \qquad \qquad 1 \le j \le n \;. The total number of loops formed is clearly Y = X 1 + X 2 + + X n , Y \; =\; X_1 + X_2 + \cdots + X_n \;, and so the expected number of loops formed is thus E [ Y ] = E [ X 1 ] + E [ X 2 ] + + E [ X n ] = j = 1 n 1 2 ( n j ) + 1 = j = 0 n 1 1 2 j + 1 E[Y] \; =\; E[X_1] + E[X_2] + \cdots + E[X_n] \; = \; \sum_{j=1}^n \frac{1}{2(n-j) + 1} \; =\; \sum_{j=0}^{n-1} \frac{1}{2j+1} For this problem we have n = 5 n=5 , so the answer is 1 1 + 1 3 + 1 5 + 1 7 + 1 9 = 563 315 = 1.787 \tfrac11 + \tfrac13 + \tfrac15 + \tfrac17 + \tfrac19 = \tfrac{563}{315} \,=\, \boxed{1.787} .

Great solution, @Mark Hennings!

[edited based on conversation below] In this case, Mark picked clever X i X_i that were independent.

However, we could say E [ Y ] = E [ X 1 ] + + E [ X n ] E[Y] = E[X_1] + \ldots + E[X_n] even if the X i X_i were not independent because of linearity of expectation . This opens the door to choosing some other random variables/ways to frame the problem. Does anyone have ideas for other approaches?

Eli Ross Staff - 5 years, 1 month ago

Log in to reply

Acutally, the X n X_n are independent!

Mark Hennings - 5 years, 1 month ago

Log in to reply

Aha - didn't read your set-up carefully enough. Thanks for noting this.

That being said, there are other ways to set up the random variables in this problem where that tool would be quite helpful.

Eli Ross Staff - 5 years, 1 month ago

Log in to reply

@Eli Ross Whether the X n X_n are independent or not, I am simply using the linearity of expectation to solve the problem (the wonders of indicator random variables!) I could, however, use the independence of the X n X_n to calculate the variance of the number of loops quite easily.

Mark Hennings - 5 years, 1 month ago

Log in to reply

@Mark Hennings Yes, which is one reason why your set-up is more powerful than some of the other ways to solve this.

Eli Ross Staff - 5 years, 1 month ago

Log in to reply

@Eli Ross Wow! What I did was boring, lengthy and not-so-elegant. I case-bashed on the number of ways in which 1 loop , 2 loops, ..., 5 loops could be formed, and they were respectively 46080 , 48000 , 16800 , 2400 , 120 46080, 48000, 16800, 2400, 120 , so the expected number of loops will be

46080 1 + 48000 2 + 16800 3 + 2400 4 + 120 5 46080 + 48000 + 16800 + 2400 + 120 = 563 315 \frac {46080*1+48000*2+16800*3+2400*4 +120*5}{46080+48000+16800+2400+120} = \frac {563}{315} .

Lol.

Shourya Pandey - 5 years, 1 month ago

Log in to reply

@Shourya Pandey Even I did the same.

Indraneel Mukhopadhyaya - 5 years, 1 month ago

Here's another. After the first pair of ends has been joined, there are n 1 n-1 shoelaces in the bucket, and possibly one loop. Let Y n Y_n be the number of loops created when n n shoelaces are joined up. Let L L be the event that a loop is created when the first pair of ends is joined. Then E [ Y n ] = 1 2 n 1 E [ Y n L ] + 2 n 2 2 n 1 E [ Y n L ] = 1 2 n 1 E [ Y n 1 + 1 ] + 2 n 2 2 n 1 E [ Y n 1 ] = E [ Y n 1 ] + 1 2 n 1 E[Y_n] \; = \; \tfrac{1}{2n-1}E[Y_n | L] + \tfrac{2n-2}{2n-1}E[Y_n|L'] \; = \; \tfrac{1}{2n-1}E[Y_{n-1} + 1] + \tfrac{2n-2}{2n-1}E[Y_{n-1}] \; = \; E[Y_{n-1}] + \tfrac{1}{2n-1} Since Y 1 = 1 Y_1 = 1 , we can solve this recurrence relation to obtain E [ Y n ] = j = 0 n 1 1 2 j + 1 . E[Y_n] \; = \; \sum_{j=0}^{n-1} \frac{1}{2j+1} \;.

Mark Hennings - 5 years, 1 month ago

Log in to reply

Nice solution! This was the one I had in mind when I wrote the problem :)

Eli Ross Staff - 5 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...