WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. Book a mock interview →
Linear Algebra 66 of 155 · Wall Street Quant

Can you explain the Gram-Schmidt process?

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

The Gram-Schmidt process is an orthogonalization procedure that allows you to transform a set of linearly independent vectors into an orthonormal basis. In other words, given a set of linearly independent vectors, the Gram-Schmidt process generates a set of mutually orthogonal unit vectors that span the same subspace.

Here’s the general algorithm for the Gram-Schmidt process:

1. Start with a set of linearly independent vectors $\{\bold{v}_1, \bold{v}_2, \dots, \bold{v}_n\}$.

2. For each vector $\bold{v}_k$ in the set, subtract its projection onto the subspace spanned by the currently processed orthogonal vectors.

3. Normalize the resulting vector.

Mathematically, this procedure can be described as follows:

For a given set of linearly independent vectors $\{\bold{v}_1, \bold{v}_2, \dots, \bold{v}_n\}$, compute the orthonormal basis $\{\bold{u}_1, \bold{u}_2, \dots, \bold{u}_n\}$ as:

1. $\bold{u}_1 = \frac{\bold{v}_1}{\|\bold{v}_1\|}$

For k = 2, …, n:

2. $\bold{w}_k = \bold{v}_k - \sum_{j=1}^{k-1} (\bold{v}_k \cdot \bold{u}_j) \bold{u}_j$

3. $\bold{u}_k = \frac{\bold{w}_k}{\|\bold{w}_k\|}$

Here, the dot () denotes the inner product of two vectors, and ∥ ⋅ ∥ represents the Euclidean norm.

**Example:**

Let’s apply the Gram-Schmidt process to the following non-orthogonal basis in 2:


$$\bold{v}_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad \bold{v}_2 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$$

Step 1: Normalize $\bold{v}_1$
$$\bold{u}_1 = \frac{\bold{v}_1}{\|\bold{v}_1\|} = \frac{1}{1} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix}$$

Step 2: Subtract projections of $\bold{v}_2$ onto $\bold{u}_1$ and normalize the result
$$\bold{w}_2 = \bold{v}_2 - (\bold{v}_2 \cdot \bold{u}_1) \bold{u}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix} - (\bold{v}_2 \cdot \bold{u}_1) \bold{u}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix} - (1) \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$


$$\bold{u}_2 = \frac{\bold{w}_2}{\|\bold{w}_2\|} = \frac{1}{\sqrt{0^2 + 1^2}} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$

So, the orthonormal basis after applying the Gram-Schmidt process is:


$$\bold{u}_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad \bold{u}_2 = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$

As you can see, the Gram-Schmidt process has successfully converted the initial set of vectors into an orthonormal basis.

Line open 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 →
📕 Buy this interview preparation book: 155 Wall Street Quant questions & answers — PDF + EPUB for $5

All 155 Wall Street Quant questions · All topics