# Gram Schmidt Calculator

Add the values to find an orthonormal basis for a set of vectors.

Size of the vectors:

X

Vectors

## Gram Schmidt Calculator:

Use this Gram schmidt calculator that allows you to orthonormalize the set of vectors using the Gram-Schmidt process. It lets you find the orthonormal basis step by step using the orthogonalization process corresponding to the given vector set.

## How To Use This Gram-Schmidt Calculator?

To use this calculator, follow these steps:

1. Set the vector Size
2. Add the components of the vectors
3. Click on the calculate button and get the orthonormal set of vectors with Gram Schmidt method

## What Is The Gram-Schmidt Process?

In linear algebra and numerical analysis, the Gram-Schmidt process is used for transforming a set of independent vectors into an orthonormal basis. This basis spans the same subspace as the original vector set. The process constructs an orthogonal set of vectors, meaning their dot product is zero. In addition to that, each vector in the new basis has a unit length (magnitude of 1). This orthonormal basis is helpful for certain applications of algebra and beyond. For a better understanding, let's say you have a set of vectors as$$\ \{\vec{v_1},\ \vec{v_2},\ \vec{v_3},\ ...\vec{v_n}\}$$ The Gram-Schmidt process changes them in orthogonal vectors as$$\ \{\vec{u_1},\ \vec{u_2},\ \vec{u_3},\ ...\vec{u_n}\}$$, and in orthonormal set as$$\ \{\vec{e_1},\ \vec{e_2},\ \vec{e_3},\ ...\vec{e_n}\}$$

Start by Setting:

$$\ \vec{u_1}= \vec{v_1}$$

For all subsequent vectors$$\ \vec{v_i}(i>1)$$ Now you need to subtract the projection of$$\ \vec{v_i}$$ onto all the previous vectors$$\ \vec{v_j}(j<1)$$ and set the result of all of that equal to$$\ \vec{u_i}$$

Use the following formula to find the projection of$$\ \vec{v_i}$$ onto$$\ \vec{u_j}:$$

$$\ proj_\vec{uj} \ (\vec{v_i}) = \frac{ \vec{v_i} \cdot \vec{u_j}}{{\vec{u_j}\cdot\vec{u_j}}} \vec{u_j}$$

The formula for$$\ \vec{u_i}:$$ $$\vec{u_i}= \vec{v_i}-\sum_{j=1}^{\ i-1}a_i\ proj_{uj}(\vec{v_i})$$

To find the orthonormal basis, normalize each vector$$\ \vec{v_i}$$ by dividing it with its magnitude$$\ | \vec{u_i}|:$$

It is widely used in various fields like computer science, physics, statistics, and machine learning also in QR decomposition, etc.

### Example:

Orthonormalize the set of the vectors$$\ V_1 = \begin{bmatrix} 1 \\ 1 \\ \end{bmatrix} \ , V_2 = \begin{bmatrix} 2 \\ 1 \\ \end{bmatrix}$$ , using the Gram-Schmidt process.

Solution:

Gram-Schmidt process,$$\ \vec{u_k} = \vec{v_k} - \Sigma_{j-1}^\text{k-1} \ proj_\vec{uj} \ (\vec{v_k})$$

where

$$\ proj_\vec{uj} \ (\vec{v_k}) = \frac{ \vec{u_j} \cdot \vec{v_k}}{|{\vec{u_j}}|^2} \vec{u_j}$$ is a vector projection.

The Normalized Vector is

$$\vec{e_k} = \frac{ \vec{u_k}}{|{\vec{u_k}}|}$$

Step 1:

$$\vec{u_1} \ = \ \vec{v_1} \ = \ \begin{bmatrix} 1 \\ 1 \\ \end{bmatrix}$$ $$\vec{u_1} \ = \ \vec{v_1} \ = \ \begin{bmatrix} 0.71 \\ 0.71 \\ \end{bmatrix}$$

Step #2: (Find Vector Projection)

$$\ proj_\vec{u_1} \ (\vec{v_2}) \ = \begin{bmatrix} 1.5 \\ 1.5 \\ \end{bmatrix} \\$$

Vector Subtraction:

$$\vec{u_2} = \vec{v_2} \ - \ proj_\vec{u_1} \ (\vec{v_2}) \ = \ \begin{bmatrix} 0.5 \\ -0.5 \\ \end{bmatrix}$$

Calculate Unit Vector:

$$\vec{e_2} = \frac{ \vec{u_2}}{|{\vec{u_2}}|} \ = \ \begin{bmatrix} 0.71 \\ -0.71 \\ \end{bmatrix}$$

Result:

$$\begin{bmatrix} 0.71 \\ 0.71 \\ \end{bmatrix} \begin{bmatrix} 0.71 \\ -0.71 \\ \end{bmatrix}$$

To automate the calculations involved in this process, use a gram schmidt calculator that lets you obtain an orthonormal set of vectors for your specific problems.

### Orthonormalization Basis:

An orthonormal basis is a specific type of basis used for spaces with an inner product (like the dot product in Euclidean space). It is a set of vectors spanning in the same spaces as the original vectors. An orthonormal basis is a specific type used for spaces with an inner product (like the dot product in Euclidean space). It is a set of vectors spanning in the same spaces as the original vectors. And, the orthonormal basis calculator is an instant way to find the basis of the space spanned by these vectors.

Using an orthonormal basis is very beneficial when you are dealing with decomposition, projections of vectors, or solving the system of equations. As it makes the calculations straightforward because the basis vectors are perpendicular to each other and have a unit length. It forms a well-defined coordinate system for a vector space.

## What Does Orthogonal Mean?

In algebra, orthogonal means two vectors that are perpendicular to each other. It is possible if the result of two vectors dot product is zero.

For instance, if you have two following vectors:

$$\vec{u_1}, \vec{v_1}$$ Then if $$\vec{u_1} \dot\ \vec{v_1}$$

They will be considered orthogonal. When it comes to orthogonal basis visualization, the vectors come in two-dimensional spaces.

For more complex, higher, or ordinary dimensions vector sets, an orthogonal basis calculator works best by using the Gram-Schmidt method.

## FAQ’s:

### How To Find Orthonormal Basis Using Gram Schmidt Process?

1. Take the given vectors as $$\vec{u_1},\ \vec{u_2},\ \vec{u_3},\ ...\vec{u_n}$$
2. Now write as$$\ \vec{u_1}= \vec{v_1},\ \text{and set}\ \vec{e_1}\$$ as the normalization of $$\vec{u_1}$$
3. Use$$\ \vec{u_2}$$ to be the vector orthogonal to$$\ \vec{u_1}$$ and set$$\ \vec{e_2}$$as the normalization of$$\ \vec{u_2}$$
4. Now choose$$\ \vec{u_3}\$$so that$$\ \vec{u_1}\ ,\vec{u_2}\$$and$$\ \vec{u_3}\$$are orthogonal, set$$\ \vec{e_3}\$$ as the normalization of$$\ \vec{u_3}$$
5. Keep repeating this process until no vector remains behind
6. Keep in mind that the non-zero$$\ \vec{e_i}$$'s are the orthonormal basis

### What is the function of Gram Schmidt calculator?

The calculator functions by applying the Gram Schmidt orthogonalization process on a set of linearly independent vectors or on the columns of a matrix to get the orthonormal basis of the space that is spanned by the vectors.

### Does Order Matter For Gram-Schmidt?

No, the order does not matter. It does not affect the resulting subspace spanned by the orthonormal basis. However, it can affect the decomposition pattern of vectors you end up with on that basis.

### Can I Apply Gram-Schmidt To Linearly Dependent Vectors?

Yes, you can apply Gram-Schmidt Process to linearly dependent vectors but it will stop providing useful results when it reaches the zero vector. In simple words, it finds linear dependency, but it can't provide the full basis if the vectors are not linearly dependent.

### What Is The Main Difference Between The Orthogonal And Orthonormal?

Orthogonal vectors are the vectors that are 90 degrees from each other. While the orthonormal vectors are orthogonal and additionally also have a vector length of 1.

### References:

From the source of Wikipedia: Gram–Schmidt process

From the source of math.hmc.edu: Gram–Schmidt Method