A **Gram-Schmidt Calculator** is a mathematical tool used to perform the Gram-Schmidt orthogonalization process.

This process transforms a set of linearly independent vectors into an orthogonal or orthonormal set of vectors.

## Gram-Schmidt Example Chart

Step | Vector | Calculation | Result |
---|---|---|---|

1 | u₁ | v₁ | (1, 1, 0) |

2 | e₁ | u₁ / ‖u₁‖ | (1/√2, 1/√2, 0) |

3 | u₂ | v₂ – proj_u₁(v₂) | (-1, 1, 0) |

4 | e₂ | u₂ / ‖u₂‖ | (-1/√2, 1/√2, 0) |

5 | u₃ | v₃ – proj_u₁(v₃) – proj_u₂(v₃) | (0, 0, 2) |

6 | e₃ | u₃ / ‖u₃‖ | (0, 0, 1) |

## Gram-Schmidt Formula

The **Gram-Schmidt Formula** for orthogonalization is:

- u₁ = v₁
- u₂ = v₂ – proj_u₁(v₂)
- u₃ = v₃ – proj_u₁(v₃) – proj_u₂(v₃) …

Where proj_u(v) is the projection of v onto u, given by:

`proj_u(v) = (v · u / u · u) * u`

**Let’s orthogonalize the vectors v₁ = (1, 1, 0), v₂ = (0, 1, 0), and v₃ = (0, 1, 1).**

- u₁ = v₁ = (1, 1, 0)
- u₂ = v₂ – proj_u₁(v₂) = (0, 1, 0) – ((0, 1, 0) · (1, 1, 0) / (1, 1, 0) · (1, 1, 0))
*(1, 1, 0) = (0, 1, 0) – (1/2)*(1, 1, 0) = (-1/2, 1/2, 0) - u₃ = v₃ – proj_u₁(v₃) – proj_u₂(v₃) = (0, 1, 1) – (1/2)
*(1, 1, 0) – (1/3)*(-1/2, 1/2, 0) = (-1/2, 1/6, 1)

The resulting orthogonal set is {(1, 1, 0), (-1/2, 1/2, 0), (-1/2, 1/6, 1)}.

## Gram-Schmidt Process

The **Gram-Schmidt process** takes a finite, linearly independent set of vectors S = {v₁, …, vₖ} and generates an orthogonal set S’ = {u₁, …, uₖ} that spans the same k-dimensional subspace of Rⁿ as S.

The process works as follows:

- Start with the first vector: u₁ = v₁
- For each subsequent vector vᵢ (i = 2, …, k): a. Subtract from vᵢ its projection onto each of the previous orthogonalized vectors uj (j = 1, …, i-1) b. The result is the next orthogonal vector uᵢ

Mathematically, this is expressed as:

`uᵢ = vᵢ - Σ(j=1 to i-1) proj_uj(vᵢ)`

Where proj_u(v) = (v · u / u · u) * u

Let’s apply the Gram-Schmidt process to the vectors v₁ = (1, 0, 1), v₂ = (1, 1, 0), and v₃ = (1, 1, 1) in R³.

- u₁ = v₁ = (1, 0, 1)
- u₂ = v₂ – proj_u₁(v₂) = (1, 1, 0) – ((1, 1, 0) · (1, 0, 1) / (1, 0, 1) · (1, 0, 1))
*(1, 0, 1) = (1, 1, 0) – (1/2)*(1, 0, 1) = (1/2, 1, -1/2) - u₃ = v₃ – proj_u₁(v₃) – proj_u₂(v₃) = (1, 1, 1) – (2/2)
*(1, 0, 1) – (1/3)*(1/2, 1, -1/2) = (0, 1, 0) – (1/6, 1/3, -1/6) = (-1/6, 2/3, 1/6)

**The resulting orthogonal set is {(1, 0, 1), (1/2, 1, -1/2), (-1/6, 2/3, 1/6)}.**