{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Montreal Problem

Montreal Problem - L< NULL for(i in 1:n T< rexp(9,1/20...

This preview shows pages 1–3. Sign up to view the full content.

#Original Montreal Problem # # JB--1-Ch -2- D -3---- B # | | | # 6 7 4 # | | | # | M | # | | | # | 8 | # | | | # Cy --5- H ------/ # LifeLeft1<-function(n) { #Input the number of repeats.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # L <- NULL for (i in 1:n) { T <- rexp(9,1/20) L1 <- min(T[1],T[2],T[7]) L2 <- min(T[1],T[5],T[6],T[8]) L3 <- min(T[1],T[2],T[3],T[4],T[8]) L4 <- min(T[1],T[6],T[5],T[4],T[3],T[7]) L5 <- min(T[9],T[2],T[7]) L6 <- min(T[9],T[5],T[6],T[8]) L7 <- min(T[9],T[2],T[3],T[4],T[8]) L8 <- min(T[9],T[6],T[5],T[4],T[3],T[7]) L[i] <- max(L1,L2,L3,L4,L5,L6,L7,L8) } return(L) } data=LifeLeft1(10000) max(data) mean(data) min(data) sd(data)...
View Full Document

{[ snackBarMessage ]}