AI Course · Week 1

What is Artificial Intelligence?

The foundations of the whole course: intelligent agents, the environments they live in, and how almost every AI problem quietly turns into a search problem.

By Arj AI Foundations Est. reading time: 18 minutes

Artificial intelligence sounds like it should be about robots and science fiction. For this course, it is something much more concrete and much more useful: getting a machine to make good decisions. This first page builds the vocabulary the entire rest of the course stands on, so read it slowly. If you understand agents, environments, and the search problem here, every later topic will feel like a variation on ideas you already know.

1

What AI actually is

Before we can build anything, we need to agree on what we are even trying to make. This matters because the word "intelligence" means different things to different people, and your exam will expect the precise version, not the sci-fi one.

A useful working definition: artificial intelligence is the study of building agents that act to achieve their goals. An agent is anything that takes in information about the world and does something in response. The clever part is not thinking like a human, it is choosing good actions.

The four schools of AI

Historically, researchers split along two questions. Should a machine copy how humans do it, or just get the right answer? And should we care about thinking, or only about acting? Cross those two questions and you get four views.

 Human-likeRational (ideal)
ThinkingThinking humanly: model the actual human mindThinking rationally: reason with perfect logic
ActingActing humanly: pass as human (the Turing test)Acting rationally: take the best action to reach a goal

This course lives almost entirely in the bottom-right box: acting rationally. We do not care whether the machine "really thinks." We care that it picks the action most likely to achieve its goal. That single idea is the thread running through search, games, learning, and everything else you will study.

Narrow AI vs general AI

Almost every AI that exists today is narrow: it does one kind of task well, like recommending videos, recognising faces, or playing chess. The general, human-level machine of the movies, one system that can do anything, is general AI, and it does not exist yet. When this course says "AI," it always means narrow, task-specific systems.

Quick intuition
A calculator is not AI, even though it does maths faster than you. AI is about choosing actions when the right choice is not obvious and there are many possibilities to weigh. Hold on to that: choosing among many possibilities is exactly what search does.
2

Agents and the agent function

Everything in AI is framed around an agent, so this is the most important word on the page. Get comfortable with it now and the rest of the course reuses it constantly.

An agent is anything that perceives its environment through sensors and acts on that environment through actuators. That is the whole definition, and it fits humans, robots, and pure software alike.

  • Human: eyes and ears are sensors, hands and legs are actuators.
  • Robot: cameras and range-finders are sensors, motors and wheels are actuators.
  • Software agent: a stream of data is its sensor, writing to a screen or a file is its actuator.

The agent function and the agent program

The agent function is the abstract rule that maps what the agent has perceived so far to the action it takes next. Think of it as a giant lookup table: this percept leads to that action. The agent program is the actual code that implements that function on a real machine. The function is the idea, the program is the implementation.

A tiny agent program

A traffic-light-following agent, written as plain logic:

percept "red light" action stop percept "green light" action go percept "obstacle" action turn

It is trivial, but it is a real agent function: every percept has a chosen action. Real agents just have far larger, cleverer versions of this mapping.

See it move

An agent never acts once and stops. It runs a loop: perceive the environment, decide, act, and the changed environment feeds the next perception. Press play and watch a single percept-then-act cycle travel around the loop.

Interactive The perceive-act loop

The environment sends a percept to the agent's sensors, the agent decides, then acts back on the environment through its actuators. Then it repeats.

Ready. Press play to run one full cycle.
Notice the agent never touches the world directly. It only ever sees percepts and sends actions.
3

PEAS: defining the problem

Before you can design any agent, you have to describe the task precisely. Skipping this step is the most common mistake in exams and in real projects, because a vague task leads to a vague, useless agent. AI has a standard four-part checklist for this, called PEAS.

  • P, Performance measure: how do we score success? What actually counts as good behaviour?
  • E, Environment: where does the agent operate, and what is in that world?
  • A, Actuators: what can the agent do to change the world?
  • S, Sensors: what can the agent perceive?

Write these four down and you have turned a fuzzy idea ("make a self-driving car") into a concrete engineering brief. Try it with the builder below: pick an agent and watch its PEAS description fill in.

Interactive PEAS builder

Choose an agent to see the four parts of its task description.

Performance
Environment
Actuators
Sensors
In an exam, a full PEAS description is often worth easy marks. Always give all four parts.
Exam technique
If a question says "describe the task environment," it is asking for PEAS. List all four parts with two or three concrete items each. Do not just define the words, apply them to the specific agent in the question.
4

Types of environment

Not all worlds are equally hard. The kind of environment an agent faces decides which techniques will work, so examiners love to test whether you can classify one. There are six standard properties, each a pair of opposites.

PropertyMeaningEasy exampleHard example
Fully vs partially observableCan the agent see the whole state at once?Chess, full board visiblePoker, hidden cards
Deterministic vs stochasticDoes the same action always give the same result?A knight always moves in an LRolling dice, traffic
Episodic vs sequentialDo past actions affect the future?Sorting items one by oneChess, each move shapes the rest
Static vs dynamicDoes the world change while the agent thinks?A crossword puzzleA real-time video game
Discrete vs continuousAre states and actions countable, or smooth?Traffic lights: red, amber, greenSteering angle of a car
Single vs multi-agentAre there other agents in the world?Solving a maze aloneChess, or drivers on a road

The harder end of each pair (partially observable, stochastic, sequential, dynamic, continuous, multi-agent) makes life difficult for an agent. The real world sits at the hard end of nearly all six, which is exactly why real-world AI is so challenging.

Worked example: classify a self-driving car

Run a taxi driving through a city against all six properties:

Observable partially (cannot see around corners) Determinism stochastic (other drivers, weather) Episodic? sequential (this turn affects the route) Static? dynamic (the world moves as you think) Discrete? continuous (speed, position, steering) Agents multi-agent (many other road users)
Hard on all six, the toughest class of environment
5

Problem-solving agents

Now we connect agents to the rest of the course. A special, very common kind of agent decides what to do by thinking ahead: it imagines sequences of actions before committing to any of them. This is a problem-solving agent, and its method is search.

It follows four steps, in order:

  1. Formulate the goal. Decide what success looks like, for example "be in Bucharest."
  2. Formulate the problem. Decide which states and actions to consider, for example "cities and the roads between them."
  3. Search. Explore possible action sequences in imagination, building up a plan.
  4. Execute. Carry out the plan in the real world.

Step 3 is where the whole next month of the course lives. Every search algorithm you will meet, uninformed, informed, adversarial, local, is just a different strategy for that one step.

The assumptions behind basic search
Classic search quietly assumes the world is static, observable, discrete, and deterministic. The real world often breaks these, but the assumptions make the problem solvable and the ideas still transfer. Keep them in mind, you will see later topics relax them one by one.
6

The formal search problem

To let a computer search, we have to define the problem in a precise, standard form. Memorise these six components, because every single search problem in this course, and every exam question, is described with them.

ComponentWhat it is
1. State spaceThe set of all possible configurations the world can be in
2. Initial stateWhere the agent starts
3. ActionsWhat the agent can do in a given state
4. Transition modelThe result of doing an action in a state: the new state it leads to
5. Goal testA check for whether a state counts as a goal
6. Action costHow expensive each action is, used to compare plans
Worked example: the 8-puzzle

The sliding tile puzzle, written formally:

State space all arrangements of 8 tiles + 1 blank Initial the scrambled board you are given Actions slide the blank up, down, left, or right Transition the blank swaps with the tile it moves into Goal test tiles are in order 1..8 with blank last Cost 1 per move
Six components, one fully defined problem a computer can search

Try the same exercise with travelling between cities: the state space is the set of cities, the initial state is your start city, actions are drives to neighbouring cities, the transition puts you in that city, the goal test asks if you have arrived, and the cost is the distance. Same six slots, a completely different problem.

7

Why search is hard

If a computer is so fast, why not just try every possibility? Because the number of possibilities explodes. This is the single most important reason AI needs clever algorithms rather than brute force, so it is worth feeling it for yourself.

The classic example is a Pacman-style world. Count the states: the agent can be in many positions, each piece of food is either eaten or not, ghosts have positions, and the agent faces a direction. These choices multiply together, and the "eaten or not" food term grows as a power of two, which gets huge fast. Drag the sliders and watch the total.

Interactive State-space explosion

Total states = positions × 2 to the power of food × ghosts squared × 4 directions.

120
30
12
Total states to search
0
The food slider dominates everything, because it grows as a power of two. This is why listing every state is hopeless.
The takeaway
A tiny game can have more states than there are seconds in the age of the universe. Search algorithms exist precisely so we never have to look at all of them. That is the problem the next few weeks solve.
8

State graphs vs search trees

One last distinction, because students mix these up constantly and exams love to catch it. A state graph and a search tree are not the same thing.

  • State graph: one node per real state, edges for legal moves. Each state appears exactly once. It is the true map of the problem, usually far too large to draw.
  • Search tree: nodes are paths, not states. The same state can appear many times, once for each different way of reaching it. The tree is built as the search runs, and it can be infinite even when the graph is finite, because of cycles.
The one sentence to remember
A state is a place you can be. A node in the search tree is a story of how you got there. Being in Bucharest is one state, but there are many paths that reach it, so it appears many times in the tree.
9

Key points and practice

If you take nothing else from this page, take these:

  • AI in this course means acting rationally: choosing the action most likely to reach a goal.
  • An agent perceives through sensors and acts through actuators.
  • PEAS defines any task: Performance, Environment, Actuators, Sensors.
  • Environments are classified on six properties, and the real world sits at the hard end of all of them.
  • A problem-solving agent thinks ahead using search, defined by six components.
  • Search is hard because the state space explodes, which is why we need smart algorithms.
4 marks
Q1. Define an agent and give the PEAS description of an automatic vacuum cleaner.
Model answer

An agent is anything that perceives its environment through sensors and acts on it through actuators. For a vacuum cleaner: Performance, amount of dirt cleaned, area covered, battery used; Environment, the rooms and floor surfaces of a home; Actuators, wheels and suction motor; Sensors, dirt sensor, bump sensor, and cliff sensor.

3 marks
Q2. Classify the environment of a chess-playing program against three properties, with reasons.
Model answer

Fully observable, because the whole board is visible. Deterministic, because a move always has the same result. Multi-agent and sequential, because an opponent also acts and each move affects the rest of the game.

5 marks
Q3. List the six components of a formal search problem and apply them to travelling from one city to another.
Model answer

State space: all cities. Initial state: the start city. Actions: drive to a neighbouring city. Transition model: you are now in that city. Goal test: are you in the destination city? Action cost: the road distance. All six together define a problem a computer can search.

Ready for the first real algorithm?
You now have the vocabulary. Next, we put it to work and explore a search space blindly with uninformed search: BFS, DFS, and friends.
Uninformed search
Scroll to Top