WalzoneInterview Prep
πŸ“ž Interviewing soon? Practice with a realistic AI mock phone interview β€” it calls you, then scores you. First 15 min FREE β†’

Wall Street Quant Β· Linear Algebra Β· question 60 of 155

How would you solve a system of linear equations using matrices?

πŸ“• Buy this interview preparation book: 155 Wall Street Quant questions & answers β€” PDF + EPUB for $5

Solving a system of linear equations using matrices, specifically with the technique of matrix inverse, involves the following steps:

1. Write the system of linear equations in matrix form.

2. Check if the coefficient matrix has an inverse.

3. Calculate the inverse of the coefficient matrix.

4. Multiply the inverse of the coefficient matrix with the constant matrix to get the solution.

Let’s consider an example:

Suppose we have a system of linear equations:


$$\begin{aligned} x - 2y &= 1\\ 3x + 2y &= 11 \end{aligned}$$

Step 1: Write the system of linear equations in matrix form.

We can write the above system of linear equations as
AX = B
, where


$$A = \begin{bmatrix} 1 & -2\\ 3 & 2 \end{bmatrix} , \quad X = \begin{bmatrix} x\\ y \end{bmatrix} , \quad B = \begin{bmatrix} 1 \\ 11 \end{bmatrix}$$

Step 2: Check if the coefficient matrix A has an inverse.

A square matrix has an inverse if and only if the determinant is nonzero, i.e.,
|det(A)| ≠ 0
.

The determinant of 2x2 matrix A is calculated as:


det(A) = (1)(2)β€…βˆ’β€…(β€…βˆ’β€…2)(3) = 2β€…+β€…6 = 8

Since |det(A)| = 8 ≠ 0, matrix A has an inverse.

Step 3: Calculate the inverse of the coefficient matrix A.

The inverse of a 2x2 matrix can be calculated using the formula:


$$A^{-1} = \frac{1}{\text{det}(A)} \begin{bmatrix} \phantom{-}d & -b\\ -c & \phantom{-}a \end{bmatrix}$$

The inverse of matrix A is:


$$A^{-1} = \frac{1}{8} \begin{bmatrix} \phantom{-}2 & \phantom{-}2\\ -3 & \phantom{-}1 \end{bmatrix}$$

Step 4: Multiply the inverse of the coefficient matrix A with the constant matrix B to get the solution.


X = Aβ€…βˆ’β€…1B


$$\begin{bmatrix} x\\ y \end{bmatrix} = \frac{1}{8} \begin{bmatrix} \phantom{-}2 & \phantom{-}2\\ -3 & \phantom{-}1 \end{bmatrix} \begin{bmatrix} 1\\ 11 \end{bmatrix} = \begin{bmatrix} \phantom{-}\frac{5}{2} \\ \phantom{-}\frac{7}{4} \end{bmatrix}$$

So, the solution to the system of linear equations is
$$x = \frac{5}{2}$$
, and
$$y = \frac{7}{4}$$
.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Wall Street Quant interview β€” then scores it.
πŸ“ž Practice Wall Street Quant β€” free 15 min
πŸ“• Buy this interview preparation book: 155 Wall Street Quant questions & answers β€” PDF + EPUB for $5

All 155 Wall Street Quant questions Β· All topics