Professional Documents
Culture Documents
AI-Practice Questions 3
AI-Practice Questions 3
Artificial Intelligence
Practice Questions
Date: 27/03/2023
Submission: 10:35 pm
Questions:
Section A
Intelligent Agents,
simple reflex agent, model-based reflex agent, goal-based agent, Utility-based agent, Learning agent
Section B
Please write in your own words and use Python as the primary programming language.
Also, use Object Oriented Programming if need be.
1. Implement a simple reflex agent that can turn on a light switch when a person enters a room.
1
2. Implement a model-based reflex agent that can turn on a light switch when a person enters a room
but also remembers the state of the light switch.
3. Implement a goal-based agent that can navigate a grid world to reach a goal location.
4. Implement a utility-based agent that can choose between two actions based on the expected utility of
each action.
5. Consider an environment in which an agent moves in a grid world. The agent can move up, down,
left, or right, and it receives a reward of -1 for each move. The agent receives a reward of +10 if it
reaches the goal state and a reward of -5 if it reaches the trap state. Write a Python implementation
of a simple reflex agent that chooses actions based only on the current percept.
6. Consider a vacuum cleaning robot that cleans a room. The robot can be in two states: clean and
dirty. The robot can perceive whether the room is clean or dirty and can take the following actions:
move left, move right, suck (if the current location is dirty), and do nothing. The robot has a
battery life of 10 moves before it needs to be recharged.
7. Write a Python implementation of a learning agent that can learn to play a game by trial and error.
Use the Q-learning algorithm and explain how it works.
8. Write a Python implementation of a utility-based agent that can make decisions based on a utility
function. Use the Expected Utility algorithm and explain how it works.