Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. rm(list=ls())
  2. N=50000
  3. x=sample(0:1,N,repl=TRUE)
  4. s=cumsum(x)
  5. r=s/(1:N)
  6. plot(r, ylim=c(0.4,0.6),type="l")
  7. lines(c(0,N),c(0.5,0.5),col="red")
  8. round(cbind(x,s,r),5)[1:10,]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement