Question: Compute the 2 times 2 markov _ matrix transition matrix for the above Markov chain.Use the string poem to create a list of 0

Compute the 2\times 2 markov_matrix transition matrix for the above Markov chain.Use the string poem to create a list of 0's and 1's with the ith element being 1 if poem[i] is a vowel and 0 otherwise (use the provided isVowel function). Store this as an array L.Once you have the list of 0's and 1's, iterate through the list and count the number of transitions from 0 to 0,0 to 1,1 to 0 and 1 to 1 and save it into a matrix A. Make sure you have the elements A[i,j]= number of transitions from j to i. Normalize the matrix so that the columns sum to 1 to get markov_matrix.

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 Programming Questions!