Hey folks,

I need an algorithm to generate random vectors. Restriction on vectors $\displaystyle $x=(x_1,\ldots,x_n)$$ are as follows:

a) $\displaystyle $x_1 + x_2 + \ldots + x_n$ = 0$ so they lie in an $\displaystyle n-1$ dimensional hyperplane going through zero.

b) $\displaystyle $x_i \in [-1,1] \forall i$$

c) The density is uniform, e.g. each vector satisfying conditions a) and b) is picked with equal probability.

Example: $\displaystyle $(1,-1/2,-1/2)$$ and $\displaystyle $(0,0,0)$$ are both OK as long as they are generated with the same probability.

Thanks