Skip to main content

Chapter 2

Artificial Intelligence

TU BIT past exam questions

Past questions and answers

60 questions set from this chapter. Most repeated first.

  • 2079 · 10 marks

Justify that AI can't exist without searching? Solve the following 8 puzzle problem using Hill climbing search algorithm.

Answer

Why AI needs search: Most AI problems (puzzles, planning, game playing, route finding, theorem proving) have no direct formula for the answer. The agent has a set of states, a set of actions and a goal, and must find a sequence of actions leading from the initial state to a goal state. Since the right sequence is not known in advance, the agent has to explore the state space, trying alternatives and comparing them. Hence problem solving in AI is formulated as search (uninformed or heuristic), and without searching an intelligent agent could not choose among many possible actions.

8-puzzle with hill climbing. The figure is not given, so the standard instance is used (blank shown as _).

Start:

2 8 3
1 6 4
7 _ 5

Goal:

1 2 3
8 _ 4
7 6 5

Heuristic h(n)h(n) = number of tiles (not counting the blank) out of place compared with the goal. Hill climbing moves to the neighbour with the lowest hh and stops if no neighbour is better.

Step 1. Start has h=4h=4 (tiles 2, 8, 1, 6 misplaced). Blank moves:

  • Up: 2 8 3 / 1 _ 4 / 7 6 5, h=3h=3
  • Left: h=5h=5
  • Right: h=5h=5

Best is Up, h=3h=3.

Step 2. From 2 8 3 / 1 _ 4 / 7 6 5:

  • Up: 2 _ 3 / 1 8 4 / 7 6 5, h=3h=3
  • Left: 2 8 3 / _ 1 4 / 7 6 5, h=3h=3
  • Right: 2 8 3 / 1 4 _ / 7 6 5, h=4h=4

No neighbour has h<3h<3. Simple (strict) hill climbing stops here on a plateau or local optimum, without reaching the goal. This is its main weakness.

With sideways moves allowed (accept equal hh):

  • Take Up: 2 _ 3 / 1 8 4 / 7 6 5, h=3h=3
  • Blank left: _ 2 3 / 1 8 4 / 7 6 5, h=2h=2
  • Blank down: 1 2 3 / _ 8 4 / 7 6 5, h=1h=1
  • Blank right: 1 2 3 / 8 _ 4 / 7 6 5, h=0h=0, the goal.

So hill climbing solves it only if sideways moves (or random restarts) are used; otherwise it can get stuck.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 3+5+2 marks

What is knowledge, representation and reasoning? When a machine is said to be passed Turing test? Give any two examples of constraint satisfaction problem.

Answer

Knowledge, representation and reasoning

  • Knowledge is the facts, rules, concepts and relationships about a domain that an intelligent system needs to behave intelligently.
  • Knowledge representation is the way this knowledge is encoded in a form a computer can store and use, for example propositional and predicate logic, semantic networks, frames, production rules and scripts. A good representation is expressive, efficient and easy to update.
  • Reasoning is the process of drawing new conclusions from the represented knowledge, for example by deduction (modus ponens, resolution), induction or abduction.

Turing test: A machine passes the Turing test when a human interrogator, communicating through text with both a machine and a human without seeing them, cannot reliably tell which is the machine (the machine is taken as intelligent if the interrogator's judgement is no better than chance, commonly judged after about five minutes of conversation).

Two examples of constraint satisfaction problems

  1. Map colouring: colour the regions of a map so that adjacent regions have different colours. Variables are regions, domain is the set of colours, constraints are that neighbours differ.
  2. 8-queens / Sudoku / cryptarithmetic (SEND + MORE = MONEY): place queens so that no two attack each other, with constraints on rows, columns and diagonals.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 10 marks

Why CNF is necessary? From the following facts, show that 'Charlie is a mammal' using FOPL based resolution method. (a) Cows, pigs and horses are mammals (b) The child of a horse is a horse (c) Bluebeard is a horse (d) Bluebeard is Charlie's father (e) Child and father are inverse relations (f) Every mammal has a father.

Answer

Why CNF is necessary: Resolution is a single inference rule that works only on clauses, i.e. disjunctions of literals. Converting every sentence into Conjunctive Normal Form (a conjunction of clauses) gives one uniform format, so resolution can be applied mechanically and proof by refutation can be automated. It also removes implications, quantifiers and complex nesting.

FOPL representation

  • (a) ∀x (cow(x)∨pig(x)∨horse(x)→mammal(x))\forall x\,(cow(x)\lor pig(x)\lor horse(x)\rightarrow mammal(x))
  • (b) ∀x ∀y (horse(x)∧child(y,x)→horse(y))\forall x\,\forall y\,(horse(x)\land child(y,x)\rightarrow horse(y)) (child(y,x)child(y,x): y is a child of x)
  • (c) horse(Bluebeard)horse(Bluebeard)
  • (d) father(Bluebeard,Charlie)father(Bluebeard, Charlie)
  • (e) ∀x ∀y (father(x,y)↔child(y,x))\forall x\,\forall y\,(father(x,y)\leftrightarrow child(y,x))
  • (f) ∀x (mammal(x)→∃y father(y,x))\forall x\,(mammal(x)\rightarrow \exists y\,father(y,x))

Goal: mammal(Charlie)mammal(Charlie).

Clauses (CNF)

  1. ¬cow(x)∨mammal(x)\lnot cow(x)\lor mammal(x)
  2. ¬pig(x)∨mammal(x)\lnot pig(x)\lor mammal(x)
  3. ¬horse(x)∨mammal(x)\lnot horse(x)\lor mammal(x)
  4. ¬horse(x)∨¬child(y,x)∨horse(y)\lnot horse(x)\lor\lnot child(y,x)\lor horse(y)
  5. horse(Bluebeard)horse(Bluebeard)
  6. father(Bluebeard,Charlie)father(Bluebeard, Charlie)
  7. ¬father(x,y)∨child(y,x)\lnot father(x,y)\lor child(y,x)
  8. ¬child(y,x)∨father(x,y)\lnot child(y,x)\lor father(x,y)
  9. ¬mammal(x)∨father(f(x),x)\lnot mammal(x)\lor father(f(x),x) (Skolem function ff)
  10. Negated goal: ¬mammal(Charlie)\lnot mammal(Charlie)

Resolution proof

  • 10 and 3 with x=Charliex=Charlie: ¬horse(Charlie)\lnot horse(Charlie) (11)
  • 6 and 7 with x=Bluebeard, y=Charliex=Bluebeard,\ y=Charlie: child(Charlie,Bluebeard)child(Charlie, Bluebeard) (12)
  • 4 and 12 with x=Bluebeard, y=Charliex=Bluebeard,\ y=Charlie: ¬horse(Bluebeard)∨horse(Charlie)\lnot horse(Bluebeard)\lor horse(Charlie) (13)
  • 13 and 5: horse(Charlie)horse(Charlie) (14)
  • 14 and 11: empty clause (contradiction)

The negated goal leads to a contradiction, so mammal(Charlie)mammal(Charlie) is true: Charlie is a mammal.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Differentiate between goal based agent and utility based agent.

Answer

Goal-based agentUtility-based agent
Chooses actions only to achieve a stated goalChooses actions to maximise a utility (degree of happiness) function
Goal gives a binary view: achieved or not achievedGives a measure of how good a state is, so states can be ranked
Cannot distinguish between several action sequences that all reach the goalCan pick the best among many ways, e.g. the fastest, safest or cheapest
Cannot handle conflicting goals or uncertainty wellHandles conflicting goals (speed vs safety) and uncertain outcomes using expected utility
Uses search and planning to reach the goalUses a utility function plus probabilities to select the action with maximum expected utility
Example: a taxi that just reaches the destinationExample: a taxi that reaches the destination quickly, safely and cheaply

A utility-based agent is more general, since a goal can be seen as a utility function with only two values.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

What is the task of activation function? What are its types?

Answer

Task of an activation function: In a neural network, a neuron computes the weighted sum of its inputs plus bias, net=∑wixi+bnet=\sum w_ix_i+b. The activation function transforms this value into the neuron's output, y=f(net)y=f(net). Its tasks are to introduce non-linearity (without it, a multi-layer network would reduce to a single linear model) and to limit or decide the output range so that the neuron fires or not.

Types

  1. Step (threshold) function: f(x)=1f(x)=1 if x≥θx\ge\theta, else 00. Used in the perceptron.
  2. Sigmoid (logistic): f(x)=11+e−xf(x)=\dfrac{1}{1+e^{-x}}, output between 0 and 1, used for probabilities.
  3. Tanh: f(x)=ex−e−xex+e−xf(x)=\dfrac{e^x-e^{-x}}{e^x+e^{-x}}, output between −1-1 and 11, zero-centred.
  4. ReLU: f(x)=max⁡(0,x)f(x)=\max(0,x), fast and widely used in deep networks.
  5. Leaky ReLU: f(x)=xf(x)=x for x>0x>0, 0.01x0.01x otherwise.
  6. Softmax: converts a vector into probabilities that sum to 1, used in the output layer for multi-class classification.
  7. Linear (identity): f(x)=xf(x)=x, used for regression outputs.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

How Dempster - Shafer theory can be used for reasoning with certainty? Explain with an example.

Answer

Dempster-Shafer (D-S) theory is a way of reasoning with uncertainty and incomplete evidence. Instead of assigning probability to single outcomes, it assigns belief mass to subsets of the frame of discernment Θ\Theta (the set of all mutually exclusive hypotheses). Ignorance can be represented, as mass left on Θ\Theta itself rather than being split equally.

  • Basic probability assignment (mass) mm: m(∅)=0m(\emptyset)=0 and ∑A⊆Θm(A)=1\sum_{A\subseteq\Theta} m(A)=1.
  • Belief: Bel(A)=∑B⊆Am(B)Bel(A)=\sum_{B\subseteq A} m(B) (lower bound).
  • Plausibility: Pl(A)=1−Bel(¬A)Pl(A)=1-Bel(\lnot A) (upper bound).
  • The certainty about AA is the interval [Bel(A), Pl(A)][Bel(A),\,Pl(A)].
  • Dempster's rule of combination merges two independent evidence sources:

m12(A)=∑B∩C=Am1(B) m2(C)1−K,K=∑B∩C=∅m1(B) m2(C)m_{12}(A)=\frac{\sum_{B\cap C=A} m_1(B)\,m_2(C)}{1-K},\qquad K=\sum_{B\cap C=\emptyset} m_1(B)\,m_2(C)

Example. Let Θ={flu,cold}\Theta=\{flu, cold\}.

  • Evidence 1: m1({flu})=0.6m_1(\{flu\})=0.6, m1(Θ)=0.4m_1(\Theta)=0.4.
  • Evidence 2: m2({flu})=0.5m_2(\{flu\})=0.5, m2({cold})=0.2m_2(\{cold\})=0.2, m2(Θ)=0.3m_2(\Theta)=0.3.

Conflict: K=m1(flu) m2(cold)=0.6×0.2=0.12K=m_1(flu)\,m_2(cold)=0.6\times0.2=0.12.

m12(flu)=0.6×0.5+0.6×0.3+0.4×0.50.88=0.30+0.18+0.200.88=0.680.88≈0.773m_{12}(flu)=\dfrac{0.6\times0.5+0.6\times0.3+0.4\times0.5}{0.88}=\dfrac{0.30+0.18+0.20}{0.88}=\dfrac{0.68}{0.88}\approx0.773

m12(cold)=0.4×0.20.88=0.080.88≈0.091m_{12}(cold)=\dfrac{0.4\times0.2}{0.88}=\dfrac{0.08}{0.88}\approx0.091

m12(Θ)=0.4×0.30.88=0.120.88≈0.136m_{12}(\Theta)=\dfrac{0.4\times0.3}{0.88}=\dfrac{0.12}{0.88}\approx0.136

So Bel(flu)=0.773Bel(flu)=0.773 and Pl(flu)=1−Bel(cold)=1−0.091=0.909Pl(flu)=1-Bel(cold)=1-0.091=0.909. The belief in flu is in the interval [0.773,0.909][0.773, 0.909], which shows reasoning with certainty and the remaining ignorance.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Define expert system. Describe its architecture.

Answer

Expert system: An expert system is an AI program that captures the knowledge of human experts in a specific narrow domain (for example MYCIN for medical diagnosis, DENDRAL for chemistry) and uses it to give advice, make decisions or solve problems at an expert's level, usually with an explanation of its reasoning.

Architecture

  1. Knowledge base: stores domain facts and rules (usually IF-THEN production rules), obtained from experts.
  2. Inference engine: the reasoning part. It applies rules to the facts using forward chaining (from facts to conclusions) or backward chaining (from a goal back to facts) to derive new knowledge. It also handles conflict resolution.
  3. Working memory (database): holds the facts of the current problem and intermediate results.
  4. User interface: lets the user enter queries and facts and view results, often in natural language or menus.
  5. Explanation facility: explains how a conclusion was reached (HOW) and why a question is being asked (WHY).
  6. Knowledge acquisition module: helps the knowledge engineer to add, update and test knowledge from experts.

The user interacts through the interface, the inference engine reads the knowledge base and working memory, and the answer plus explanation are returned.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

What is the purpose of alpha beta pruning? Explain.

Answer

Purpose: Alpha-beta pruning is an optimisation of the minimax algorithm used in two-player games (chess, tic-tac-toe). Minimax must examine every node of the game tree, which grows exponentially. Alpha-beta pruning gives the same result as minimax but skips (prunes) branches that cannot influence the final decision, so the search is much faster and deeper searches become possible.

How it works: Two values are carried along the search.

  • α\alpha: the best (highest) value found so far for the MAX player along the path, initially −∞-\infty.
  • β\beta: the best (lowest) value found so far for the MIN player, initially +∞+\infty.

A branch is pruned whenever α≥β\alpha\ge\beta, because the opponent would never let the game reach that position.

Example: MAX node with two MIN children. The first MIN child has leaves 3 and 5, so its value is 3, giving α=3\alpha=3 at MAX. In the second MIN child the first leaf is 2. MIN can get at most 2, which is less than α=3\alpha=3, so MAX will never choose this branch; the remaining leaves of that child are pruned.

With best move ordering the number of nodes examined drops from O(bd)O(b^d) to about O(bd/2)O(b^{d/2}), where bb is the branching factor and dd is the depth.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Illustrate your own scenario for shopping at my mall and represent those concepts using scripts.

Answer

The question leaves the representation scheme open. A frame/script style (like Prolog facts and rules) is used here for a shopping mall, "My Mall".

Scenario: A customer enters the mall, picks products from shops, pays at the counter and receives a bill. Members get a discount.

Concepts as facts (Prolog)

% shops and the products they sell
shop(clothes_hub).  shop(fresh_mart).  shop(tech_zone).
sells(clothes_hub, shirt, 1500).
sells(fresh_mart, rice, 120).
sells(tech_zone, earphones, 2000).

% customers
customer(ram).  customer(sita).
member(ram).

% wants to buy
buys(ram, shirt).
buys(sita, rice).

Rules

% price with discount: members get 10 percent off
price_for(C, Item, P) :-
    sells(_, Item, Base),
    ( member(C) -> P is Base * 0.9 ; P = Base ).

% total bill for a customer's purchases
bill(C, Item, Amount) :-
    buys(C, Item),
    price_for(C, Item, Amount).

Queries

?- bill(ram, shirt, A).    % A = 1350.0   (Rs 1500 less 10 percent)
?- bill(sita, rice, A).    % A = 120      (not a member)

Script (sequence of events): enter mall, browse shops, select item, go to the billing counter, pay (cash or card), receive the bill, exit. This is also represented as a frame with slots: customer, item, shop, price, payment_mode.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 2+3 marks

Define deterministic and non-deterministic environment. Differentiate between BFS and DFS.

Answer

Deterministic environment: the next state of the environment is completely determined by the current state and the action the agent executes. There is no uncertainty, e.g. chess, 8-puzzle.

Non-deterministic (stochastic) environment: the same action in the same state can lead to different outcomes, so the agent must handle uncertainty, e.g. taxi driving, poker, robot moving on a slippery floor.

BFS vs DFS

BasisBFSDFS
Data structureQueue (FIFO)Stack (LIFO) / recursion
OrderExpands all nodes at depth dd before depth d+1d+1Goes down one branch to the deepest node, then backtracks
CompletenessComplete (finite branching factor)Not complete in infinite or cyclic spaces
OptimalityOptimal for uniform step costNot optimal
TimeO(bd)O(b^d)O(bm)O(b^m)
SpaceO(bd)O(b^d), largeO(bm)O(bm), small
UseShortest pathMemory-limited problems, deep solutions

Here bb is the branching factor, dd the depth of the shallowest goal and mm the maximum depth.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Explain the different ambiguities related to NLP.

Answer

Ambiguity means a piece of language can be interpreted in more than one way. NLP must resolve it at each level.

  1. Lexical ambiguity: a single word has several meanings or parts of speech. "Bank" can be a river bank or a financial bank; "book" can be a noun or a verb.
  2. Syntactic (structural) ambiguity: a sentence has more than one valid parse tree. "I saw the man with a telescope" can mean I used the telescope, or the man had it.
  3. Semantic ambiguity: the sentence is syntactically fine but its meaning is unclear, often from word-sense or quantifier scope. "Every student read a book" may mean one common book or a different book each.
  4. Referential (anaphoric) ambiguity: a pronoun or phrase can refer to several earlier entities. "Ram told Hari that he won" - who is "he"?
  5. Pragmatic ambiguity: the intended meaning depends on context or speaker intention. "Can you pass the salt?" is a request, not a question about ability.
  6. Discourse ambiguity: the interpretation of a sentence depends on the preceding sentences.

Resolution uses part-of-speech tagging, word-sense disambiguation, probabilistic parsing, context and world knowledge.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Describe the concept of learning by analogy with an example.

Answer

Learning by analogy is a form of learning in which a new problem is solved by recognising its similarity to a problem already solved, and transferring the known solution (or knowledge) to the new situation, with suitable adaptation.

Steps

  1. Retrieve a similar past case (source) from memory.
  2. Find the mapping between the source and the target problem.
  3. Transfer the source's solution or knowledge to the target.
  4. Adapt it to the differences, and test it.
  5. Store the new solved case for future use.

Example: a student who knows that water flowing through a pipe depends on pressure difference and pipe resistance learns electric current. By analogy, water pressure maps to voltage, flow rate to current, and pipe resistance to electrical resistance, so I=V/RI = V/R is understood as the analogue of flow == pressure//resistance. Another example is a doctor diagnosing a new patient from a similar earlier case.

It is the basis of case-based reasoning, and its quality depends on how good the similarity measure and mapping are.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 4+6 marks

What properties does a machine need to pass the Turing Test? Explain the ambiguities at each NLP step.

Answer

Turing Test: proposed by Alan Turing (1950). A human interrogator asks written questions to a hidden human and a hidden machine. If the interrogator cannot reliably tell which is the machine, the machine passes.

Capabilities a machine needs

  1. Natural language processing to communicate in a human language.
  2. Knowledge representation to store what it knows or hears.
  3. Automated reasoning to use the stored knowledge to answer questions and draw new conclusions.
  4. Machine learning to adapt to new circumstances and detect patterns.

The Total Turing Test adds computer vision and robotics for perceiving and manipulating objects.

Ambiguities at each NLP step

StepAmbiguity
Lexical analysisWord boundaries, and a word with several categories or senses: "bank", "light" (noun, verb, adjective).
Syntactic analysisSeveral parse trees: "I saw the girl with a telescope".
Semantic analysisMultiple meanings and quantifier scope: "Every man loves a woman".
Discourse integrationA sentence's meaning depends on earlier ones; pronoun reference: "Ram met Hari. He was ill."
Pragmatic analysisIntended meaning differs from literal meaning: "Can you open the window?" is a request.

Each is resolved using context, probabilities and world knowledge.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 10 marks

Define an agent. Describe PEAS and the types of environment with examples.

Answer

Agent: anything that perceives its environment through sensors and acts upon it through actuators. A human has eyes and ears as sensors and hands and legs as actuators; a robot has cameras and motors; a software agent has keystrokes or packets as input and screen output or messages as actions. An agent maps its percept history to an action: f:P∗→Af: P^* \rightarrow A.

PEAS is the task-environment description of an agent:

  • Performance measure: how success is judged.
  • Environment: the world the agent operates in.
  • Actuators: the means of acting.
  • Sensors: the means of perceiving.

Example, automated taxi:

PEAS
Safe, fast, legal, comfortable trip, profitRoads, traffic, pedestrians, customersSteering, accelerator, brake, signal, hornCameras, GPS, speedometer, sonar, odometer

Types of environment

  1. Fully vs partially observable: sensors give the complete state or not. Chess is fully observable; poker and taxi driving are partially observable.
  2. Deterministic vs stochastic: the next state is fully determined by the current state and action or not. Chess is deterministic; taxi driving is stochastic.
  3. Episodic vs sequential: in episodic environments each decision is independent (image classification); in sequential ones the current action affects future ones (chess, taxi).
  4. Static vs dynamic: whether the environment changes while the agent deliberates. Crossword is static; taxi driving is dynamic.
  5. Discrete vs continuous: finite number of states and actions (chess) or continuous values (taxi speed, position).
  6. Single vs multi-agent: crossword is single-agent; chess is competitive multi-agent; taxi driving is cooperative/competitive multi-agent.
  7. Known vs unknown: whether the rules of the environment are known to the agent.

The hardest case is partially observable, stochastic, sequential, dynamic, continuous and multi-agent, such as taxi driving.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 10 marks

How does Depth Limited Search fix DFS and what are its limitations? Illustrate AO* search on multiplying three matrices.

Answer

Depth Limited Search (DLS)

DFS can go down an infinite or very deep branch and never return, so it is incomplete. DLS runs DFS but treats nodes at a predefined depth limit ll as if they had no successors. Hence it never goes deeper than ll, so it always terminates, and memory stays O(bl)O(bl).

It returns three outcomes: a solution, failure (no solution at all), or cutoff (no solution within limit ll).

Limitations

  • Incomplete if the shallowest goal is deeper than ll (l<dl < d).
  • Not optimal if l>dl > d, since it may return a deeper solution first.
  • Choosing a good ll needs knowledge of the problem (e.g. the diameter of the state space). A bad choice gives failure or wasted time.
  • Time is O(bl)O(b^l).

Iterative deepening search removes the need to choose ll by trying l=0,1,2,…l=0,1,2,\dots.

AO* search on multiplying three matrices

AO* works on an AND-OR graph: an OR arc gives alternative ways to solve a node, and an AND arc means all its sub-problems must be solved. Matrix chain multiplication A×B×CA \times B \times C is the example. The problem is the root. It can be solved by two OR alternatives:

  • (AB)C(AB)C: AND of sub-problems {AB, (AB)C}\{AB,\ (AB)C\}
  • A(BC)A(BC): AND of sub-problems {BC, A(BC)}\{BC,\ A(BC)\}

Let AA be 10×3010\times 30, BB be 30×530\times 5, CC be 5×605\times 60. The cost of multiplying a p×qp\times q matrix with a q×rq\times r matrix is pqrpqr.

  • (AB)C(AB)C: ABAB costs 10⋅30⋅5=150010\cdot30\cdot5 = 1500; then (10×5)(5×60)(10\times5)(5\times60) costs 10⋅5⋅60=300010\cdot5\cdot60 = 3000. Total =4500=4500.
  • A(BC)A(BC): BCBC costs 30⋅5⋅60=900030\cdot5\cdot60 = 9000; then (10×30)(30×60)(10\times30)(30\times60) costs 10⋅30⋅60=1800010\cdot30\cdot60=18000. Total =27000=27000.

Steps of AO*:

  1. Start with the root and expand it, giving the two AND arcs with heuristic estimates for each unsolved child.
  2. Compute each arc's cost as the sum of its children's costs plus the arc cost, and mark the cheapest arc as the current best.
  3. Expand an unsolved leaf on the best path, recompute costs, and propagate revised costs back up to the root.
  4. Repeat until the root is labelled solved.

The best solution graph is the (AB)C(AB)C arc with cost 45004500, so the order of multiplication is (A×B)×C(A\times B)\times C.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain the architecture of an expert system.

Answer

An expert system is a program that emulates the decision-making of a human expert in a narrow domain (e.g. MYCIN for diagnosis, DENDRAL for chemistry).

Architecture

  1. Knowledge base: domain facts and heuristic rules (usually IF-THEN) obtained from experts.
  2. Inference engine: the reasoning part. It applies the rules to the facts using forward chaining (data-driven) or backward chaining (goal-driven) to derive conclusions, and decides the order in which rules fire.
  3. Working memory (fact base): the current facts of the case being solved plus conclusions drawn so far.
  4. User interface: lets the user enter queries and facts and see results in a natural, convenient form.
  5. Explanation facility: explains why a question is asked and how a conclusion was reached, which builds trust.
  6. Knowledge acquisition module: helps the knowledge engineer to add, edit and validate knowledge from experts.

Flow: the user enters facts through the interface, the inference engine matches them against the knowledge base, updates working memory, and returns a conclusion with an explanation.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

How does a genetic algorithm work?

Answer

A genetic algorithm (GA) is a search and optimisation technique inspired by natural selection. It evolves a population of candidate solutions towards better ones.

Working

  1. Initialisation: create a random population of individuals (chromosomes), each encoding a solution as a bit string or similar.
  2. Fitness evaluation: compute a fitness value for every chromosome using an objective function.
  3. Selection: choose fitter individuals as parents (roulette wheel, tournament, rank selection).
  4. Crossover: combine two parents at a crossover point to make offspring. For example 1101∣0011101|001 and 0110∣1100110|110 give 11011101101110 and 01100010110001.
  5. Mutation: randomly flip a few bits with small probability to maintain diversity and escape local optima.
  6. Replacement: form the new generation from offspring (and possibly the best old individuals, called elitism).
  7. Termination: repeat steps 2-6 until a satisfactory fitness is reached or the maximum number of generations is done. The best chromosome is the answer.

GAs need no gradient information and work on complex search spaces, but they are slow and give no guarantee of the global optimum.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Describe the types of neural networks.

Answer

Neural networks are classified by structure and learning style.

  1. Single-layer feed-forward network (perceptron): inputs connect directly to output neurons. It can solve only linearly separable problems such as AND and OR.
  2. Multilayer feed-forward network (MLP): has one or more hidden layers between input and output, and signals flow in one direction only. With back-propagation it can learn non-linear functions such as XOR.
  3. Recurrent (feedback) network: contains feedback connections, so outputs are fed back as inputs and the network has memory. Examples are Hopfield networks, Elman networks and LSTM, used for sequences and associative memory.
  4. Radial Basis Function network: hidden units use radial (Gaussian) functions; used for function approximation and classification.
  5. Self-organising map (Kohonen): unsupervised, competitive learning that clusters input data onto a low-dimensional map.
  6. Convolutional neural network: uses convolution and pooling layers for images.

By learning method: supervised, unsupervised and reinforcement networks.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

What is machine learning? Describe NLU and NLG.

Answer

Machine learning (ML) is the branch of AI in which a computer improves its performance on a task from experience (data) without being explicitly programmed. Mitchell's definition: a program learns from experience EE with respect to task TT and performance measure PP if its performance on TT, measured by PP, improves with EE. Types are supervised, unsupervised and reinforcement learning, e.g. spam filtering, house price prediction.

NLU (Natural Language Understanding): the part of NLP that converts human language into a machine-usable meaning representation. It involves lexical, syntactic and semantic analysis, resolving ambiguity, and extracting intent and entities. Example: from "Book a flight to Pokhara tomorrow" it extracts intent = book flight, destination = Pokhara, date = tomorrow.

NLG (Natural Language Generation): the part of NLP that produces natural-language text from structured data or an internal representation. Stages: content determination, document structuring, sentence aggregation, lexicalisation, and surface realisation. Example: generating a weather report "Tomorrow will be sunny with a high of 25 degrees" from numerical forecast data.

NLU maps text to meaning; NLG maps meaning to text. A chatbot uses both.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Differentiate backward vs. forward chaining, with an example.

Answer

Forward chaining is data-driven reasoning: start with the known facts, fire rules whose conditions are satisfied, add new facts, and continue until the goal is derived or no rule applies.

Backward chaining is goal-driven reasoning: start with the goal (hypothesis), find rules that conclude it, and treat their conditions as sub-goals to be proved, recursively, until they match known facts.

BasisForward chainingBackward chaining
DirectionFrom facts to goalFrom goal to facts
Driven byDataGoal
ApproachBottom-upTop-down
EfficiencyMay derive many irrelevant factsExplores only relevant rules
UseMonitoring, planning, designDiagnosis, query answering
Example systemCLIPS, OPS5Prolog, MYCIN

Example Rules: R1: A∧B→CA \wedge B \rightarrow C; R2: C→DC \rightarrow D; R3: D→ED \rightarrow E. Facts: A,BA, B. Goal: EE.

  • Forward: A,BA,B fire R1, giving CC; CC fires R2, giving DD; DD fires R3, giving EE. Goal reached.
  • Backward: to prove EE use R3, so prove DD; use R2, so prove CC; use R1, so prove AA and BB; both are known facts. Hence EE is true.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Define a game. Give the state space representation of a known problem.

Answer

Game: a game is a multi-agent (usually competitive) environment with a fixed set of rules in which players take turns choosing actions, and each outcome gives a payoff. It is formally defined by the initial state, the players, the legal actions in each state, a transition model, a terminal test, and a utility function (e.g. +1+1 win, 00 draw, −1-1 loss). Examples: chess, tic-tac-toe.

State space representation: Water jug problem (4-litre jug and 3-litre jug, no markings, a pump; get exactly 2 litres in the 4-litre jug).

  • State: (x,y)(x, y) with xx litres in the 4-litre jug, yy in the 3-litre jug; 0≤x≤40\le x\le4, 0≤y≤30\le y\le3.
  • Initial state: (0,0)(0,0). Goal state: (2,n)(2, n) for any nn.
  • Operators:
    • Fill the 4-litre jug: (x,y)→(4,y)(x,y)\to(4,y) if x<4x<4
    • Fill the 3-litre jug: (x,y)→(x,3)(x,y)\to(x,3) if y<3y<3
    • Empty either jug: (x,y)→(0,y)(x,y)\to(0,y) or (x,0)(x,0)
    • Pour 3-litre into 4-litre until full or empty: (x,y)→(x+y,0)(x,y)\to(x+y,0) if x+y≤4x+y\le4, else (4, y−(4−x))(4,\,y-(4-x))
    • Pour 4-litre into 3-litre similarly.
  • A solution path: (0,0)→(0,3)→(3,0)→(3,3)→(4,2)→(0,2)→(2,0)(0,0)\to(0,3)\to(3,0)\to(3,3)\to(4,2)\to(0,2)\to(2,0).

The goal (2,0)(2,0) is reached in 6 moves.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Draw a semantic network for five statements on animals, plants, roses, carnivores, and tigers.

Answer

A semantic network is a graph-based knowledge representation: nodes are concepts or objects and labelled arcs are relations (commonly is-a and has/eats).

Statements:

  1. Plants are living things (or: Animals and plants are living things).
  2. A rose is a plant.
  3. A carnivore is an animal that eats animals.
  4. A tiger is a carnivore.
  5. Animals eat plants or other animals (herbivores eat plants).

Network:

              Living Thing
              ^          ^
          is-a|          |is-a
          Animal        Plant
          ^   ^            ^
      is-a|   |eats        |is-a
  Carnivore ----> Animal  Rose
      ^
  is-a|
    Tiger

Arcs: Animal -is-a-> Living Thing; Plant -is-a-> Living Thing; Rose -is-a-> Plant; Carnivore -is-a-> Animal; Carnivore -eats-> Animal; Tiger -is-a-> Carnivore.

Inheritance: a Tiger inherits all properties of Carnivore, Animal and Living Thing, so we can infer "a tiger eats animals" and "a tiger is a living thing" without storing them explicitly.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain belief network, with an example.

Answer

A belief network (Bayesian network) is a directed acyclic graph (DAG) that represents probabilistic dependencies among random variables.

  • Each node is a random variable.
  • Each directed edge X→YX\rightarrow Y means XX directly influences YY (XX is a parent of YY).
  • Each node has a conditional probability table (CPT) P(Xi∣Parents(Xi))P(X_i \mid \text{Parents}(X_i)).

The joint distribution factorises as

P(X1,…,Xn)=∏i=1nP(Xi∣Parents(Xi))P(X_1,\dots,X_n)=\prod_{i=1}^{n}P(X_i\mid \text{Parents}(X_i))

Example (alarm network): Burglary (B) and Earthquake (E) cause Alarm (A); Alarm causes JohnCalls (J).

Let P(B)=0.001P(B)=0.001, P(E)=0.002P(E)=0.002, P(A∣B,E)=0.95P(A\mid B,E)=0.95, P(A∣B,¬E)=0.94P(A\mid B,\neg E)=0.94, P(A∣¬B,E)=0.29P(A\mid \neg B,E)=0.29, P(A∣¬B,¬E)=0.001P(A\mid \neg B,\neg E)=0.001, P(J∣A)=0.90P(J\mid A)=0.90, P(J∣¬A)=0.05P(J\mid \neg A)=0.05.

Probability that John calls, the alarm sounds, with a burglary but no earthquake:

P(J,A,B,¬E)=P(B) P(¬E) P(A∣B,¬E) P(J∣A)=0.001×0.998×0.94×0.90≈0.000844P(J,A,B,\neg E)=P(B)\,P(\neg E)\,P(A\mid B,\neg E)\,P(J\mid A)=0.001\times0.998\times0.94\times0.90\approx 0.000844

Belief networks allow inference under uncertainty, e.g. computing P(B∣J)P(B\mid J) via Bayes' rule.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain hill climbing search and its limitations.

Answer

Hill climbing is a local search algorithm that repeatedly moves to the neighbouring state with the best (highest) heuristic value, and stops when no neighbour is better than the current state. It is like climbing a hill in fog, looking only at the immediate surroundings.

Algorithm (steepest-ascent)

  1. Start with an initial state as current.
  2. Generate all successors of the current state and pick the best one.
  3. If it is better than the current state, make it current and repeat; otherwise stop and return the current state.

It uses very little memory (only the current state) and no backtracking.

Limitations

  1. Local maxima: a peak higher than its neighbours but lower than the global maximum; the search gets stuck.
  2. Plateau: a flat region where all neighbours have equal value, so there is no direction to move.
  3. Ridges: a sequence of local maxima that are hard to climb since the needed move is not a single step.
  4. It is neither complete nor optimal.

Remedies: random restart, simulated annealing, sideways moves, stochastic hill climbing.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 10 marks

What are the issues in knowledge representation? Given the following knowledge base, using resolution show that (a) Ava likes watermelon (b) Apple and watermelon are fruits (c) Ava eats watermelon and love it so much (d) Anything eaten by anybody and love it so much if fruits

Answer

Issues in knowledge representation

  1. Choice of attributes: which attributes are important enough to represent (e.g. instance and isa), and whether they are general enough to support inheritance.
  2. Relationships between attributes: inverses, existence in an isa hierarchy, techniques for reasoning about values, and single-valued attributes.
  3. Granularity: the level of detail at which knowledge is stored - primitives or high-level facts.
  4. Representing sets of objects: properties of a set as a whole versus properties of its members.
  5. Finding the right structure: selecting the appropriate stored structure when it is needed.
  6. Also: incompleteness, uncertainty, inconsistency, and the trade-off between expressiveness and efficiency.

Resolution proof

Knowledge base in predicate logic:

  1. Eats(Ava,Apple)Eats(Ava, Apple)
  2. Eats(Ava,Watermelon)Eats(Ava, Watermelon)
  3. Loves(Ava,Apple)Loves(Ava, Apple)
  4. Loves(Ava,Watermelon)Loves(Ava, Watermelon)
  5. ∀x ∀y  [Eats(y,x)∧Loves(y,x)→Fruit(x)]\forall x\,\forall y\;[Eats(y,x)\wedge Loves(y,x)\rightarrow Fruit(x)] (anything eaten by anybody and loved so much is a fruit)
  6. ∀x ∀y  [Loves(y,x)→Likes(y,x)]\forall x\,\forall y\;[Loves(y,x)\rightarrow Likes(y,x)]

Clauses (CNF):

  • C1: Eats(Ava,Apple)Eats(Ava,Apple)
  • C2: Eats(Ava,Watermelon)Eats(Ava,Watermelon)
  • C3: Loves(Ava,Apple)Loves(Ava,Apple)
  • C4: Loves(Ava,Watermelon)Loves(Ava,Watermelon)
  • C5: ¬Eats(y,x)∨¬Loves(y,x)∨Fruit(x)\neg Eats(y,x)\vee\neg Loves(y,x)\vee Fruit(x)
  • C6: ¬Loves(y,x)∨Likes(y,x)\neg Loves(y,x)\vee Likes(y,x)

(a) Ava likes watermelon. Negated goal: ¬Likes(Ava,Watermelon)\neg Likes(Ava,Watermelon). Resolve with C6 using {y/Ava, x/Watermelon}\{y/Ava,\ x/Watermelon\} to get ¬Loves(Ava,Watermelon)\neg Loves(Ava,Watermelon). Resolve with C4 to get the empty clause. Hence proved.

(b) Apple and watermelon are fruits. Negated goal: ¬Fruit(Apple)∨¬Fruit(Watermelon)\neg Fruit(Apple)\vee\neg Fruit(Watermelon).

  • Resolve with C5 using {x/Apple, y/Ava}\{x/Apple,\ y/Ava\}: ¬Eats(Ava,Apple)∨¬Loves(Ava,Apple)∨¬Fruit(Watermelon)\neg Eats(Ava,Apple)\vee\neg Loves(Ava,Apple)\vee\neg Fruit(Watermelon)
  • With C1 and then C3: ¬Fruit(Watermelon)\neg Fruit(Watermelon)
  • With C5 using {x/Watermelon, y/Ava}\{x/Watermelon,\ y/Ava\}: ¬Eats(Ava,Watermelon)∨¬Loves(Ava,Watermelon)\neg Eats(Ava,Watermelon)\vee\neg Loves(Ava,Watermelon)
  • With C2 and then C4: empty clause. Hence both are fruits.

(c) Ava eats watermelon and loves it so much. Negated goal: ¬Eats(Ava,Watermelon)∨¬Loves(Ava,Watermelon)\neg Eats(Ava,Watermelon)\vee\neg Loves(Ava,Watermelon). Resolving with C2 gives ¬Loves(Ava,Watermelon)\neg Loves(Ava,Watermelon), and with C4 gives the empty clause. Proved.

(d) Anything eaten by anybody and loved so much is a fruit. This is the general rule C5 itself. It is consistent with the facts: both items Ava eats and loves (apple, watermelon) are derived to be fruits in (b) by instantiating it with unification.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 10 marks

How do you evaluate any searching algorithm? What are constraint satisfaction problems? Differentiate between Greedy Best First Search and A* search.

Answer

Evaluating a search algorithm uses four criteria:

  1. Completeness: does it always find a solution if one exists?
  2. Optimality: does it find the least-cost solution?
  3. Time complexity: the number of nodes generated.
  4. Space complexity: the maximum number of nodes held in memory.

Complexity is expressed with bb (branching factor), dd (depth of shallowest goal) and mm (maximum depth).

Constraint satisfaction problems (CSPs): problems defined by

  • a set of variables X={X1,…,Xn}X=\{X_1,\dots,X_n\},
  • a domain DiD_i of allowed values for each variable,
  • a set of constraints specifying allowed combinations of values.

A solution is a complete assignment that satisfies all constraints. Examples: map colouring, N-queens, Sudoku, scheduling. They are solved by backtracking search with forward checking, arc consistency and heuristics like minimum remaining values.

Greedy Best-First vs A*

BasisGreedy best-firstA*
Evaluation functionf(n)=h(n)f(n)=h(n)f(n)=g(n)+h(n)f(n)=g(n)+h(n)
ConsidersOnly estimated cost to goalCost so far plus estimated cost to goal
CompleteNo (can loop)Yes (finite branching, positive costs)
OptimalNoYes if hh is admissible (and consistent for graph search)
SpeedOften fastSlower, more careful
MemoryCan be largeLarge, O(bd)O(b^d)

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 10 marks

Express the mathematical model of a neuron. Distinguish between learning rule and learning rate. How Back-propagation algorithm is used in learning? Explain.

Answer

Mathematical model of a neuron

A neuron receives inputs x1,…,xnx_1,\dots,x_n with weights w1,…,wnw_1,\dots,w_n and a bias bb. It computes the net input and applies an activation function ff:

net=∑i=1nwixi+b,y=f(net)net=\sum_{i=1}^{n} w_i x_i + b,\qquad y=f(net)

Common choices of ff: step, sigmoid f(z)=11+e−zf(z)=\dfrac{1}{1+e^{-z}}, tanh, ReLU.

Learning rule vs learning rate

  • A learning rule is the formula or procedure by which the weights are updated, e.g. the Hebbian rule Δwi=ηxiy\Delta w_i=\eta x_i y, the perceptron rule Δwi=η(t−y)xi\Delta w_i=\eta(t-y)x_i, the delta rule, or back-propagation.
  • The learning rate η\eta is a small positive constant inside that rule that scales the size of each weight update. Too large causes oscillation or divergence; too small makes learning slow.

Back-propagation

It trains a multilayer feed-forward network by gradient descent on the error E=12∑k(tk−yk)2E=\tfrac12\sum_k (t_k-y_k)^2.

  1. Initialise weights with small random values.
  2. Forward pass: present an input, compute hidden outputs and then output yky_k.
  3. Error: compute tk−ykt_k-y_k at the output.
  4. Backward pass: for sigmoid units,
    • output layer: δk=(tk−yk) yk(1−yk)\delta_k=(t_k-y_k)\,y_k(1-y_k)
    • hidden layer: δj=hj(1−hj)∑kδkwjk\delta_j=h_j(1-h_j)\sum_k \delta_k w_{jk}
  5. Update weights: Δwij=η δj xi\Delta w_{ij}=\eta\,\delta_j\,x_i, wij←wij+Δwijw_{ij}\leftarrow w_{ij}+\Delta w_{ij}.
  6. Repeat over all training patterns (epochs) until the error is below a threshold.

The error is propagated backward from the output layer, layer by layer, using the chain rule, so every weight gets its share of the gradient.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

What is the role of rewards and punishment in reinforcement learning? Describe with an example.

Answer

Reinforcement learning (RL) is learning by interaction: an agent takes actions in an environment, receives a numerical reward (positive feedback) or punishment (negative reward), and learns a policy that maximises the cumulative reward.

Role of reward and punishment

  • Reward reinforces the action that led to it, making it more likely to be chosen again in that state.
  • Punishment discourages the action that led to it.
  • They are the only teaching signal: there is no labelled correct answer, so the agent learns through trial and error.
  • They define the goal. The agent maximises the expected discounted return Gt=∑k=0∞γkrt+k+1G_t=\sum_{k=0}^{\infty}\gamma^k r_{t+k+1}, 0≤γ≤10\le\gamma\le1.
  • Delayed rewards force the agent to balance short-term and long-term gains, and exploration against exploitation.

Example: a robot in a maze. It gets +10+10 on reaching the exit, −10-10 for hitting a wall or trap, and −1-1 per step. Early on it moves randomly. Over many episodes, Q-learning updates

Q(s,a)←Q(s,a)+α[r+γmax⁡a′Q(s′,a′)−Q(s,a)]Q(s,a)\leftarrow Q(s,a)+\alpha\big[r+\gamma\max_{a'}Q(s',a')-Q(s,a)\big]

so actions leading to the exit gain high values, wall-hitting actions get low values, and the robot learns the shortest safe path. Other examples: game playing (AlphaGo), training a dog with treats.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Represent the following knowledge using conceptual dependency. (a) He opened the door (b) Ram gave rose to sita. (c) she is crying

Answer

Conceptual dependency (CD) represents the meaning of a sentence using primitive acts (e.g. ATRANS = transfer of possession, PTRANS = transfer of physical location, PROPEL = application of force, MOVE = move a body part, INGEST, EXPEL, MTRANS = transfer of mental information), with conceptual cases: actor, object, recipient, direction, instrument.

(a) He opened the door. (Door opened by moving the hand to push it.)

He⇔PROPEL←odoor←Rfrom closed to openHe \Leftrightarrow PROPEL \xleftarrow{o} door \xleftarrow{R}{\scriptstyle\text{from closed to open}}

  • Actor: He; act: PROPEL (applies force to the door; instrument: he MOVEs his hand to the door)
  • Object: door
  • Result: door's state changes, doordoor (position = closed) ⇒\Rightarrow doordoor (position = open)
  • Tense: past.

(b) Ram gave rose to Sita.

Ram⇔ATRANS←orose←R  Ram  SitaRam \Leftrightarrow ATRANS \xleftarrow{o} rose \xleftarrow{R}_{\;Ram}^{\;Sita}

  • Actor: Ram; act: ATRANS (transfer of possession)
  • Object: rose
  • Direction: from Ram (donor) to Sita (recipient)
  • Tense: past.

(c) She is crying.

She⇔EXPEL←otears←D  eyes  SheShe \Leftrightarrow EXPEL \xleftarrow{o} tears \xleftarrow{D}{}_{\;eyes}^{\;She}

  • Actor: She; act: EXPEL (tears expelled from her eyes), conceptually also showing the state SheShe (sad) as the cause
  • Object: tears
  • Tense: present (continuing).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Distinguish between Depth First Search and Breadth First Search.

Answer

BasisBreadth First SearchDepth First Search
StrategyExpands the shallowest unexpanded node (level by level)Expands the deepest unexpanded node
Data structureQueue (FIFO)Stack (LIFO) or recursion
CompletenessComplete if bb is finiteIncomplete in infinite or cyclic spaces
OptimalityOptimal when all step costs are equalNot optimal
Time complexityO(bd)O(b^d)O(bm)O(b^m)
Space complexityO(bd)O(b^d) (stores whole frontier)O(bm)O(bm) (only current path)
Best used whenSolution is shallow, shortest path neededSolution is deep, memory is limited

Here bb is the branching factor, dd the depth of the shallowest goal and mm the maximum depth. For a tree with root A, children B, C, and B's children D, E: BFS visits A, B, C, D, E; DFS visits A, B, D, E, C.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

What is rational agent? List some applications of AI.

Answer

Rational agent: an agent that, for each possible percept sequence, selects an action expected to maximise its performance measure, given the evidence from the percept sequence and its built-in knowledge. Rationality depends on the performance measure, prior knowledge, available actions and the percept sequence so far. Rational does not mean omniscient or perfect, only doing the best it can with what it knows.

Applications of AI

  • Healthcare: diagnosis, medical imaging, drug discovery
  • Robotics and automation: industrial robots, drones
  • Natural language processing: machine translation, chatbots, voice assistants
  • Computer vision: face recognition, object detection, self-driving cars
  • Expert systems: finance, fault diagnosis
  • Games: chess, Go
  • Education: intelligent tutoring, personalised learning
  • Banking and e-commerce: fraud detection, recommendation systems
  • Agriculture: crop monitoring, yield prediction

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Explain about unification and lifting with example.

Answer

Unification is the process of finding a substitution θ\theta that makes two logical expressions identical. Unify(p,q)=θUnify(p,q)=\theta such that SUBST(θ,p)=SUBST(θ,q)SUBST(\theta,p)=SUBST(\theta,q).

Example: Knows(John,x)Knows(John, x) and Knows(John,Jane)Knows(John, Jane) unify with θ={x/Jane}\theta=\{x/Jane\}. Knows(John,x)Knows(John,x) and Knows(y,Mother(y))Knows(y, Mother(y)) unify with θ={y/John, x/Mother(John)}\theta=\{y/John,\ x/Mother(John)\}. Knows(John,x)Knows(John,x) and Knows(x,Elizabeth)Knows(x,Elizabeth) fail, because xx cannot be both John and Elizabeth (this can be fixed by standardising variables apart).

Rules: a variable can be bound to a term; constants must match exactly; function symbols must match with unifiable arguments; a variable cannot be bound to a term containing itself (occurs check). The unifier returned should be the most general unifier (MGU).

Lifting means extending inference rules from propositional logic to first-order logic so that reasoning works directly with variables instead of instantiating all possible ground terms. Generalised Modus Ponens is the lifted rule:

p1′,…,pn′, (p1∧⋯∧pn⇒q)SUBST(θ,q)where SUBST(θ,pi′)=SUBST(θ,pi)\frac{p_1',\dots,p_n',\ (p_1\wedge\dots\wedge p_n\Rightarrow q)}{SUBST(\theta,q)}\quad\text{where } SUBST(\theta,p_i')=SUBST(\theta,p_i)

Example: given King(John)King(John), Greedy(John)Greedy(John) and King(x)∧Greedy(x)⇒Evil(x)King(x)\wedge Greedy(x)\Rightarrow Evil(x), unification finds θ={x/John}\theta=\{x/John\} and concludes Evil(John)Evil(John) in a single step, with no need to generate all instances. Lifting plus unification makes first-order inference (resolution, forward and backward chaining) efficient.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Distinguish between simple reflex agent and model based agent.

Answer

BasisSimple reflex agentModel-based reflex agent
Decision basisCurrent percept onlyCurrent percept plus internal state (history)
MemoryNoneMaintains an internal model of the world
Rule formCondition-action rules: if condition then actionUpdates state using how the world evolves and how its actions affect it, then applies rules
Partial observabilityFails or loopsHandles it by tracking unobserved parts
ComplexitySimple and fastMore complex
EnvironmentWorks only if the environment is fully observableWorks in partially observable environments
ExampleThermostat; vacuum that cleans if dirt is seenCar that remembers other vehicles when they are out of sight; lane-changing taxi

Structure: simple reflex: Sensors →\rightarrow condition-action rules →\rightarrow Actuators. Model-based: Sensors →\rightarrow update state (using world model) →\rightarrow rules →\rightarrow Actuators.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

How does script can be used in representing knowledge? Explain.

Answer

A script is a structured knowledge representation for a stereotyped sequence of events in a particular context, proposed by Schank and Abelson. It lets a system fill in unstated details and answer questions about typical situations such as eating at a restaurant, visiting a doctor, or attending a lecture.

Components

  • Entry conditions: conditions that must hold for the script to be invoked (the customer is hungry and has money).
  • Roles: the participants (customer, waiter, cook, cashier).
  • Props: objects used (table, menu, food, bill).
  • Track: a variant of the script (fast food, restaurant).
  • Scenes: the ordered sequence of events (entering, ordering, eating, exiting).
  • Results: conditions true after the script (customer is not hungry, has less money, owner has more money).

Example: restaurant script Scene 1 Entering: customer enters, looks for a table, sits. Scene 2 Ordering: gets menu, calls waiter, orders. Scene 3 Eating: cook prepares, waiter serves, customer eats. Scene 4 Exiting: waiter brings bill, customer pays, leaves.

Use in knowledge representation: Given "Ram went to a restaurant, ordered a pizza and left a tip", a system using the script infers that Ram sat down, was served, ate it and paid, though none of this is stated. It supports story understanding, question answering, and filling in missing information. Its limitation is that it is rigid and handles unusual situations poorly.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Explain the different steps in NLP.

Answer

NLP converts human language into machine-usable form and back through these steps:

  1. Lexical analysis (morphological): divide the text into paragraphs, sentences and words (tokenisation), identify word structure (root, prefix, suffix), and assign parts of speech.
  2. Syntactic analysis (parsing): check grammar and build a parse tree showing how words form phrases and sentences, using a grammar. "Ram eats rice" is parsed as S →\rightarrow NP VP. Ungrammatical sentences like "Rice Ram the eats" are rejected.
  3. Semantic analysis: assign meaning to the structure, mapping the parse into a context-free meaning representation (logical form). "Hot ice-cream" is semantically anomalous.
  4. Discourse integration: the meaning of a sentence depends on previous sentences, and affects later ones. It resolves pronouns: "Ram went to the market. He bought apples."
  5. Pragmatic analysis: interpret the sentence in terms of the real-world context and speaker intention. "Do you know the time?" is a request to tell the time.

Each step must resolve ambiguity. A typical flow is: input text →\rightarrow lexical →\rightarrow syntactic →\rightarrow semantic →\rightarrow discourse →\rightarrow pragmatic →\rightarrow meaning.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080.2 · 5 marks

Describe the components of expert system.

Answer

An expert system emulates a human expert in a narrow domain. Its components are:

  1. Knowledge base: domain facts and rules (typically IF-THEN production rules, frames or semantic nets) gathered from human experts.
  2. Inference engine: the reasoning mechanism. It matches facts against rules and derives conclusions by forward chaining (data-driven) or backward chaining (goal-driven), with a conflict-resolution strategy to choose which rule fires.
  3. Working memory: stores the facts about the current problem and intermediate conclusions.
  4. User interface: the means for the user to input data and receive advice, usually through questions, menus or natural language.
  5. Explanation subsystem: justifies the reasoning, answering "why do you ask this?" and "how did you reach this conclusion?".
  6. Knowledge acquisition subsystem: tool for the knowledge engineer to elicit, enter and update expert knowledge.

People involved: the domain expert, the knowledge engineer and the end user. Examples: MYCIN (medical), DENDRAL (chemistry), XCON (computer configuration).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 2+2+6 marks

Explain how problems are formulated in state space representation. Build a state space with start and goal states, assign heuristic and actual costs, and show a Greedy Best First Search path.

Answer

Problem formulation in state space representation

A problem is formulated by defining:

  1. State space: the set of all states reachable from the initial state by any sequence of actions.
  2. Initial state: where the agent starts.
  3. Actions/operators: the legal moves in each state.
  4. Transition model: the resulting state of applying an action.
  5. Goal test: whether a state is a goal.
  6. Path cost: a numeric cost for each path (sum of step costs).

A solution is a path from the initial state to a goal state.

State space with heuristics

Start SS, goal GG. Edges carry actual costs; each node carries a heuristic hh (estimated cost to GG).

NodehhEdges (actual cost)
S10S-A (2), S-B (3)
A7A-C (4), A-D (5)
B4B-D (3), B-E (6)
C6C-G (8)
D3D-G (5)
E2E-G (3)
G0goal

Greedy Best-First Search uses f(n)=h(n)f(n)=h(n) and always expands the open node with the smallest hh.

  1. Open = {S}. Expand S: A (h=7h=7), B (h=4h=4).
  2. Smallest is B (4). Expand B: D (3), E (2). Open = {A 7, D 3, E 2}.
  3. Smallest is E (2). Expand E: G (0).
  4. Pick G, the goal.

Path found: S→B→E→GS\rightarrow B\rightarrow E\rightarrow G with actual cost 3+6+3=123+6+3=12.

The path S→B→D→GS\rightarrow B\rightarrow D\rightarrow G costs 3+3+5=113+3+5=11, which is cheaper, so greedy best-first is fast but not optimal.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 4+6 marks

Explain unification and lifting in predicate logic. Build a first-order predicate logic knowledge base for four statements about students, smart people, and intelligence, then convert it to CNF.

Answer

Unification finds a substitution θ\theta that makes two predicate-logic expressions identical, e.g. Knows(John,x)Knows(John,x) and Knows(y,Mother(y))Knows(y,Mother(y)) unify with θ={y/John, x/Mother(John)}\theta=\{y/John,\ x/Mother(John)\}. The most general unifier (MGU) is used, and a variable cannot be bound to a term containing itself (occurs check).

Lifting means using inference rules directly on first-order sentences with variables, instead of converting to propositional logic by instantiating with every ground term. Generalised Modus Ponens uses unification to apply a rule: from King(John)King(John), Greedy(John)Greedy(John) and King(x)∧Greedy(x)⇒Evil(x)King(x)\wedge Greedy(x)\Rightarrow Evil(x) with θ={x/John}\theta=\{x/John\} we infer Evil(John)Evil(John) at once.

Knowledge base (FOL) for:

  1. Every student is smart.
  2. Smart people are intelligent.
  3. Ram is a student.
  4. Anyone who is intelligent passes the exam (or: Ram is not a fool).

Using predicates Student(x)Student(x), Smart(x)Smart(x), Intelligent(x)Intelligent(x), Passes(x)Passes(x):

  1. ∀x  [Student(x)→Smart(x)]\forall x\;[Student(x)\rightarrow Smart(x)]
  2. ∀x  [Smart(x)→Intelligent(x)]\forall x\;[Smart(x)\rightarrow Intelligent(x)]
  3. Student(Ram)Student(Ram)
  4. ∀x  [Intelligent(x)→Passes(x)]\forall x\;[Intelligent(x)\rightarrow Passes(x)]

Conversion to CNF

Eliminate implication (P→Q≡¬P∨QP\rightarrow Q\equiv\neg P\vee Q). All variables are universally quantified, so drop the quantifiers after standardising; there are no existentials, so no Skolemisation is needed.

  1. ¬Student(x)∨Smart(x)\neg Student(x)\vee Smart(x)
  2. ¬Smart(y)∨Intelligent(y)\neg Smart(y)\vee Intelligent(y)
  3. Student(Ram)Student(Ram)
  4. ¬Intelligent(z)∨Passes(z)\neg Intelligent(z)\vee Passes(z)

Check: resolving 3 with 1 (x/Ramx/Ram) gives Smart(Ram)Smart(Ram); with 2 gives Intelligent(Ram)Intelligent(Ram); with 4 gives Passes(Ram)Passes(Ram).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 2+8 marks

Define a learning rule. Explain how backpropagation trains an ANN.

Answer

Learning rule: the mathematical formula or procedure that specifies how the weights of a neural network are changed in response to inputs and (target) outputs, i.e. wnew=wold+Δww_{new}=w_{old}+\Delta w. Examples: Hebbian rule, perceptron rule, delta rule, back-propagation.

Training an ANN by back-propagation

Back-propagation trains a multilayer feed-forward network by gradient descent on the squared error

E=12∑k(tk−yk)2E=\frac12\sum_k (t_k-y_k)^2

where tkt_k is the target and yky_k the actual output.

Algorithm

  1. Initialise all weights and biases with small random values; choose learning rate η\eta.
  2. Forward pass: for an input pattern, compute hidden outputs hj=f(∑iwijxi+bj)h_j=f\big(\sum_i w_{ij}x_i+b_j\big) and output values yk=f(∑jwjkhj+bk)y_k=f\big(\sum_j w_{jk}h_j+b_k\big), with sigmoid f(z)=1/(1+e−z)f(z)=1/(1+e^{-z}) so f′=f(1−f)f'=f(1-f).
  3. Output error term:

δk=(tk−yk) yk(1−yk)\delta_k=(t_k-y_k)\,y_k(1-y_k)

  1. Hidden error term (error propagated back through the weights):

δj=hj(1−hj)∑kδk wjk\delta_j=h_j(1-h_j)\sum_k \delta_k\,w_{jk}

  1. Weight update:

Δwjk=η δk hj,Δwij=η δj xi\Delta w_{jk}=\eta\,\delta_k\,h_j,\qquad \Delta w_{ij}=\eta\,\delta_j\,x_i

and the biases similarly with input 1.

  1. Repeat steps 2-5 for all patterns (one epoch), and for many epochs until EE falls below a threshold or the epoch limit is reached.

The forward pass computes the output; the backward pass distributes the output error to every weight using the chain rule, so each weight moves in the direction that reduces EE. Limitations: may stop at local minima, and is slow if η\eta is badly chosen.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Define artificial intelligence and state the Turing Test.

Answer

Artificial intelligence (AI) is the branch of computer science concerned with building machines and software that perform tasks which normally require human intelligence, such as reasoning, learning, perception, problem solving and language understanding. Russell and Norvig classify definitions as systems that think like humans, act like humans, think rationally, or act rationally.

Turing Test

Proposed by Alan Turing in 1950 as an operational test for machine intelligence.

  • Three participants: a human interrogator, a human, and a machine, the latter two hidden in separate rooms.
  • The interrogator communicates only by text and asks any questions for a fixed period.
  • If the interrogator cannot reliably tell which respondent is the machine, the machine passes the test and is considered intelligent.

To pass, the machine needs natural language processing, knowledge representation, automated reasoning and machine learning. The Total Turing Test also needs computer vision and robotics. Criticism: Searle's Chinese Room argument says that passing shows imitation, not understanding.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 1+4 marks

Define an intelligent agent and build a PEAS description for a particle-picking robot.

Answer

Intelligent agent: an entity that perceives its environment through sensors and acts on it through actuators so as to achieve its goals, choosing actions that maximise its expected performance measure; it is autonomous, reactive and goal-directed.

PEAS for a particle-picking robot

ComponentDescription
Performance measurePercentage of particles correctly picked, number of particles picked per unit time, minimum wrongly picked or missed, low energy use, no damage to the objects
EnvironmentWork surface or conveyor belt carrying particles of different shapes, sizes and colours, bins, lighting, other objects
ActuatorsRobotic arm and joints, gripper or suction pick-up, conveyor or wheel motors, sorting mechanism
SensorsCamera (vision), proximity and touch sensors, force sensors in the gripper, position encoders

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Explain how iterative deepening search finds a goal in a state space, with an example.

Answer

Iterative deepening search (IDS) repeatedly runs depth-limited search with limit l=0,1,2,…l=0,1,2,\dots until a goal is found. It combines the small memory use of DFS with the completeness and optimality (for unit step cost) of BFS.

Algorithm

  1. For l=0,1,2,…l=0,1,2,\dots:
  2. Run depth-limited DFS to depth ll.
  3. If a goal is found, return the solution; otherwise (cutoff) increase ll and repeat.

Example: tree with S at root; children A, B; A's children C, D; B's children E, F; goal = F.

  • l=0l=0: visit S. Not goal.
  • l=1l=1: visit S, A, B. No goal.
  • l=2l=2: visit S, A, C, D, B, E, F. Goal F found.

The goal at depth 2 is found at iteration l=2l=2, so the shallowest goal is returned.

Properties

  • Complete (finite bb) and optimal for uniform step costs.
  • Time O(bd)O(b^d). The upper levels are regenerated, but it is a small overhead since most nodes are at the bottom level: nodes generated =(d)b+(d−1)b2+⋯+bd=(d)b+(d-1)b^2+\dots+b^d.
  • Space O(bd)O(bd).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 3+2 marks

State the Dempster-Shafer Theory and explain its use in statistical reasoning.

Answer

Dempster-Shafer Theory (DST) is a mathematical theory of evidence for reasoning under uncertainty that generalises Bayesian probability. Instead of assigning probability to single hypotheses, it assigns belief mass to sets of hypotheses, so ignorance can be represented explicitly.

  • Frame of discernment Θ\Theta: the set of all mutually exclusive hypotheses.
  • Basic probability assignment (mass) m:2Θ→[0,1]m:2^\Theta\rightarrow[0,1], with m(∅)=0m(\emptyset)=0 and ∑A⊆Θm(A)=1\sum_{A\subseteq\Theta}m(A)=1.
  • Belief: Bel(A)=∑B⊆Am(B)Bel(A)=\sum_{B\subseteq A}m(B) (lower bound).
  • Plausibility: Pl(A)=1−Bel(¬A)Pl(A)=1-Bel(\neg A) (upper bound).
  • The interval [Bel(A),Pl(A)][Bel(A),Pl(A)] shows the uncertainty about AA.

Dempster's rule of combination for two independent evidence sources m1,m2m_1,m_2:

m12(A)=∑B∩C=Am1(B) m2(C)1−K,K=∑B∩C=∅m1(B) m2(C)m_{12}(A)=\frac{\sum_{B\cap C=A}m_1(B)\,m_2(C)}{1-K},\qquad K=\sum_{B\cap C=\emptyset}m_1(B)\,m_2(C)

Use in statistical reasoning: it lets a system combine evidence from several independent sources (sensors, experts, symptoms) to narrow down the set of possible hypotheses and compute belief intervals, without needing prior probabilities. Example: in medical diagnosis, two tests give mass to {flu, cold} and {flu}; combining them increases belief in {flu}. Applications include diagnosis, sensor fusion and expert systems.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 2+3 marks

Describe the mathematical model of an ANN and differentiate feed-forward from feed-back ANNs.

Answer

Mathematical model of an ANN

An artificial neuron receives inputs x1,…,xnx_1,\dots,x_n with weights w1,…,wnw_1,\dots,w_n and bias bb. It computes

net=∑i=1nwixi+b,y=f(net)net=\sum_{i=1}^{n}w_ix_i+b,\qquad y=f(net)

where ff is an activation function (step, sigmoid 1/(1+e−z)1/(1+e^{-z}), tanh, ReLU). A network arranges many such neurons in layers, with the weights learned from data.

Feed-forward vs feedback ANN

BasisFeed-forwardFeed-back (recurrent)
Signal flowOne direction, input →\rightarrow hidden →\rightarrow outputLoops: outputs are fed back as inputs
CyclesNonePresent
MemoryNone; output depends on the current inputHas memory of earlier states
BehaviourStatic mappingDynamic system
ExamplesPerceptron, MLPHopfield, Elman, LSTM
UseClassification, regressionSequence prediction, associative memory

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Explain how a genetic algorithm performs learning.

Answer

A genetic algorithm learns by evolving a population of candidate solutions (hypotheses), keeping and combining those that perform well, as in natural selection.

Learning process

  1. Encode each hypothesis as a chromosome (a bit string, e.g. a rule or a set of weights) and create a random initial population.
  2. Evaluate fitness: score each chromosome by how well it performs the task, e.g. accuracy on training data.
  3. Select parents with probability proportional to fitness (roulette wheel or tournament).
  4. Crossover: swap parts of two parents at a random point to produce children that mix their features.
  5. Mutation: flip random bits with small probability, introducing new features and avoiding premature convergence.
  6. Replace the old population with the new generation (keeping elites if used).
  7. Repeat steps 2-6 over many generations until a fitness threshold or generation limit.

Each generation the average fitness rises, so the population "learns" a good hypothesis. Example: learning classification rules, where each chromosome encodes a rule and fitness is the number of training examples it classifies correctly. GAs are used for optimisation, scheduling and tuning neural networks.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 2+3 marks

Explain how an expert system works and describe its architecture.

Answer

Working: An expert system captures an expert's knowledge as rules in a knowledge base. The user enters the facts of a case through the user interface; the inference engine matches these facts with the rules, using forward or backward chaining, derives new facts and conclusions, and presents advice with an explanation of the reasoning.

Architecture

  1. Knowledge base: domain facts and IF-THEN rules supplied by experts.
  2. Inference engine: applies the rules to the facts to deduce conclusions, controlling the order of rule firing.
  3. Working memory: current facts and intermediate results of the case.
  4. User interface: for entering queries and viewing results.
  5. Explanation facility: tells the user how and why a conclusion was reached.
  6. Knowledge acquisition module: lets the knowledge engineer build and update the knowledge base.

Examples: MYCIN (diagnosis of bacterial infections), DENDRAL (molecular structure).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Discuss discourse and pragmatic analysis in natural language processing.

Answer

Discourse analysis (discourse integration)

Sentences in a text are not independent: the meaning of a sentence depends on the sentences before it and influences the interpretation of those after it. Discourse analysis therefore studies how sentences connect to form a coherent text. Its main tasks:

  • Anaphora (pronoun) resolution: linking pronouns and referring expressions to earlier entities. "Ram went to the shop. He bought milk." - He = Ram.
  • Coherence relations: identifying cause, contrast, sequence or elaboration between sentences.
  • Ellipsis and reference across sentences, and discourse structure (topic and segment boundaries).

Pragmatic analysis

Pragmatics interprets language in terms of the real-world context, the speaker's intention and shared knowledge, going beyond the literal meaning. It resolves what the speaker really means, using situation and world knowledge.

  • "Can you pass the salt?" is a request, not a question about ability.
  • "It's cold here." may mean "please close the window."
  • Handling of speech acts (request, promise, question), irony, politeness and implicature.

It is the final stage of NLP, applied after lexical, syntactic and semantic analysis, and is needed by dialogue systems, chatbots and question answering. It is hard because it requires extensive common-sense knowledge.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 3+2 marks

Explain how scripts represent knowledge, with an example.

Answer

A script is a structured representation of a stereotyped sequence of events in a familiar situation (Schank and Abelson), used to fill in missing details when understanding stories and answering questions.

Components: entry conditions, roles (actors), props (objects), scenes (ordered events), tracks (variations), and results (conditions after completion).

How it represents knowledge: the script stores the typical events in order, using primitive acts from conceptual dependency. When a story fits the script, the system assumes the usual events happened even if unstated, which supports inference and prediction.

Example: restaurant script

  • Entry conditions: customer is hungry and has money.
  • Roles: customer, waiter, cook, cashier. Props: table, menu, food, bill, money.
  • Scene 1, entering: customer enters, finds a table, sits.
  • Scene 2, ordering: reads menu, calls waiter, orders.
  • Scene 3, eating: food is brought and eaten.
  • Scene 4, exiting: gets bill, pays, leaves.
  • Results: customer is full and has less money; restaurant has more money.

Given "Sita went to a restaurant and ordered momo, then left", the script lets the system answer "Did Sita eat?" (yes) and "Did she pay?" (yes), though neither was stated.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2+6+2 marks

Construct a state space graph with start state, intermediate states and goal state. Show DFS is not complete and BFS is complete over the state space, and whether depth-limited search fixes DFS's incompleteness.

Answer

State space graph

Start state SS, goal state GG. Edges (directed): S→AS\rightarrow A, S→BS\rightarrow B, A→CA\rightarrow C, C→AC\rightarrow A (a cycle), A→DA\rightarrow D, B→GB\rightarrow G.

S -> A -> C -> A (cycle)
|    |
|    -> D
-> B -> G

Intermediate states: A, B, C, D. Goal: G.

DFS is not complete. DFS, taking successors in alphabetical order, goes S, A, then C, then back to A, then C, and so on. It follows the cycle A→C→A→…A\rightarrow C\rightarrow A\rightarrow\dots forever and never backtracks to B, although G is reachable via S→B→GS\rightarrow B\rightarrow G. (An infinitely deep branch has the same effect.) So DFS fails to find a solution that exists, hence is incomplete.

BFS is complete. BFS expands level by level: level 0: S; level 1: A, B; level 2: C, D, G (from A: C, D; from B: G). It reaches G at depth 2 before exploring any deeper, so it terminates with the shallowest solution S→B→GS\rightarrow B\rightarrow G. Since the branching factor is finite, BFS always finds a goal if one exists.

Does depth-limited search fix DFS? Partly. With limit ll, DFS backtracks at depth ll, so it cannot loop forever: with l=2l=2 it explores S, A, C (cut off), D, then backtracks to B and reaches G at depth 2, so it finds the solution. But with l=1l=1 it returns cutoff and fails, since G is at depth 2. So DLS guarantees termination but is complete only if l≥dl\ge d (depth of the shallowest goal). It is also not optimal if l>dl>d. Iterative deepening, which increases ll gradually, fully fixes the incompleteness.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 3+7 marks

Differentiate forward and backward chaining. Convert the given statements about students, John, and the IT course into FOPL, then use resolution to check whether John is talent.

Answer

Forward vs backward chaining

BasisForward chainingBackward chaining
DirectionData-driven: starts from known facts and applies rules to derive new factsGoal-driven: starts from the goal and works back to find facts that support it
ReasoningFacts →\rightarrow conclusionGoal →\rightarrow facts
UseMonitoring, planning, prediction (what follows?)Diagnosis, query answering (is this true?)
EfficiencyMay derive many irrelevant factsExplores only rules relevant to the goal
Example systemsOPS5, CLIPSProlog, MYCIN

Statements (as commonly given)

  1. All students who take the IT course are talented.
  2. John is a student.
  3. John takes the IT course.

FOPL

  1. ∀x [Student(x)∧Takes(x,IT)→Talent(x)]\forall x\,[Student(x) \land Takes(x, IT) \rightarrow Talent(x)]
  2. Student(John)Student(John)
  3. Takes(John,IT)Takes(John, IT)

Goal: prove Talent(John)Talent(John).

Resolution

Convert to clauses:

  • C1: ¬Student(x)∨¬Takes(x,IT)∨Talent(x)\neg Student(x) \lor \neg Takes(x, IT) \lor Talent(x)
  • C2: Student(John)Student(John)
  • C3: Takes(John,IT)Takes(John, IT)
  • C4 (negated goal): ¬Talent(John)\neg Talent(John)

Steps:

  • C1 and C4 with x/Johnx/John give C5: ¬Student(John)∨¬Takes(John,IT)\neg Student(John) \lor \neg Takes(John, IT)
  • C5 and C2 give C6: ¬Takes(John,IT)\neg Takes(John, IT)
  • C6 and C3 give the empty clause □\square.

The negated goal leads to a contradiction, so Talent(John)Talent(John) is true: John is talented.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 3+7 marks

Differentiate supervised from unsupervised learning. Explain how learning by genetic algorithm is done, with an example.

Answer

Supervised vs unsupervised learning

BasisSupervisedUnsupervised
DataLabelled (input and correct output)Unlabelled (inputs only)
GoalLearn a mapping from inputs to outputsDiscover structure or patterns in data
TasksClassification, regressionClustering, association, dimensionality reduction
FeedbackError against known targetNo target; uses similarity or density
ExamplesDecision trees, SVM, back-propagationk-means, PCA

Learning by genetic algorithm

A genetic algorithm (GA) is a search and learning method inspired by natural selection. A population of candidate solutions (chromosomes) evolves over generations.

Steps:

  1. Initialise a random population of chromosomes (e.g. bit strings).
  2. Evaluate each with a fitness function.
  3. Selection: choose fitter individuals as parents (roulette wheel, tournament).
  4. Crossover: swap parts of two parents to make offspring.
  5. Mutation: flip random bits with small probability to keep diversity.
  6. Replace the population with the new generation and repeat until the fitness is good enough or the generation limit is reached.

Example: maximise f(x)=x2f(x) = x^2 for 0≤x≤310 \le x \le 31 using 5-bit strings.

  • Initial population: 01101 (13), 11000 (24), 01000 (8), 10011 (19). Fitness: 169, 576, 64, 361.
  • Select 11000 and 10011 as parents (high fitness). Single-point crossover after bit 2: 11011 (27) and 10000 (16).
  • The offspring 11011 has fitness 729, better than any parent. Mutation may further vary it.
  • After several generations the population converges to 11111 (31) with fitness 961.

The system "learns" the best solution without being told the answer, only through fitness feedback.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2+3 marks

Define symbolic AI. State the properties an agent should have to pass the Turing Test.

Answer

Symbolic AI

Symbolic AI (classical or "good old-fashioned" AI) is the approach in which intelligence is produced by manipulating human-readable symbols according to explicit rules and logic. Knowledge is represented as symbols, predicates, rules and frames, and reasoning is done by search and inference (e.g. expert systems, theorem provers, Prolog).

Properties for passing the Turing Test

To convince a human interrogator that it is human in a text conversation, the agent should have:

  • Natural language processing: to communicate in the human's language.
  • Knowledge representation: to store what it knows and hears.
  • Automated reasoning: to use the stored knowledge to answer questions and draw new conclusions.
  • Machine learning: to adapt to new circumstances and detect patterns.

(The total Turing Test adds computer vision and robotics to perceive objects and manipulate them.)

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2+3 marks

Differentiate stochastic from deterministic environments. Construct a PEAS framework for an agent of your choice.

Answer

Stochastic vs deterministic environment

DeterministicStochastic
The next state is completely determined by the current state and the agent's actionThe next state involves randomness; the same action in the same state may give different results
No uncertainty for the agentAgent must handle uncertainty and probabilities
Example: chess, crossword puzzleExample: taxi driving, poker, backgammon

PEAS for an automated taxi driver

  • Performance measure: safe, fast, legal, comfortable trip; minimum fuel use and fare maximised.
  • Environment: roads, other vehicles, pedestrians, traffic signals, weather, passengers.
  • Actuators: steering, accelerator, brake, horn, indicators, display.
  • Sensors: cameras, GPS, speedometer, odometer, sonar/lidar, microphone, keyboard.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 5 marks

Construct a game-search state space with utilities. Show how minimax searches it and identify any alpha and beta cutoffs.

Answer

Game tree with utilities

Take a two-player game where MAX moves first, then MIN, with leaf utilities:

            MAX (A)
        /     |     \
     B(min)  C(min)  D(min)
     /  \    /  \    /  \
    3   12  2    4  14   5

Minimax

  • B = min(3, 12) = 3
  • C = min(2, 4) = 2
  • D = min(14, 5) = 5
  • A = max(3, 2, 5) = 5, so MAX plays the move to D.

Alpha-beta cutoffs (left to right)

  • Visit B: leaves 3 then 12 give B = 3. Root alpha becomes 3.
  • Visit C: first leaf 2 gives beta = 2, which is ≤α=3\le \alpha = 3. MIN can force at most 2, which MAX will never choose, so the leaf 4 is pruned (alpha cutoff).
  • Visit D: leaf 14 gives beta = 14 (> alpha, continue), leaf 5 gives D = 5. Alpha becomes 5.
  • Root value = 5.

Only the leaf 4 is cut off here; the result is the same as minimax with fewer node evaluations. Beta cutoffs occur symmetrically at MIN nodes' parents when a MAX node finds a value ≥β\ge \beta.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2.5+2.5 marks

Explain knowledge representation using conceptual dependency. Represent three sentences about Hari, Ram, and a story using it.

Answer

Conceptual dependency (CD)

Conceptual dependency, proposed by Roger Schank, represents the meaning of sentences independent of the language, using a small set of primitive acts and conceptual categories, so that sentences with the same meaning get the same representation.

Main elements:

  • Primitive acts: ATRANS (transfer of possession), PTRANS (physical transfer of location), MTRANS (transfer of mental information), PROPEL (apply force), INGEST, GRASP, SPEAK, MBUILD, etc.
  • Conceptual categories: PP (picture producer: actor/object), ACT, PA (picture aid: attribute), AA (action aid), T (time), LOC (location).
  • Dependencies/arrows: ⇔\Leftrightarrow (actor-action link), →\rightarrow (object), ←\leftarrow direction (to/from), oo (object case), RR (recipient), DD (direction), tense markers pp (past), ff (future).

Examples

  1. "Hari gave Ram a book."

Hari⇔ATRANS←obook←R(to:Ramfrom:Hari)Hari \Leftrightarrow ATRANS \xleftarrow{o} book \xleftarrow{R} \begin{pmatrix} to: Ram \\ from: Hari \end{pmatrix}

(past tense, pp, above the double arrow)

  1. "Ram went to school."

Ram⇔PTRANS←oRam←D(to:schoolfrom:unknown)Ram \Leftrightarrow PTRANS \xleftarrow{o} Ram \xleftarrow{D} \begin{pmatrix} to: school \\ from: unknown \end{pmatrix}

  1. "Hari told Ram a story."

Hari⇔MTRANS←ostory←R(to:Ram′s memoryfrom:Hari′s memory)Hari \Leftrightarrow MTRANS \xleftarrow{o} story \xleftarrow{R} \begin{pmatrix} to: Ram's\ memory \\ from: Hari's\ memory \end{pmatrix}

Each sentence reduces to one primitive act with actor, object and direction slots, which helps in paraphrasing and inference.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 3+2 marks

Explain the development of expert systems and discuss their applications.

Answer

Expert system

An expert system is a program that captures the knowledge of a human expert in a narrow domain and uses it to solve problems and give advice at expert level.

Development of expert systems

  1. Problem identification and feasibility: choose a suitable domain (well defined, expertise available, benefit justifies cost).
  2. Knowledge acquisition: the knowledge engineer elicits facts, rules and heuristics from the domain expert by interviews, observation and case study.
  3. Knowledge representation: encode knowledge as production rules, frames or semantic nets in the knowledge base.
  4. Inference engine design: select reasoning strategy (forward or backward chaining) and conflict resolution.
  5. User interface and explanation facility: allow questions, show why and how a conclusion was reached.
  6. Implementation: build with a shell (CLIPS, Prolog, Exsys).
  7. Testing, validation and refinement: compare results with experts, correct rules.
  8. Deployment and maintenance: update the knowledge base as the domain changes.

Components: knowledge base, inference engine, working memory, user interface, explanation module, knowledge acquisition module.

Applications

  • Medical diagnosis (MYCIN, for bacterial infections)
  • Mineral exploration (PROSPECTOR)
  • Chemical analysis (DENDRAL)
  • Computer configuration (XCON/R1)
  • Finance: loan approval, fraud detection
  • Fault diagnosis in machines and networks; agricultural advice; legal advice

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 3+2 marks

Define semantic analysis in NLP. Explain how ambiguities are handled.

Answer

Semantic analysis in NLP

Semantic analysis is the stage of natural language processing that determines the meaning of a sentence. It maps the syntactic structure (parse tree) into a meaning representation, such as logical form or semantic networks, by assigning meanings to words, resolving word senses and combining them compositionally. For example, in "The pen is in the box", it must decide the sense of "pen" and the relation "in".

Handling ambiguities

Ambiguity occurs when an input has more than one interpretation. Types and treatment:

  • Lexical ambiguity (a word has several senses, e.g. "bank"): handled by word sense disambiguation using context, selectional restrictions and statistical co-occurrence.
  • Syntactic (structural) ambiguity ("I saw the man with a telescope"): keep multiple parses, then choose using preference rules, probabilistic grammars or semantic constraints.
  • Semantic ambiguity (scope of quantifiers): use semantic constraints and world knowledge.
  • Referential/anaphoric ambiguity ("Ram told Hari that he won"): resolve pronouns through discourse context and recency or agreement rules.
  • Pragmatic ambiguity: use knowledge of the speaker's intention and the situation.

General strategy: generate all interpretations, then prune using context, domain knowledge and probabilities, or ask the user for clarification.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2+3 marks

Define an artificial neural network. Define learning rule and learning rate.

Answer

Artificial neural network (ANN)

An ANN is a computational model inspired by the biological brain, made of many simple processing units (neurons) connected by weighted links. Each neuron computes a weighted sum of its inputs and passes it through an activation function:

y=f(∑i=1nwixi+b)y = f\left(\sum_{i=1}^{n} w_i x_i + b\right)

The network learns by adjusting weights from examples, and is used for classification, pattern recognition and prediction.

Learning rule

A learning rule is the procedure or formula by which the weights of the network are updated during training so that the output approaches the desired output. Examples: Hebbian rule Δwij=η xiyj\Delta w_{ij} = \eta\, x_i y_j, perceptron rule, delta (Widrow-Hoff) rule Δwi=η(t−y)xi\Delta w_i = \eta (t - y) x_i, and back-propagation.

Learning rate

The learning rate η\eta (a small positive constant, usually 0<η≤10 < \eta \le 1) controls the size of the weight update at each step. A large η\eta learns fast but may overshoot or oscillate; a small η\eta is stable but slow.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 2+3 marks

Define a goal tree. Explain how problem decomposition is done using goal trees.

Answer

Goal tree

A goal tree (AND-OR tree) is a tree representation of a problem in which the root is the main goal and the children are subgoals into which it is decomposed. Nodes are linked by:

  • AND links: all subgoals must be solved for the parent to be solved.
  • OR links: solving any one subgoal is enough.

Leaves are primitive problems that can be solved directly.

Problem decomposition using goal trees

  1. Start with the original problem as the root goal.
  2. Break it into simpler subproblems. If all parts are needed, join them with an AND; if there are alternative ways, use OR.
  3. Continue decomposing each subgoal until each is a primitive (directly solvable) problem.
  4. Solve the leaves and propagate upward: an AND node is solved when all children are solved, an OR node when at least one child is solved.
  5. The root is solved when its solution subtree is found. Search (e.g. AO*) finds the least-cost solution subtree.

Example: goal "Go to Kathmandu" = OR(Travel by bus, Travel by plane). "Travel by bus" = AND(Buy ticket, Reach bus park, Board bus).

Useful in symbolic integration, theorem proving and planning.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2083 · 5 marks

Define an admissible heuristic. Formulate a state space with heuristics and actual costs, and show that greedy best-first search is not optimal.

Answer

Admissible heuristic

A heuristic h(n)h(n) is admissible if it never overestimates the true cost to reach the goal from node nn:

h(n)≤h∗(n)h(n) \le h^*(n)

where h∗(n)h^*(n) is the actual optimal cost from nn to the goal. A* with an admissible heuristic is optimal.

State space (S start, G goal)

Edges with actual costs, and heuristic values:

  • S →\rightarrow A (cost 2), S →\rightarrow B (cost 5)
  • A →\rightarrow G (cost 10)
  • B →\rightarrow G (cost 3)
  • h(S)=6h(S) = 6, h(A)=2h(A) = 2, h(B)=3h(B) = 3, h(G)=0h(G) = 0

Check admissibility: h(A)=2≤10h(A) = 2 \le 10, h(B)=3≤3h(B) = 3 \le 3, so hh is admissible.

Greedy best-first search expands the node with the smallest h(n)h(n) only.

  • From S, successors A (h=2h = 2) and B (h=3h = 3). Greedy picks A.
  • From A, reaches G. Path S-A-G, cost 2+10=122 + 10 = 12.

The optimal path is S-B-G with cost 5+3=85 + 3 = 8.

Since 12 > 8, greedy best-first search returned a non-optimal path because it ignores the cost already incurred g(n)g(n). A* using f=g+hf = g + h would give f(A)=4f(A) = 4, f(B)=8f(B) = 8, expand A, find G with f=12f = 12, then expand B (f=8f = 8) and find G with f=8f = 8, hence the optimal path.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

Questions from TU BIT 2079 Fourth Semester Web Technology I (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fourth Semester Web Technology I (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2080.2 Fourth Semester Web Technology I (TU IOST semester board exam, 2080.2 (BS), via StudyNp), TU BIT 2081 Fourth Semester Web Technology I (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fourth Semester Web Technology I (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2083 Fourth Semester Web Technology I (TU IOST semester board exam, 2083 (BS), via StudyNp), TU BIT 2079 Fourth Semester Artificial Intelligence (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fourth Semester Artificial Intelligence (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2080.2 Fourth Semester Artificial Intelligence (TU IOST semester board exam, 2080.2 (BS), via StudyNp), TU BIT 2082 Fourth Semester Artificial Intelligence (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2083 Fourth Semester Artificial Intelligence (TU IOST semester board exam, 2083 (BS), via StudyNp), TU BIT 2079 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2080.2 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2080.2 (BS), via StudyNp), TU BIT 2081 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2083 Fourth Semester Systems Analysis and Design (TU IOST semester board exam, 2083 (BS), via StudyNp), TU BIT 2079 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2080.2 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2080.2 (BS), via StudyNp), TU BIT 2081 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2083 Fourth Semester Network and Data Communications (TU IOST semester board exam, 2083 (BS), via StudyNp), TU BIT 2079 Fourth Semester Operations Research (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fourth Semester Operations Research (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2080.2 Fourth Semester Operations Research (TU IOST semester board exam, 2080.2 (BS), via StudyNp), TU BIT 2081 Fourth Semester Operations Research (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fourth Semester Operations Research (TU IOST semester board exam, 2082 (BS), via StudyNp) and TU BIT 2083 Fourth Semester Operations Research (TU IOST semester board exam, 2083 (BS), via StudyNp). Answers are written for this site; check them against your class notes.