Solution (source code)

= Solution

A <quadratic form> on a finite-dimensional real <vector space> is a function $q(v)=B(v,v)$ for a symmetric <bilinear form> $B$. Conversely $B(u,v)=\tfrac12(q(u+v)-q(u)-q(v))$ recovers that <bilinear form>. Two <quadratic forms> are congruent if a <linear isomorphism> $T$ satisfies $q_2(v)=q_1(Tv)$; in coordinates this is <matrix congruence>, $A_2=P^TA_1P$, with $P$ invertible.

<Sylvester's law of inertia> says that a real <quadratic form> admits coordinates in which
$$
q=\sum_{j=1}^{p}u_j^2-\sum_{j=p+1}^{p+q}u_j^2,
$$
and the numbers of positive, negative and zero squares, $(p,q,r)$, are independent of the coordinates. Here $p+q+r=\dim V$; $p$ and $q$ are the maximal dimensions of subspaces on which the <quadratic form> is positive definite and negative definite, while $r$ is the dimension of its <radical of a bilinear form>. These numbers are the <inertia of a bilinear form>. The <rank of a quadratic form> is $p+q$, and the <signature of a quadratic form>, in the signed-difference convention, is $p-q$.

Completing squares gives
$$
q(x,y,z)=-2\left(x-\frac y2-3z\right)^2-\frac12y^2+19z^2.
$$
The change of coordinates is invertible, so \b[the inertia is $(1,2,0)$ and the signature is $-1$]. If signature is recorded as an ordered pair instead, that pair is $(1,2)$.