

set.seed(12345)
n <- 100
x <- c(0:n, n:0)
a<-cumsum(rnorm(n))
b<-cumsum(rnorm(n))
y <- c(c(0,a), rev(c(0,b)))

plot (x, y, type = "n", xlab = "Time", ylab = "Distance")
polygon(x, y, col = "gray", border = "blue")
title("Distance Between Brownian Motions")
