Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python. Write a program that takes as input an 8 8 matrix where each element could be ' s ' ( a space )
Using Python. Write a program that takes as input an matrix where each element could be a space or a wall and
exactly one element is othe origin and exactly one element is dthe destination and does the following:
a Assuming the grid is numbered starting left to right, top to bottom in sequence creates a vector of
states.
b Generates transition matrices, one for each direction of movement. Movements are possible only between
spaces. Note that any action that moves across a wall or out of the grid would result in no movement staying
in the same space
c For a policy that randomly chooses each direction with equal likelihood, computes the average number of steps
it takes to move from the origin to the destination.
dextra credit Add as inputs to your code, a policy where is the probability by which
up is the action, probability of moving one step down, probability of moving one step to the left, and
the probability of moving one step to the right, and compute the average number of steps to get from the
origin to the destination.
Execute your code for the following maze grid:
In a written report, describe clearly and mathematically how you developed the Markov chain for the problem and
explain using an example executed using your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started