|
|
Re: Generate random numbers with fixed sum and different constraints
Posted:
Nov 19, 2012 8:54 PM
|
|
"David Epstein" <David.Epstein.spam@remove.warwick.ac.uk> wrote in message <k8d1g1$4gr$1@newscl01ah.mathworks.com>... > @Roger: what were your reasons for rejecting this approach in your randfixedsum package on FEX? - - - - - - - - - - I think you will find that as n increases the acceptance rate in such a procedure shrinks toward zero altogether too rapidly, thereby restricting one in practice to a rather small range for n.
To get a feeling for this, consider an n-dimensional hypersphere of radius 1/2 enclosed in an n-dimensional cube with unit-length sides. The n-dimensional volume of the cube is 1 whereas that of the hypersphere for even n is (pi/4)^(n/2)/(n/2)! (See http://en.wikipedia.org/wiki/N-sphere.) For n = 50 this would be 1.53E-28, a small acceptance rate indeed.
Roger Stafford
|
|