Suppose we have a start value S <- 10 and two vectors, i.e. x <- c(0,0,1,1,1,0,0,1,0,0) y <- c(3,1,1,2,1,2,2,1,1,2)
S <- 10
x <- c(0,0,1,1,1,0,0,1,0,0)
y <- c(3,1,1,2,1,2,2,1,1,2)
I have