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.
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.
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-like | Rational (ideal) | |
|---|---|---|
| Thinking | Thinking humanly: model the actual human mind | Thinking rationally: reason with perfect logic |
| Acting | Acting 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.
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 traffic-light-following agent, written as plain logic:
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.
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.
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.
Choose an agent to see the four parts of its task description.
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.
| Property | Meaning | Easy example | Hard example |
|---|---|---|---|
| Fully vs partially observable | Can the agent see the whole state at once? | Chess, full board visible | Poker, hidden cards |
| Deterministic vs stochastic | Does the same action always give the same result? | A knight always moves in an L | Rolling dice, traffic |
| Episodic vs sequential | Do past actions affect the future? | Sorting items one by one | Chess, each move shapes the rest |
| Static vs dynamic | Does the world change while the agent thinks? | A crossword puzzle | A real-time video game |
| Discrete vs continuous | Are states and actions countable, or smooth? | Traffic lights: red, amber, green | Steering angle of a car |
| Single vs multi-agent | Are there other agents in the world? | Solving a maze alone | Chess, 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.
Run a taxi driving through a city against all six properties:
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:
- Formulate the goal. Decide what success looks like, for example "be in Bucharest."
- Formulate the problem. Decide which states and actions to consider, for example "cities and the roads between them."
- Search. Explore possible action sequences in imagination, building up a plan.
- 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 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.
| Component | What it is |
|---|---|
| 1. State space | The set of all possible configurations the world can be in |
| 2. Initial state | Where the agent starts |
| 3. Actions | What the agent can do in a given state |
| 4. Transition model | The result of doing an action in a state: the new state it leads to |
| 5. Goal test | A check for whether a state counts as a goal |
| 6. Action cost | How expensive each action is, used to compare plans |
The sliding tile puzzle, written formally:
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.
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.
Total states = positions × 2 to the power of food × ghosts squared × 4 directions.
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.
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.
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.
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.
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.
