Paper Sheets of Standard Sizes
A printing shop runs 16 batches per job. For each batch, they take one sheet of paper at random from an envelope. At the beginning, the envelope contains a single A1 sheet. Whenever an A n sheet (w...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
A printing shop runs \(16\) batches (jobs) every week and each batch requires a sheet of special colour-proofing paper of size \(A5\).
Every Monday morning, the supervisor opens a new envelope, containing a large sheet of the special paper with size \(A1\).
The supervisor proceeds to cut it in half, thus getting two sheets of size \(A2\). Then one of the sheets is cut in half to get two sheets of size \(A3\) and so on until an \(A5\)-size sheet is obtained, which is needed for the first batch of the week.
All the unused sheets are placed back in the envelope.

At the beginning of each subsequent batch, the supervisor takes from the envelope one sheet of paper at random. If it is of size \(A5\), then it is used. If it is larger, then the ’cut-in-half’ procedure is repeated until an \(A5\)-size sheet is obtained, and any remaining sheets are always placed back in the envelope.
Excluding the first and last batch of the week, find the expected number of times (during each week) that the supervisor finds a single sheet of paper in the envelope.
Give your answer rounded to six decimal places using the format \(x.xxxxxx\).
Problem 151: Paper Sheets of Standard Sizes
Mathematical Development
Definition 1. A state is a tuple , where denotes the number of A sheets in the envelope for . The A1 sheet is omitted because it is consumed in the first (excluded) batch.
Lemma 1 (State Transition Rules). When an A sheet () is selected from the envelope, the state transition is:
- : ; all other components unchanged.
- : .
- : .
- : .
Proof. An A sheet with is cut by successive halving into sheets A, A, …, A, A. The final halving of an A produces two A sheets, so the cut of A yields one sheet of each size from A through A, plus two A sheets. One A is consumed for the batch. The net effect is: remove one A, add one each of A, …, A. For , the sheet is consumed outright.
Lemma 2 (Initial State). The state after the first batch (which deterministically consumes the lone A1 sheet) is .
Proof. Cutting A1 yields one each of A2, A3, A4, and two copies of A5. One A5 is consumed, leaving counts .
Lemma 3 (Finiteness of the State Space). The reachable state space satisfies , , , , subject to the invariant . In particular, the number of reachable states is at most .
Proof. Define the A5-equivalent count , reflecting that each A sheet can be decomposed into sheets of A5. The initial state has . Each batch consumes exactly one A5-equivalent unit (one A5 is used), so decreases by 1 per batch. No transition creates additional A5-equivalent mass: when an A sheet () is cut and one A5 consumed, the net change is . Since no A2 is ever created (only removed), . Similarly, , , and .
Theorem 1 (Expectation Recursion). Define as the expected number of single-sheet encounters from state onward, excluding the terminal batch. Let be the total sheet count. Then and for :
where denotes the state obtained by selecting an A sheet from state (as defined in Lemma 1).
Proof. The process is a finite-state Markov chain on with absorbing state . At each non-terminal state , the worker observes a single sheet if and only if . The problem excludes the first batch (state , where ) and the last batch. The last batch occurs at state , which is the unique pre-terminal state; it transitions to with certainty. We exclude this state from the single-sheet count by the indicator condition .
Each sheet of size is selected with probability (uniform random draw). After selection, the state transitions to and the process continues. By the tower property of conditional expectation:
The recursion terminates at since no further batches occur. Since strictly decreases, there are no cycles, ensuring the recursion is well-founded.
Corollary. The answer to the problem is .
Editorial
We single-sheet indicator (exclude terminal state). Finally, recurse over each possible selection. We use dynamic programming over the state space implied by the derivation, apply each admissible transition, and read the answer from the final table entry.
Pseudocode
Single-sheet indicator (exclude terminal state)
Recurse over each possible selection
Complexity Analysis
- Time: where is the number of reachable states. Each state is visited once (via memoization) and requires work (at most 4 recursive lookups and arithmetic operations). Total: .
- Space: for the memoization table.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
map<tuple<int,int,int,int>, double> memo;
double E(int a2, int a3, int a4, int a5) {
if (a2 == 0 && a3 == 0 && a4 == 0 && a5 == 0)
return 0.0;
auto key = make_tuple(a2, a3, a4, a5);
auto it = memo.find(key);
if (it != memo.end()) return it->second;
int T = a2 + a3 + a4 + a5;
double result = 0.0;
// Single-sheet indicator, excluding terminal state (0,0,0,1)
if (T == 1 && !(a2 == 0 && a3 == 0 && a4 == 0 && a5 == 1))
result = 1.0;
if (a2 > 0)
result += (double)a2 / T * E(a2 - 1, a3 + 1, a4 + 1, a5 + 1);
if (a3 > 0)
result += (double)a3 / T * E(a2, a3 - 1, a4 + 1, a5 + 1);
if (a4 > 0)
result += (double)a4 / T * E(a2, a3, a4 - 1, a5 + 1);
if (a5 > 0)
result += (double)a5 / T * E(a2, a3, a4, a5 - 1);
memo[key] = result;
return result;
}
int main() {
printf("%.6f\n", E(1, 1, 1, 1));
return 0;
}
from functools import lru_cache
@lru_cache(maxsize=None)
def E(a2, a3, a4, a5):
"""Expected single-sheet encounters from state (a2,a3,a4,a5) onward,
excluding the terminal pick at (0,0,0,1)."""
if a2 == 0 and a3 == 0 and a4 == 0 and a5 == 0:
return 0.0
T = a2 + a3 + a4 + a5
result = 0.0
if T == 1 and not (a2 == 0 and a3 == 0 and a4 == 0 and a5 == 1):
result = 1.0
if a2 > 0:
result += (a2 / T) * E(a2 - 1, a3 + 1, a4 + 1, a5 + 1)
if a3 > 0:
result += (a3 / T) * E(a2, a3 - 1, a4 + 1, a5 + 1)
if a4 > 0:
result += (a4 / T) * E(a2, a3, a4 - 1, a5 + 1)
if a5 > 0:
result += (a5 / T) * E(a2, a3, a4, a5 - 1)
return result
print(f"{E(1, 1, 1, 1):.6f}")