Construction of an Orthonormal Set of Vectors From a Linearly Independent Set Using Gram - Schmidt Procedure

Given a set of linearly independent vectors in a space
$V$
we can construct an orthonormal by first using set for
$V$
using the Gram - Scmidt procedure to find an orthogonal set of vectors, then dividing each vector so found by its magnitude.
Example Find an orthonormal set in
$\mathbb{R}^5$
using the set of vectors
$\left\{ \mathbf{v}_1, \mathbf{v}_2 , \mathbf{v}_3 \right\} = \left\{ \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} , \begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix} , \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} \right\}$

This set of vectors is not an orthogonal set.
$\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \cdot \begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix} =0+0+0-1+0=-1$

$\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \cdot \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} =1+0+0-1+0=2$

$\begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix} \cdot \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} =0+1+1-1+0=1$

To construct an orthogonal set
$\left\{ \mathbf{u}_1, \mathbf{u}_2 , \mathbf{u}_3 \right\}$
first let
$\mathbf{u}_1= \mathbf{v}_1= \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}$

\begin{aligned}\mathbf{u}_2 &= \mathbf{v}_2 - \frac{\mathbf{v}_2 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \\ &= \begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix} - \frac{ \begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix} \cdot \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}}{\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \cdot \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}} \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \\ &= \begin{pmatrix}0\\1\\1\\-1\\0\end{pmatrix}+ \frac{1}{2} \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \\ &= \begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix}\end{aligned}

\begin{aligned} \mathbf{u}_3 &= \mathbf{v}_3 - \frac{\mathbf{v}_3 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1}- \frac{\mathbf{v}_3 \cdot \mathbf{u}_2}{\mathbf{u}_2 \cdot \mathbf{u}_2} \\ &= \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} - \frac{ \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} \cdot \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}} {\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \cdot \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}} \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} - \frac{ \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix} \cdot \begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix}} {\begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix} \cdot \begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix}} \begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix} \\ &= \begin{pmatrix}1\\1\\1\\1\\1\end{pmatrix}- \begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}- \begin{pmatrix}2/5\\4/5\\4/5\\-2/5\\0\end{pmatrix}\\ &= \begin{pmatrix}-2/5\\1/5\\1/5\\2/5\\1\end{pmatrix}\end{aligned}

An orthonormal set of vectors is then
$\left\{ \frac{\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix}}{\left\|\begin{pmatrix}1\\0\\0\\1\\0\end{pmatrix} \right\|}, \frac{\begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix}}{\left\| \begin{pmatrix}1/2\\1\\1\\-1/2\\0\end{pmatrix} \right\| }, \frac{\begin{pmatrix}-2/5\\1/5\\1/5\\2/5\\1\end{pmatrix}}{\left\| \begin{pmatrix}-2/5\\1/5\\1/5\\2/5\\1\end{pmatrix} \right\|} \right\} = \left\{ \begin{pmatrix}1/ \sqrt{2}\\0\\0\\1/ \sqrt{2}\\0\end{pmatrix}, \begin{pmatrix}\sqrt{1/10}\\ \sqrt{2/5}\\ \sqrt{2/5}\\- \sqrt{1/10}\\0\end{pmatrix}, \begin{pmatrix}-2/ \sqrt{35}\\ 1/ \sqrt{35}\\ 1/ \sqrt{35}\\ 2/ \sqrt{35}\\ \sqrt{5/7}\end{pmatrix} \right\}$