= Solution
Partition the items into successive groups of size two, with a singleton final group if $n$ is <odd>. For a pair $(x,y)$ on the east bank, execute
$$
\mathrm{LoadFirst}(x,\mathrm{EAST}),\
\mathrm{LoadLast}(y,\mathrm{EAST}),\
\mathrm{Move}(\mathrm{EAST},\mathrm{WEST}),\
\mathrm{UnloadFirst}(y,\mathrm{WEST}),\
\mathrm{UnloadLast}(x,\mathrm{WEST}).
$$
For a singleton $x$, execute
$$
\mathrm{LoadFirst}(x,\mathrm{EAST}),\
\mathrm{Move}(\mathrm{EAST},\mathrm{WEST}),\
\mathrm{UnloadLast}(x,\mathrm{WEST}).
$$
Return the empty boat east between groups. Each group starts and ends with marker $q_0$, and its items finish west, proving all <preconditions> and the final goal by <mathematical induction> over the groups. For $n\ge1$ there are $\lceil n/2\rceil$ outward journeys and \b[$2\lceil n/2\rceil-1$ crossings] in total; $\lceil\cdot\rceil$ is the <ceiling function>. Again $n=0$ needs no actions.
Back to article page