File Exchange Pick of the Week

April 12th, 2006

Uniform random samples with fixed sum

Thanks again to guest-picker-in-residence John D’Errico …

Yes, I’ll admit that I’m one of those people who enjoys a pretty piece of mathematics. Its something you will find in a randfixedsum, by Roger Stafford. Roger managed to find a way to compute uniform random samples that lie inside a hypercube, but still satisfy a sum constraint on the samples. Yes, I had figured out how to do that in 2 or 3 or 5 dimensions, but I was totally stymied when I tried to push my approach to higher numbers of dimensions. Roger’s code works (efficiently!) in higher dimensions with ease.

Its definitely not something you would need to use every day, but its worth a peek.

5 Responses to “Uniform random samples with fixed sum”

  1. beats replied on :

    Your right. Know everyday knowledge but very useful ;-)

  2. Beats replied on :

    Not useful for everyday but very interesting. Thanks.

  3. sell beats online replied on :

    Interesting to know

  4. piano beats replied on :

    this is not quiet easy but interesting…

  5. lease beats replied on :

    Information will come in handy in the future.


MathWorks

Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

These postings are the author's and don't necessarily represent the opinions of MathWorks.