Gram-Schmidt Process & Orthonormal Bases

Example 2.

`Begin with three linearly independent vectors: `

v[1] = vector([1, -1, 0])

v[2] = vector([1, 0, -2])

v[3] = vector([0, -1, -2])

`Apply Gram-Schmidt Process to these three vectors: `

w[1] = v[1]

w[2] = v[2]-`(`*v[2]*` dot`*` w`[1]*`)`/` ||`/w[1]/`||`^2*`w `[1]

w[3] = v[3]-`(`*v[3]*` dot`*` w`[1]*`)`/` ||`/w[1]/`||`^2*`w `[1]-`(`*v[3]*` dot`*` w`[2]*`)`/` ||`/w[2]/`||`^2*`w `[2]

w[1] = [1, -1, 0]

w[2] = vector([1, 0, -2])-`(`*vector([1, 0, -2])*` dot`*vector([1, -1, 0])*`)`/` ||`/vector([1, -1, 0])/`||`^2*vector([1, -1, 0])

w[3] = vector([0, -1, -2])-`(`*vector([0, -1, -2])*` dot`*vector([1, -1, 0])*`)`/` ||`/vector([1, -1, 0])/`||`^2*vector([1, -1, 0])-`(`*vector([0, -1, -2])*` dot`*vector([1/2, 1/2, -2])*`)`/` ||`/vecto...

`Obtain a basis of three orthogonal vectors: `

w[1] = vector([1, -1, 0])

w[2] = vector([1/2, 1/2, -2])

w[3] = vector([-8/9, -8/9, -4/9])

`Obtain an orthonormal basis of three orthogonal unit vectors: `

u[1] = 1/` ||`/w[1]/`||`*` w`[1], `   ||`*w[1]*`||` = 2^(1/2)

u[2] = 1/` ||`/w[2]/`||`*` w`[2], `   ||`*w[2]*`||` = 3/2*2^(1/2)

u[3] = 1/` ||`/w[3]/`||`*` w`[3], `   ||`*w[3]*`||` = 4/3

u[1] = vector([1/2*2^(1/2), -1/2*2^(1/2), 0])

u[2] = vector([1/6*2^(1/2), 1/6*2^(1/2), -2/3*2^(1/2)])

u[3] = vector([-2/3, -2/3, -1/3])