A bowl contains N strands of noodles. You reach into the bowl and grab two free ends at random and attach them. You do this N times until there are no free ends left.
What is the minimum N such that the expected number of loops generated by the N steps described above exceeds 3?
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.
I prefer the simpler formula of E [N+1] = E [N] + 1/(2N-1) which follows logically from your approach which says you either link the first strand to itself or you are back to square one.
Still a nice solution.
Log in to reply
Yes, using linearity of expectation to form a recurrence is a nice method too. How about you post that as a solution?
Wow, even though I was aware of this result, it didn't occur to me that it required so many noodles just to get 3 loops on average.
How did you sum that series up ?
The real trick is recognizing that regardless of the outcome of the first connection (formed a loop or didn't form a loop), the number of strands has decreased by 1. Once you realize that it is fairly straightforward calculation.
Log in to reply
That is a very nice observation. Maybe we can try to come up with a fun problem where the number of threads either increase or decrease by 1, stochastically, and then try figuring out how we could solve it.
We can set up a recurrence relation for the expected number of loops given n strands of noodles. Let E(n) be the expected number of loops for n strands. Now let us introduce one more strand (I imagine it is red) so that our bowl now has n+1 strands. The probability that the red strand ends up looped with just itself is p = 2 n + 1 1 . This follows because one end of the red strand must end up joined to one of the other 2n+1 ends in the bowl. Each end is equally likely and just one of those ends is the other red end! If the red strand does not form a one strand loop with itself it must be incorporated into one of the loops formed by n strands. 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 the series
1 + 3 1 + 5 1 + 7 1 + 9 1 + 1 1 1 + 1 3 1 + … ( 1 )
where summing the first n terms of the series gives the expected number of loops if we have n strands of noodles.
Summing 56 terms gives 2.994 and adding the 5 7 t h gives 3.0033.
And so the minimum number required is 5 7
Note added later.
I admit that I wrote a short program to evaluate (1), but subsequently I found another way to the answer.
As he often does, Euler (pronounced 'oiler') provided the lubricant.
We will use his result that, to a good approximation,
∑ 1 n k 1 = ln n + γ where γ = 0 . 5 7 7 2 is the Euler-Mascheroni constant..
It is not too hard to see that the first n terms of (1) can be written as
∑ 1 2 n − 1 k 1 − 2 1 ∑ 1 n − 1 k 1
Now use Euler's result to approximate this as
ln ( 2 n − 1 ) + γ − 2 1 ( ln ( n − 1 ) + γ )
This simplifies to
ln ( n − 1 2 n − 1 ) + 2 γ … ( 2 )
Provided n is not too small, this formula approximates the expected number of loops with n strands of noodle.
We can also use this formula to find the number of terms (n) which are needed to make (1) exceed 3. First make a crude estimate by approximating the argument of the log function in (2)
3 ≈ ln ( 2 n ) + 2 γ
It is easy to make n the subject of this formula yielding n ≈ 5 6 . 6
Then trying 56 and 57 in (2) yields partial sums 2.994 and 3.0033 agreeing spectacularly well with the results found by actually summing the series.
Bravo Euler!
I found it surprising that the expected number of loops increases so slowly. It does make sense; if n is large, then p is very small, and the probability of forming a new loop would be very less compared to the probability of two strands merging into one.
This seems the neatest approach. I'd be interested to see a closed form solution to the last part as I ended up with 70 using cruder numerical methods.
Log in to reply
I do not think there is any closed form for this. I looked this up on W|A
after reading some of the comments I managed to find a closed form which approximates the sum of the first n terms provided n is not too small. I've extended my solution to include this.
I think there is an error in defining "p", it should be 1/(2n-1), not 1/(2n+1).
Log in to reply
p refers to the situation with n+1 strands and so 2n+2 ends.
This problem is another candidate for being handled by indicator random variables.
Every time a pair of ends is joined, the number of strands of noodles in the bowl goes down by one (either one strand is turned into a loop, or else two strands are joined into one). If we let Z j be the number of loops formed when the j th pair of ends is joined, then Z = Z 1 + Z 2 + Z 3 + ⋯ + Z N is the total number of loops formed, and hence E [ Z ] = j = 1 ∑ N E [ Z j ] = j = 1 ∑ N P [ Z j = 1 ] Just before the j pair of ends is joined, there are N + 1 − j strands in the bowl. If we pick one end, then the probability that we form a loop is just the probability that we pick the other end of that loop, ouf of the 2 ( N + 1 − j ) − 1 other ends that could be chosen. Thus P [ Z j = 1 ] = 2 N + 1 − 2 j 1 and hence E [ Z ] = J = 1 ∑ N 2 N + 1 − 2 j 1 = j = 1 ∑ N 2 j − 1 1 which first exceeds 3 when N = 5 7 .
Problem Loading...
Note Loading...
Set Loading...
Assume that we have reached into the bowl and pulled out one end. Then there are 2 N − 1 free ends left in the bowl. Therefore, there is a 1 / ( 2 N − 1 ) chance that a loop is formed by choosing the other end of the noodle that we are holding. And there is a ( 2 N − 2 ) / ( 2 N − 1 ) chance that a loop is not formed. In the former case, we end up with one loop and N − 1 strands. In the latter case, we just end up with N − 1 strands, because we have simply created a strand of twice the original length, and the length of a strand is irrelevant.
Therefore, after the first step, we see that no matter what happens, we end up with N − 1 strands and, on average, 1 / ( 2 N − 1 ) loops. We can now repeat this reasoning with N − 1 strands. After the second step, we are guaranteed to be left with N − 2 strands and, on average, another 1 / ( 2 N − 3 ) loops. This process continues until we are left with one strand, whereupon the final Nth step leaves us with zero strands, and we (definitely) gain one more loop.
So the average number of loops is 1 / ( 2 N − 1 ) + 1 / ( 2 N − 3 ) + ... + 1 / 3 + 1 . This first exceeds 3 when N = 5 7 .