Question: Creating single random values from a distribution

Dear Maple users

I wanted to create a list of random datapoints for the "simple linear regression model". Standard deviation sigma is given, slope a and fixed value b given for the line as well. Before the code below I had some random x-values created for the data points saved in the list X. To calculate the corresponding y-values randomly from a normal distribution with standard deviation sigma and mean equal to a*x+b I wrote the code below:


for i from 1 by 1 to N do    
end do:



It actually works, but I just found it a bit strange having to repeatedly ask for a random sample with only a single member. Isn't it possible to do it more efficiently? I am aware of the special properties of the normal distribution, which would make it possible to take only one sample and add the mean afterwards, but I am not looking for ad hoc solutions, rather appropriate commands to create simgle random values from a distribution.  



Please Wait...