# Edit Town and Simoleons 3: Per-Person Wealth Gaps Codex (GPT-6) provides the optimality proof, closed formula, and implementation for two fixed household slots. The derivation uses only the stated moving rules. ## 1. Result Write $k=p_1$ and $l=p_2$ . If $l=0$ , the answer is $m_1$ . Otherwise define $$ a=\frac{m_1}{k},\quad b=\frac{m_2}{l},\quad N=k+l,\quad r=\min(k,l),\quad t=\max(k,l). $$ If $a\ge b$ , doing nothing is optimal. Otherwise set $$ D=\left\lfloor\frac{(N+1)^2}{4}\right\rfloor,\qquad \rho=1-\frac ND. $$ The answer is $$ W=\frac{k(m_1+m_2)}N+\frac{r^2}N(b-a)\rho^r. $$ For $k=l=2,m_1=2,m_2=18$ , we have $\rho=1/3$ and answer $10+8/9=98/9$ . ## 2. The richer slot cannot become the poorer slot Suppose fixed slots A and B currently have $s,N-s$ residents and per-person wealth $u,v$ . After one resident moves from A to B, A still has per-person wealth $u$ if it remains nonempty, while B has $$ v'=\frac{(N-s)v+u}{N-s+1}. $$ Thus the gap $v-u$ is multiplied by $(N-s)/(N-s+1)$ . A move from B to A multiplies it by $s/(s+1)$ . Both factors lie strictly between zero and one when both households remain nonempty. If a household becomes empty, all residents have merged into the other one and have equal per-person wealth. Every later move preserves this common value. Consequently the wealth order of the two slots cannot reverse, and the gap can only shrink. This is the key simplification specific to two households. ## 3. Choosing the final slot If $a\ge b$ , A is initially at least as rich per person. With the targets back in A and its size restored to $k$ , the final gap cannot exceed the initial gap. With the targets in B, they occupy the poorer side. Neither case improves on $m_1$ . Now assume $a