Question: USING PYTHON PROGRAMMING LANGUAGE Write a program that simulates a 2D drunkards walk with 100 steps. That is, write a program that starts at (0,

USING PYTHON PROGRAMMING LANGUAGE

Write a program that simulates a 2D drunkards walk with 100 steps. That is, write a program that starts at (0, 0), and at each step of the program, changes that position by either +1 in the x-direction, 1 in the x-direction, +1 in the y-direction, or 1 in the y-direction, each possibility happening with probability 1/4.

For example, the first few steps might be (0,0) (0,1) (1,1) (2,1) (2,0) (1,0) (2,0)

Have the program print out the location (that is, the x-coordinate and y-coordinate) after 100 steps.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!