# Gram-Schmidt process

The Gram-Schmidt process is a way of converting one set of vectors that forms a basis into another, more friendly one.

Suppose we have a set of vectors ${\displaystyle \{v_{1},...,v_{n}\}}$ that form a basis for ${\displaystyle R^{n}}$, and that we wish to convert these into a friendly[needs to be explained] basis. We begin by finding out which component of a vector is being unfriendly to a second vector, which we may do with inner products. If we have two vectors ${\displaystyle u,v}$, then we may find the component of ${\displaystyle u}$ being unfriendly to ${\displaystyle v}$ with ${\displaystyle proj_{u}(v)={\frac {}{}}u}$. By subtracting this from ${\displaystyle v}$, we get the component friendly to ${\displaystyle u}$. By returning to our abstract set ${\displaystyle \{v_{1},...,v_{n}\}}$, we may make use of this observation to construct a general algorithm to convert an arbitrary basis into a friendly basis. Like from our original set, each time we use the process on a new vector, it is guaranteed to be mutually friendly with all the previous vectors.

Define:

${\displaystyle w_{1}}$ = ${\displaystyle v_{1}}$

${\displaystyle w_{2}}$ = ${\displaystyle v_{2}-proj_{w_{1}}v_{2}}$

et cetera, with the general term:

${\displaystyle w_{n}=v_{n}-\sum _{i=1}^{n-1}{proj_{w_{i}}v_{n}}}$

Should we wish to make this a friendly and cute[needs to be explained] basis, we can simply make each new element of the basis cute, by replacing both ${\displaystyle v_{n}}$ with ${\displaystyle {\frac {v_{n}}{||v_{n}||}}}$.