Question: Show by using maple please Using the random number generator of Maple, rand() we will study a simple version of the famous random walk process',

Show by using maple please

Show by using maple please Using the random number generator of Maple,

Using the random number generator of Maple, rand() we will study a simple version of the famous random walk process', which has countless applications in many fields of science and economics. This simple version of random walk is a 1-dimensional walk, where, starting at the origin, our random walker takes one step, either forward or backward, with equal probability. The next step is again either forward or backward, with equal probability, etc. etc.. Kinda like a drunk person lost in an unknown street! Where will he end up after N number of steps? First we will need to create a Maple function that gives either -1 or 1 (for a left or a right step, respectively) with equal probability. I will give you the first step, so you can get going. There are many ways of doing this but here is a simple one: fr: =rand(-10.. 9) gr: = x rightarrow sign (fr(x)) We already know what rand does (check your notes!): it produces a random integer between -10 and 9. Then gr(x) takes the sign of this random number. Since there is equal probability that fr will create a positive or a negative number (0 counts as positive here), gr(x) gives -1 or 1 with equal probability. Using the sea command, create a table of 20 random -1s and ls from the gr(x) function, defined above. Using the summation function of Maple, sum those 20 numbers of the table you created in (a). This is the final position of your random walker after 20 steps! Now that you know how to do (a) and (b), create a do loop that repeats (a) and (b) 500 times, but for Woof 300 random -1s and 1s at a time. These final positions should be stored in a table, just as we have often done whenever we created do loops. In essence you have recorded the final positions of 500 random walkers starting at the same point. (Like 500 drunks, all exiting the bar at closing time. Where will they be after 300 random steps each? Plot your results. How far have the farthest couple of random walkers walked? Create a histogram of your results. This histogram will show the distribution of the final positions of our 500 random walkers. What do you observe? Repeat (c), (d), (e) for 1000 walkers with 500 steps each Using the random number generator of Maple, rand() we will study a simple version of the famous random walk process', which has countless applications in many fields of science and economics. This simple version of random walk is a 1-dimensional walk, where, starting at the origin, our random walker takes one step, either forward or backward, with equal probability. The next step is again either forward or backward, with equal probability, etc. etc.. Kinda like a drunk person lost in an unknown street! Where will he end up after N number of steps? First we will need to create a Maple function that gives either -1 or 1 (for a left or a right step, respectively) with equal probability. I will give you the first step, so you can get going. There are many ways of doing this but here is a simple one: fr: =rand(-10.. 9) gr: = x rightarrow sign (fr(x)) We already know what rand does (check your notes!): it produces a random integer between -10 and 9. Then gr(x) takes the sign of this random number. Since there is equal probability that fr will create a positive or a negative number (0 counts as positive here), gr(x) gives -1 or 1 with equal probability. Using the sea command, create a table of 20 random -1s and ls from the gr(x) function, defined above. Using the summation function of Maple, sum those 20 numbers of the table you created in (a). This is the final position of your random walker after 20 steps! Now that you know how to do (a) and (b), create a do loop that repeats (a) and (b) 500 times, but for Woof 300 random -1s and 1s at a time. These final positions should be stored in a table, just as we have often done whenever we created do loops. In essence you have recorded the final positions of 500 random walkers starting at the same point. (Like 500 drunks, all exiting the bar at closing time. Where will they be after 300 random steps each? Plot your results. How far have the farthest couple of random walkers walked? Create a histogram of your results. This histogram will show the distribution of the final positions of our 500 random walkers. What do you observe? Repeat (c), (d), (e) for 1000 walkers with 500 steps each

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!