# Science:Math Exam Resources/Courses/MATH152/April 2013/Question A 04/Solution 1

We reduce the matrix to row echelon form. Subtracting the first row from the last row transforms

${\displaystyle M={\begin{bmatrix}1&7&3\\0&p&5\\1&pq+7&8\end{bmatrix}}}$

into

${\displaystyle {\begin{bmatrix}1&7&3\\0&p&5\\0&pq&5\end{bmatrix}}.}$

Next, subtracting ${\displaystyle q}$ times the second row from the third row yields

${\displaystyle {\begin{bmatrix}1&7&3\\0&p&5\\0&0&5-5q\end{bmatrix}}.}$

Clearly, this matrix has rank at least 2 (since, for instance, the first and third columns are linearly independent regardless of the value of ${\displaystyle q}$). On the other hand, it must have rank less than 3 whenever ${\displaystyle p=0}$ or ${\displaystyle 5-5q=0}$ (or both), which is to say that ${\displaystyle M}$ has rank 2 exactly when ${\displaystyle \color {blue}p=0}$ or ${\displaystyle \color {blue}q=1}$ (or both).