Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with question 3. 2. Random walk is one of the primary and relatively simple random processes in which the process starts from
I need help with question 3.
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. 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_stepsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started