# How to generate an orthogonal vector

I have two vectors $a$, $b$ each containing $10$ random numbers from the standard normal distributions. I want to generate another vector $C$ of $10$ numbers from the standard distribution where $\mathbb{E}(a\cdot C)=\mathbb{E}(b\cdot C)=0$ (orthogonal), where $\mathbb{E}$ is the expectation.

-
For two vectors to be orthogonal you require their inner product <x, y> to be zero. Is that what you want? So you want their Covariance rather than their Expectation to be 0? (I am just trying to undestand your question here). – usεr11852 Jan 20 '13 at 0:18
Yes, you are right. I have read in a paper I can regress C based on A,B and normalize the residuals. But I could not do it myself (specially when A,B are matrices rather than vectors.) – remo Jan 20 '13 at 4:25
Welcome to our site, Remo! I have used $\TeX$ markup to make your notation a little more readable. While doing that I noticed what appeared to be a typographical error and changed $\mathbb{E}(a\cdot b)$ to $\mathbb{E}(a\cdot C)$, understanding your question to be about generating a random vector $C$ whose expectation is orthogonal to two given vectors $a$ and $b$. If that is incorrect, please make any necessary changes to the question. – whuber Jan 20 '13 at 11:05
@whuber I also think this is $E(\langle a, C\rangle)$. But $E(\langle a, C\rangle) = \langle a, E(C)\rangle$; this nothing but a linear constraint on the $E(C_i)$'s, hence the question is strange because it seemes to require a standard normal distribution for $C$. – Stéphane Laurent Jan 20 '13 at 11:24
@whuber Finally the question which makes more sense is $\langle a, C\rangle = 0$ a.s. – Stéphane Laurent Jan 20 '13 at 13:19

If you do this then you get $\sum c_i =0$. No ? – Stéphane Laurent Jan 20 '13 at 9:49
In addition to what @Stéphane wrote, it seems to me that this answer is too strong: it generates a $C$ that is surely orthogonal to both $a$ and $b$ (not just orthogonal in expectation). – whuber Jan 20 '13 at 11:07