From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generate random numbers with fixed sum and different constraints
Date: Tue, 20 Nov 2012 01:54:09 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 8
Message-ID: <k8ens1$kfr$>
References: <k80995$9eo$> <k87s11$h6u$> <k88l7g$7tm$> <k88qag$nm1$> <k89ehg$rm6$> <k8b4e9$ja7$> <k8badi$8rd$> <k8d1g1$4gr$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1353376449 20987 (20 Nov 2012 01:54:09 GMT)
NNTP-Posting-Date: Tue, 20 Nov 2012 01:54:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:783114

"David Epstein" <> wrote in message <k8d1g1$4gr$>...
> @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  For n = 50 this would be 1.53E-28, a small acceptance rate indeed.

Roger Stafford