Computer Science & Applications (Paper 2) (Code 87) · Unit 10 of 10

Artificial Intelligence

कृत्रिम बुद्धिमत्ता

Unit overview: the topics below, with their summaries, are the syllabus for this unit. The comprehensive note further down covers every topic in full — explanations, definitions, worked examples, tables, exam points and practice questions — and the short revision note after it is only a quick recap. Standalone one-topic learning pages are not built yet — every topic on this page is covered in the notes and the practice questions below, and each topic card links to those sections.

Premium chapters for this unit

AI search & knowledge representation → premium chapter · free preview · ~26 min · 4 practice questions

Machine learning basics → premium chapter · free preview · ~26 min · 4 practice questions

NLP & expert systems → premium chapter · free preview · ~24 min · 4 practice questions

Topics checklist — with weightage (platform estimate from past-question frequency, not an NTA guarantee)

AI search & knowledge representation

High weightage

BFS/DFS/A*, heuristics, logic, semantic nets.

Machine learning basics

High weightage

Supervised vs unsupervised, overfitting, neural nets intro.

NLP & expert systems

Medium

Parsing, knowledge-based systems, fuzzy logic.

Comprehensive unit note · ~23 min read

Artificial intelligence is the study of how to make machines do things that, done by people, would be said to require intelligence: solving problems, reasoning, learning from experience, understanding language, and acting sensibly under uncertainty. The field is broad because intelligence itself is broad, so this unit is organised around four questions. How does an agent search for a solution when the space of possibilities is large? How can knowledge be represented so that a machine can reason with it? How can a machine learn from data instead of being told every rule? And how can it understand human language and apply expert knowledge to real problems? Each question has its own methods, and exam questions test whether you can choose the right method for a given situation, not just recite definitions. Search comes first because it is the most general problem-solving tool. A problem is defined by states, actions, a start state, a goal test, and a cost for each step. An agent searches by expanding states in some order until it reaches a goal. Uninformed search uses no knowledge about how close a state is to the goal; informed search uses a heuristic, an estimate of the remaining cost, to guide the search toward promising states. Game playing adds an opponent, so search must assume the opponent will choose the worst move for the agent. Knowledge representation comes next: logic gives precise rules for deduction, while semantic networks, frames, and scripts organise knowledge in structures closer to how people describe the world. Neither is sufficient alone, and real systems combine them. Learning changes the picture: instead of programming rules by hand, the system adjusts its own parameters from examples. Supervised learning predicts labels from labelled examples, unsupervised learning finds structure in unlabelled data, and neural networks learn layered representations through training. Language and expert systems then show intelligence applied: natural language processing must cope with ambiguity at every level, from words to sentences to meaning, while an expert system captures the knowledge of a human specialist in a form an inference engine can apply to new cases. Keep asking, for each method, what it assumes, what it costs, and where it fails.

Learning objectives

  • Formulate a problem as states, actions, and costs, and compare BFS, DFS, uniform-cost search, greedy search, and A* search.
  • Apply minimax and alpha-beta pruning to small game trees and explain why pruning is safe.
  • Represent knowledge in propositional logic, first-order logic, semantic networks, frames, and scripts, and explain resolution.
  • Explain Bayesian reasoning and fuzzy logic for reasoning under uncertainty.
  • Compare supervised and unsupervised learning, including decision trees, kNN, SVM intuition, k-means, and hierarchical clustering.
  • Diagnose overfitting and underfitting using bias, variance, and train, validation, and test performance, and compute precision, recall, and F1.
  • Explain perceptrons, multilayer networks, backpropagation, and activation functions, and describe NLP processing and expert-system architecture.

Overview: Agents, Problems, and Intelligence

An intelligent agent perceives its environment through sensors, chooses actions through a program, and acts through actuators. A thermostat, a chess program, and a self-driving car are all agents in this broad sense, differing in how complex their environment is. Environments can be fully or partially observable, deterministic or stochastic, static or dynamic, discrete or continuous, and single-agent or multi-agent. A problem is well defined when you can state the initial state, the actions available in each state, the transition model that says what each action does, the goal test, and the path cost. Search then becomes the process of generating a sequence of actions from the initial state to a goal state. The distinction between a solution and an optimal solution matters throughout: a solution is any path to a goal, while an optimal solution has the lowest total cost. Algorithms are judged by completeness, whether they are guaranteed to find a solution if one exists; optimality, whether they find the lowest-cost solution; time complexity, how long they take as the problem grows; and space complexity, how much memory they need. These four criteria, not vague claims of cleverness, are how you compare search methods in an exam.

AI search & knowledge representation

Uninformed search uses no estimate of distance to the goal. Breadth-first search expands nodes level by level, using a queue. It is complete and optimal when every step costs the same, but its space requirement grows exponentially with depth, which is its main weakness. Depth-first search expands the deepest node first, using a stack or recursion. It needs far less memory, but it is not complete in infinite spaces and not optimal, because it may return the first solution it finds rather than the cheapest. Depth-limited search caps the depth to avoid infinite descent, and iterative deepening repeats depth-limited search with increasing limits, combining the memory advantage of depth-first search with the completeness and optimality of breadth-first search for uniform costs. Uniform-cost search expands the node with the lowest path cost so far, using a priority queue; it is complete and optimal provided step costs are positive, and it is the search analogue of Dijkstra algorithm.

Informed search adds a heuristic function h(n), an estimate of the cost from node n to the nearest goal. Greedy best-first search expands the node with the lowest h(n), which can be very fast when the heuristic points the right way but is neither complete in general nor optimal, because it ignores the cost already paid. A* search expands the node with the lowest f(n) = g(n) + h(n), where g(n) is the cost from the start to n. If h(n) never overestimates the true remaining cost, the heuristic is admissible, and A* is optimal. If h is also consistent, meaning the estimated cost from a node is no greater than the step cost plus the estimate from the successor, then A* never needs to reopen a node. The quality of the heuristic decides everything: a heuristic of zero reduces A* to uniform-cost search, while a perfect heuristic goes straight to the goal.

Game playing uses minimax: the maximising player chooses the move with the highest value, the minimising opponent chooses the lowest, and leaf nodes are scored by an evaluation function when the game tree is too large to search to the end. Alpha-beta pruning speeds up minimax without changing its result. Alpha is the best value the maximiser can guarantee so far, beta is the best value the minimiser can guarantee so far, and a branch is pruned when it cannot improve on those bounds: if a minimising node already offers the maximiser less than alpha, the maximiser will never choose that branch, and symmetrically for beta. Pruning is safe precisely because the pruned branches could not affect the final choice at the root. With good move ordering, alpha-beta can roughly double the searchable depth in the same time.

Knowledge representation asks how facts and rules are stored so reasoning is possible. Propositional logic deals with whole statements that are true or false, combined with AND, OR, NOT, and implication. It is simple and decidable, but it cannot express general statements about all objects without listing every case. First-order logic adds objects, predicates, variables, and quantifiers: for all and there exists. A statement such as every student is a person becomes a quantified formula rather than a long list. Inference in first-order logic often uses resolution: convert statements to clause form, negate the goal, and repeatedly resolve pairs of clauses that contain complementary literals, deriving a contradiction if the goal follows. Unification finds substitutions that make two expressions identical, which is what lets a general rule apply to a specific case. Semantic networks represent knowledge as a graph of nodes for concepts and labelled arcs for relations such as is-a and has-part; inheritance lets a specific concept inherit properties of a general one, so a fact about birds applies to sparrows unless overridden. Frames are structured records with slots and default values, useful for stereotyped situations such as a classroom or a restaurant visit; a frame for a lecture might have slots for teacher, subject, room, and time. Scripts are frame-like structures for sequences of events, describing the expected scenes, roles, and props in a familiar activity such as visiting a restaurant, from entering to paying. Logic is precise but can be awkward for default and procedural knowledge; networks, frames, and scripts are intuitive but need care to keep their semantics precise. Reasoning under uncertainty extends all of this: Bayesian reasoning updates beliefs with evidence using probabilities, so a prior belief combined with a likelihood gives a posterior belief, and Bayes networks represent conditional dependencies between variables. Fuzzy logic replaces sharp true or false membership with degrees of membership, so a person can be tall to degree 0.8 rather than simply tall or not tall, which suits vague concepts such as hot, fast, or large.

Machine learning basics

Machine learning learns a mapping from inputs to outputs from data, rather than from hand-written rules. In supervised learning, each training example carries the correct answer. Regression predicts a continuous value, such as a price or a temperature; classification predicts a discrete label, such as spam or not spam. A decision tree splits data by asking, at each node, the question that best separates the classes, usually judged by information gain or impurity reduction; it is easy to interpret but can overfit if grown too deep, and pruning or depth limits control this. The k-nearest neighbours method classifies a new point by the majority label of its k closest training points under some distance measure; it needs no training phase beyond storing the data, but it is sensitive to irrelevant features, to the choice of k, and to feature scaling, and it can be slow at prediction time. A support vector machine finds the hyperplane that separates classes with the largest margin, the gap between the boundary and the nearest training points, called support vectors; the kernel trick lets it handle non-linear boundaries by implicitly mapping data into a higher-dimensional space. In unsupervised learning, no labels are given. Clustering groups similar points together. K-means chooses k initial centres, assigns each point to the nearest centre, recomputes each centre as the mean of its points, and repeats until stable; it is simple and fast but needs k in advance, is sensitive to initial centres and outliers, and assumes roughly spherical clusters. Hierarchical clustering builds a tree of clusters, either by merging the closest clusters bottom-up or splitting top-down, and the resulting dendrogram can be cut at any level to choose the number of clusters.

Generalisation is the central problem: a model must perform on new data, not just on data it has seen. Overfitting means the model has memorised noise and detail in the training data, so training accuracy is high but test accuracy is low. Underfitting means the model is too simple to capture the pattern, so both training and test accuracy are low. The bias-variance view explains the trade-off: bias is error from wrong assumptions that make the model too rigid, variance is error from sensitivity to the particular training sample, and total error combines bias, variance, and irreducible noise. Simple models have high bias and low variance; complex models have low bias and high variance; the best model balances the two. Data is therefore split into a training set for fitting, a validation set for choosing settings such as depth or k, and a test set, used once, for an honest final estimate. Cross-validation repeats the split to reduce the luck of any single split. Evaluation needs more than accuracy when classes are imbalanced. Precision is the fraction of predicted positives that are truly positive; recall is the fraction of true positives that were found; F1 is their harmonic mean, which punishes a model that is good on one and poor on the other. A confusion matrix of true positives, false positives, true negatives, and false negatives is the source of all four measures.

Neural networks build learning from simple units. A perceptron takes weighted inputs, sums them, adds a bias, and passes the result through an activation function to produce an output; it can learn only linearly separable problems, which is a famous limitation that a single layer cannot overcome. A multilayer perceptron stacks layers: an input layer, one or more hidden layers, and an output layer, so hidden units can learn intermediate features and the network can represent non-linear mappings. Activation functions decide the non-linearity: the sigmoid squashes values between 0 and 1 but can saturate and slow learning, the hyperbolic tangent squashes between minus 1 and 1, and ReLU outputs the input if positive and zero otherwise, which is simple and widely used but can leave units permanently inactive, the dying ReLU problem. Training uses backpropagation: a forward pass computes predictions, a loss function measures error, and gradients are propagated backwards through the network by the chain rule, telling each weight how much it contributed to the error; gradient descent then adjusts each weight slightly against its gradient, with the learning rate controlling the step size. Too large a learning rate overshoots, too small learns slowly. Deep learning simply means networks with many layers, which can learn hierarchical features from raw data, at the cost of needing large datasets and heavy computation.

NLP & expert systems

Natural language processing must turn strings of characters into meaning, and ambiguity appears at every level. Tokenisation splits text into tokens, usually words and punctuation; it is not trivial, because punctuation, contractions, and multi-word names need rules or learned models. Normalisation may lower-case text and remove stop words, and stemming chops words to a root form, so running and runs both become run, while lemmatisation maps words to their dictionary form using vocabulary knowledge, so better becomes good. Morphological analysis handles prefixes, suffixes, and inflections. Syntactic analysis, or parsing, assigns grammatical structure: a sentence is broken into phrases such as noun phrases and verb phrases according to a grammar, and a parse tree shows that structure. Semantic analysis then assigns meaning, resolving word senses: bank can mean a river edge or a financial institution, and only context decides. Pragmatic analysis considers the speaker intent and context beyond the sentence itself. Ambiguity is therefore classified as lexical, when a word has several meanings; syntactic, when a sentence has several parse trees, as in a sentence about seeing a person with a telescope; semantic, when scope or reference is unclear; and pragmatic, when the intended speech act is unclear. Classical NLP used rules and grammars; statistical and neural methods learn patterns from large text collections, and modern language models predict and generate text from context, but the underlying pipeline of tokenise, analyse, and interpret remains the right way to think about exam questions on NLP stages.

An expert system captures the knowledge of a human specialist for a narrow domain and applies it to new cases. Its architecture has four main parts. The knowledge base stores facts and rules, often as if-then rules elicited from the expert. The inference engine applies those rules to the facts of a case, by forward chaining from facts toward conclusions, or by backward chaining from a hypothesised goal back to the facts needed to support it. Working memory holds the facts of the current case and intermediate conclusions. The explanation facility justifies a conclusion by showing the rules used, which matters because users must trust and check expert advice, especially in medicine or engineering. Knowledge acquisition, extracting knowledge from experts and encoding it, is the classic bottleneck: experts often find their tacit knowledge hard to state, rules can conflict, and maintaining a large rule base is expensive. Expert systems excel in narrow, well-understood domains with clear rules, and fail where knowledge is broad, tacit, or rapidly changing, which is one reason modern AI often combines rule-based components with learned models.

Key definitions

  • Agent: An entity that perceives its environment through sensors and acts on it through actuators, choosing actions according to its program.
  • State space: The set of all states reachable in a problem, together with the actions that move between them.
  • Heuristic function: A function h(n) that estimates the cost from node n to the nearest goal; it guides informed search.
  • Admissible heuristic: A heuristic that never overestimates the true cost to the nearest goal; A* with an admissible heuristic is optimal.
  • Breadth-first search: Search that expands nodes level by level using a queue; complete and optimal for uniform step costs, but memory-heavy.
  • Depth-first search: Search that expands the deepest node first; memory-light but neither complete in infinite spaces nor optimal.
  • Uniform-cost search: Search that expands the lowest-cost node so far using a priority queue; complete and optimal for positive step costs.
  • A* search: Informed search that expands the node with the lowest f(n) = g(n) + h(n), combining cost so far with estimated remaining cost.
  • Minimax: A game-tree algorithm in which the maximiser chooses the highest value and the minimiser chooses the lowest, assuming optimal play by both.
  • Alpha-beta pruning: A minimax optimisation that cuts branches which cannot affect the root decision, using alpha and beta bounds.
  • Propositional logic: Logic over whole statements that are true or false, combined with AND, OR, NOT, and implication.
  • First-order logic: Logic that adds objects, predicates, variables, and quantifiers to propositional logic, allowing general statements about classes of objects.
  • Resolution: An inference rule that combines clauses containing complementary literals to derive new clauses, used to prove a goal by contradiction.
  • Semantic network: A graph representation of knowledge with nodes for concepts and labelled arcs for relations, supporting inheritance of properties.
  • Frame: A structured record for a stereotyped situation, with slots for its parts and default values that apply unless overridden.
  • Bayesian reasoning: Reasoning that updates a prior belief with observed evidence, using likelihoods, to obtain a posterior belief.
  • Fuzzy logic: Logic in which membership is a degree between 0 and 1, rather than simply true or false, suited to vague concepts.
  • Overfitting: Learning noise and detail in the training data so training performance is high but performance on new data is poor.
  • Bias and variance: Bias is error from overly rigid assumptions, variance is error from sensitivity to the training sample; good models balance the two.
  • Precision: The fraction of items predicted positive that are truly positive: true positives divided by all predicted positives.
  • Recall: The fraction of truly positive items that were found: true positives divided by all actual positives.
  • Perceptron: A single artificial neuron that sums weighted inputs plus a bias and applies an activation function to produce an output.
  • Backpropagation: Training by propagating error gradients backwards through a network using the chain rule, so each weight can be adjusted by gradient descent.
  • Tokenisation: Splitting text into tokens, usually words and punctuation, as the first step of natural language processing.
  • Inference engine: The component of an expert system that applies the rules in the knowledge base to the facts of a case, by forward or backward chaining.

Formulas

  • A* evaluation: f(n) = g(n) + h(n), where g(n) is the cost from the start to n and h(n) is the estimated cost from n to the goal.
  • Precision = TP / (TP + FP), where TP is true positives and FP is false positives.
  • Recall = TP / (TP + FN), where FN is false negatives.
  • F1 = 2 x Precision x Recall / (Precision + Recall), the harmonic mean of precision and recall.
  • Accuracy = (TP + TN) / (TP + TN + FP + FN), where TN is true negatives.
  • Perceptron output: y = activation(sum of weight times input plus bias).

Worked examples

Example 1: A search problem has a start S, with two successors A and B. The cost from S to A is 3 and from S to B is 1. The heuristic estimates are h(A) = 4 and h(B) = 6. The true remaining cost from A is 4 and from B is 7. Which node does A* expand first, and is the heuristic admissible?

Compute f for each node. For A, f(A) = g(A) + h(A) = 3 + 4 = 7. For B, f(B) = g(B) + h(B) = 1 + 6 = 7. The two f values tie at 7, so A* may expand either first depending on tie-breaking; neither is preferred by f alone. Check admissibility: h(A) = 4 equals the true cost 4, so it does not overestimate. h(B) = 6 is less than the true cost 7, so it also does not overestimate. Both estimates are admissible, and A* with this heuristic remains optimal.

Example 2: A classifier on a test set gives TP = 80, FP = 20, FN = 20, TN = 80. Compute precision, recall, F1, and accuracy.

Precision = TP / (TP + FP) = 80 / (80 + 20) = 80 / 100 = 0.80. Recall = TP / (TP + FN) = 80 / (80 + 20) = 80 / 100 = 0.80. F1 = 2 x 0.80 x 0.80 / (0.80 + 0.80) = 1.28 / 1.60 = 0.80. Accuracy = (TP + TN) / total = (80 + 80) / 200 = 160 / 200 = 0.80. All four measures are 0.80 here because the confusion matrix is symmetric in this example; in general precision and recall differ, and F1 punishes a large gap between them.

Example 3: K-means is run with k = 2 on points 1, 2, 9, and 10 on a line, with initial centres 1 and 10. Show the first assignment and the updated centres.

Assign each point to the nearest centre. Point 1 is distance 0 from centre 1 and 9 from centre 10, so it joins centre 1. Point 2 is distance 1 from centre 1 and 8 from centre 10, so it joins centre 1. Point 9 is distance 8 from centre 1 and 1 from centre 10, so it joins centre 10. Point 10 joins centre 10. The new centre for the first cluster is the mean of 1 and 2, which is 1.5. The new centre for the second cluster is the mean of 9 and 10, which is 9.5. A second assignment with centres 1.5 and 9.5 gives the same clusters, so the algorithm has converged.

Uninformed search methods compared

MethodCompletenessOptimalityMain weakness
Breadth-first searchYesYes, for uniform costsExponential memory use
Depth-first searchNo, in infinite spacesNoMay return a costly solution first
Uniform-cost searchYes, for positive costsYesCan expand many low-cost nodes
Iterative deepeningYesYes, for uniform costsRepeats shallow expansions

Greedy best-first search versus A* search

AspectGreedy best-firstA*
Node chosenLowest h(n) onlyLowest f(n) = g(n) + h(n)
Cost already paidIgnoredIncluded through g(n)
OptimalityNot guaranteedGuaranteed with admissible h(n)
Typical behaviourFast when heuristic is good, can loopSlower but principled

Supervised versus unsupervised learning

AspectSupervisedUnsupervised
LabelsTraining data carries correct answersNo labels are given
TasksRegression and classificationClustering and dimensionality reduction
ExamplesDecision trees, kNN, SVMK-means, hierarchical clustering
EvaluationCompare predictions with true labelsJudge cluster quality, no single ground truth

Overfitting versus underfitting

AspectOverfittingUnderfitting
Training performanceHighLow
Test performanceLowLow
CauseModel too complex, memorises noiseModel too simple, misses the pattern
RemedySimplify, prune, regularise, get more dataUse a richer model or better features

Diagrams (described)

Search tree diagram: the start node branches into successors, each successor branches again, and the frontier is the set of generated but unexpanded nodes. Breadth-first search expands the frontier level by level, depth-first search goes deep down one branch first.

A* flow: start with the start node in the frontier, repeatedly remove the node with the lowest f(n), test for the goal, generate successors with updated g and f values, and stop when a goal node is removed from the frontier.

Minimax and alpha-beta diagram: maximiser nodes choose the maximum of their children, minimiser nodes choose the minimum, and a branch is cut when its value already lies outside the alpha to beta window, because it cannot change the root choice.

Expert system architecture diagram: knowledge base and working memory both connect to the inference engine, the inference engine connects to the user through an explanation facility, and knowledge acquisition feeds new rules into the knowledge base.

Exam points

  • BFS is complete and optimal for uniform costs but memory-heavy; DFS is memory-light but neither complete in infinite spaces nor optimal.
  • A* is optimal when the heuristic is admissible, meaning it never overestimates the true remaining cost.
  • Alpha-beta pruning does not change the minimax result; it only avoids exploring branches that cannot affect the root decision.
  • Propositional logic cannot easily express general statements; first-order logic adds predicates, variables, and quantifiers.
  • Resolution proves a goal by negating it, converting to clause form, and deriving a contradiction.
  • K-means needs k in advance and is sensitive to initial centres; hierarchical clustering produces a dendrogram that can be cut at any level.
  • A single perceptron can learn only linearly separable problems; hidden layers let a multilayer network learn non-linear mappings.
  • Precision focuses on false positives, recall focuses on false negatives, and F1 is their harmonic mean.
  • Forward chaining reasons from facts toward conclusions; backward chaining reasons from a goal back to supporting facts.
  • Stemming chops words to a root form; lemmatisation maps words to their dictionary form using vocabulary knowledge.

Common mistakes

  • Mistake: saying greedy best-first search is optimal because it uses a heuristic. Correction: greedy search ignores cost already paid, so it is not optimal; A* adds g(n) and is optimal with an admissible heuristic.
  • Mistake: confusing admissible with consistent. Correction: admissible means never overestimating; consistent is stronger and also guarantees no node needs reopening.
  • Mistake: claiming alpha-beta pruning changes the game result. Correction: pruning only skips branches that cannot change the root value, so the result is identical to plain minimax.
  • Mistake: saying a perceptron can solve any classification problem. Correction: a single perceptron is limited to linearly separable problems; non-linear problems need hidden layers.
  • Mistake: reporting accuracy alone on imbalanced data. Correction: use precision, recall, and F1 from the confusion matrix, because high accuracy can hide total failure on the rare class.
  • Mistake: tuning on the test set. Correction: tune on a validation set and use the test set once for a final estimate, otherwise the test estimate is optimistically biased.
  • Mistake: equating stemming with lemmatisation. Correction: stemming chops endings by rule, lemmatisation uses vocabulary knowledge to reach the true dictionary form.
  • Mistake: thinking the inference engine stores knowledge. Correction: the knowledge base stores rules and facts; the engine only applies them to the current case in working memory.

Practice questions from this note (original practice — not official PYQs)

Checking login…

Quick revision: Search by criteria: BFS complete and optimal for uniform costs but memory-heavy, DFS memory-light but not optimal, uniform-cost search optimal for positive costs, iterative deepening combines DFS memory with BFS guarantees. Informed search: greedy uses h(n) only and is not optimal, A* uses f(n) = g(n) + h(n) and is optimal when h never overestimates. Games: minimax assumes optimal opponents, alpha-beta prunes branches outside the alpha to beta window without changing the result. Representation: propositional logic handles whole statements, first-order logic adds objects, predicates, variables, and quantifiers, resolution proves by contradiction, semantic networks inherit along is-a links, frames hold slots and defaults, scripts hold event sequences. Uncertainty: Bayesian reasoning updates priors with evidence, fuzzy logic uses degrees of membership. Learning: regression predicts numbers, classification predicts labels, kNN votes among neighbours, SVM maximises the margin, k-means needs k and iterates assign and recompute, hierarchical clustering gives a dendrogram. Generalisation: overfitting means high training but low test accuracy, underfitting means low on both, bias is rigidity, variance is sensitivity to the sample, and precision, recall, and F1 come from the confusion matrix. Neural nets: perceptrons are linear only, hidden layers add non-linearity, backpropagation sends gradients backwards, ReLU passes positive inputs unchanged. NLP: tokenise, stem or lemmatise, parse, resolve meaning, handle ambiguity. Expert systems: knowledge base plus inference engine plus working memory plus explanation facility, with knowledge acquisition as the bottleneck.

Unit revision note (quick recap)

AI is search plus knowledge plus learning: find good paths through large spaces, represent what is known, and improve from data without being told every rule.

Learning objectives

  • Explain search and heuristics
  • Distinguish ML types
  • Explain overfitting and evaluation

Key concepts

  • A* search: Best-first search with f = g + h. Optimal when the heuristic h is admissible (never overestimates).
  • Overfitting: A model that memorises training data (including noise) and fails on new data.
  • Supervised vs unsupervised: Supervised learns from labelled examples; unsupervised finds structure in unlabelled data.
  • Heuristic: An estimate of remaining cost that guides search.

Formulas

  • A*: f(n) = g(n) + h(n), h admissible ⇒ optimal

Worked examples

  • A chess engine uses search + evaluation heuristics; a spam filter uses supervised learning from labelled emails.

Exam points

  • BFS is complete and optimal for uniform cost; DFS is memory-light but not optimal.
  • More training data and regularisation fight overfitting; more parameters alone do not.

Common mistakes

  • Calling any AI "learning" — rule-based expert systems do not learn from data.

Quick revision: Search, knowledge representation, logic, ML basics, neural nets intro, NLP, expert systems.

Practice questions from the whole unit bank (31 in the bank)

This unit's practice bank — the note above has its own smaller practice set drawn from the same bank, so a question can appear in both lists. The list below shows the free sample or the full bank depending on your plan.

Checking login…

Related tests

Unit test for this unit (31 bank questions, 38 min) · Full Mock — CS Paper 2 (100 questions) · Combined 150-question mock (180 min). All +2 per correct, no negative marking.

Revision summary

Search, knowledge representation, logic, ML basics, neural nets intro, NLP, expert systems.

After revising, take the unit test above, then check your unit-wise report on the Dashboard to find weak topics.