TITLE: Orthonormal basis of $\{(x_1, \dots, x_n) \mid x_1+x_2+\cdots+x_n=0\}$
QUESTION [8 upvotes]: How can we find the orthonormal basis of $\{(x_1,\dots,x_n) \in \Bbb R^n \mid x_1+x_2+\cdots+x_n=0\}$? 
It is easy to find a basis, but using Gram-Schmidt procedure seems difficult to obtain an orthonormal one.

REPLY [13 votes]: You need to find a orthonormal (sub-)basis of $n-1$ elements in ${\Bbb R}^n$ that is orthogonal to $v=(1,1,\ldots,1)$. I don't think there is a good canonical choice. Here is a simple way, though:
 \begin{align}
  u_1  &= \left( \begin{matrix}1 & -1 & 0 & 0 & \ldots & 0 \end{matrix} \right)\\
  u_2  &=\left( \begin{matrix}1 & 1 & -2 & 0 & \ldots & 0 \end{matrix}\right) \\
  u_3  &=\left(  \begin{matrix}1 & 1 & 1 & -3 & \ldots & 0 \end{matrix}\right) \\
    & ...\\
  u_{n-1}  &= \left( \begin{matrix} 1 & 1 & 1 & 1 & \ldots & -(n-1) \end{matrix}\right) \\
\end{align}
They are pairwise orthogonal and orthogonal to $v$ and you just have to normalize.