Question: Using random we choose from the list [1,2,3,4]. If the value is one then we move right from the previous x position: 1 x[i] =x(i-1]
Using random we choose from the list [1,2,3,4]. If the value is one then we move right from the previous x position: 1 x[i] =x(i-1] 1 + If the value is two, then we move left from the previous x position: 1 x[i] x[i-1] -1 = If the value is three, we move up from the previous y position: 2 y[1] -y[i-1] 1 + And when the value is four, we move down from the previous y position: 2 y[1] -y(i-1] -1 Here is another way to describe this: step(O)0 eft step(n-1 step(n)right stepn-I) up step(n-1 down step(n 1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
