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?