Solution (source code)

= Solution

Write the chocolate count as $K_n=\sum_{j=1}^nI_j$ with <independent> <Bernoulli random variables>. Each has <expected value> $p$ and <variance> $p(1-p)$. By linearity of <expected value> and additivity of <variance> for independent variables,
$$
\boxed{\overline k_n=np,\qquad V_n=np(1-p).}
$$