09-03-2013 09:21 AM - edited 09-03-2013 09:21 AM
@ziedhosni wrote:
Sorry for the mistake,I mean with this the last solution suggesting to do the sum then divide each number by the sum. This is what I am using before asking the question
The numbers will have all a flat probability between zero and 1/N. That is not low variance by any definition. Your problem description does not specify the random range of individual numbers, so this seems like a valid solution.
09-03-2013 09:28 AM
The problem you are not asking for a random number is. Since your are forcing a situation on the set of random numbrs, you wil not get a uniform distribution on it any more, thus it will fail the normal random test number test. As you mention, the low variance is an indication. Random numbers do not have your constrain. Another issue, is that you are looking at too low number of random numbers, 5 is insufficient. Generally they are looking at a lot more. If you want to use your method, you should consider generating millions of random numbers. Guess what, it will be very rare to have number > .1
09-03-2013 09:31 AM
I will ask the same question by another way: how can obtain 5 independant random numbers that their sum is equal or near to one and at leat one of them is greater than 0.6.
I have posted a VI called Random near to the solution but I am still not satisfied. Mathematically,it is very ugly.
To be clear, I am trying to mix different chemical reagents with different proportion and the total volume is fixed. If I use all the previous ideas I fall in the following problem: I mix the reagents with proportions near to each others:0.1 0.33 0.2 0.1 ..
09-03-2013 09:35 AM
@ziedhosni wrote:
All the generated numbers are below 0.4. None of them reach 0.7 or 0.9.
See attached
You still have not specified what you mean by "random". As others have said, if you want each random number to be between 0 and 1 and the sum should be 1, you are introducing a correlation between the numbers that no longer makes them random. For example if the first random number is 0.9, all following numbers need to be way below 0.1. You need much better specifications for the desired randomness!
09-03-2013 09:42 AM
Yes. To have 1 number above .9, you'd need the other numbers to be below .1 in sum total. There is a 10% chance of any given number to below .1. For 4 numbers to sum below .1, then you'd have probably a 1 in 10,000 chance. Actually perhaps far greater odds.
09-03-2013 09:43 AM
Then try my solution, atleast you have 50% probability of the 1st number being >0.5 😉
/Y
09-03-2013 09:45 AM - edited 09-03-2013 09:46 AM
RavensFan wrote:
eyeballxxx wrote:
As an aside, random numbers with uniform distribution like to cluster. Think of a Gaussian bell.
Can you post some sort of reference that supports that statement?
Uniform distribution means any given value has as likely chance of occurring as any other. There is no Gaussian bell and there is no clustering.
I wasn't professing any kind of number theory backing, just speaking from experience that with a low sample volume you tend to get clusters. It's clear as you increase the samples the uniformity becomes more evident.
09-03-2013 09:50 AM
There are 2 psuedo random process (I used the term loosely) you could use:
1. use a uniform number to pick the first number (0 - 1)
a. get another random number between 0 and 1. If the sum less than 1 use if not go pick another
b. repeat until the fifth number. use the remainder
2. Use a uniform rand number generator (0 - 1), a
a. pick a another random number between (0 - [1 - a]), b
b. pick another random number between ( 0 - [ 1 - a - b]), continune until 4 numbers
c. use the remainder for the fifth number
You can use different variations of 1 and 2 or other, e.g. reverse the the order.
09-03-2013 09:54 AM
Ok let me say to be specific semi-random if the term exist. I need variables where sum is equal to 1 and have a high variance. So if I generate 5 numbers, I have a mean equal to 0.2.
Good numbers: 0.1 0.6 0.01 0.15 0.14
Bad numbers: 0.22 0.31 0.1 0.15 0.22
Sorry for people cannot read tjhe vis
09-03-2013 09:54 AM - edited 09-03-2013 09:55 AM
Another possibility would be to skew the random numbers heavily before normalizing. For example the following code will give you typically one relatively large number.