Question: Exercise 1 . ( 5 0 points ) DiffusionIn this exercise, we use a 3 D random walk to simulate a diffusion process. Imagine a

Exercise 1.(50 points) DiffusionIn this exercise, we use a 3D random walk to simulate a diffusion process. Imagine a particle starting at the origin (0,0,0) that has equal probabilities to go in 6 possible directions - left, right, backward, forward, down, and up. For example, when the particle is at (r, y, z), with equal probability 1/6, its next location isat (2-1,y,2),(2+1,3,2),(2,3-1,2),(2,2+1,2),(2, V,2-1) or (2,3,2+1).The particle will conduct the random walk for n steps. We are interested in the distribution of the final locations of particles after each takes n steps. Specifically, we would like to know the distribution of the distance between the final location and the origin. In order to obtain this distribution, we simulate m such particles, and check the proportion of the particles that lies within rn distance from the origin, where r is a real number between 0 and 1. Note all the particles will be within a sphere with radius n since particles only move n steps and the furthest they can go is a distance n from the origin. In our simulation, we will calculatethe proportion of particles that are within rn from the origin for r =0.05,0.10,0.15,...,0.90,0.95,1.00.Below is the main function for this program. Note how we use command line arguments. int main (int argc, char *argv])

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 Programming Questions!