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.
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.
That is a very nice and elegant method.
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 , and the number of loops formed either stays the same or else increases by 1 , since either two shoelaces are joined into a single one, or else one shoelace is turned into a loop.
Suppose there are n shoelaces in the bucket to begin with, and let X j be the number of loops formed when the j t h pair of ends is joined. The random variable X j can only take the values 0 and 1 . Just before the j t h pair of ends is joined, there are n + 1 − j shoelaces and therefore 2 ( n + 1 − j ) free ends in the bucket.
Anton picks one of these ends. The probability that 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 other ends that he has to choose from. Thus E [ X j ] = P [ X j = 1 ] = 2 ( n − j ) + 1 1 1 ≤ j ≤ n . The total number of loops formed is clearly Y = X 1 + X 2 + ⋯ + 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 2 ( n − j ) + 1 1 = j = 0 ∑ n − 1 2 j + 1 1 For this problem we have n = 5 , so the answer is 1 1 + 3 1 + 5 1 + 7 1 + 9 1 = 3 1 5 5 6 3 = 1 . 7 8 7 .
Great solution, @Mark Hennings!
[edited based on conversation below] In this case, Mark picked clever X i that were independent.
However, we could say E [ Y ] = E [ X 1 ] + … + E [ X n ] even if the 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?
Log in to reply
Acutally, the X n are independent!
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.
Log in to reply
@Eli Ross – Whether the 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 to calculate the variance of the number of loops quite easily.
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.
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 4 6 0 8 0 , 4 8 0 0 0 , 1 6 8 0 0 , 2 4 0 0 , 1 2 0 , so the expected number of loops will be
4 6 0 8 0 + 4 8 0 0 0 + 1 6 8 0 0 + 2 4 0 0 + 1 2 0 4 6 0 8 0 ∗ 1 + 4 8 0 0 0 ∗ 2 + 1 6 8 0 0 ∗ 3 + 2 4 0 0 ∗ 4 + 1 2 0 ∗ 5 = 3 1 5 5 6 3 .
Lol.
Log in to reply
@Shourya Pandey – Even I did the same.
Here's another. After the first pair of ends has been joined, there are n − 1 shoelaces in the bucket, and possibly one loop. Let Y n be the number of loops created when n shoelaces are joined up. Let L be the event that a loop is created when the first pair of ends is joined. Then E [ Y n ] = 2 n − 1 1 E [ Y n ∣ L ] + 2 n − 1 2 n − 2 E [ Y n ∣ L ′ ] = 2 n − 1 1 E [ Y n − 1 + 1 ] + 2 n − 1 2 n − 2 E [ Y n − 1 ] = E [ Y n − 1 ] + 2 n − 1 1 Since Y 1 = 1 , we can solve this recurrence relation to obtain E [ Y n ] = j = 0 ∑ n − 1 2 j + 1 1 .
Log in to reply
Nice solution! This was the one I had in mind when I wrote the problem :)
Problem Loading...
Note Loading...
Set Loading...
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 = 2 n + 1 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 ) + 2 n + 1 1
and obviously E(1) = 1
Now just crank the handle to get E ( 5 ) = 1 + 3 1 + 5 1 + 7 1 + 9 1 = 3 1 5 5 6 3 = 1 . 7 8 7