Problem №151

Original author: Project Euler
  • Transfer
The printing house performs 16 tasks every week, and for each task a sheet of special photo paper of size A5 is required.

Every Monday, the master takes out a new sheet of A1 format.

He cuts the sheet in half, getting two sheets of A2 format. Then it cuts only one of them again, receives two A3 sheets, and so on, until it receives the A5 format necessary for the first print.

All other sheets are stuffed into the nightstand.



Before starting each next task, he takes one random sheet from the nightstand. If the sheet turned out to be A5 format, then it is immediately used. Otherwise, the procedure of cutting in half is repeated until the first suitable sheet is obtained, and the residues are again removed into the nightstand.

If you exclude the first and last prints of the week, find the expected number of times (every week) when the master discovers exactly one sheet of paper in the nightstand.

Round the answer to 6 digits after the decimal point and report in x.xxxxxx format

Also popular now: