LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random numbers addition 1

What do you think about this VI attached, do you have an idea of how to integratethe variance as a control insteat of upper an lower limit.

0 Kudos
Message 11 of 38
(1,509 Views)

How about generating five independant random numbers and then dividing each of the five by thier sum.

The resulting numbers will then sum to 1.

 

Example -

Original series: .76, .89, .5, .17, .02 (sum = 2.34)

 

Dividing each by the sum gives:

0.324786
0.380341
0.213675
0.072649
0.008547

 

(totaling: 0.999998 because I truncaded results)

Message 12 of 38
(1,501 Views)

That is an excellent idea.

Message 13 of 38
(1,489 Views)

Thanks but this is what I did in the first message with VI and I am not satisfied with it. I said the number have a low variance and always near to the mean.

0 Kudos
Message 14 of 38
(1,488 Views)

@ziedhosni wrote:

Thanks but this is what I did in the first message with VI and I am not satisfied with it. I said the number have a low variance and always near to the mean.



Since there are many answers above, you need so specify what "this" is.

 

(Earlier, I was just about to suggest Don's solution, but here on the west coast, we have a time diasadvantage. :D)

Message 15 of 38
(1,482 Views)

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

0 Kudos
Message 16 of 38
(1,474 Views)

@ziedhosni wrote:

Thanks but this is what I did in the first message with VI and I am not satisfied with it. I said the number have a low variance and always near to the mean.


 

 

You'll have to qualify this.  What do you consider low variance?  How are you even measuring/calculating that?

 

Post a screen shot of your VI that show these results that you don't like.

Message 17 of 38
(1,473 Views)

 


@ziedhosni wrote:

Thanks but this is what I did in the first message with VI and I am not satisfied with it. I said the number have a low variance and always near to the mean.



As an aside, random numbers with uniform distribution like to cluster. Think of a Gaussian bell.

Message 18 of 38
(1,470 Views)

@eyeballxxx wrote:

 


@ziedhosni wrote:

Thanks but this is what I did in the first message with VI and I am not satisfied with it. I said the number have a low variance and always near to the mean.



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.

Message 19 of 38
(1,461 Views)

All the generated numbers are below 0.4. None of them reach 0.7 or 0.9.

See attached

0 Kudos
Message 20 of 38
(1,455 Views)