1. What is Artificial Intelligence?
AI is the science of creating systems that perform tasks requiring human-like intelligence: reasoning, learning, perception, language understanding, and planning. The field began at the 1956 Dartmouth workshop and has cycled through "AI summers" and "winters" as expectations met reality.
Today, AI spans symbolic reasoning, statistical machine learning, robotics, and large language models. Understanding classical AI foundations helps you reason about modern systems.
2. Intelligent Agents
An agent perceives its environment through sensors and acts through actuators to maximize a performance measure. The PEAS framework describes:
- Performance — goal metric (e.g., passenger safety)
- Environment — taxi world, chess board, web
- Actuators — steering, moves, HTTP requests
- Sensors — cameras, GPS, user input
Agent types: simple reflex, model-based, goal-based, utility-based, and learning agents.
3. Uninformed & Informed Search
Many AI problems are formulated as graph search: find a path from start to goal.
- BFS — complete, optimal for unit costs, memory-heavy
- DFS — low memory, not optimal
- A* — uses heuristic \(h(n)\); optimal if \(h\) is admissible
where \(g(n)\) is cost from start and \(h(n)\) estimates cost to goal.
import heapq
def astar(start, goal, neighbors, heuristic):
frontier = [(heuristic(start), 0, start)]
came_from = {start: None}
g_score = {start: 0}
while frontier:
_, g, current = heapq.heappop(frontier)
if current == goal:
return reconstruct_path(came_from, current)
for nxt, cost in neighbors(current):
tentative = g + cost
if nxt not in g_score or tentative < g_score[nxt]:
g_score[nxt] = tentative
f = tentative + heuristic(nxt)
heapq.heappush(frontier, (f, tentative, nxt))
came_from[nxt] = current
return None
4. Propositional & First-Order Logic
Logic-based AI represents knowledge with symbols and inference rules. Propositional logic uses atomic sentences (P, Q) combined with AND, OR, NOT, IMPLIES. First-order logic adds quantifiers (∀, ∃), predicates, and objects for richer representations.
Modus ponens: from \(P \rightarrow Q\) and \(P\), infer \(Q\). Forward chaining applies rules until no new facts; backward chaining works from goals.
5. Expert Systems
Expert systems encode domain knowledge as IF-THEN rules. Components: knowledge base, inference engine, explanation facility. MYCIN (medical diagnosis) and early commercial systems demonstrated value before statistical ML dominated.
Modern systems combine symbolic rules with learned models — see AI Advanced for neuro-symbolic approaches.