# Copia le seguenti righe e incollale in R
tic <- function(x) {s <-proc.time()[3]; while(proc.time()[3] < s+x) s <- s}
# tic(x) fa passare x sec
for(i in 0:10) {n <- 20*2^i; plot(c(0,2),c(0,1.6),type="n",xlab="",ylab="",asp=1)
   abline(h=seq(0,1.4,0.2), lty=3)
   hist(runif(n)+runif(n),seq(0,2,2/15),probability=TRUE,add=TRUE)
   lines(c(0,1,2),c(0,1,0), lty=3); text(0,1.1,n); tic(4) }