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 trans_matrix. 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 1. 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:
A=np.array([[1,1],[2,0]])
def evect_approx1(x_0,k):
x_vect=0
for j in range(1,k+1):
x_vect=np.dot(A,x_0)
x_0=x_vect
return x_vect
# This function approximates the dominant eigenvalue of our matrix A.
def eval_approx1(x_0,k):
A=np.array([[1,1],[2,0]])
lambda_1=0
for j in range(1,k+1):
x_vect=np.dot(A,x_0)
x_0=x_vect
lambda_1=(np.dot(A,x_vect)/x_0)[0]
return lambda_1
# This function approximates the dominant eigenvalue and eigenvector of our matrix A using the normalized iterative process.
def norm_evect_approx1(x_0, k):
A = np.array([[1,1],[2,0]])
for j in range(k):
w_j = A @ x_0
x_j = x_0
x_0= w_j / np.linalg.norm(w_j)
val = w_j[0]/ x_j[0]
return x_0, val
# This function approximates the dominant eigenvalue and eigenvector of our matrix A using the normalized iterative process.
def norm_evect_approx1(x_0, k):
A = np.array([[1,1],[2,0]])
for j in range(k):
w_j = A @ x_0
x_j = x_0
x_0= w_j / np.linalg.norm(w_j)
val = w_j[0]/ x_j[0]
return x_0, val
# This function approximates the dominant eigenvalue and eigenvector of an arbitrary matrix using the Rayleigh quotiend as described in Problem 5.
def ray_quotient(M, x_0, k):
x_vect, _= norm_approx_gen(M, x_0, k)
rayleigh_quotient = np.dot(np.dot(M, x_vect), x_vect)/ np.dot(x_vect, x_vect)
return rayleigh_quotient
def subscriber_vals(x_0, k):
P = np.array([[0.7,0.2],
[0.3,0.8]])
x = x_0
for _ in range(k):
x = np.dot(P, x)
return x

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!