Question: We will be using Matlab as the software tool for this lab project. 1.Explore and become familiar with the random number generators in Matlab such

We will be using Matlab as the software tool for this lab project.

1.Explore and become familiar with the random number generators in Matlab such as rand,

randn, and randi (in fact all software tools can only generate pseudo-random numbers). Notice that to randomize the generators the use of rng function is encouraged as the previous techniques are discouraged.

2. Random walk is one of the primary and relative 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.

Write the required Matlab script to simulate a single random walk process for 100 steps. The following delineates the required script. This must include an appropriate plot with marker.

Position = 0;

for n = 1: Nstep

% 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.

Include your script and the plot in your report.

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. Change the graph color of each process for better representation. Ask the user to enter the number of processes to be simulated. Include your script and the plot in your report. Notice that you can create a matrix of the number of processes (Nwalks) to be its columns and the number of steps (Nsteps) to be its rows and plot the matrix versus the steps generated as:

n = 1:Nsteps

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!