File Exchange Pick of the Week

Our best user submissions

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the Original version of the page.

Uniform random samples with fixed sum 5

Posted by Michelle Hirsch,

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.


Comments are closed.

5 CommentsOldest to Newest