Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (15 points) Create a function X = run-walk(z0, PT) that takes as input an initial condition x(0) E RN, a transition matrix P of

image text in transcribed

3. (15 points) Create a function X = run-walk(z0, PT) that takes as input an initial condition x(0) E RN, a transition matrix P of size N N, and the number of time steps T > 0. As output, the function returns a matrix X = [x(0),x(1), . . . , X(7-1)] of size N T so that each column contains x-P1x program by allocating memory for X before going into a for loop. For example, you can write X = zeros((N,T)), and then replace the zeros with the actual ualues of x(t) (T-1) Hint: Improve the speed of your To test your function, consider the transition matrix P associated with the adjacency matrix 0 1 0 1 Let x(0-11,0,0,0]T and plot 2 (t) as a function of t E {0,1, , 15) for each i {1, 2, 3, 4), all in the same plot(ie., there will be 4 curves in the plot). Make a second plot by repeating the simulation for a different graph: the graph one obtained by removing the self edges in the adjacency matrix above (i.e., set A11 A44 0). Comment on your observations

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

Students also viewed these Databases questions

Question

3. Contrast relational contexts in organizations

Answered: 1 week ago

Question

2. Describe ways in which organizational culture is communicated

Answered: 1 week ago

Question

1. Describe and compare approaches to managing an organization

Answered: 1 week ago