Question: Construct the transition matrix describing the pond this bullfrog will be in , and save it as a NumPy array called trans _ matrix. When
Construct the transition matrix describing the pond this bullfrog will be in and save it as a NumPy array called transmatrix. When ordering your variables to create the matrix, order the ponds as A B C then D
Interactive
Find the steady state probability vector for this transition matrix, and determine what percentage of the bullfrog's time will be spent in pond C in the long run regardless of which pond he starts in Recall that finding the steady state probability vector is the same thing as finding the eigenvector corresponding to the dominant eigenvalue You don't need to submit the answer you find for this steady state vector.
Hint
Use a function you defined earlier.
Previous functions used:
Anparray
def evectapproxxk:
xvect
for j in rangek:
xvectnpdotAx
xxvect
return xvect
# This function approximates the dominant eigenvalue of our matrix A
def evalapproxxk:
Anparray
lambda
for j in rangek:
xvectnpdotAx
xxvect
lambdanpdotAxvectx
return lambda
# This function approximates the dominant eigenvalue and eigenvector of our matrix A using the normalized iterative process.
def normevectapproxx k:
A nparray
for j in rangek:
wj A @ x
xj x
x wj nplinalg.normwj
val wj xj
return x val
# This function approximates the dominant eigenvalue and eigenvector of our matrix A using the normalized iterative process.
def normevectapproxx k:
A nparray
for j in rangek:
wj A @ x
xj x
x wj nplinalg.normwj
val wj xj
return x val
# This function approximates the dominant eigenvalue and eigenvector of an arbitrary matrix using the Rayleigh quotiend as described in Problem
def rayquotientM x k:
xvect, normapproxgenM x k
rayleighquotient npdotnpdotM xvect xvect npdotxvect, xvect
return rayleighquotient
def subscribervalsx k:
P nparray
x x
for in rangek:
x npdotP x
return x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
