We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
That's not what it's asking. If the new guy opens the envelope and sees 0100, then there is one piece of paper inside. Count=1. He'll cut it up, keep the smallest one, and produce 0011. The next time he goes to the envelope, it will have two pieces of paper, so Count is unchanged at 1. With a 50-50 chance, he'll grab the larget piece (A2), split it, keep half, and put the other half back into the envelope: 0002. The next time, there are two pieces, so we still have Count=1, he'll keep one resulting in: 0001; Finally, for the last batch, he opens the envelope to find one piece of paper, so we increment Count=2. Go through all possible paths, count # of times we have a single paper, compute expected value.
Project Euler #151: Paper sheets of standard sizes: an expected-value problem.
You are viewing a single comment's thread. Return to all comments →
That's not what it's asking. If the new guy opens the envelope and sees 0100, then there is one piece of paper inside. Count=1. He'll cut it up, keep the smallest one, and produce 0011. The next time he goes to the envelope, it will have two pieces of paper, so Count is unchanged at 1. With a 50-50 chance, he'll grab the larget piece (A2), split it, keep half, and put the other half back into the envelope: 0002. The next time, there are two pieces, so we still have Count=1, he'll keep one resulting in: 0001; Finally, for the last batch, he opens the envelope to find one piece of paper, so we increment Count=2. Go through all possible paths, count # of times we have a single paper, compute expected value.
Expected # times he sees a single piece of paper = 0.5*2 + 0.5*3 = 5/2.