Solution (source code)

= Solution

A <statistic> $T$ is a <sufficient statistic> for $\theta$ if the conditional <distribution> of the data given $T$ does not depend on $\theta$. For a dominated family with density or mass function $f_\theta(x)$, the <Fisher-Neyman factorization theorem> states that this is equivalent to
$$
\boxed{f_\theta(x)=g_\theta(T(x))h(x),}
$$
where $h$ is nonnegative and independent of $\theta$, and $g_\theta$ is nonnegative and depends on the data only through $T$.

For a discrete sample space, suppose first that the factorization holds. If $\mathbb P_\theta(T=t)>0$, summing over the fibre gives $\mathbb P_\theta(T=t)=g_\theta(t)\sum_{T(x)=t}h(x)$, so
$$
\mathbb P_\theta(X=x\mid T=t)=\frac{h(x)}{\sum_{T(z)=t}h(z)}\quad(T(x)=t).
$$
This conditional <distribution> is independent of $\theta$, proving that $T$ is a <sufficient statistic>. Conversely, let $q_t(x)$ be the common conditional mass function guaranteed by the <sufficient statistic> property, for every fibre attainable under at least one parameter. Set $h(x)=q_{T(x)}(x)$ and $g_\theta(t)=\mathbb P_\theta(T=t)$. Then $\mathbb P_\theta(X=x)=g_\theta(T(x))h(x)$. Fibres never attained under any parameter can be assigned any conditional distribution, since their multiplying probability is always zero. This proves both directions of the discrete criterion, including possible parameter-dependent supports.