Random Number
Random numbers were originally generated manually or mechanically by using such techniques as spinning wheels, or dice rolling, or card shufing. The modern approach is
to use a computer to successively generate pseudo-random numbers. These p
#
# AMA518 Simulation
# Example 1
#
n<-20
#arrive time of each custmer, assumed independent
p<-cumsum(rexp(n,3)
print(n/p[n])
plot(p,1:n,type='b',las=1)
#sample(c(0.2,0.6),1,repl=TRUE,prob=c(0.5,0.5)
#service time for each custmer, assumed independent
q<-