How to generate two groups of $n$ random numbers in $U(0,1)$ such that sum of these two groups equal? I want to have two groups of $n$ random numbers $u_i$ and $v_i$ in $U(0,1)$, such that $\sum u_i = \sum v_i$
What I tried is:
I can firstly get $u_i$ by $U\sim U(0,1)$, make $s=\sum u_i$.
Then I found it is very difficult to generate another $n$ uniformly distributed random numbers $v_i$ from $U(0,1)$ that sum to $s$, where $s$ can be any real value in $[0,n]$
Try to make the question clearer, my original problem is:
The random variables, of course, is not independent! But my question requires the sampled values for each parameter roughly distributed in range [0,1] such that the Monte Carlo sampling will effectively go over the whole parameter space for the system.
I have $8$ parameters $\kappa_i, i=1,\ldots,8$ from a system, each parameter $\kappa_i$ can be any value (better be uniformly distributed) in $[0,1]$. But I have a constraint on my parameters which is $\kappa_1+\kappa_2+\kappa_3+\kappa_4=\kappa_5+\kappa_6+\kappa_7+\kappa_8$. Now I want to sample the whole parameter space (is this counted as Monte Carlo?) with such constraint. What should I do?
 A: Here is a procedure to generate two $n$tuples of random variables $(u_k)$ and $(v_k)$, both i.i.d. uniform on $(0,1)$, with $u_1+\cdots u_n=v_1+\cdots+v_n$.
For every $k$, let $f_k$ denote the PDF of the sum of $k$ i.i.d. random variables uniformly distributed on $(0,1)$. Generate $n$ i.i.d. random variables $u_i$ uniform on $(0,1)$, and consider $s_n=u_1+\cdots+u_n$. Then generate $v_n$ distributed as $u_n$ conditionally on $u_1+\cdots+u_n=s_n$, that is, with density $$f_n(s_n)^{-1}\cdot f_{n-1}(s_n-x)\cdot\mathbf 1_{(0,1)}(x).$$ Next, define $s_{n-1}=s_n-v_n$ and generate $v_{n-1}$ distributed as $u_{n-1}$ conditionally on $u_1+\cdots+u_{n-1}=s_{n-1}$, that is, with density $$f_{n-1}(s_{n-1})^{-1}\cdot f_{n-2}(s_{n-1}-x)\cdot\mathbf 1_{(0,1)}(x),$$ and so on, until $v_2$ distributed as $u_2$ conditionally on $u_1+u_2=s_2$, that is, with density $$f_2(s_2)^{-1}\cdot f_{1}(s_2-x)\cdot\mathbf 1_{(0,1)}(x)=f_2(s_2)^{-1}\cdot \mathbf 1_{(s_2-1,s_2)}(x)\cdot\mathbf 1_{(0,1)}(x).$$ Finally define $v_1=s_2-v_2$. Then $(v_k)$ is i.i.d. uniform on $(0,1)$ and $u_1+\cdots u_n=v_1+\cdots+v_n$ almost surely.
To sum up, the procedure is exact but it requires to compute $n-1$ PDFs, each PDF $f_k$ being a polynomial of degree $k-1$ on each interval $(i-1,i)$ with $1\leqslant i\leqslant k$.
A: 
I have 8 parameters $κ_i,i=1,…,8$ from a system, each parameter $κ_i$ can be any value (better be uniformly distributed) in $[0,1]$. But I have a constraint on my parameters which is $κ_1+κ_2+κ_3+κ_4=κ_5+κ_6+κ_7+κ_8$. Now I want to sample the whole parameter space (is this counted as Monte Carlo?) with such constraint. What should I do?

If  understand your problem: 
a) simulate freely 4 random numbers [0, 1]
b) let be its sum n1 
c) simulate  THREE ALSO FREELY and add, say n2
d) if 0<= ni-n2 <= 1 then keep x=n1-n2, otherwise reject the attempt
e) repeat from a) to d) any times in order to get a large stock   
