What Python code will solve the following: The goal of this section is to estimate the probabilities Pij (transition probabilities) associated with finding food from any location (i, j) inside the maze. A rat will be considered successful in finding food if the probability of finding food from a given location exceeds 0.5. 1. Use Equation (1) to write down equations for each probability Pij for i = 1, 2, · · · , 6, j = 1, 2, 3, · · · , 5. Equation 1 is : Pij = 1/4Pi-1j + 1/4 Pi+1j +1/4 Pij-1 + 1/4Pij+1 2. Notice that your equations constitutes a system of linear equations with 30 equations and 30 unknowns, with the unknowns as the transition probabilities. Identify the coefficient matrix for the system of equations and write your system in the form Ap = b, where b is some constant vector and p the vector of transition probabilities, ordered from the upper left hand corner of the maze to the lower right hand corner. The goal is to solve the system for p. 2 3. How would you characterize the coefficient matrix? is it full, sparse, symmetric. 4. Solve the system of equations for the transition probabilities p using Gaussian Elimination. Determine the relative backward error and condition number of the system matrix and use that to estimate the relative forward error. Use the infinity norm to calculate the error and condition number. Will you consider the system matrix to be ill-conditioned? 5. Determine the transition probabilities p by solving the system of equations Ap = b using the Jacobi iterative method and compare with the solution from Gaussian elimination. In particular, how many iterations of Jacobi method will it take to get within 10−3 of the Gaussian elimination solution? Use the infinity norm to calculate the error. 6. From your transition probabilities determine the number of starting positions from which the rat can be expected to find food given that it makes random decisions.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

What Python code will solve the following:

The goal of this section is to estimate the probabilities Pij (transition probabilities) associated with finding food from any location (i, j) inside the maze. A rat will be considered successful in finding food if the probability of finding food from a given location exceeds 0.5. 1. Use Equation (1) to write down equations for each probability Pij for i = 1, 2, · · · , 6, j = 1, 2, 3, · · · , 5. Equation 1 is : Pij = 1/4Pi-1j + 1/4 Pi+1j +1/4 Pij-1 + 1/4Pij+1 2. Notice that your equations constitutes a system of linear equations with 30 equations and 30 unknowns, with the unknowns as the transition probabilities. Identify the coefficient matrix for the system of equations and write your system in the form Ap = b, where b is some constant vector and p the vector of transition probabilities, ordered from the upper left hand corner of the maze to the lower right hand corner. The goal is to solve the system for p. 2 3. How would you characterize the coefficient matrix? is it full, sparse, symmetric. 4. Solve the system of equations for the transition probabilities p using Gaussian Elimination. Determine the relative backward error and condition number of the system matrix and use that to estimate the relative forward error. Use the infinity norm to calculate the error and condition number. Will you consider the system matrix to be ill-conditioned? 5. Determine the transition probabilities p by solving the system of equations Ap = b using the Jacobi iterative method and compare with the solution from Gaussian elimination. In particular, how many iterations of Jacobi method will it take to get within 10−3 of the Gaussian elimination solution? Use the infinity norm to calculate the error. 6. From your transition probabilities determine the number of starting positions from which the rat can be expected to find food given that it makes random decisions.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Hiring Problem
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education