1

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.

Bernard
  • 175,478
Temirzhan
  • 983
  • 1
  • 11
  • 25
  • 1
    If the vectors are linearly independent complete them with a third vector to a basis of $;\Bbb R^3;$ and then orthonormalize this basis with GS – DonAntonio Dec 17 '17 at 19:33
  • 1
    Just add a third vector, linearly independent on the two given, and use Gramm-Schmidt. –  Dec 17 '17 at 19:33
  • @gimusi the purpose of the post was to understand HOW gram schmidt could be used to find a 3rd orthogonal vector. Yes, taking the cross product is much more efficient. But, again that is not the purpose of my question. – Temirzhan Dec 17 '17 at 19:42
  • @Temirzhan Note that GS is used to produce an orthonormal/orthogonal basis starting from a generic basis, since you have onli 2 vectors the first step is to find a third vector and for that you can also use cross product. As an alternative you can consider a generic vector (a,b,c) and set to be zero the dot product with the 2 given vectors. – user Dec 17 '17 at 19:47
  • Gram-Schmidt assumes 3 linearly independent vectors. If you want to be precise, the process can't orthogonalize a basis, if it wasn't given one. – user251257 Dec 17 '17 at 19:47
  • @DonAntonio 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. – Temirzhan Dec 17 '17 at 20:03
  • If you have two vectors in $\mathbb{R}^2$ how are you going to find a third vector orthogonal to both unless both those be tied are the same vector? – Triatticus Dec 17 '17 at 20:07
  • @Triatticus : see my answer for an algorithm that does just that. – John Hughes Dec 17 '17 at 20:23
  • I take their comment to mean if I had two linearly independent vectors in $\mathbb{R}^2$ how to find a third orthogonal to the first two....but you can't because two independent vectors already forms a basis for the plane...there isn't a third vector orthogonal to the first two – Triatticus Dec 17 '17 at 20:29
  • @Temirzhan If we’re talking about $\mathbb R^n$, there is the canonical basis; take some vectors to complete your system from there. Then you can orthogonalize all the way. – arseniiv Dec 17 '17 at 20:31
  • @Triatticus: I see your point. I read OP's $R^2$ as $R^3$ (which I suspect is what was intended, but who knows?). – John Hughes Dec 17 '17 at 20:39

2 Answers2

2

$$ \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.

John Hughes
  • 93,729
0

To find a third vector $v_3$ orthogonal to the 2 given vetors $v_1$ and $v_2$ you can set:

$$v_3=(a,b,c)$$

and solve:

$$\begin{cases}v_3 \cdot v_1=0\\ v_3 \cdot v_2=0\end{cases}$$

In this way you can find infinite solutions.

Choose one of them and apply GS.

user
  • 154,566