N <- 100000 A <- runif(N,0,1) B <- runif(N,0,1) X <- abs(A-B) bornes <- seq(0,1,0.05) hist(X,breaks=bornes)