I want to generate 4 random numbers between 1 and 100 so that the total adds up to 100. How do I do that?
say result1) 20,10,40,30 result2 ) 33,33,33,1 etc. Thanks
I want to generate 4 random numbers between 1 and 100 so that the total adds up to 100. How do I do that?
say result1) 20,10,40,30 result2 ) 33,33,33,1 etc. Thanks
The way to go is:
Step 1: Generate four random numbers between 0 and 1
Step 2: Add these four numbers
Step 3: Divide each of the four numbers by the sum,
Step 4: Multiply by 100, and round to the nearest integer.