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 = number of tiles (not counting the blank) out of place compared with the goal. Hill climbing moves to the neighbour with the lowest and stops if no neighbour is better.
Step 1. Start has (tiles 2, 8, 1, 6 misplaced). Blank moves:
- Up:
2 8 3 / 1 _ 4 / 7 6 5, - Left:
- Right:
Best is Up, .
Step 2. From 2 8 3 / 1 _ 4 / 7 6 5:
- Up:
2 _ 3 / 1 8 4 / 7 6 5, - Left:
2 8 3 / _ 1 4 / 7 6 5, - Right:
2 8 3 / 1 4 _ / 7 6 5,
No neighbour has . 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 ):
- Take Up:
2 _ 3 / 1 8 4 / 7 6 5, - Blank left:
_ 2 3 / 1 8 4 / 7 6 5, - Blank down:
1 2 3 / _ 8 4 / 7 6 5, - Blank right:
1 2 3 / 8 _ 4 / 7 6 5, , 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
- 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.
- 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)
- (b) (: y is a child of x)
- (c)
- (d)
- (e)
- (f)
Goal: .
Clauses (CNF)
- (Skolem function )
- Negated goal:
Resolution proof
- 10 and 3 with : (11)
- 6 and 7 with : (12)
- 4 and 12 with : (13)
- 13 and 5: (14)
- 14 and 11: empty clause (contradiction)
The negated goal leads to a contradiction, so 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 agent | Utility-based agent |
|---|---|
| Chooses actions only to achieve a stated goal | Chooses actions to maximise a utility (degree of happiness) function |
| Goal gives a binary view: achieved or not achieved | Gives a measure of how good a state is, so states can be ranked |
| Cannot distinguish between several action sequences that all reach the goal | Can pick the best among many ways, e.g. the fastest, safest or cheapest |
| Cannot handle conflicting goals or uncertainty well | Handles conflicting goals (speed vs safety) and uncertain outcomes using expected utility |
| Uses search and planning to reach the goal | Uses a utility function plus probabilities to select the action with maximum expected utility |
| Example: a taxi that just reaches the destination | Example: 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, . The activation function transforms this value into the neuron's output, . 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
- Step (threshold) function: if , else . Used in the perceptron.
- Sigmoid (logistic): , output between 0 and 1, used for probabilities.
- Tanh: , output between and , zero-centred.
- ReLU: , fast and widely used in deep networks.
- Leaky ReLU: for , otherwise.
- Softmax: converts a vector into probabilities that sum to 1, used in the output layer for multi-class classification.
- Linear (identity): , 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 (the set of all mutually exclusive hypotheses). Ignorance can be represented, as mass left on itself rather than being split equally.
- Basic probability assignment (mass) : and .
- Belief: (lower bound).
- Plausibility: (upper bound).
- The certainty about is the interval .
- Dempster's rule of combination merges two independent evidence sources:
Example. Let .
- Evidence 1: , .
- Evidence 2: , , .
Conflict: .
So and . The belief in flu is in the interval , 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
- Knowledge base: stores domain facts and rules (usually IF-THEN production rules), obtained from experts.
- 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.
- Working memory (database): holds the facts of the current problem and intermediate results.
- User interface: lets the user enter queries and facts and view results, often in natural language or menus.
- Explanation facility: explains how a conclusion was reached (HOW) and why a question is being asked (WHY).
- 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.
- : the best (highest) value found so far for the MAX player along the path, initially .
- : the best (lowest) value found so far for the MIN player, initially .
A branch is pruned whenever , 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 at MAX. In the second MIN child the first leaf is 2. MIN can get at most 2, which is less than , 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 to about , where is the branching factor and 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
| Basis | BFS | DFS |
|---|---|---|
| Data structure | Queue (FIFO) | Stack (LIFO) / recursion |
| Order | Expands all nodes at depth before depth | Goes down one branch to the deepest node, then backtracks |
| Completeness | Complete (finite branching factor) | Not complete in infinite or cyclic spaces |
| Optimality | Optimal for uniform step cost | Not optimal |
| Time | ||
| Space | , large | , small |
| Use | Shortest path | Memory-limited problems, deep solutions |
Here is the branching factor, the depth of the shallowest goal and 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.
- 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.
- 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.
- 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.
- Referential (anaphoric) ambiguity: a pronoun or phrase can refer to several earlier entities. "Ram told Hari that he won" - who is "he"?
- Pragmatic ambiguity: the intended meaning depends on context or speaker intention. "Can you pass the salt?" is a request, not a question about ability.
- 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
- Retrieve a similar past case (source) from memory.
- Find the mapping between the source and the target problem.
- Transfer the source's solution or knowledge to the target.
- Adapt it to the differences, and test it.
- 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 is understood as the analogue of flow pressureresistance. 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
- Natural language processing to communicate in a human language.
- Knowledge representation to store what it knows or 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 for perceiving and manipulating objects.
Ambiguities at each NLP step
| Step | Ambiguity |
|---|---|
| Lexical analysis | Word boundaries, and a word with several categories or senses: "bank", "light" (noun, verb, adjective). |
| Syntactic analysis | Several parse trees: "I saw the girl with a telescope". |
| Semantic analysis | Multiple meanings and quantifier scope: "Every man loves a woman". |
| Discourse integration | A sentence's meaning depends on earlier ones; pronoun reference: "Ram met Hari. He was ill." |
| Pragmatic analysis | Intended 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: .
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:
| P | E | A | S |
|---|---|---|---|
| Safe, fast, legal, comfortable trip, profit | Roads, traffic, pedestrians, customers | Steering, accelerator, brake, signal, horn | Cameras, GPS, speedometer, sonar, odometer |
Types of environment
- Fully vs partially observable: sensors give the complete state or not. Chess is fully observable; poker and taxi driving are partially observable.
- Deterministic vs stochastic: the next state is fully determined by the current state and action or not. Chess is deterministic; taxi driving is stochastic.
- Episodic vs sequential: in episodic environments each decision is independent (image classification); in sequential ones the current action affects future ones (chess, taxi).
- Static vs dynamic: whether the environment changes while the agent deliberates. Crossword is static; taxi driving is dynamic.
- Discrete vs continuous: finite number of states and actions (chess) or continuous values (taxi speed, position).
- Single vs multi-agent: crossword is single-agent; chess is competitive multi-agent; taxi driving is cooperative/competitive multi-agent.
- 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 as if they had no successors. Hence it never goes deeper than , so it always terminates, and memory stays .
It returns three outcomes: a solution, failure (no solution at all), or cutoff (no solution within limit ).
Limitations
- Incomplete if the shallowest goal is deeper than ().
- Not optimal if , since it may return a deeper solution first.
- Choosing a good needs knowledge of the problem (e.g. the diameter of the state space). A bad choice gives failure or wasted time.
- Time is .
Iterative deepening search removes the need to choose by trying .
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 is the example. The problem is the root. It can be solved by two OR alternatives:
- : AND of sub-problems
- : AND of sub-problems
Let be , be , be . The cost of multiplying a matrix with a matrix is .
- : costs ; then costs . Total .
- : costs ; then costs . Total .
Steps of AO*:
- Start with the root and expand it, giving the two AND arcs with heuristic estimates for each unsolved child.
- 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.
- Expand an unsolved leaf on the best path, recompute costs, and propagate revised costs back up to the root.
- Repeat until the root is labelled solved.
The best solution graph is the arc with cost , so the order of multiplication is .
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
- Knowledge base: domain facts and heuristic rules (usually IF-THEN) obtained from experts.
- 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.
- Working memory (fact base): the current facts of the case being solved plus conclusions drawn so far.
- User interface: lets the user enter queries and facts and see results in a natural, convenient form.
- Explanation facility: explains why a question is asked and how a conclusion was reached, which builds trust.
- 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
- Initialisation: create a random population of individuals (chromosomes), each encoding a solution as a bit string or similar.
- Fitness evaluation: compute a fitness value for every chromosome using an objective function.
- Selection: choose fitter individuals as parents (roulette wheel, tournament, rank selection).
- Crossover: combine two parents at a crossover point to make offspring. For example and give and .
- Mutation: randomly flip a few bits with small probability to maintain diversity and escape local optima.
- Replacement: form the new generation from offspring (and possibly the best old individuals, called elitism).
- 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.
- Single-layer feed-forward network (perceptron): inputs connect directly to output neurons. It can solve only linearly separable problems such as AND and OR.
- 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.
- 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.
- Radial Basis Function network: hidden units use radial (Gaussian) functions; used for function approximation and classification.
- Self-organising map (Kohonen): unsupervised, competitive learning that clusters input data onto a low-dimensional map.
- 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 with respect to task and performance measure if its performance on , measured by , improves with . 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.
| Basis | Forward chaining | Backward chaining |
|---|---|---|
| Direction | From facts to goal | From goal to facts |
| Driven by | Data | Goal |
| Approach | Bottom-up | Top-down |
| Efficiency | May derive many irrelevant facts | Explores only relevant rules |
| Use | Monitoring, planning, design | Diagnosis, query answering |
| Example system | CLIPS, OPS5 | Prolog, MYCIN |
Example Rules: R1: ; R2: ; R3: . Facts: . Goal: .
- Forward: fire R1, giving ; fires R2, giving ; fires R3, giving . Goal reached.
- Backward: to prove use R3, so prove ; use R2, so prove ; use R1, so prove and ; both are known facts. Hence 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. win, draw, 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: with litres in the 4-litre jug, in the 3-litre jug; , .
- Initial state: . Goal state: for any .
- Operators:
- Fill the 4-litre jug: if
- Fill the 3-litre jug: if
- Empty either jug: or
- Pour 3-litre into 4-litre until full or empty: if , else
- Pour 4-litre into 3-litre similarly.
- A solution path: .
The goal 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:
- Plants are living things (or: Animals and plants are living things).
- A rose is a plant.
- A carnivore is an animal that eats animals.
- A tiger is a carnivore.
- 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 means directly influences ( is a parent of ).
- Each node has a conditional probability table (CPT) .
The joint distribution factorises as
Example (alarm network): Burglary (B) and Earthquake (E) cause Alarm (A); Alarm causes JohnCalls (J).
Let , , , , , , , .
Probability that John calls, the alarm sounds, with a burglary but no earthquake:
Belief networks allow inference under uncertainty, e.g. computing 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)
- Start with an initial state as current.
- Generate all successors of the current state and pick the best one.
- 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
- Local maxima: a peak higher than its neighbours but lower than the global maximum; the search gets stuck.
- Plateau: a flat region where all neighbours have equal value, so there is no direction to move.
- Ridges: a sequence of local maxima that are hard to climb since the needed move is not a single step.
- 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
- Choice of attributes: which attributes are important enough to represent (e.g. instance and isa), and whether they are general enough to support inheritance.
- Relationships between attributes: inverses, existence in an isa hierarchy, techniques for reasoning about values, and single-valued attributes.
- Granularity: the level of detail at which knowledge is stored - primitives or high-level facts.
- Representing sets of objects: properties of a set as a whole versus properties of its members.
- Finding the right structure: selecting the appropriate stored structure when it is needed.
- Also: incompleteness, uncertainty, inconsistency, and the trade-off between expressiveness and efficiency.
Resolution proof
Knowledge base in predicate logic:
- (anything eaten by anybody and loved so much is a fruit)
Clauses (CNF):
- C1:
- C2:
- C3:
- C4:
- C5:
- C6:
(a) Ava likes watermelon. Negated goal: . Resolve with C6 using to get . Resolve with C4 to get the empty clause. Hence proved.
(b) Apple and watermelon are fruits. Negated goal: .
- Resolve with C5 using :
- With C1 and then C3:
- With C5 using :
- With C2 and then C4: empty clause. Hence both are fruits.
(c) Ava eats watermelon and loves it so much. Negated goal: . Resolving with C2 gives , 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:
- Completeness: does it always find a solution if one exists?
- Optimality: does it find the least-cost solution?
- Time complexity: the number of nodes generated.
- Space complexity: the maximum number of nodes held in memory.
Complexity is expressed with (branching factor), (depth of shallowest goal) and (maximum depth).
Constraint satisfaction problems (CSPs): problems defined by
- a set of variables ,
- a domain 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*
| Basis | Greedy best-first | A* |
|---|---|---|
| Evaluation function | ||
| Considers | Only estimated cost to goal | Cost so far plus estimated cost to goal |
| Complete | No (can loop) | Yes (finite branching, positive costs) |
| Optimal | No | Yes if is admissible (and consistent for graph search) |
| Speed | Often fast | Slower, more careful |
| Memory | Can be large | Large, |
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 with weights and a bias . It computes the net input and applies an activation function :
Common choices of : step, sigmoid , 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 , the perceptron rule , the delta rule, or back-propagation.
- The learning rate 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 .
- Initialise weights with small random values.
- Forward pass: present an input, compute hidden outputs and then output .
- Error: compute at the output.
- Backward pass: for sigmoid units,
- output layer:
- hidden layer:
- Update weights: , .
- 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 , .
- 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 on reaching the exit, for hitting a wall or trap, and per step. Early on it moves randomly. Over many episodes, Q-learning updates
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.)
- Actor: He; act: PROPEL (applies force to the door; instrument: he MOVEs his hand to the door)
- Object: door
- Result: door's state changes, (position = closed) (position = open)
- Tense: past.
(b) Ram gave rose to Sita.
- Actor: Ram; act: ATRANS (transfer of possession)
- Object: rose
- Direction: from Ram (donor) to Sita (recipient)
- Tense: past.
(c) She is crying.
- Actor: She; act: EXPEL (tears expelled from her eyes), conceptually also showing the state (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
| Basis | Breadth First Search | Depth First Search |
|---|---|---|
| Strategy | Expands the shallowest unexpanded node (level by level) | Expands the deepest unexpanded node |
| Data structure | Queue (FIFO) | Stack (LIFO) or recursion |
| Completeness | Complete if is finite | Incomplete in infinite or cyclic spaces |
| Optimality | Optimal when all step costs are equal | Not optimal |
| Time complexity | ||
| Space complexity | (stores whole frontier) | (only current path) |
| Best used when | Solution is shallow, shortest path needed | Solution is deep, memory is limited |
Here is the branching factor, the depth of the shallowest goal and 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 that makes two logical expressions identical. such that .
Example: and unify with . and unify with . and fail, because 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:
Example: given , and , unification finds and concludes 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
| Basis | Simple reflex agent | Model-based reflex agent |
|---|---|---|
| Decision basis | Current percept only | Current percept plus internal state (history) |
| Memory | None | Maintains an internal model of the world |
| Rule form | Condition-action rules: if condition then action | Updates state using how the world evolves and how its actions affect it, then applies rules |
| Partial observability | Fails or loops | Handles it by tracking unobserved parts |
| Complexity | Simple and fast | More complex |
| Environment | Works only if the environment is fully observable | Works in partially observable environments |
| Example | Thermostat; vacuum that cleans if dirt is seen | Car that remembers other vehicles when they are out of sight; lane-changing taxi |
Structure: simple reflex: Sensors condition-action rules Actuators. Model-based: Sensors update state (using world model) rules 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:
- Lexical analysis (morphological): divide the text into paragraphs, sentences and words (tokenisation), identify word structure (root, prefix, suffix), and assign parts of speech.
- 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 NP VP. Ungrammatical sentences like "Rice Ram the eats" are rejected.
- Semantic analysis: assign meaning to the structure, mapping the parse into a context-free meaning representation (logical form). "Hot ice-cream" is semantically anomalous.
- 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."
- 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 lexical syntactic semantic discourse pragmatic 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:
- Knowledge base: domain facts and rules (typically IF-THEN production rules, frames or semantic nets) gathered from human experts.
- 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.
- Working memory: stores the facts about the current problem and intermediate conclusions.
- User interface: the means for the user to input data and receive advice, usually through questions, menus or natural language.
- Explanation subsystem: justifies the reasoning, answering "why do you ask this?" and "how did you reach this conclusion?".
- 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:
- State space: the set of all states reachable from the initial state by any sequence of actions.
- Initial state: where the agent starts.
- Actions/operators: the legal moves in each state.
- Transition model: the resulting state of applying an action.
- Goal test: whether a state is a goal.
- 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 , goal . Edges carry actual costs; each node carries a heuristic (estimated cost to ).
| Node | Edges (actual cost) | |
|---|---|---|
| S | 10 | S-A (2), S-B (3) |
| A | 7 | A-C (4), A-D (5) |
| B | 4 | B-D (3), B-E (6) |
| C | 6 | C-G (8) |
| D | 3 | D-G (5) |
| E | 2 | E-G (3) |
| G | 0 | goal |
Greedy Best-First Search uses and always expands the open node with the smallest .
- Open = {S}. Expand S: A (), B ().
- Smallest is B (4). Expand B: D (3), E (2). Open = {A 7, D 3, E 2}.
- Smallest is E (2). Expand E: G (0).
- Pick G, the goal.
Path found: with actual cost .
The path costs , 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 that makes two predicate-logic expressions identical, e.g. and unify with . 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 , and with we infer at once.
Knowledge base (FOL) for:
- Every student is smart.
- Smart people are intelligent.
- Ram is a student.
- Anyone who is intelligent passes the exam (or: Ram is not a fool).
Using predicates , , , :
Conversion to CNF
Eliminate implication (). All variables are universally quantified, so drop the quantifiers after standardising; there are no existentials, so no Skolemisation is needed.
Check: resolving 3 with 1 () gives ; with 2 gives ; with 4 gives .
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. . 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
where is the target and the actual output.
Algorithm
- Initialise all weights and biases with small random values; choose learning rate .
- Forward pass: for an input pattern, compute hidden outputs and output values , with sigmoid so .
- Output error term:
- Hidden error term (error propagated back through the weights):
- Weight update:
and the biases similarly with input 1.
- Repeat steps 2-5 for all patterns (one epoch), and for many epochs until 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 . Limitations: may stop at local minima, and is slow if 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
| Component | Description |
|---|---|
| Performance measure | Percentage of particles correctly picked, number of particles picked per unit time, minimum wrongly picked or missed, low energy use, no damage to the objects |
| Environment | Work surface or conveyor belt carrying particles of different shapes, sizes and colours, bins, lighting, other objects |
| Actuators | Robotic arm and joints, gripper or suction pick-up, conveyor or wheel motors, sorting mechanism |
| Sensors | Camera (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 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
- For :
- Run depth-limited DFS to depth .
- If a goal is found, return the solution; otherwise (cutoff) increase and repeat.
Example: tree with S at root; children A, B; A's children C, D; B's children E, F; goal = F.
- : visit S. Not goal.
- : visit S, A, B. No goal.
- : visit S, A, C, D, B, E, F. Goal F found.
The goal at depth 2 is found at iteration , so the shallowest goal is returned.
Properties
- Complete (finite ) and optimal for uniform step costs.
- Time . The upper levels are regenerated, but it is a small overhead since most nodes are at the bottom level: nodes generated .
- Space .
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 : the set of all mutually exclusive hypotheses.
- Basic probability assignment (mass) , with and .
- Belief: (lower bound).
- Plausibility: (upper bound).
- The interval shows the uncertainty about .
Dempster's rule of combination for two independent evidence sources :
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 with weights and bias . It computes
where is an activation function (step, sigmoid , tanh, ReLU). A network arranges many such neurons in layers, with the weights learned from data.
Feed-forward vs feedback ANN
| Basis | Feed-forward | Feed-back (recurrent) |
|---|---|---|
| Signal flow | One direction, input hidden output | Loops: outputs are fed back as inputs |
| Cycles | None | Present |
| Memory | None; output depends on the current input | Has memory of earlier states |
| Behaviour | Static mapping | Dynamic system |
| Examples | Perceptron, MLP | Hopfield, Elman, LSTM |
| Use | Classification, regression | Sequence 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
- Encode each hypothesis as a chromosome (a bit string, e.g. a rule or a set of weights) and create a random initial population.
- Evaluate fitness: score each chromosome by how well it performs the task, e.g. accuracy on training data.
- Select parents with probability proportional to fitness (roulette wheel or tournament).
- Crossover: swap parts of two parents at a random point to produce children that mix their features.
- Mutation: flip random bits with small probability, introducing new features and avoiding premature convergence.
- Replace the old population with the new generation (keeping elites if used).
- 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
- Knowledge base: domain facts and IF-THEN rules supplied by experts.
- Inference engine: applies the rules to the facts to deduce conclusions, controlling the order of rule firing.
- Working memory: current facts and intermediate results of the case.
- User interface: for entering queries and viewing results.
- Explanation facility: tells the user how and why a conclusion was reached.
- 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 , goal state . Edges (directed): , , , (a cycle), , .
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 forever and never backtracks to B, although G is reachable via . (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 . Since the branching factor is finite, BFS always finds a goal if one exists.
Does depth-limited search fix DFS? Partly. With limit , DFS backtracks at depth , so it cannot loop forever: with 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 it returns cutoff and fails, since G is at depth 2. So DLS guarantees termination but is complete only if (depth of the shallowest goal). It is also not optimal if . Iterative deepening, which increases 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
| Basis | Forward chaining | Backward chaining |
|---|---|---|
| Direction | Data-driven: starts from known facts and applies rules to derive new facts | Goal-driven: starts from the goal and works back to find facts that support it |
| Reasoning | Facts conclusion | Goal facts |
| Use | Monitoring, planning, prediction (what follows?) | Diagnosis, query answering (is this true?) |
| Efficiency | May derive many irrelevant facts | Explores only rules relevant to the goal |
| Example systems | OPS5, CLIPS | Prolog, MYCIN |
Statements (as commonly given)
- All students who take the IT course are talented.
- John is a student.
- John takes the IT course.
FOPL
Goal: prove .
Resolution
Convert to clauses:
- C1:
- C2:
- C3:
- C4 (negated goal):
Steps:
- C1 and C4 with give C5:
- C5 and C2 give C6:
- C6 and C3 give the empty clause .
The negated goal leads to a contradiction, so 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
| Basis | Supervised | Unsupervised |
|---|---|---|
| Data | Labelled (input and correct output) | Unlabelled (inputs only) |
| Goal | Learn a mapping from inputs to outputs | Discover structure or patterns in data |
| Tasks | Classification, regression | Clustering, association, dimensionality reduction |
| Feedback | Error against known target | No target; uses similarity or density |
| Examples | Decision trees, SVM, back-propagation | k-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:
- Initialise a random population of chromosomes (e.g. bit strings).
- Evaluate each with a fitness function.
- Selection: choose fitter individuals as parents (roulette wheel, tournament).
- Crossover: swap parts of two parents to make offspring.
- Mutation: flip random bits with small probability to keep diversity.
- Replace the population with the new generation and repeat until the fitness is good enough or the generation limit is reached.
Example: maximise for 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
| Deterministic | Stochastic |
|---|---|
| The next state is completely determined by the current state and the agent's action | The next state involves randomness; the same action in the same state may give different results |
| No uncertainty for the agent | Agent must handle uncertainty and probabilities |
| Example: chess, crossword puzzle | Example: 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 . 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 .
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: (actor-action link), (object), direction (to/from), (object case), (recipient), (direction), tense markers (past), (future).
Examples
- "Hari gave Ram a book."
(past tense, , above the double arrow)
- "Ram went to school."
- "Hari told Ram a story."
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
- Problem identification and feasibility: choose a suitable domain (well defined, expertise available, benefit justifies cost).
- Knowledge acquisition: the knowledge engineer elicits facts, rules and heuristics from the domain expert by interviews, observation and case study.
- Knowledge representation: encode knowledge as production rules, frames or semantic nets in the knowledge base.
- Inference engine design: select reasoning strategy (forward or backward chaining) and conflict resolution.
- User interface and explanation facility: allow questions, show why and how a conclusion was reached.
- Implementation: build with a shell (CLIPS, Prolog, Exsys).
- Testing, validation and refinement: compare results with experts, correct rules.
- 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:
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 , perceptron rule, delta (Widrow-Hoff) rule , and back-propagation.
Learning rate
The learning rate (a small positive constant, usually ) controls the size of the weight update at each step. A large learns fast but may overshoot or oscillate; a small 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
- Start with the original problem as the root goal.
- Break it into simpler subproblems. If all parts are needed, join them with an AND; if there are alternative ways, use OR.
- Continue decomposing each subgoal until each is a primitive (directly solvable) problem.
- 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.
- 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 is admissible if it never overestimates the true cost to reach the goal from node :
where is the actual optimal cost from to the goal. A* with an admissible heuristic is optimal.
State space (S start, G goal)
Edges with actual costs, and heuristic values:
- S A (cost 2), S B (cost 5)
- A G (cost 10)
- B G (cost 3)
- , , ,
Check admissibility: , , so is admissible.
Greedy best-first search expands the node with the smallest only.
- From S, successors A () and B (). Greedy picks A.
- From A, reaches G. Path S-A-G, cost .
The optimal path is S-B-G with cost .
Since 12 > 8, greedy best-first search returned a non-optimal path because it ignores the cost already incurred . A* using would give , , expand A, find G with , then expand B () and find G with , 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.