How to quickly check if vectors are an orthonormal basis of a vector space?

Let's say we got $3$ vectors given and we need to check if they are an orthonormal basis of some vector space. How would that be done quickly? I have read on several sites on the Internet and here is my summary, correct me if I'm wrong please:

1. All vectors need to be linearly independent.
2. Vectors are perpendicular aka orthogonal to each other (if $3$ vectors given, I have to do it as pairs of $2$, right?).
3. Each vector has length $1$.

That is correct.

1. All vectors need to be linearly independent

This is by definition the case for any basis: the vectors have to be linearly independent and span the vector space. An orthonormal basis is more specific indeed, the vectors are then:

• all orthogonal to each other: "ortho";
• all of unit length: "normal".

Note that any basis can be turned into an orthonormal basis by applying the Gram-Schmidt process.

A few remarks (after comments):

• the vector space needs to be equipped with an inner product to talk about orthogonality of vectors (you're then working in a so called inner product space);
• if all vectors are mutually orthogonal, then they are definitely linearly independent (so you wouldn't have to check this separately, if you check orthogonality).
• Thank you! I'm just not sure about 2. Let's say we have $3$ vectors $v_1,v_2,v_3$. I first check orthogonality for $v_1,v_2$, then $v_1,v_3$, then $v_2,v_3$...? :S – tenepolis Mar 20 '17 at 9:15
• Yes, you could do that. Note that stopping after the two first checks would be insufficient since $(1,0,0) \perp (0,1,0)$ and $(1,0,0) \perp (0,1,1)$ but $(0,1,0) \not\perp (0,1,1)$. – StackTD Mar 20 '17 at 9:17
• So for this general example, it would be enough to check if $v_1,v_2$ are orthogonal, and $v_1,v_3$ are orthogonal? – tenepolis Mar 20 '17 at 9:19
• The example shows it would not be enough, since $v_1 \perp v_2$ and $v_1 \perp v_3$ doesn't mean that $v_2 \perp v_3$. – StackTD Mar 20 '17 at 9:20
• Note that pairwise orthogonality implies linear independence, as long as none of your $v_i$ is the all-$0$ vector (and therefore in particular if they all have unit length). So you don't actually need to check (1). – Klaus Draeger Mar 20 '17 at 12:58

If you are using a computing environment where matrix operations are fast, you can check that

$$A^T \cdot A = I$$

where $A$ is a matrix of your basis of column-vectors vectors: $(i_1|i_2|i_3)$.

Note that according to matrix multiplication semantics, each element in the result matrix corresponds to the dot-product of a pair of basis vectors. Hence it exactly matches the definition of orthonormality: the dot-product $<i_j,i_k>$ is 1 on the diagonal (when $j = k$) and 0 elsewhere (when $j \ne k$).

• It may be worth pointing out that you don't need to be careful with whether the rows or columns of $A$ are your basis vectors. Even if you accidentally make the rows of $A$ the basis vectors, the test still works. – Brian Moths Mar 20 '17 at 16:32
• Note that to use this we must have a basis already chosen (to write down matrices) and that our inner product must match the standard dot product in terms of this basis (so that matrix multiplication corresponds to taking inner product of rows of the left matrix with columns of the right matrix). Also, to apply the first comment, the number of vectors should be the same as the dimension of the whole space. – Morgan Sherman Mar 21 '17 at 0:07
• Nice-- and this highlights that it is not necessary to examine each pair separately, which would take time n^3, whereas matrix multiplication can be done faster: en.wikipedia.org/wiki/… – Don Hatch Mar 21 '17 at 6:15
• @DonHatch faster-than-n^3 matrix multiplication algorithms are impractical, however there is a randomized \Theta(n^2) algorithm that verifies matrix multiplication. – n.m. Mar 21 '17 at 7:47
• Let me guess -- you are a computer scientist? They are the only ones that routinely use the word "semantics". :) – Federico Poloni Mar 21 '17 at 7:53

What you write down is correct, and that is exactly the definition of orthonormal bases.

If in the Euclidean spaces, you know we can check the linear dependence by its determinant, which is the only thing making the matter easier.

• Thank you! I'm just not sure about 2. Let's say we have $3$ vectors $v_1,v_2,v_3$. I first check orthogonality for $v_1,v_2$, then $v_1,v_3$, then $v_2,v_3$...? :S – tenepolis Mar 20 '17 at 9:15
• Yes, you have to check it pairwisely. For example, in $\mathbb{R}^3$ with standard inner product, $(1,0,0)\perp (0,1,0)$ with $(0,1,0)\perp (1,0,1).$ – tommy xu3 Mar 20 '17 at 9:20
• The reply is correct, but in the real world, it's probably faster to solve @Alex' answer - or at least do the row reduction to the point that you know you have a full rank matrix - than to compute a determinant. – Placidia Mar 20 '17 at 12:15
• Yes, since an orthogonal set implies a linearly independent set~ thank you! – tommy xu3 Mar 20 '17 at 12:17

Assume the vectors are in 3-dimensional Euclidean space and have these coordinates: $$(x_1,y_1,z_1), \ \ (x_2,y_2,z_2), \ \ (x_3,y_3,z_3).$$ To verify orthogonality, check the following: $$x_1\cdot x_2+y_1\cdot y_2+z_1\cdot z_2=0,$$ $$x_1\cdot x_3+y_1\cdot y_3+z_1\cdot z_3=0,$$ $$x_2\cdot x_3+y_2\cdot y_3+z_2\cdot z_3=0.$$

Orthonormal means that, in addition to orthogonality, each vector has length 1. We can check the following to ensure each vector has unit length: $$x_1^2+y_1^2+z_1^2=1,$$ $$x_2^2+y_2^2+z_2^2=1,$$ $$x_3^2+y_3^2+z_3^2=1.$$

We speak about Orthogonality in a vector space when it has an inner product( which is a generalization of dot product) defined over it. Read about Inner Product Spaces here -> https://en.wikipedia.org/wiki/Inner_product_space

Say we have an Innerproduct space $X$= (X, < , > ) where the dimension of X as a vector space is 3 , then we say given vectors $x$ ,$y$ and $z$ form an $orthonormal$ $basis$ if < x , y > = 0 , < x , z > = 0 and < y , z > = 0 also < x , x >=1 , < y , y > = 1 and < z , z > = 1. Actually orthonormal vectors are anyway linearly independent so you need not check for linear independence of vectors seperately.

• "Actually orthonormal vectors are anyway linearly independent so you need not check for linear independence of vectors seperately." I think you mean the opposite. You need to check for linear independence of vectors separately. – Pakk Mar 20 '17 at 12:24
• No @Pakk in my knowledge orthogonality implies linear independence, so to prove given vectors are orthogonal is sufficient. Check this post out math.stackexchange.com/questions/409810/… – ajay pawar Mar 20 '17 at 13:36
• Aha, I see what you mean: if you already know that a set of vectors is orthonormal, if follows that this set of vectors is independent. I agree. – Pakk Mar 20 '17 at 13:44
• +1 for pointing out that simply being a vector space doesn't provide enough information to determine orthogonality (or normality) of a basis. – Tristan Mar 20 '17 at 14:58