N <- 10000 X <- c() for (n in 1:N) { X <- c(X,min(runif(2,0,1))) } bornes <- seq(0,1,0.05) hist(X,breaks=bornes)