How to calculate Fisher criterion weights? I am studying pattern recognition and machine learning, and I ran into the following question.

Consider a two-class classification problem with equal prior class probability $$P(D_1)=P(D_2)= \frac{1}{2}$$
and the distribution of instances in each classes given by
$$ p(x|D_1)= {\cal N} \left( \begin{bmatrix} 0  \\0 \end{bmatrix},
\begin{bmatrix} 2 & 0 \\ 0 & 1  \end{bmatrix} \right),$$
$$ p(x|D_2)= {\cal N} \left( \begin{bmatrix} 4  \\ 4 \end{bmatrix},
\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \right).$$
How to calculate Fisher criterion weights?

Update 2: The calculated weight provided by my book is:
$W=\begin{bmatrix} \frac{-4}{3}   \\ \frac{-2}{9}  \end{bmatrix}$.
Update 3: As hinted by @xeon, I understand that I should determine the projection line for the Fisher’s discriminant.
Update 4: Let $W$ be the direction of the projection line, then the Fisher linear discriminant method finds that the best $W$ is the one for which the criterion function is maximized. The remaining challenge is how can we get numerically  $W$ vector? 
 A: $\mathbf{SOLUTION 1:}$
Following Duda et al. (Pattern CLassification) which has an alternate solution to @lucas and in this case gives very easy to compute solution by hand. (Hope this alternate solution helps!! :))
In two class LDA the objective is:
$\frac{w^TS_Bw}{w^TS_Ww}$ which just means that increase the between class variance and decrease the within class variance. 
where $S_B = (m_1-m_2)(m_1-m_2)^T$ and $S_W = S_1 + S_2$, here  $S_1,S_2$ are covariance matrix and $m_1,m_2$ are means of class 1 and 2 respectively. 
The solution of this generalized raleigh quotient is a generalized eigen value probem.
$S_Bw = \lambda S_Ww \rightarrow {S_W}^{-1}S_Bw = \lambda w $ 
The above formulation has a closed form solution. $S_B$ is a rank 1 matrix with basis $m_1-m_2$ so $w \propto {S_W}^{-1}(m1-m2)$ which can be normlizd to get the answer. 
I just calculated the $w$ and got [0.5547;0.8321]. 
${S_W}^{-1}(m1-m2) = {(S_1 + S_2)}^{-1}(m1 - m2) = {(\begin{bmatrix}
  2 & 0 \\
  0 & 1
 \end{bmatrix}
 + \begin{bmatrix}
  1 & 0 \\
  0 & 1
 \end{bmatrix})}^{-1}(\begin{bmatrix}
  0 \\
  0 
 \end{bmatrix}
  - \begin{bmatrix}
  4 \\
  4 
 \end{bmatrix}
 )
 ={(\begin{bmatrix}
  1/3 & 0 \\
  0 & 1/2
 \end{bmatrix})}(\begin{bmatrix}
  0 \\
  0 
 \end{bmatrix}
  - \begin{bmatrix}
  4 \\
  4 
 \end{bmatrix}
 )
 = \begin{bmatrix}
  -1.3333 \\
  -2.0000 
 \end{bmatrix} \propto 
 \begin{bmatrix}
  0.5547 \\
  0.8321 
 \end{bmatrix} $ 
Ref: Pattern Classification by Duda, Hart, Stork
$\mathbf{SOLUTION 2:}$
Alternatively, it can be solved by finding eigen vector to the generalized eigen value problem. 
$S_Bw = \lambda S_Ww$ 
A polynomial in lambda can be formed by $determinant(S_B - \lambda S_W)$ and the solutions to that polynomial will be the eigen value for $S_Bw = \lambda S_Ww$.
Now lets say you got a set of eigen values $\lambda_1,\lambda_2, ..., \lambda_n,$ as roots of the polynomial. 
Now substitute $\lambda = \lambda_i, i \in \{1,2,..,n\}$ and get the corresponding eigen vector as solution to the linear system of equations $S_Bw_i = \lambda_i S_Ww_i$. By doing this for each i you can get a set of vectors $\{w_i\}_{i=1}^{n}$ and it is a set of eigen vectors as solutions. 
$determinant(S_B - \lambda S_W) = \begin{bmatrix}
  16 - 3\lambda & 16 \\
  16 & 16 - 2\lambda
 \end{bmatrix} =6\lambda^2 - 80\lambda$, So eigen values are roots to polynomial $6\lambda^2 - 80\lambda$.
So $\lambda= $ 0 and 40/3 are the two solutions.
For LDA, eigen vector corresponding to highest eigen value is the solution. 
Solution to system of equation $(S_B - \lambda_i S_W)w_i = 0$ and $\lambda_i = 40/3$
which turns out to be $\begin{bmatrix}
  16 - 3\lambda & 16 \\
  16 & 16 - 2\lambda
 \end{bmatrix}w_i \propto \begin{bmatrix}
  -72 & 48 \\
  48 & -32 \end{bmatrix}w_i = 0$
Solution to the above system of equation is $\begin{bmatrix}
  -0.5547 \\
  -0.8321 \end{bmatrix} \propto \begin{bmatrix}
  0.5547 \\
  0.8321 \end{bmatrix}$ which is same as previous solution. 
Alternatively, we can say that $\begin{bmatrix}
  0.5547 \\
  0.8321 \end{bmatrix}$ lies in the null space of $\begin{bmatrix}
  -72 & 48 \\
  48 & -32 \end{bmatrix}$.
For two class LDA, eigen vector with highest eigen value is the solution. In general, for C class LDA, the first C - 1 eigen vectors to highest C - 1 eigen values constitute the solution. 
This video explains how to compute eigen vectors for simple eigen value problem. ( https://www.khanacademy.org/math/linear-algebra/alternate_bases/eigen_everything/v/linear-algebra-finding-eigenvectors-and-eigenspaces-example )
Following is an example.
http://www.sosmath.com/matrix/eigen2/eigen2.html
Multi-class LDA:
http://en.wikipedia.org/wiki/Linear_discriminant_analysis#Multiclass_LDA
Calculating Null Space of a matrix:
https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/null_column_space/v/null-space-2-calculating-the-null-space-of-a-matrix
A: Following the paper you linked to (Mika et al., 1999), we have to find the $\mathbf{w}$ which maximizes the so called generalized Rayleigh quotient,
$$\frac{\mathbf{w}^\top \mathbf{S}_B \mathbf{w}}{\mathbf{w}^\top \mathbf{S}_W \mathbf{w}},$$
where for means $\mathbf{m}_1, \mathbf{m}_2$ and covariances $\mathbf{C}_1, \mathbf{C}_2$,
\begin{align}
\mathbf{S}_B &= (\mathbf{m}_1 - \mathbf{m}_2)(\mathbf{m}_1 - \mathbf{m}_2)^\top, &
\mathbf{S}_W &= \mathbf{C}_1 + \mathbf{C}_2.
\end{align}
The solution can be found by solving the generalized eigenvalue problem
\begin{align}
\mathbf{S}_B\mathbf{w} = \lambda \mathbf{S}_W\mathbf{w},
\end{align}
by first computing the eigenvalues $\lambda$ by solving
\begin{align}
\det(\mathbf{S}_B - \lambda \mathbf{S}_W) = 0
\end{align}
and then solving for the eigenvector $\mathbf{w}$. In your case,
$$\mathbf{S}_B - \lambda \mathbf{S}_W = 
\begin{pmatrix}16 - 3\lambda & 16 \\ 16 & 16 - 2\lambda\end{pmatrix}.$$
The determinant of this 2x2 matrix can be computed by hand.
The eigenvector with the largest eigenvalue maximizes the Rayleigh quotient. Instead of doing the calculations by hand, I solved the generalized eigenvalue problem in Python using scipy.linalg.eig and got
$$w_1 \approx 0.5547, w_2 \approx 0.8321,$$
which is different from the solution you found in your book. Below I plotted the optimal hyperplane of the weight vector I found (black) and the hyerplane of the weight vector found in your book (red).
$\hskip1in$
