I have the following challenge: Let X be a V.A. discrete evenly distributed in the interval [1, 10]. Be Y another V.A. each sample of Y is given by the median value of one set of 10 X samples. Generate 10^6 Y samples.
I'm using R, with the following code:
x <- runif(10000000,1,10)
sample <- cut(x,breaks=10)
y = median(sample)