Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rm(list=ls())
- N=50000
- x=sample(0:1,N,repl=TRUE)
- s=cumsum(x)
- r=s/(1:N)
- plot(r, ylim=c(0.4,0.6),type="l")
- lines(c(0,N),c(0.5,0.5),col="red")
- round(cbind(x,s,r),5)[1:10,]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement