Problem 866

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
ergias
Posts: 2
Joined: Wed Dec 06, 2023 1:52 pm

Problem 866

Post by ergias »

To handle what the father does with the pieces, I tried to manually run the case N=4.
However, I could not retrieve the number 994 in the end, and I found a different result depending on the order I placed the pieces.
For instance, if I put 1 then 2 then 3 then 4, the segments' lengths are 1, 2, 3, and 4, so the corresponding result would be $H_1\times H_2\times H_3\times H_4=1\times6\times15\times28 = 2520$.
On the other hand, if I put 2, then 4, then 1, then 3, I create segments of length 1, 1, 2, and 4 so the resulting number would be $1\times1\times6\times28=168$.

How am I supposed to get the expected value 994 ?
Is there something I missed ?
DJohn
Posts: 90
Joined: Sat Oct 11, 2008 12:24 pm

Re: Problem 866

Post by DJohn »

You are probably missing the meaning of expected. In mathematics the expected number is the average over all possible ways of obtaining the number.

For N=4, there are 4! = 24 orders in which the pieces can be picked up. You've worked out the products for two of those orders. If you find the product for all of the orders, add them together, then divide by 24 (the number of orders), you will have the expected value of the product. And that is indeed 994.
ergias
Posts: 2
Joined: Wed Dec 06, 2023 1:52 pm

Re: Problem 866

Post by ergias »

oh ! I indeed misunderstood the word "expected". It is clearer for me now, thanks !
Post Reply