Gram-Schmidt process

From TCS Wiki
Jump to navigation Jump to search

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 [math]\displaystyle{ \{v_{1},...,v_{n}\} }[/math] that form a basis for [math]\displaystyle{ R^{n} }[/math], and that we wish to convert these into a friendlyTemplate:What 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 [math]\displaystyle{ u,v }[/math], then we may find the component of [math]\displaystyle{ u }[/math] being unfriendly to [math]\displaystyle{ v }[/math] with [math]\displaystyle{ proj_{u}(v)=\frac{\lt v,u\gt }{\lt u,u\gt }u }[/math]. By subtracting this from [math]\displaystyle{ v }[/math], we get the component friendly to [math]\displaystyle{ u }[/math]. By returning to our abstract set [math]\displaystyle{ \{v_{1},...,v_{n}\} }[/math], 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:

[math]\displaystyle{ w_{1} }[/math] = [math]\displaystyle{ v_{1} }[/math]

[math]\displaystyle{ w_{2} }[/math] = [math]\displaystyle{ v_{2} - proj_{w_{1}}v_{2} }[/math]

et cetera, with the general term:

[math]\displaystyle{ w_{n}=v_{n}-\sum_{i=1}^{n-1}{proj_{w_{i}}v_{n}} }[/math]

Should we wish to make this a friendly and cuteTemplate:What basis, we can simply make each new element of the basis cute, by replacing both [math]\displaystyle{ v_{n} }[/math] with [math]\displaystyle{ \frac{v_{n}}{||v_{n}||} }[/math].