Question: Problem 5 Create a Final-Location Simulation In this problem, you will define a function runSimulation3 that runs numTrials trials of a single-walk simulation by some

Problem 5 Create a Final-Location Simulation In this problem, you will define a function runSimulation3 that runs numTrials trials of a single-walk simulation by some drunk from any of the DrunkKinds in a DirtyField. The length of the single-walk simulation must have numSteps. The dirty field must have dirtyTiles number of dirty tiles which are located randomly within fXLimit and fYLimit as the limits of the xy axes. For each trial, you should create a new DirtyField and start the drunk at location (0,0). The simulation should plot the distribution of all of the final locations for the single-walk simulations across the multiple simulation trials. The plot should also display the the mean numbers of (x,y) distances between the final locations and the start location (0,0) across the multiple trials of the single-walks. Your plotted picture should be similar to the picture provided below. Hint: You should reference the lecture code that addresses similar task. Note that you should identify which part of the lecture code that addresses a similar problem to this one. Then, you need to make some revision so that the code is able to resolve this problem. Feel free to ask if you have any questions or problems.

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!