[Math] How to use Gram-Schmidt to find vectors that are orthogonal to one another

gram-schmidt

Say I have 2 vectors in $R^3$ how can I use Gram Schmidt to find a vector that is orthogonal to both of them? I am not looking to use the cross product.

I could've sworn by my professor that they said it was possible, but the more I read into the Gram Schmidt process. The more it seems like it ONLY orthonormalizes a set of vectors and isn't possible to give you a new vector which is orthogonal to both.

Best Answer

$$ \newcommand {\proj} {{\mathrm {proj}}} $$ I'm going to answer the question implicit in @Temirzhan's last comment,

I have another Question what if I had two vectors in $R^2$ and wanted to find a 3rd vector that was orthogonal to both? I can't use the cross product so how would I go about finding that 3rd vector.

with a slightly generalized form of GS that I often find useful.

Define $\proj(v, B)$, where $B = \{u_1, u_2, ..., u_k\}$ is a set of pairwise orthogonal unit vectors, by the following:

$$ \proj(v, B) = v - \sum_i v \cdot u_i \\ $$

Then $\proj(v, B)$ is the orthogonal projection of $v$ onto the plane perpendicular to the span of the set $B$.

I'll now describe a modified GS process that applies to a set of nonzero vectors $\{v_1, \ldots, v_k \in \Bbb R^n\}$ to produce an orthonormal basis $\{w_1, \ldots, w_{k}, w_{k+1}, \ldots, w_n\}$ with the property that $span (v_1, \ldots, v_i) \subset span(w_1, \ldots, w_i)$ for $i = 1, 2, \ldots, k$. If the vectors $v_i$ are independent, then the "subset" becomes an equality.

  1. Extend the set $v_1, \ldots, v_k$ by adding the standard unit vectors $e_1, \ldots, e_n$ to get a set of $n+k$ vectors that span $\Bbb R^n$.

  2. Set $i = 1$.

  3. Compute $u_1 = \proj(v_1, \{\})$. If $u_1 = 0$, move on; otherwise, let $w_1 = \frac{1}{\| u_1 \|} u_1$, and let $i$ be $i + 1$.

  4. Let $u_2 = \proj(v_2, \{ u_1, \ldots u_i\})$. If $u_2 = 0$, move on. Otherwise, let $w_i = \frac{1}{\| u_2 \|} u_2$ and let $i$ be $i + 1$.

  5. Let $u_3 = \proj(v_3, \{ u_1, \ldots u_i\})$. If $u_3 = 0$, move on. Otherwise, let $w_i = \frac{1}{\| u_3 \|} u_3$ and let $i$ be $i + 1$.

  6. Continue in this manner until $i = n$, at which point you have the desired orthonormal basis.

The sketch of this algorithm is "do GS to the vectors, but if you ever get a zero-vector, toss it out and move on." Thus @Temirzhan can apply this algorithm to his vectors $a$ and $b$, extended by $e_1, e_2, e_3$; even if the span of $a$ and $b$ happens to be the whole $xy$-plane, the result will be a basis for 3-space.