Docsity

Introduction Linear Algebra - MATLAB Project 2 | MATH 240, Study Guides, Projects, Research of Linear Algebra

Toggle sidebar
bg1
Dr. Wolfe MATH 240 MATLAB PROJECT #2 Due July 2, 2009
1. Consider Ex. 2, p.296 Lay. The stochastic matrix for this problem is
P=
.50 .25 .25
.25 .50 .25
.25 .25 .50
(a) Type Pˆ2 to calculate P2.
(b) Use Pand P2to answer the following questions. Suppose an animal chooses food
#1 on the initial trial. What is the probability that the animal will:
(i) choose food #2 on the next trial ?
(ii) choose food #2 on the second trial after the initial trial ?
(iii) choose food #3 on the second trial after the initial trial ?
(c) Type I=eye(3), rref(P-I)to calculate the reduced echelon form of P−I. Record
this and use it to write the general solution xto the system (P−I)x=0. Also
choose a nonzero value for the free variable and write a particular solution w.
To calculate the steady state vector qfor Penter your solution wand type
q=w/sum(w). Explain why qis a probability vector and verify that qsatisfies
Pq=q.
2. Ex.4, p.296, Lay Also answer the following question. In the long run what is the
probability that the weather will be good on any given day ? (Show all calculations.)
3. Ex.21, p.297 Lay. In part (a) to compute the steady state vector write R=rref(P-
eye(4)) Then
w= [−R(1:3,4); 1],q=w/sum(w)

Partial preview of the text

Download Introduction Linear Algebra - MATLAB Project 2 | MATH 240 and more Study Guides, Projects, Research Linear Algebra in PDF only on Docsity!

Dr. Wolfe MATH 240 MATLAB PROJECT #2 Due July 2, 2009

  1. Consider Ex. 2, p.296 Lay. The stochastic matrix for this problem is

P =

(a) Type Pˆ2 to calculate P 2. (b) Use P and P 2 to answer the following questions. Suppose an animal chooses food #1 on the initial trial. What is the probability that the animal will: (i) choose food #2 on the next trial? (ii) choose food #2 on the second trial after the initial trial? (iii) choose food #3 on the second trial after the initial trial? (c) Type I=eye(3), rref(P-I)to calculate the reduced echelon form of P −I. Record this and use it to write the general solution x to the system (P − I)x = 0. Also choose a nonzero value for the free variable and write a particular solution w. To calculate the steady state vector q for P enter your solution w and type q=w/sum(w). Explain why q is a probability vector and verify that q satisfies P q = q.

  1. Ex.4, p.296, Lay Also answer the following question. In the long run what is the probability that the weather will be good on any given day? (Show all calculations.)
  2. Ex.21, p.297 Lay. In part (a) to compute the steady state vector write R=rref(P- eye(4)) Then w = [−R( 1 : 3 , 4 ); 1 ], q = w/sum(w)