Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with question 4 It's in Matlab 2. Random walk is one of the primary and relatively simple random processes in which the

image text in transcribed

I need help with question 4

It's in Matlab
2. "Random walk" is one of the primary and relatively simple random processes in which the process starts from a neutral position (position = 0) and by tossing a fair coin the process (the walker) moves either one step forward (step = +1, with probability 0.5) or one step backward (step = -1, with probability 0.5). The goal is to observe the process as it progresses for large number of trials, say 100 or 1000 and observe the final position of the process (or the walker). Write the required Matlab script to simulate a single random walk process for 100 steps. The following delineates the kernel script. This must include an appropriate output plot with marker on. Position = 0; for n = 1: Num_step % generate the random step of +1 or -1. end % Use "cumsum function to complete Position from the generated steps. % Plot the single random walk process with marker and appropriate labels. 3. Repeat the random walk process of previous section for an ensemble of say 5 simultaneous processes. Plot the ensemble of the processes on the same figure (use "hold on). Change the graph color of each process for better representation. Ask the user to enter the number of processes to be simulated interactively if you wish so. Include your script and the plot in your report. Notice that you can create a matrix of the number of processes (Num_walks) to be its columns and the number of steps (Num_steps) to be its rows and plot the matrix versus the steps generated as: n = 1: Num_steps; 4. Compute the crossing time (required steps) of the point +15 for each of the random walks in part 3, which is the step number at which the random walk reached either +15 or -15 if ever. Find the average of crossing time of all random walks (Use more processes for this section, at least 20). Notice that some of the walks may not reach the designated crossing point and should not be included in simple averaging. 2. "Random walk" is one of the primary and relatively simple random processes in which the process starts from a neutral position (position = 0) and by tossing a fair coin the process (the walker) moves either one step forward (step = +1, with probability 0.5) or one step backward (step = -1, with probability 0.5). The goal is to observe the process as it progresses for large number of trials, say 100 or 1000 and observe the final position of the process (or the walker). Write the required Matlab script to simulate a single random walk process for 100 steps. The following delineates the kernel script. This must include an appropriate output plot with marker on. Position = 0; for n = 1: Num_step % generate the random step of +1 or -1. end % Use "cumsum function to complete Position from the generated steps. % Plot the single random walk process with marker and appropriate labels. 3. Repeat the random walk process of previous section for an ensemble of say 5 simultaneous processes. Plot the ensemble of the processes on the same figure (use "hold on). Change the graph color of each process for better representation. Ask the user to enter the number of processes to be simulated interactively if you wish so. Include your script and the plot in your report. Notice that you can create a matrix of the number of processes (Num_walks) to be its columns and the number of steps (Num_steps) to be its rows and plot the matrix versus the steps generated as: n = 1: Num_steps; 4. Compute the crossing time (required steps) of the point +15 for each of the random walks in part 3, which is the step number at which the random walk reached either +15 or -15 if ever. Find the average of crossing time of all random walks (Use more processes for this section, at least 20). Notice that some of the walks may not reach the designated crossing point and should not be included in simple averaging

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What other blunt questions do you think would be appropriate?

Answered: 1 week ago

Question

What is the growth rate of GDP per capita?

Answered: 1 week ago