Solution (source code)

= Solution

The inequality in the printed rule is reversed. With the stated definition of $L$, a larger score favors group one. For example, in one dimension take $\mu_1=1$, $\mu_2=-1$, $\Sigma=1$, equal priors and $x=1$. The score is $2$, and $f_1(1)>f_2(1)$, whereas the printed rule assigns group two. The correct <Bayes classifier> follows from minimizing the error cost as follows.

Let $R$ be the region assigned to group one, let $f_i$ be its <multivariate normal density>, and let each misclassification cost $c>0$, with zero cost for correct classification. The expected cost is
$$
c\left[\pi_1\int_{R^c}f_1(x)\,dx+\pi_2\int_Rf_2(x)\,dx\right]
=c\pi_1+c\int_R\bigl[\pi_2f_2(x)-\pi_1f_1(x)\bigr]\,dx.
$$
The permitted integral-minimization result therefore selects $R=\{x:\pi_1f_1(x)>\pi_2f_2(x)\}$. Points of equality may be assigned to either group without changing the risk. Equivalently, the <Bayes classifier> chooses the larger posterior probability.

For positive priors and a common positive-definite <covariance matrix>, the normalization constants cancel in the <likelihood ratio>. Expanding the two quadratic forms gives
$$
\begin{aligned}
\log\frac{f_1(x)}{f_2(x)}
&=-\frac12\left[(x-\mu_1)^T\Sigma^{-1}(x-\mu_1)-(x-\mu_2)^T\Sigma^{-1}(x-\mu_2)\right]\\
&=(\mu_1-\mu_2)^T\Sigma^{-1}x-\frac12(\mu_1-\mu_2)^T\Sigma^{-1}(\mu_1+\mu_2)\\
&=L^Tx-\frac12L^T(\mu_1+\mu_2).
\end{aligned}
$$
Thus the correct <Gaussian Bayes classifier>, choosing group one on ties, is
$$
\boxed{\text{choose group 1 if }L^Tx-\tfrac12L^T(\mu_1+\mu_2)\geq\log(\pi_2/\pi_1);\quad\text{otherwise choose group 2}.}
$$
This proves the intended classification result with the necessary correction. Equal error costs remove $c$ from the decision, while <prior odds> determine the threshold.