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 65 of 155

How would you use linear algebra in solving simultaneous linear equations?

📕 Buy this interview preparation book: 155 Wall Street Quant questions & answers — PDF + EPUB for $5

Linear algebra is the branch of mathematics dealing with vector spaces and linear mappings between those spaces. It is a powerful tool for solving simultaneous linear equations because it allows us to represent the problem as a matrix, and use matrix operations to solve it efficiently.

Let’s consider a system of linear equations with n variables and n equations. The general form of such a system can be written as:


$$\begin{aligned} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2 \\ &\vdots \\ a_{n1}x_1 + a_{n2}x_2 + \cdots + a_{nn}x_n &= b_n\end{aligned}$$

We can use matrices to represent this system. Let A be the matrix of coefficients, X the matrix of variables, and B the matrix of constants:


$$A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix}, X = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}, B = \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_n \end{bmatrix}$$

With this representation, we can rewrite the system of linear equations as a matrix equation:


AX = B

We can then use methods like Gaussian elimination, LU-factorization, or QR-factorization to solve the matrix equation and find the variables. One common method is the Gaussian elimination which involves applying a series of row operations to bring the augmented matrix [A | B] into row-echelon form or reduced row-echelon form.

Let’s consider a simple example to illustrate the use of linear algebra in solving simultaneous linear equations. Suppose we have the following system of equations:


$$\begin{aligned} 2x_1 + 3x_2 &= 5 \\ 4x_1 + 9x_2 &= 15\end{aligned}$$

We write this system in matrix form as follows:


$$A = \begin{bmatrix} 2 & 3 \\ 4 & 9 \end{bmatrix}, X = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}, B = \begin{bmatrix} 5 \\ 15 \end{bmatrix}$$

We form the augmented matrix [A | B]:


$$\begin{bmatrix} 2 & 3 & | & 5 \\ 4 & 9 & | & 15 \end{bmatrix}$$

We apply Gaussian elimination by first dividing the first row by 2, and then using it to eliminate the 4 in the second row:


$$\begin{bmatrix} 1 & 1.5 & | & 2.5 \\ 0 & 3 & | & 10 \end{bmatrix}$$

Finally, we divide the second row by 3, and back-substitute to find the solution:


$$\begin{bmatrix} 1 & 0 & | & 1 \\ 0 & 1 & | & 10/3 \end{bmatrix}$$


$$X = \begin{bmatrix} 1 \\ 10/3 \end{bmatrix}$$

Thus, the solution to the system of linear equations is x1 = 1 and x2 = 10/3.

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