nrep <- 100000 dimc <- 4 x <- rnorm(dimc*nrep,mean=2,sd=0.5) x <- matrix(x,nrow=nrep) y <- apply(x,1,sum) sum(y>7)/length(y)