Я думаю, что вам нужно это.
R <- 50
n <- 1000
set.seed(42)
res <- replicate(R, rbinom(n, 1, .5))
p <- apply(res, 2, function(x) cumsum(x)/seq_along(x))
plot(1:1000, ylim=c(0, 1), type="n")
apply(p, 2, function(x) lines(1:1000, x, col="grey50"))
abline(h=.5)
![enter image description here](https://i.stack.imgur.com/fg6jV.png)