Random numbers generation with conditions.

R

ramana

Hi everybody,


I want to generate "n"(say24) number of random numbers between a
specified range(say between 50 & 40) with two conditions such that the
average should be "X"(say 44.56) and with a standard deviation "X1"(Say
3.21).

Can anybody helpme out to solve this problem.

Thanks and Best Regards

Ramana
 
B

bj

use norminv() to generate your distirbution
=norminv(rand(),44.56,3.21)

see Help for more info.
 
B

B. R.Ramachandran

Hi Ramana,

If you want the average and standard deviation to be exactly equal to the
values you specify (say 44.56 and 3.21 respectively), you may try this
approach.

Generate "n" (say 24) random numbers (say between 40 and 50) using,
=RAND()*10+40 in say A2:A25. Have helper cells created for the required
average (say in B2), the required standard deviation (say in B3), the actual
average (say in C2), and the actual standard deviation (say in C3).

Now launch the 'Solver',
'Set Target Cell' --> $C$2,
'Equal To' --> select the 'Value of' button, and enter 44.56 in the bar,
'By Changing Cells'-->$A$2:$A$25 (for example)
'Add' the constraint --> $C$3 = $B$3,
'Solve', 'OK'

Once the random numbers are optimized to conform to the constraints, they
lose their formula and change into mere values. Please note that these
numbers of course are uniform random numbers (and not gaussian random
numbers) as expected of the =RAND() function.

Regards,
B. R. Ramachandran
 
R

ramana

Hi,

Thank you for the information given Now I'm trying to apply to this
for my sprcific problem.

Thanks and Regards

Ramana
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top