PROJECT EULER · #0253
Tidying Up A
A small child has a “number caterpillar” consisting of forty jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers
Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks up the pieces at random and places them in the correct order.
As the caterpillar is built up in this way, it forms distinct segments that gradually merge together.
The number of segments starts at zero (no pieces placed), generally increases up to about eleven or twelve, then tends to drop again before finishing at a single segment (all pieces placed).
For example:
| Piece Placed | Segments So Far |
|---|---|
| 12 | 1 |
| 4 | 2 |
| 29 | 3 |
| 6 | 4 |
| 34 | 5 |
| 5 | 4 |
| 35 | 4 |
| … | … |
Let
For a caterpillar of ten pieces, the number of possibilities for each
| M | Possibilities |
|---|---|
| 1 | 512 |
| 2 | 250912 |
| 3 | 1815264 |
| 4 | 1418112 |
| 5 | 144000 |
so the most likely value of
The most likely value of
Give your answer rounded to six decimal places.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.