0% found this document useful (0 votes)
17 views3 pages

Reinforcement Learning MDP Assignment

The document outlines two assignments for a Reinforcement Learning course. The first assignment involves designing a finite Markov Decision Process (MDP) for a student navigating between a hostel, academic block, and mess, requiring value and policy iteration. The second assignment focuses on a 9x9 grid-world environment where a robot must reach a goal, utilizing Value Iteration, Policy Iteration, and Monte Carlo techniques to compute optimal policies and visualize them.

Uploaded by

Rahul Kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Reinforcement Learning MDP Assignment

The document outlines two assignments for a Reinforcement Learning course. The first assignment involves designing a finite Markov Decision Process (MDP) for a student navigating between a hostel, academic block, and mess, requiring value and policy iteration. The second assignment focuses on a 9x9 grid-world environment where a robot must reach a goal, utilizing Value Iteration, Policy Iteration, and Monte Carlo techniques to compute optimal policies and visualize them.

Uploaded by

Rahul Kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RO3002: Reinforcement Learning

Assignment-2

Question 1: ​​ ​ ​ ​ ​ ​ ​ ​ ​ (30 marks)

An undergraduate student at Plaksha University has the task of attending classes and eating
food during their tenure in college. The student has access to three locations on campus: hostel,
Bharti Airtel block (academic block), and mess (canteen). The student receives a reward of -1 for
staying in the hostel, +3 for attending class at the Bharti Airtel block, and +1 for being in the
mess. At any given time, the student can either eat food or attend class.​

When the student is at the hostel, they attempt to attend classes by either going to the Bharti
Airtel block with a 50% probability or staying in the hostel with a 50% probability. If the student
is hungry, they always go to the mess from the hostel with a 100% probability. From the Bharti
Airtel block, the student attends class by either staying in the Bharti Airtel block with a 70%
probability or going to the mess with a 30% probability. If the student becomes hungry while in
the Bharti Airtel block, they either go to the mess with an 80% probability or stay in the Bharti
Airtel block with a 20% probability. At the mess, the student has a 60% chance of attending
classes by going to the Bharti Airtel block, a 30% chance of attending class by going to the
hostel, and a 10% chance of attending from the mess itself. If the student is hungry, they always
stay in the mess with a 100% probability.​

Using this information, design a finite MDP by writing down the possible combinations of states,
actions, transition probability from one state to another for a given action, and rewards in a
tabular form. Also, draw a diagram of the MDP from the information mentioning the probability
and rewards. ​

●​ Based on the designed MDP, perform value iteration and show the optimal value for
each state and the policy obtained. ​ ​ ​ ​ ​ ​ ​
●​ Based on the designed MDP, perform policy iteration and show the optimal policy.
●​ Discuss the results obtained from policy iteration and value iteration.
Question 2: ​​ ​ ​ ​ ​ ​ ​ ​ ​ (30 marks)

You are given a 9x9 grid-world environment where:

●​ The robot icon marks the agent's starting location.


●​ The star symbol represents the goal position.
●​ Two tunnels, labelled IN and OUT, serve as one-way portals. The agent can enter through
IN and exit through OUT.
●​ The agent receives a reward of +1 upon reaching the goal; in all other states, the reward
is 0.

Your task is to solve this problem using Value Iteration, Policy Iteration, and Monte Carlo
techniques. Specifically, you are required to:

1.​ Implement Value Iteration to compute the optimal policies.


2.​ Implement Policy Iteration to compute the optimal policies.
3.​ Implement Monte Carlo with Exploring Starts to compute the optimal policies.
4.​ Visualize the optimal policy for each method by plotting a quiver plot, showing the
direction of the agent's optimal movements at each grid cell for all three approaches.

Due Date:- 28th March 2025

Common questions

Powered by AI

Monte Carlo methods do not require knowledge of transition models and can effectively learn from experiences, which is advantageous in environments where the model is unknown or complex. However, they rely on complete episodes and can have high variance in estimates. Dynamic programming techniques like Value Iteration and Policy Iteration are more efficient in environments with known models, allowing faster convergence to optimal policies with systematic updates but can be computationally expensive for large state spaces. The choice depends on model availability, computational resources, and the complexity of the environment .

The finite Markov Decision Process (MDP) framework can model the student's navigation by defining the states as the three locations: hostel, Bharti Airtel block, and mess. Actions correspond to moving between these locations or staying put, influenced by probabilities (e.g., 50% from hostel to Bharti Airtel block or mess based on hunger). Each transition carries a reward: -1 at the hostel, +3 at the Bharti Airtel block, and +1 at the mess, which reflects the student's satisfaction with each location .

The transition probabilities and reward structure can be represented in a table with states as rows, actions as columns, and cells containing pairs of transition probability and associated reward. For instance, from "Hostel," actions "To Bharti Airtel" and "To Mess" have transition probabilities of 0.5 and 1.0 with rewards of +3 and +1, respectively. Similarly, from "Bharti Airtel," transition to "Mess" has a 0.3 probability with a reward of +1, and staying has a probability of 0.7 with a reward of +3 .

An agent can learn an optimal policy in a grid-world environment using Monte Carlo techniques by implementing Exploring Starts. This method randomly initiates episodes from various states and actions, ensuring sufficient exploration across the state-action space. Incorporating techniques like epsilon-greedy policies can further enhance exploration by allowing occasional selection of non-greedy actions, preventing early convergence to suboptimal solutions. This thorough exploration helps the Monte Carlo approach converge to an optimal policy by adequately sampling diverse environmental dynamics .

The reward system signifies the student's preferences, motivating them to attend classes over staying in the hostel or being in the mess. The negative reward for the hostel (-1) discourages idleness or lack of productive activity, whereas a high reward for the Bharti Airtel block (+3) emphasizes academic engagement. A moderate reward for the mess (+1) reflects basic sustenance. During Policy Iteration, these reward values critically influence state evaluation, guiding the policy to favor transitions toward the Bharti Airtel block and mess, optimizing productivity and nutrition balance in the student's routine .

A quiver plot is chosen for visualization as it effectively represents the direction of optimal actions across multiple states in a grid. This allows viewers to quickly assess the recommended movements and understand the policy's strategy at a glance. Visualizing through quiver plots also helps identify patterns or unexpected behaviors in the policy that might require further investigation or validation. It bridges the computational outcomes with intuitive visual interpretation, facilitating communication of results .

The Monte Carlo method with Exploring Starts differs mainly in not relying on a model of the environment's dynamics. It uses repeated sampling to estimate the returns of states and uses these estimates to improve policies. It allows for randomness in policy exploration, starting episodes from random states and actions, ensuring diverse experiences. Value Iteration and Policy Iteration, however, rely on known transition and reward models to perform deterministic updates, systematically refining state values and policies .

Value Iteration computes the optimal values by iteratively updating state values based on future rewards, converging towards the optimal value function and policy. It provides a direct way to find the maximum expected reward by evaluating all possible actions at each state until the values stabilize. In contrast, Policy Iteration involves two steps: policy evaluation, which computes the value function under the current policy, and policy improvement, which updates the policy to select actions that maximize value. This cycle repeats until the policy is stable and optimal .

Policy iteration might converge faster in practice as it does not require the exhaustive value updates per iteration; instead, it focuses on policy stability. However, each policy evaluation step can be computationally expensive due to the requirement of solving linear systems. Value iteration, while typically requiring more iterations, performs simpler updates and is advantageous when dealing with larger state spaces as it incrementally improves values. Factors influencing choice include the size of the state space, available computational resources, and the trade-off between iteration speed and per-iteration complexity .

The introduction of one-way tunnels affects optimal policy computation by creating unique transition dynamics that need to be accommodated. These tunnels can create shortcuts or traps, which must be accurately modeled in the transition probabilities when performing Value Iteration. As the agent can suddenly relocate from one point to another via the tunnel, the value of states connected by the tunnel can change abruptly affecting the value update process. This unique feature influences path planning and requires careful consideration to accurately determine optimal states and actions .

You might also like