subject

Random Walker Collisions In lecture, we saw how to model the behavior of a random walker on a 2D grid using a Monte Carlo simulation. In this problem, we will investigate collisions between two of these random walkers. Specifically, use your simulation to track the distances of the two walkers until they collide. 1. Start by writing a MATLAB script to simulate the path that the single random walker A takes on an 11 x 11 grid of tiles. Let this random walker use a random compass as shown in class. Thus, the probability p of moving in the North, East, South, and West directions is given by 0.2. The remaining probability is the one used to stay put. If the random walker tries to move "past" one of the boundaries on its turn, his position does not change (you can think of this as a particle bumping into a wall and staying still). Choose a random tile to let the random walker A start his walk. Lastly, write a function to update the position of the random walker A. The function must use exactly the function header shown below, i. e. the function name and number and ordering of inputs and outputs must be followed exactly. function (x, y) = Randwalk_2D (x0, y0, BC) Here, x0 and y0 are the initial positions of the random walker, BC is the array of boundary conditions, and x and y are the updated positions of the random walker. 2. Add the random walker B to your simulation who moves according to its own randomly generated values using the same compass as the random walker A in Part 1. Let the random walker B start his walk on the tile that is furthest away from the start tile of walker A. At each iteration, both walkers move simultaneously to an adjacent tile using the rules outlined in Part 1. Continue updating the position of both walkers until a collision occurs (or until the maximum number of iterations, which is set to 1000, is reached). More precisely, a collision occurs when both random walkers occupy the same tile after both have completed their move. Furthermore, a collision occurs when both random walkers are next to each other and move to the other one's tile. Note that in this instance, the collision appears on their way, but both random walkers will end up on tiles that are again next to each other. In other words, collision also appears when their paths cross. 3. Track the movement of each random walker by storing their positions in four 1D-arrays associated with their x- and y-positions in the grid. After the simulation, calculate for each iteration the distance between the random walkers A and B, and plot the results vs. the number of iterations to see when the two random walkers A and B came close to each other and when they were far away from each other.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
What are compression artifacts? 1) visible defects in the picture caused by the nature of the compression algorithm. 2) numbers that tell a web server how much to compress a picture for faster transmission. 3) invisible defects in the picture preserved by lossless compression. 4) numbers that tell a photo editing program how much to compress a picture for faster transmission.
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
question
Computers and Technology, 22.06.2019 21:50
Answer the following questions regarding your system by using the commands listed in this chapter. for each question, write the command you used to obtain the answer. a. what are the total number of inodes in the root filesystem? how many are currently utilized? how many are available for use? b. what filesystems are currently mounted on your system? c. what filesystems are available to be mounted on your system? d. what filesystems will be automatically mounted at boot time?
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
You know the right answer?
Random Walker Collisions In lecture, we saw how to model the behavior of a random walker on a 2D gri...
Questions
question
Chemistry, 24.07.2019 13:00
Questions on the website: 13722367