LCG - f {y <- (a*x + c) %% m y output <- c(output, y)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#LCG code. # LCG <- function(N,seed,a,c,m) L {#initializations # x <- (a*seed + c) %% m x output <- x o #create the numbers # for (i in 2:N)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f {y <- (a*x + c) %% m y output <- c(output, y) o x<-y x }return(output) r }#Example from class # LCG(100,3,2,0,5)...
View Full Document

This note was uploaded on 11/16/2010 for the course STAT 340 taught by Professor Xu(sunny)wang during the Spring '09 term at Waterloo.

Ask a homework question - tutors are online