Solution (source code)

= Solution

The term $\lambda_iS_i$ moves susceptible people in group $i$ into its infective class, while $\gamma I_i$ moves infectives into recovery. In
$$
\lambda_i=\beta\sum_jC_{ij}I_j/N_j,
$$
$C_{ij}$ is the contact rate of a person in group $i$ with group $j$, and $I_j/N_j$ is the infectious fraction there. The reciprocity condition $N_iC_{ij}=N_jC_{ji}$ says that the total number of $i$--$j$ contacts agrees when counted from either group. Common $\beta$ and $\gamma$ mean age-independent transmission per infectious contact and recovery rate. There is no transmission between distinct age groups exactly when
$$
\boxed{C_{ij}=0\quad(i\ne j).}
$$