Question: import numpy as npimport numpy.linalg as ladef steady _ state _ vector ( mat ) : dimension = mat.shape [ 0 ] # Store the
import numpy as npimport numpy.linalg as ladef steadystatevectormat: dimension mat.shape # Store the dimension of the matrix mat mat npeyedimension # mat is mat Identity Matrix I ones nponesdimension mat npcmat ones X npdotmat matT Y nponesdimension return lasolveX Ydef threesteptransitionmat i j: temp mat # Initialize temp with mat temp npdottemp mat # Calculate temp temp npdottemp mat # Calculate temp return tempijmarkovmatrix nparraysteadystate steadystatevectormarkovmatrixprobstark threesteptransitionmarkovmatrix, # House Targaryen, House Stark# Print the resultsprintSteady State Vector:"printsteadystateprintProbability of Transition from House Targaryen to House Stark after steps:"printprobstark
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
