# Completing a unitary matrix given a column

I am given a unit vector $e=1/\sqrt{n}(1,1,\ldots,1)'$ and the problem is to construct an $n\times n$ (real) unitary matrix $U$ which will contain $e$ as the last column. I understand that there are infinite number of such $U$ ($n>2$). I wonder if there is a very simple closed form for $U$, i.e., very simple $n-1$ vectors orthogonal to each other and to $e$.

-
What you call a real unitary matrix is more usually referred to as an orthogonal matrix. – joriki Dec 7 '11 at 1:00
Have you seen Hadamard matrices? – J. M. Dec 7 '11 at 2:00
@joriki, yes its surely "orthogonal". J.M. I have seen a only few of them :) – Tapu Dec 7 '11 at 2:11
also, you can always extend the given vector to a basis for $R^n$ and then use the gram schmidt process to get what you want. – user12014 Dec 7 '11 at 4:13

The columns of $$\pmatrix{1&1&1&1&1\cr1&-1&1&1&1\cr1&0&-2&1&1\cr1&0&0&-3&1\cr1&0&0&0&-4\cr}$$ are pairwise orthogonal. If you divide the 1st column by $\sqrt5$, the second by $\sqrt2$, the third by $\sqrt 6$, the fourth by $\sqrt12$, and the fifth by $\sqrt20$, you should get an orthogonal matrix. Then you just have to move the first column to the far right.
This is the case $n=5$, but the pattern should be clear.
@Tapu: MATLAB has them built-in: gallery('orthog',n,4); for Mathematica, you can use Helmert[n_] := DiagonalMatrix[1/Sqrt[Prepend[Table[j (j + 1), {j, n - 1}], n]]].SparseArray[{{1, j_} -> 1, {i_, j_} /; i > j -> 1, Band[{2, 2}] -> -Range[n - 1]}, {n, n}] – J. M. Dec 7 '11 at 2:51