# x is a fair die, i.e. has probability distribution:
die <- list(x=1:6,fx=rep(1/6,6))
# we have 5 of them
dists <- replicate(5,die,simplify=FALSE)
# what is the distribution of x1*x2*x3*x4*x5?
prod.dist <- dists.product(dists)
plot(prod.dist$x,prod.dist$fx,xlab="x1*x2*x3*x4*x5",ylab="fx",type="h")
Run the code above in your browser using DataLab