I need to write a small code using Python to answer those questions of linear algebra. I am using Google Colab.
Problem 2: Votes in elections
In an election, voters may switch to vote for a candidate from another party in the next election. The percentages are represented in the table:
C L N
0.50 0.40 0.10
0.30 0.40 0.30
0.20 0.20 0.60
Problem 2A
If in this election Conservatives received 25% of the votes, Liberals 30% of the votes, and Nationals the remaining 45% of the votes, what is the predicted distribution for the next election?
Problem 2B
If a person voted for the National party in this election, find the probability that the person votes for the Conservative party in the election two years from now.
Problem 2C
If this transition matrix is valid for many years, what is going to happen with the distribution of votes in the long term?
Problem 2D
Use eigenvectors to find the steady-state vector for this problem.