# error in the book “A first course in Machine Learning”?

I am reading the book "A first course in Machine learning". At page 74 when talking about the maximum likelihood solution, considering the data matrix X 2x2, he uses this expression

$$z^TX^TXz = z_1^2\sum_{i=1}^N x_{i1}^2+2z_1z_2\sum_{i=1}^N x_{i1}x_{i2}+z_2^2\sum_{i=1}^N x_{i2}^2$$

and then it says

Because the first and last term must be positive, proving this expression is greater than zero is equivalent that their combined value is larger than the middle term:

$$z_1^2\sum_{i=1}^N x_{i1}^2++z_2^2\sum_{i=1}^N x_{i2}^2>2z_1z_2\sum_{i=1}^N x_{i1}x_{i2}$$

and from that it makes some reasoning.

Should not be $$z_1^2\sum_{i=1}^N x_{i1}^2++z_2^2\sum_{i=1}^N x_{i2}^2> - 2z_1z_2\sum_{i=1}^N x_{i1}x_{i2}$$ or am I missing something?

• you are correct – Alejandro Celis Sep 18 at 16:14
• @AlejandroCelis Did you read the paragraph of the book? – Francesco Boi Sep 19 at 8:22
• yes. These sign typos are not significant at the end as indeed $z^T X^T X z$ is positive definite for $z \neq 0$ since $X$ is a real symmetric matrix. This is a linear algebra result that can be found in textbooks, search for quadratic forms. – Alejandro Celis Sep 19 at 20:11