On Fri, 27 Apr 2012, Vale Fara wrote:

I am working with lotteries and I need to generate two sets of uniform
random numbers.

Requirements:
1) each set has 60 random numbers

random integers?

2) random numbers in the first set are taken from an interval (0-10),
whereas numbers in the second set are taken from a higher interval
(15-25)

Depends on if you mean integers.  R has functions.  Here's one:

http://www.astrostatistics.psu.edu/su07/R/html/stats/html/Uniform.html


3) numbers generated in the first set should be matched to numbers in
the second set (row by row) so that the expected value of each couple
of random numbers (i.e. of each lottery) is around to a given value
(12.5 +/- 5, where 12.5 is the median value of the interval extremes).

Do you mean that the mean for the pair of numbers must be between 7.5 and 17.5, inclusive? That means the sum must be from 15 to 35. Well, you are in luck because if you make the numbers as you suggested above, that will happen -- you don't have to do anything special to make it happen.


For the computation of the expected value, the probabilities in each
lottery are ½ and ½.

For what outcome?  You lost me.


How do this? Any help given would be greatly appreciated.

I hope that helps.

Mike
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to