{"id":1869,"date":"2006-04-12T06:35:37","date_gmt":"2006-04-12T11:35:37","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=1869"},"modified":"2016-05-10T14:31:38","modified_gmt":"2016-05-10T18:31:38","slug":"uniform-random-samples-with-fixed-sum","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2006\/04\/12\/uniform-random-samples-with-fixed-sum\/","title":{"rendered":"Uniform random samples with fixed sum"},"content":{"rendered":"<p>Thanks again to guest-picker-in-residence John D&#8217;Errico &#8230;<\/p>\n<p>Yes, I&#8217;ll admit that I&#8217;m one of those people who enjoys a pretty piece of mathematics. Its something you will find in a <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=9700&amp;objectType=file (link no longer works)\">randfixedsum<\/a>, 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&#8217;s code works (efficiently!) in higher dimensions with ease.<\/p>\n<p>Its definitely not something you would need to use every day, but its worth a peek.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks again to guest-picker-in-residence John D&#8217;Errico &#8230;<br \/>\nYes, I&#8217;ll admit that I&#8217;m one of those people who enjoys a pretty piece of mathematics. Its something you will find in&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2006\/04\/12\/uniform-random-samples-with-fixed-sum\/\">read more >><\/a><\/p>\n","protected":false},"author":33,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1869"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=1869"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"predecessor-version":[{"id":7034,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1869\/revisions\/7034"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}