Write a method called randomWalk that performs steps of a random onedimensional walk. The random walk should begin at position 0. On each
step, you should either increase or decrease the position by 1 (each with
equal probability). Your code should continue making steps until a
position of 3 or 23 is reached, and then report the maximum position
that was reached during the walk. The output should look like the
following:
position = 1
position = 0
position = –1
position = –2
position = –3
max position = 1
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here