Math
The Gram-Schmidt process
I decided to include the Gram-Schmidt process on my website because when I first learned it, I
thought it could help me visualize the 4th dimension.
First define:
$$proj_{\overset{\rightharpoonup}{x}}(\overset{\rightharpoonup}{v})=\frac{\left
<\overset{\rightharpoonup}{v},\overset{\rightharpoonup}{x}\right>}{\left
<\overset{\rightharpoonup}{x},\overset{\rightharpoonup}{x}\right>}\overset{\rightharpoonup}{x}$$
and this is the inner product:
$$\left<\overset{\rightharpoonup}{v},\overset{\rightharpoonup}{x}\right>=\sum_{j=1}^{n}v_{j}
x_{j}$$
Given the following set of k linearly independent vectors:
$$V=\left\{\overset{\rightharpoonup}{v}_{1},...,\overset{\rightharpoonup}{v}_{k}\right\}$$
The Gram-Schmidt process defines the vectors:
$$X=\left\{\overset{\rightharpoonup}{x}_{1},...,\overset{\rightharpoonup}{x}_{k}\right\}$$
as follows:
$$\begin{align*}
\overset{\rightharpoonup}{x}_{1}=&\overset{\rightharpoonup}{v}_{1}, \\
\overset{\rightharpoonup}{x}_{2}=&\overset{\rightharpoonup}{v}_{2}-proj_{\overset{\rightharpoonup}{x}_{1}}(\overset{\rightharpoonup}{v}_{2}),
\\
\overset{\rightharpoonup}{x}_{3}=&\overset{\rightharpoonup}{v}_{3}-proj_{\overset{\rightharpoonup}{x}_{1}}(\overset{\rightharpoonup}{v}_{3})-proj_{\overset{\rightharpoonup}{x}_{2}}(\overset{\rightharpoonup}{v}_{3}),
\\
&\vdots \\
\overset{\rightharpoonup}{x}_{k}=&\overset{\rightharpoonup}{v}_{k}-\sum_{j=1}^{k-1}proj_{\overset{\rightharpoonup}{x}_{j}}(\overset{\rightharpoonup}{v}_{k})
\end{align*}$$
where they are all perpendicular or orthogonal to one another.
Example
Start with k linearly independent vectors.
$$V=\left\{
\begin{bmatrix*}[c]
-1 \\
0 \\
1 \\
1
\end{bmatrix*},
\begin{bmatrix*}[c]
0 \\
2 \\
0 \\
2
\end{bmatrix*},
\begin{bmatrix*}[c]
1 \\
0 \\
3 \\
1
\end{bmatrix*},
\begin{bmatrix*}[c]
0 \\
1 \\
3 \\
2
\end{bmatrix*}
\right\}$$
Now at this point, the magic already happened! Because these 4 vectors are linearly independent
and span 4-space.
$$W=span\left\{\overset{\rightharpoonup}{v}_{1},...,\overset{\rightharpoonup}{v}_{k}\right\}$$
All the Gram-Schmidt process is going to do is find an orthogonal basis. Then we can
normalize each vector to create an orthonormal basis.
Applying Gram-Schmidt gives us:
$$X=\left\{
\begin{bmatrix*}[c]
-1 \\
0 \\
1 \\
1
\end{bmatrix*},
\begin{bmatrix*}[c]
\frac{2}{3} \\
2 \\
-\frac{2}{3} \\
\frac{4}{3}
\end{bmatrix*},
\begin{bmatrix*}[c]
2 \\
0 \\
2 \\
0
\end{bmatrix*},
\begin{bmatrix*}[c]
-\frac{1}{10} \\
\frac{1}{5} \\
\frac{1}{10} \\
-\frac{1}{5}
\end{bmatrix*}
\right\}$$
To me this is remarkable because we are staring at 4 lines which are perpendicular to one another.
And now to get the orthonormal basis, we need to change these to unit vectors by dividng them by
their lengths.
$$\hat{x}_{n}=\frac{\overset{\rightharpoonup}{x}_{n}}{||\overset{\rightharpoonup}{x}_{n}||}$$
Then apply it to all vectors we get:
$$\begin{bmatrix*}[c]
-\frac{\sqrt{3}}{3} \\
0 \\
\frac{\sqrt{3}}{3} \\
\frac{\sqrt{3}}{3}
\end{bmatrix*},
\begin{bmatrix*}[c]
\frac{\sqrt{15}}{15} \\
\frac{\sqrt{15}}{15} \\
-\frac{\sqrt{15}}{15} \\
\frac{2\sqrt{15}}{15}
\end{bmatrix*},
\begin{bmatrix*}[c]
\frac{\sqrt{2}}{2} \\
0 \\
\frac{\sqrt{2}}{2} \\
0
\end{bmatrix*},
\begin{bmatrix*}[c]
-\frac{\sqrt{10}}{10} \\
\frac{\sqrt{10}}{5} \\
\frac{\sqrt{10}}{10} \\
-\frac{\sqrt{10}}{5}
\end{bmatrix*}$$
and now we have an orthonormal basis that spans 4-space.
The 4th Dimension
Visualizing
XYZ is easy because 3 dimensional space allows us to draw three lines which are perpendicular to one another. However what if we could draw four lines perpendicular to one another as in the diagram below. We have now introduced a
W representing a healthy addition to length, width and height. Hence we have a new dimension and can now start imagining hyperspace.
For more information,
Carl Sagan does an excellent job of explaining
4-space.