Definition
Artificial Intelligence is the science and engineering of making machines that can perform tasks that would require intelligence if done by humans — including reasoning, learning, planning, perception, and language understanding.
🎯 Goals of AI
Build systems that think or act either humanly (mimicking human cognition) or rationally (optimally, according to logical principles). These four orientations — think humanly, act humanly, think rationally, act rationally — define the spectrum of AI research.
🔬 Contributing Disciplines
AI draws from Mathematics (logic, probability), Philosophy (reasoning, ethics), Neuroscience (brain models), Psychology (cognition), Linguistics (language), Computer Science (algorithms), and Control Theory (feedback systems).
⚙️ Core Capabilities
Natural language processing, knowledge representation, automated reasoning, machine learning, computer vision, robotics, and planning are the principal capability areas that modern AI systems address.
📐 Turing Test
Proposed by Alan Turing in 1950, the Turing Test asks: can a machine converse so naturally that a human evaluator cannot distinguish it from a person? It remains a philosophical benchmark, though modern AI increasingly transcends it in narrow domains.
What is an Intelligent Agent?
An agent is anything that perceives its environment through sensors and acts upon it through actuators. Humans perceive via eyes, ears, and skin; act via hands and voice. Software agents perceive via data streams and act via API calls or file writes.
The Agent–Environment Cycle
Perception → Reasoning → Action → New State
World / Task
Percepts
Decision / Logic
Actions
(Updated)
Percept & Percept Sequence
A percept is the agent's current sensory input at any moment. The complete history of everything the agent has perceived is the percept sequence. An agent's behavior is a function from percept sequence to action.
Agent Function vs Agent Program
The agent function is the abstract mathematical mapping: percept sequence → action. The agent program is the concrete implementation running on hardware — the physical instantiation of the function.
Rational Agent
A rational agent selects actions that maximise expected performance given what it has perceived so far and what it knows about the world. Rationality is not the same as omniscience — it means doing the best possible with available information.
🏆 Performance Measure
An external standard that evaluates an agent's success. For a vacuum cleaner, it might be: amount of dirt cleaned per unit energy. It must be defined by the designer, not the agent itself.
📚 Prior Knowledge
What the agent knows about the environment before acting — domain knowledge built in at design time. This guides exploration and helps interpret percepts.
🔍 Rationality vs Omniscience
An omniscient agent knows outcomes in advance. A rational agent only maximises expected outcomes. Rationality is achievable; omniscience is not. Rational agents must also explore and learn.
| Concept | Description | Example |
|---|---|---|
| Omniscience | Knows the actual outcome of every action | Knowing a coin will land heads before flipping |
| Rationality | Maximises expected outcome given knowledge | Choosing the statistically best route, not the guaranteed best |
| Autonomy | Learning from percepts rather than relying solely on prior knowledge | A chess agent improving by playing games |
| Performance Measure | Objective criterion for evaluating agent success | Score, distance, time, cost, accuracy |
PEAS Framework
Every agent design starts with defining: Performance measure, Environment, Actuators, Sensors — the four dimensions that specify what the agent must do and in what context.
Environment Properties
Fully Observable vs Partially Observable
Fully observable: sensors give complete access to the environment state (e.g., chess board). Partially observable: some state is hidden (e.g., card games, real-world driving with limited sensor range).
Single Agent vs Multi-Agent
Single-agent: only one agent acts (e.g., puzzle solving). Multi-agent: multiple agents interact — can be competitive (chess, auctions) or cooperative (multi-robot coordination).
Deterministic vs Stochastic
Deterministic: the next state is fully determined by the current state and action (e.g., a maze). Stochastic: uncertainty exists in outcomes (e.g., weather forecasting, robotic manipulation).
Episodic vs Sequential
Episodic: each episode is independent; past actions do not affect future ones (e.g., image classification). Sequential: current decisions affect future situations (e.g., chess, driving).
Static vs Dynamic
Static: environment does not change while the agent deliberates (e.g., crossword). Dynamic: the environment can change during the agent's decision making (e.g., real-time trading, driving).
Discrete vs Continuous
Discrete: finite number of distinct states and actions (e.g., chess). Continuous: states and actions are real-valued (e.g., robot arm control, autonomous driving).
📋 Simple Reflex Agent
Acts only on the current percept, ignoring history. Uses condition–action rules: "If dirty → suck; if location A → move right." Works only in fully observable environments. Very limited — has no memory.
return action
🗺️ Model-Based Reflex Agent
Maintains an internal model of the world, updating its state based on percept history. Can handle partial observability by tracking what it can't currently sense. More robust than simple reflex.
🎯 Goal-Based Agent
Considers goal states and uses search and planning to find action sequences that lead to them. More flexible — can handle changing goals. Requires reasoning about the future, not just the present.
📊 Utility-Based Agent
Uses a utility function to assign numeric value to states, enabling tradeoffs between goals. Selects actions that maximise expected utility — can balance competing objectives like speed vs safety.
🤖 Learning Agent
A higher-order architecture that includes a performance element (the agent's acting component), a critic (evaluates performance against a standard), a learning element (modifies the performance element based on feedback), and a problem generator (suggests exploratory actions to improve future learning). Learning agents can start with minimal knowledge and improve over time.
Problem-Solving Agent
A goal-based agent that formulates a problem as a search task, finds a sequence of actions to reach the goal, and executes that plan. It deliberates before acting — suitable for deterministic, observable, discrete environments.
Five Components of a Problem
1. Initial State
The starting state of the agent. For a navigation problem, this is the agent's current city. For 8-puzzle, it's the scrambled tile arrangement.
2. Actions (Operators)
The set of actions available to the agent in any state. Formally a function: Actions(s) returns all actions applicable in state s.
3. Transition Model
Defines the result of applying an action: Result(s, a) = s'. Together with the initial state, this determines the state space.
4. Goal Test
A predicate that checks whether a given state is a goal state. Can be explicit (e.g., state == Bucharest) or implicit (e.g., no tiles out of place).
5. Path Cost
A numeric cost assigned to each path (sequence of actions). Enables the agent to find not just any solution, but an optimal one with minimum cost.
Solution & Optimality
A solution is an action sequence from initial to goal state. An optimal solution has the lowest path cost among all solutions.
Well-Known Toy Problems
| Problem | State Space | Operators | Goal |
|---|---|---|---|
| 8-Puzzle | 9!/2 = 181,440 states | Slide tile Up/Down/Left/Right | Tiles in order 1–8 |
| 8-Queens | 648 placements | Place queen on board | No two queens attack each other |
| Travelling Salesman | (n-1)!/2 tours | Visit next city | Minimum-cost complete tour |
| Route Finding | Map cities & roads | Drive from city to city | Reach destination city |
| Cryptarithmetic | Digit assignments | Assign digit to letter | Arithmetic equation holds |
Uninformed (Blind) Search Strategies
Breadth-First Search (BFS)
Expands shallowest unexpanded node. Complete and optimal (uniform cost). Time/Space: O(bd) — poor for large depths.
Depth-First Search (DFS)
Expands deepest node first. Not complete (infinite paths) or optimal. Space: O(bm) — memory-efficient but may go down infinite branches.
Uniform Cost Search
Expands node with lowest path cost g(n). Optimal for non-negative step costs. Equivalent to BFS when all costs are equal.
Iterative Deepening DFS
Combines DFS space efficiency with BFS completeness. Runs DFS with depth limit 0, 1, 2… until goal is found. Space: O(bd).
Bidirectional Search
Runs two simultaneous searches — one forward from start, one backward from goal — meeting in the middle. Reduces time to O(bd/2).
Depth-Limited Search
DFS with a maximum depth limit l. Incomplete if the goal is beyond depth l. Solves the infinite-path problem of DFS when depth bound is known.
Informed (Heuristic) Search
🌟 Greedy Best-First Search
Uses heuristic h(n) — estimated cost to goal — to expand the most promising node. Fast but not optimal or complete. Can get stuck in loops.
⭐ A* Search
Combines path cost and heuristic: evaluates nodes by f(n) = g(n) + h(n). With an admissible heuristic (never overestimates), A* is complete and optimal. The gold standard of heuristic search.
Problem Types
| Type | Characteristic | Example Technique |
|---|---|---|
| Single-state problem | Fully observable, deterministic | Standard search algorithms |
| Multiple-state problem | Partially observable, deterministic | Belief state search |
| Contingency problem | Partially observable, non-deterministic | AND-OR tree search |
| Exploration problem | Unknown state space | Online search, reinforcement learning |
| Constraint Satisfaction | Variables with domain constraints | Backtracking, arc consistency |
| Adversarial problem | Competing agent in environment | Minimax, Alpha-Beta pruning |
State Space
A state space is a graph where each node represents a possible world configuration and each directed edge represents applying an operator. Problem solving is path finding in this graph from the initial state to a goal state.
Formal Definition
A state space is a tuple (S, A, T, s₀, G) where: S = set of states, A = set of actions, T = transition function, s₀ = initial state, G = goal states. A solution is a path in this graph.
Search Tree vs Search Graph
A search tree expands nodes without tracking visited states (may revisit). A search graph (explored set) tracks visited nodes to avoid cycles — essential for loopy state spaces.
Search Algorithm Performance Metrics
Heuristic Properties
Admissibility
A heuristic is admissible if it never overestimates the true cost to the goal: h(n) ≤ h*(n). An admissible heuristic guarantees A* optimality. Example: straight-line distance in map navigation.
Consistency (Monotonicity)
A heuristic is consistent if for every node n and successor n': h(n) ≤ cost(n, n') + h(n'). Consistency implies admissibility and ensures A* never revisits nodes on the optimal path.
Local Search Methods
Hill Climbing
Moves to the best immediate neighbour; no backtracking. Fast but gets stuck in local maxima, plateaus, and ridges. Random restarts help escape local optima.
Simulated Annealing
Allows occasional "bad" moves with probability e−ΔE/T. Temperature T decreases over time (cooling schedule). Can escape local optima; convergence guaranteed under ideal schedule.
Genetic Algorithms
Population-based search using selection, crossover, and mutation operators inspired by natural evolution. Effective for complex optimisation with large, irregular search spaces.
What is a Production System?
A production system is a model of computation built around condition–action rules (productions). It is the foundation of expert systems and models human cognitive processes as described by Newell and Simon's work on problem solving.
📦 Production Memory
The rule base — a set of if–then rules. Each rule has a left-hand side (LHS) specifying conditions and a right-hand side (RHS) specifying actions to perform when conditions match.
THEN <action>
🗄️ Working Memory
The data store holding current world state, facts, and partial results. Rules fire when their LHS patterns match elements in working memory; actions modify working memory.
🔄 Inference Engine
The control mechanism that: (1) matches rule conditions to working memory (pattern matching), (2) selects which rule to fire (conflict resolution), and (3) executes the rule's action (act).
Recognize–Act Cycle
Current Facts
Find Matching Rules
Eligible Rules
Conflict Resolution
Characteristics of Production Systems
Modularity
Each production rule is independent. Adding, removing, or modifying one rule does not require changing others — making knowledge bases easier to maintain and extend.
Uniformity
All knowledge is represented in the same if–then format. This simplicity makes rule bases easy to inspect, debug, and explain — a key advantage for expert systems transparency.
Natural Knowledge Representation
Rules closely mirror how domain experts articulate knowledge: "If the patient has fever and cough, suspect flu." This makes knowledge acquisition from experts more intuitive.
Separability of Knowledge & Control
The rule base (domain knowledge) is cleanly separated from the inference engine (control strategy). The same engine can be used for different rule bases — enabling reuse.
Conflict Resolution Strategies
Forward vs Backward Chaining
→ Forward Chaining (Data-Driven)
Starts from known facts in working memory and fires rules whose conditions match, generating new facts until a goal is reached or no rules apply. Used in monitoring and alerting systems.
← Backward Chaining (Goal-Driven)
Starts from the goal and works backwards, identifying which rules could establish it, then verifying their conditions recursively. Used in diagnostic systems and Prolog-style logic programming.
Healthcare & Medicine
Medical imaging diagnosis, drug discovery, clinical decision support, patient outcome prediction, and robotic surgery assistance.
Autonomous Vehicles
Self-driving cars using computer vision, sensor fusion, path planning, and real-time decision making in complex traffic environments.
Natural Language Processing
Machine translation, sentiment analysis, chatbots, question answering, text summarisation, and large language models.
Game Playing
AlphaGo, AlphaZero, and OpenAI Five demonstrated superhuman performance in Go, Chess, Shogi, and Dota 2 through deep reinforcement learning.
Cybersecurity
Intrusion detection, malware classification, anomaly detection, network threat analysis, and automated incident response.
Finance & Trading
Algorithmic trading, credit scoring, fraud detection, portfolio optimisation, risk assessment, and robo-advisors.
Scientific Research
Protein structure prediction (AlphaFold), materials discovery, climate modelling, particle physics analysis, and genomics.
Recommendation Systems
Netflix, Spotify, Amazon, and YouTube use collaborative filtering and deep learning to personalise content at massive scale.
Robotics & Automation
Industrial robots, warehouse automation, surgical robots, agricultural drones, and service robots for delivery and care.
Creative AI
Image generation (DALL·E, Midjourney), music composition, video synthesis, style transfer, and AI-assisted design tools.
Education
Intelligent tutoring systems, adaptive learning platforms, automated grading, personalised curricula, and learning analytics.
Smart Cities & IoT
Traffic management, energy optimisation, predictive maintenance, air quality monitoring, and urban planning support.
AI Ethical Considerations
As AI systems become more powerful, challenges around bias & fairness, transparency & explainability, privacy, accountability, job displacement, and safety alignment are central concerns for researchers, policymakers, and society. Responsible AI development requires embedding these concerns from the earliest design stages.