Re: [R] Sum(Random Numbers)=100

From: Carl Witthoft <>
Date: Tue, 08 Jul 2008 17:40:23 -0400

quote: In the present case use rmultinom(1, 100, rep(1/50,50))

At least in my version, rmultinom normalizes the last argument, so rep(1,50) works just as well.

Back to the original problem: either assign 49 randoms and give the remainder to the 50th slot, or do the right thing :-) :

You have 50 outcomes, so simply draw numbers from the uniform distribution over the range 1:50. Keep drawing until you've assigned a number to each of your "dollars" (i.e. each item in your sample set).

Carl mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 08 Jul 2008 - 21:45:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 22:31:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive