COMP 3200 - Intro to Artificial Intelligence - Lecture 02 - Agents, Actions, and Environments
Overview
David Churchill establishes the agent, action, state, policy, and environment definitions used throughout COMP 3200, showing how an agent maps observations to actions and how rationality depends on goals, available knowledge, and expected outcomes. He then explains how state-space size and environment properties, including observability, randomness, timing, and number of agents, shape which AI algorithms can solve a problem.
Key takeaways
- An agent function maps the observations available to an agent to an action, while a policy is commonly expressed as a mapping from the current state to an action.
- Some problems require observation history: estimating a falling person's trajectory or stealing League of Legends' Baron depends on past observations when velocity or current hit points are hidden.
- Rationality is defined relative to a performance measure and the agent's knowledge; it means selecting the best expected action, not knowing the outcome in advance.
- A performance measure must reflect the actual objective: minimizing distance alone can be inferior to minimizing delivery cost, as illustrated by UPS's reported $50 million annual savings from reducing left turns.
- State-space size alone does not establish strategic difficulty: Go has roughly 10^172 configurations, yet changing its capture rules can make the winner obvious.
- Environment properties such as observability, stochasticity, sequential effects, dynamics, and continuous actions constrain which AI algorithms are suitable.
Chapters
- David Churchill introduces the terminology that underpins later AI topics and assignments involving games.
- The lecture uses the classical AI meaning of an agent, not the recent term for agentic large language models.
- The definitions recur throughout the course, so the slides serve as a reference for assignments and exams.
- An agent is the entity in an environment that makes decisions and takes actions toward a goal.
- For a robot vacuum, the house is the environment and keeping it clean is a possible goal; Boston Dynamics' Spot is another physical-agent example.
- In chess, the agent is the player, not an individual queen, king, or pawn; in a Mario game it could be Mario or an NPC dragon.
- The cart in the pole-balancing problem acts to keep the pole upright, illustrating an agent in a compact physics simulation.
- An agent observes an environment, chooses an action, changes the environment's state, and repeats the cycle.
- In the classroom fire example, a person observes exits and crowding before choosing a route to escape.
- Physical agents use sensors such as cameras, laser range finders, or sonar, and actuators such as wheels or arms.
- Software agents may read simulation data directly, such as game RAM, while still treating that information as observations; computer decisions proceed in discrete time steps.
- A percept is an instantaneous input from an agent's sensors, while a state is a snapshot of the environment at a particular time.
- A percept sequence records the complete observation history available to an agent over its time in the problem.
- An agent function maps a percept sequence to an action; in course problems, the current fully observable state will often be sufficient.
- Chess illustrates a state-based problem: the board position generally contains what is needed to select a move, without replaying every earlier move.
- A single image of a person in the air does not reveal their velocity, starting point, or whether they are moving upward or downward, all potentially important to placing a rescue trampoline.
- Physical knowledge such as gravity helps predict a fall, but earlier observations can still be needed to estimate the person's trajectory.
- In League of Legends, stealing the Baron objective requires estimating its remaining health from prior damage, player levels, and items when the current hit points are hidden.
- These examples contrast with chess, where the current board state is generally enough to determine the best next move.
- An action in a state produces a next state through a state-transition function, written as STF(S, A) = S′ or S(t+1).
- A two-state example uses two actions: action 1 keeps the environment in its current state, while action 0 switches to the other state.
- In Connect Four, placing a yellow piece in a column changes the board state; the physical fall of the piece can be abstracted away.
- In Super Mario World, a button press affects the next frame; at 60 frames per second, the simulation advances through about 60 states each second.
- A policy, denoted π, maps a state to an action; an optimal policy is written π*.
- A policy can be implemented as a lookup table, if-statements, a flowchart, or a neural network.
- Blackjack's basic strategy is presented as an optimal policy based on the player's cards and the dealer's visible card.
- A pathfinding policy can assign a direction to each grid state, with multiple arrows where several moves are equally close to a goal.
- A rational agent selects the action that best advances its goal according to a defined performance measure.
- Performance measures may be maximized, such as Flappy Bird distance traveled, or minimized, such as route distance or cost.
- Pole-balancing performance can be measured by survival time, while chess and StarCraft may need intermediate measures because winning can take many actions.
- Chess piece values, such as pawn 1, bishop 3, rook 5, and queen 9, can guide choices but may mislead when they conflict with checkmate.
- Churchill cites UPS route optimization as an example of optimizing the real objective: fewer left turns reportedly saved about $50 million annually.
- Expected value is the sum of each possible outcome's numerical value multiplied by its probability.
- A fair six-sided die has an expected roll of 3.5 because each result from 1 to 6 has probability 1/6.
- A bet paying $1,000 on a roll of 5 or 6 has a one-third chance of winning, so repeated outcomes matter more than a single lucky or unlucky roll.
- Decision quality should be judged by expected outcome rather than the result of one event, a distinction Churchill applies to sports decisions such as low-probability Hail Mary plays.
- An omniscient agent knows the exact outcomes of random events and the complete environment state, unlike a rational agent.
- A rational agent chooses well using its performance measure, prior knowledge, available actions, and percept history, but cannot know what a die roll will actually produce.
- A task environment defines the problem, such as the classroom for an escape task or the board and pieces for chess.
- Environment specifications determine which algorithms are appropriate, making problem definition a prerequisite to agent design.
- The state space is the set of possible environment configurations; the action space is the set of actions available from a state, often summarized by an average or worst case.
- Tic-tac-toe has at most 3^9, or roughly 10,000, board configurations because each of nine squares can be X, O, or blank.
- Chess has an estimated state space around 10^43, while Go's 19-by-19 board has 3^361, approximately 10^172, possible configurations.
- A large state space signals that exhaustive enumeration may be infeasible, but the rules also determine whether a game is strategically complex.
- Game-tree complexity counts action sequences, not just distinct states; different move orders can reach the same board position.
- The number of possible sequences can far exceed the number of states, making exhaustive search impractical for games such as Go.
- Churchill compares Go's enormous game tree with scales from the age of the universe to the number of atoms in the universe to convey its size.
- Removing captures from Go leaves a similarly large configuration space but makes the first player win simply by having one more piece, showing why rules matter.
- Observability distinguishes fully observable environments, such as chess, from partially observable ones, such as poker or StarCraft with unseen enemy units.
- Deterministic environments produce a fixed next state from a state and action; stochastic environments introduce uncertainty through events such as dice rolls or card draws.
- Episodic tasks, such as recognizing handwritten digits, are independent across instances, while sequential tasks such as chess have actions with long-term consequences.
- Dynamic environments can change while an agent decides, as in StarCraft; static turn-based chess waits for the player's move.
- Discrete problems use distinct states or actions, while continuous robotics tasks may allow a range of forces, angles, and times.
- Single-agent versus multi-agent distinguishes pathfinding from settings where another player's actions must be anticipated.
- Complete information means the rules and possible actions are known; an agent may still lack information even if it can observe the entire board.
- A crossword puzzle is presented as a comparatively easy combination: single-agent, deterministic, fully observable, static, and discrete.
- Adding opponents, randomness, hidden information, dynamics, and continuous actions leads from chess-like settings toward backgammon, poker, StarCraft, and physical soccer robots.
- Likely exam tasks include classifying an environment's properties and estimating a game's state or action space.
Transcript excerpt
0:01 So, lecture number two. Um, today we're going to be talking about really laying the foundations for the rest of the course with a bunch of definitions and terminology and stuff like that. And we're going to be talking about agents, actions, and environments. And these are not the agents that have become popular recently in terms of agentic LLMs and all that stuff. These are an older um definition of agents. So just a quick note um for this class and pretty much this class only this is going to be a really dense lecture with a lot of definitions a lot of terminology and so I just ask for this class unless there's unless you think I've made like a grave mistake and you need to make a correction um just try and save the questions for the end of this lecture because it's very likely that if you do have a question it's going to be answered on like the next slide and there's about an hour and five to an
0:49 hour and 10 minutes of straight lecture material here. um that I just want to to get through. And don't worry if you don't understand everything. It's it's pretty intuitive stuff, but if you don't understand it all at once, obviously the lecture slides are available there for you and you can go have a look at them later. And we'll be talking about all of these concepts and stuff throughout the course. And so, um we'll be very familiar with them by the time we uh we get about halfway through the course. And of course, use the slides as a as a reference going forward to study for exams, for the assignments, and stuff like that. So first of all um what is an agent? So
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Dave Churchill.