Solution (source code)

= Solution

Let $\{v_i\}$ be an orthonormal <eigenbasis> of $C$, with $\lambda_1\geq\lambda_2\geq\cdots\geq0$. Expand $w=\sum_i b_iv_i$. At the normalized length imposed on positive-output equilibria,
$$
\sum_i b_i^2=\frac1\alpha,\qquad
\langle y^2\rangle=w^TCw=\sum_i\lambda_i b_i^2\leq\frac{\lambda_1}{\alpha}.
$$
Equality holds exactly when $w$ lies in the largest-eigenvalue eigenspace. If $\lambda_1$ is simple,
$$
\boxed{w=\pm\frac{v_1}{\sqrt\alpha},\qquad
\max\langle y^2\rangle=\frac{\lambda_1}{\alpha}.}
$$
The norm constraint is essential: without it, scaling a direction with positive eigenvalue makes the output second moment arbitrarily large, so the printed maximization statement would have no finite maximum. When $\alpha=1$, this is the usual unit-length formulation.

For centered inputs, maximizing this quantity maximizes output variance. The unit therefore selects the first <principal component analysis> direction: a stimulus feature with the greatest variation in the input ensemble. Biologically, learned synaptic weights become selective to that dominant correlated pattern, rather than to a teacher-supplied label. For uncentered inputs it maximizes a second moment including the mean response, which is not the same as maximizing variance. If the top eigenvalue is repeated, any normalized vector in its eigenspace attains the same maximum.