x1<-c(runif(10000)) x2<-c(runif(10000)) abdiff<-abs(x1-x2) hist(abdiff) n<-length(abdiff) plot(sort(abdiff),(1:n)/n,type="s",ylim=c(0,1)) length(abdiff[abdiff<.1])/10000