Chapter 1
Artificial Intelligence
TU BSc CSIT past exam questions
Past questions and answers
67 questions set from this chapter. Most repeated first.
- 2076 · 10 marks
Construct a state space with appropriate heuristics and local costs. Show that Greedy Best First search is not complete for the state space. Also illustrate A* is complete and guarantees solution for the same state space.
Answer
State space. Take an undirected graph with start , goal and two other nodes , . Edge costs (local costs) and heuristic values:
| Edge | Cost |
|---|---|
| – | 1 |
| – | 3 |
| – | 3 |
| Node | ||||
|---|---|---|---|---|
| 2 | 1 | 3 | 0 |
The true cost to the goal is , , , . Since everywhere, is admissible. It is also consistent: for example and .
Greedy best-first search (f(n) = h(n)) is not complete. It always expands the node with the smallest , ignoring the cost so far and (in tree search) repeated states.
| Step | Expanded | Frontier after expansion (node : h) |
|---|---|---|
| 1 | (h=2) | :1, :3 |
| 2 | (h=1) | :2, :3 |
| 3 | (h=2) | :1, :3, :3 |
| 4 | (h=1) | :2, :3, ... |
From the only successor is , and , so is chosen again, then again, and so on. The search oscillates forever and node (the only way to ) is never expanded. Hence greedy search fails to find a solution although one exists, so it is incomplete (in an infinite or looping state space).
A* search (f(n) = g(n) + h(n)) is complete here. Because grows with every move, a looping path eventually has a larger than the path that reaches the goal.
| Step | Expanded (g, f) | New nodes added (g, f) |
|---|---|---|
| 1 | (0, 2) | (1, 2), (3, 6) |
| 2 | (1, 2) | (2, 4) |
| 3 | (2, 4) | (3, 4), (5, 8) |
| 4 | (3, 4) | (4, 6) |
| 5 | (3, 6) | (6, 6), (6, 8) |
| 6 | (6, 6) is selected: goal test succeeds |
(Ties at are broken in favour of the goal/shallower node; any other tie-break only delays by finitely many steps, since each further loop raises by 2.)
Solution: with cost , which is optimal.
Conclusion. Greedy search can loop on the cheapest-looking heuristic and never reach the goal, whereas A* is complete (finite branching factor, all step costs ) and, with an admissible heuristic, also optimal. A* guarantees a solution whenever one exists, as shown above.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 10 marks
How resolution algorithm is used in FOPL to infer conclusion?
Consider the facts;
Anyone whom Pugu loves is a star. Any hero who does not rehearse does not act. Anmol is a hero. Any hero who does not work does not rehearse. Anyone who does not act is not a star. Convert above into FOPL and use resolution to infer that “If Anmol does not work, then Pugu does not love Anmol”.
Answer
Resolution in FOPL. Resolution is a refutation-based inference rule. To prove that a query follows from a knowledge base :
- Convert every sentence of to first-order logic.
- Convert to clause (conjunctive normal) form: eliminate , move inward, standardise variables, Skolemise , drop .
- Negate the query, convert it to clauses and add it to the set.
- Repeatedly pick two clauses containing complementary literals, unify them (finding a most general unifier ) and add the resolvent.
- If the empty clause () is derived, the set is contradictory, so .
Conversion to FOPL.
Goal: . Its negation is .
Clause form.
- C1:
- C2:
- C3:
- C4:
- C5:
- C6: (negated goal)
- C7: (negated goal)
Resolution proof.
| Step | Resolve | Unifier | Resolvent |
|---|---|---|---|
| 8 | C1, C7 | ||
| 9 | C5, C8 | ||
| 10 | C2, C3 | ||
| 11 | C10, C9 | none | |
| 12 | C4, C3 | ||
| 13 | C12, C11 | none | |
| 14 | C13, C6 | none | (empty clause) |
The empty clause is derived, so the negated goal is inconsistent with the knowledge base. Hence "If Anmol does not work, then Pugu does not love Anmol" is proved.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 10 marks
Define mathematical model of artificial neural network. Discuss how Hebbian learning algorithm can be used to train a neural network. Support your answer with an example.
Answer
Mathematical model of an artificial neural network. An ANN is built from simple processing units (artificial neurons) joined by weighted connections. A single neuron receives inputs with weights and a bias . It first forms the net input
and then applies an activation function to give the output
Common activation functions are:
- Step / threshold: if , else (or for the bipolar case).
- Sigmoid: .
- Tanh: .
Neurons are arranged in layers (input, hidden, output). Knowledge is stored in the weights, and learning means adjusting them.
Hebbian learning. Hebb's rule states that "neurons that fire together wire together": if two connected neurons are active together, the connection between them is strengthened. For input and target (output) the weight update is
Training algorithm.
- Initialise all weights and bias to .
- For each training pair : set the activation , update and .
- After all patterns have been presented once the weights are final (Hebb learning needs only one pass).
Example: AND function with bipolar inputs and targets.
| 1 | 1 | 1 |
| 1 | -1 | -1 |
| -1 | 1 | -1 |
| -1 | -1 | -1 |
Start with .
| Pattern | ||||||
|---|---|---|---|---|---|---|
| (1, 1) | 1 | 1 | 1 | 1 | 1 | 1 |
| (1, -1) | -1 | 1 | -1 | 0 | 2 | 0 |
| (-1, 1) | 1 | -1 | -1 | 1 | 1 | -1 |
| (-1, -1) | 1 | 1 | -1 | 2 | 2 | -2 |
Final weights: .
Check: with :
- :
- :
- :
- :
All four outputs match the targets, so the network has learned the AND function.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
What is Ai? How can you define AI from the perspective of thought process?
Answer
Artificial Intelligence (AI) is the branch of computer science concerned with designing machines and programs that can perform tasks which normally require human intelligence, such as learning, reasoning, problem solving, perception and understanding language. The term was coined by John McCarthy in 1956.
Definitions from the perspective of thought process. Russell and Norvig classify the definitions of AI along two dimensions: thought/reasoning versus behaviour, and human-like versus rational. The thought-process view contains two approaches:
-
Thinking humanly (the cognitive modelling approach). AI is "the exciting new effort to make computers think... machines with minds, in the full and literal sense" (Haugeland, 1985), or "the automation of activities that we associate with human thinking, such as decision making, problem solving, learning" (Bellman, 1978). To say a program thinks like a human, we must know how humans think, which we learn through introspection, psychological experiments and brain imaging. Cognitive science combines AI models with experimental techniques to test theories of the mind (e.g. the General Problem Solver of Newell and Simon).
-
Thinking rationally (the "laws of thought" approach). AI is "the study of mental faculties through the use of computational models" (Charniak and McDermott, 1985), or "the study of the computations that make it possible to perceive, reason and act" (Winston, 1992). It follows Aristotle's syllogisms and formal logic: correct reasoning patterns that always give correct conclusions from correct premises. The logicist tradition builds programs that represent problems in logical notation and prove conclusions. Its difficulties are that informal and uncertain knowledge is hard to express in logic, and that being able to solve a problem "in principle" is different from solving it in practice.
So, in terms of thought process, AI is either modelling how humans think or implementing correct (rational) reasoning in machines.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Discuss the types of environment where an agent can work on.
Answer
An agent's environment is the world it perceives through sensors and acts upon through actuators. Environments are classified by the following properties.
-
Fully observable vs partially observable. In a fully observable environment the sensors give the complete state at each moment (e.g. chess, crossword). In a partially observable one, sensors are noisy or incomplete (e.g. taxi driving, poker).
-
Deterministic vs stochastic. If the next state is completely determined by the current state and the agent's action, the environment is deterministic (chess). Otherwise it is stochastic (taxi driving, where traffic is unpredictable). An environment that is deterministic except for the actions of other agents is called strategic.
-
Episodic vs sequential. In an episodic environment the agent's experience is divided into independent episodes, and the current decision does not affect later ones (image classification on an assembly line). In a sequential environment the current decision affects future decisions (chess, driving).
-
Static vs dynamic. A static environment does not change while the agent deliberates (crossword puzzle). A dynamic one changes with time (taxi driving). If the environment does not change but the agent's score does with time, it is semi-dynamic (chess with a clock).
-
Discrete vs continuous. Discrete environments have a finite number of states, percepts and actions (chess). Continuous ones have infinitely many values (taxi driving: speed, position).
-
Single-agent vs multi-agent. Only one agent acts (crossword) versus several competing or cooperating agents (chess is competitive; taxi driving is partly cooperative).
-
Known vs unknown. In a known environment the agent knows the "laws" (outcomes of actions); in an unknown one it must learn them.
The hardest case is partially observable, stochastic, sequential, dynamic, continuous and multi-agent, such as driving a taxi.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Illustrate with an example, how uniform cost search algorithm can be used for finding goal in a state space.
Answer
Uniform cost search (UCS) is an uninformed search that expands the frontier node with the lowest path cost . It uses a priority queue ordered by , and the goal test is applied when a node is selected for expansion (not when generated). It is complete (if every step cost ) and optimal.
Algorithm.
- Put the start node in the priority queue with .
- Remove the node with the smallest . If it is a goal, return the path.
- Otherwise expand it; for every child compute and insert it (or update it if a cheaper path to an already-queued state is found).
- Repeat from step 2.
Example. State space with start and goal :
| Edge | Cost |
|---|---|
| 1 | |
| 5 | |
| 15 | |
| 10 | |
| 5 | |
| 5 |
| Step | Node expanded | Frontier (node : g) |
|---|---|---|
| 1 | (0) | :1, :5, :15 |
| 2 | (1) | :5, :11 (via A), :15 |
| 3 | (5) | :10 (via B, better than 11), :15 |
| 4 | (10) | goal selected, stop |
The path found is with cost . Note that the path (cost 11) was generated first, but because the goal is tested only when selected, UCS returns the cheaper path. Hence UCS finds the least-cost solution.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Define frame. How knowledge is encoded in a frame? Justify with an example.
Answer
Frame. A frame is a data structure for representing stereotyped knowledge about an object, concept or situation, proposed by Marvin Minsky (1975). It is a collection of slots (attributes) with fillers (values), and frames are organised in a hierarchy so that specific frames inherit properties from more general ones.
How knowledge is encoded.
- Each frame has a name and a set of slots.
- A slot holds a value, a default value, a range/type restriction, or a procedure (facet: if-needed, if-added, if-removed demons) that computes or reacts to a value.
- Frames are linked by
is-a(class–subclass) andinstance-oflinks, so a child frame inherits slot values from its parent unless overridden. - Reasoning is done by filling slots, inheriting defaults and firing attached procedures.
Example.
Frame: Person
is-a: Mammal
legs: 2 (default)
can_speak: true
Frame: Student
is-a: Person
studies_at: (value: a college)
roll_no: (value: integer)
age: [15..40] (range)
if-needed: compute_age(date_of_birth)
Frame: Ram
instance-of: Student
studies_at: Patan College
roll_no: 21
age: 20
Asking for Ram.legs finds no local value, so the system follows instance-of to Student, then is-a to Person and inherits legs = 2. Frames therefore store structured knowledge compactly, support default reasoning and inheritance, and attach procedures to data.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
What do you mean by membership of an element in a fuzzy set? Given a domain of discourse X={10, 20, 30, 40, 50, 60, 70}, construct a fuzzy set from X. Use your own assumptions for defining membership.
Answer
Membership in a fuzzy set. In a classical (crisp) set an element either belongs () or does not belong (). In a fuzzy set on a universe , each element has a degree of membership , given by the membership function . A value near means strong membership, near weak membership. A fuzzy set is written
Constructing a fuzzy set. Let and let = "numbers close to 40", with the triangular membership function
| 10 | 20 | 30 | 40 | 50 | 60 | 70 | |
|---|---|---|---|---|---|---|---|
| 0 | 0.33 | 0.67 | 1 | 0.67 | 0.33 | 0 |
For example and .
Hence
Here 40 fully belongs to the set, 30 and 50 belong to degree , 20 and 60 to degree , while 10 and 70 do not belong at all.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Write an algorithm for learning by Genetic Approach.
Answer
Genetic algorithm (GA) is a search and learning technique inspired by natural selection. A population of candidate solutions (chromosomes, usually bit strings) evolves over generations using selection, crossover and mutation, guided by a fitness function.
Algorithm.
- Initialise: generate a random population of chromosomes.
- Evaluate: compute the fitness of every chromosome.
- Repeat until the termination condition (a chromosome of sufficient fitness is found, or a maximum number of generations is reached):
- Selection: choose parents with probability proportional to fitness (roulette-wheel, tournament or rank selection).
- Crossover: with probability , pair parents and exchange parts of their strings at a random crossover point to create offspring; otherwise copy the parents.
- Mutation: with a small probability , flip each bit of the offspring.
- Replacement: form the new population from the offspring (optionally keeping the best individuals, i.e. elitism).
- Evaluate the fitness of the new population.
- Return the fittest chromosome as the solution.
Pseudocode.
initialize population P(0) randomly
evaluate fitness of each member of P(0)
t = 0
while not terminated:
P' = empty
while |P'| < N:
parent1, parent2 = select(P(t))
child1, child2 = crossover(parent1, parent2, pc)
mutate(child1, pm); mutate(child2, pm)
add child1, child2 to P'
P(t+1) = P'
evaluate fitness of P(t+1)
t = t + 1
return best individual in P(t)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
How uncertain knowledge is represented? Given following full joint probability distribution representing probabilities of having different sizes of CD, find the probability that a CD cover has a length of 130mm given the width is 15mm.
y=Width ↓ x=Length → 129 15 0.12 16 0.08
Answer
Representing uncertain knowledge. Knowledge is uncertain when facts are incomplete, noisy or non-deterministic. It is represented with:
- Probability theory: each proposition has a degree of belief in ; full joint probability distributions, conditional probabilities, Bayes' rule and Bayesian (belief) networks are used.
- Certainty factors (as in MYCIN), Dempster–Shafer theory (belief and plausibility intervals), and fuzzy logic (degrees of truth/membership).
- Non-monotonic logics / default reasoning for conclusions that can be withdrawn.
Numerical part. We need . By the definition of conditional probability:
From the table, .
The marginal probability of width 15 is the sum of its row:
Therefore
The probability that a CD cover has length 130 mm given a width of 15 mm is 0.7.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
How the concept of machine vision are used in Robotics to configure sensors of Robots?
Answer
Machine vision in robotics is the use of cameras and image-processing algorithms to let a robot acquire, analyse and interpret images of its surroundings. It acts as the robot's "eyes", and the visual information is used to decide how to configure and use the other sensors.
Steps of machine vision.
- Image acquisition: a camera (CCD/CMOS, stereo or depth camera) converts the scene into a digital image.
- Pre-processing: noise removal, smoothing, contrast enhancement.
- Segmentation and edge detection: separate objects from the background and find boundaries.
- Feature extraction: corners, shapes, colour and texture.
- Object recognition / interpretation: match features against models to identify objects, positions and orientation.
Use in configuring the robot's sensors.
- Choosing and placing sensors: vision defines the field of view, resolution, lighting and camera mounting (eye-in-hand on the gripper or fixed overhead) required for the task.
- Calibration: camera calibration relates image coordinates to real-world coordinates, so that the robot arm can reach what the camera sees.
- Sensor fusion: vision is combined with proximity, range (ultrasonic, laser), touch and force sensors. Vision gives the location of a target, range sensors give accurate distance, and tactile sensors confirm the grasp.
- Feedback control (visual servoing): the difference between the desired and the observed image position is used to correct the robot's motion continuously.
- Adaptation: based on what is detected (obstacle, object size, colour), the robot selects which sensors to activate and their thresholds.
Applications: part inspection, pick-and-place, assembly, navigation and obstacle avoidance of mobile robots, and sorting in industry.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
How syntactic and semantic analysis is done during natural language processing? Explain with example.
Answer
Natural language processing (NLP) proceeds through several levels: lexical, syntactic, semantic, pragmatic and discourse analysis.
Syntactic analysis (parsing). It checks whether a sentence is grammatically well formed and builds its structure (a parse tree) using a lexicon and grammar rules, usually context-free rules such as:
Parsing can be top-down or bottom-up (e.g. chart parsing, or augmented transition networks).
Example: "The boy eats an apple."
S
├── NP: Det(The) N(boy)
└── VP: V(eats)
└── NP: Det(an) N(apple)
A sentence like "Boy the apple eats" fails syntactic analysis because no rule derives it.
Semantic analysis. It assigns meaning to the syntactic structure, producing a logical representation independent of context. Word senses are resolved and the roles (agent, object) are attached using the parse tree. For the example above:
It also rejects sentences that are grammatical but meaningless, e.g. "Colourless green ideas sleep furiously", or "The apple eats the boy" (violates the selectional restriction that the agent of eats must be animate). Ambiguity is handled here, e.g. "bank" (river bank or financial bank).
Summary: syntactic analysis answers "is the sentence well formed and how is it structured?", semantic analysis answers "what does it mean?". The outputs go on to pragmatic analysis, which interprets the meaning in context.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Consider following facts
Every traffic chases driver. Every driver who horns is smart. No traffic catches any smart driver. Any traffic who chases some driver but does not catch him frusted.
Now configure FoPL knowledge base for above statements. Use resolution algorithm to draw a conclusion that “If all drivers horn, then all traffics are frusted.”
Answer
Knowledge base in FOPL. Predicates: , , , , , , .
- Every traffic chases a driver:
- Every driver who horns is smart:
- No traffic catches any smart driver:
- Any traffic who chases some driver but does not catch him is frustrated:
Goal: .
Negated goal: .
Clause form (Skolem function for the driver chased by , constant for the unfrustrated traffic):
- C1:
- C2:
- C3:
- C4:
- C5:
- C6: (negated goal)
- C7: (negated goal)
- C8: (negated goal)
Resolution proof.
| Step | Resolve | Unifier | Resolvent |
|---|---|---|---|
| 9 | C7, C1 | ||
| 10 | C7, C2 | ||
| 11 | C9, C6 | ||
| 12 | C3, C9 | ||
| 13 | C12, C11 | none | |
| 14 | C4, C7 | ||
| 15 | C14, C13 | ||
| 16 | C5, C7 | ||
| 17 | C16, C9 | ||
| 18 | C17, C10 | none | |
| 19 | C18, C15 | none | |
| 20 | C19, C8 | none |
The empty clause is derived, so the negated goal is contradictory. Therefore "If all drivers horn, then all traffics are frustrated" is proved.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Describe mathematical model of neural network. What does it means to train a neural networl? Write algoritmn for preceptron learning.
Answer
Mathematical model of a neural network. A neuron computes a weighted sum of its inputs plus a bias and passes it through an activation function:
where are inputs, weights, the bias and the activation (step, sigmoid, tanh, ReLU). A network is a set of such neurons arranged in layers, with the output of one layer being the input of the next. For a multilayer network, layer computes .
Training a neural network means finding values of the weights and biases that make the network's outputs match the desired outputs on a set of training examples. This is done iteratively: present an input, compare the actual output with the target , measure the error (e.g. ), and adjust the weights to reduce the error. Training ends when the error is acceptably small or a maximum number of epochs is reached. The trained weights then generalise to unseen inputs.
Perceptron learning algorithm (single neuron, step activation, learning rate , ):
- Initialise weights and bias to small random values (or ).
- For each training pair in the training set:
- Compute .
- Compute the output if , (or ) otherwise.
- If , update: and .
- Repeat step 2 (one pass is one epoch) until no weight changes occur in a complete epoch (all patterns are correctly classified) or the maximum number of epochs is reached.
By the perceptron convergence theorem, the algorithm converges in a finite number of steps if the classes are linearly separable. It cannot learn non-separable functions such as XOR.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What is Turing test? How it can be used to measure intelligence of machine?
Answer
Turing test. Proposed by Alan Turing in 1950 ("Computing Machinery and Intelligence") as an operational definition of machine intelligence, replacing the question "Can machines think?".
Set-up (imitation game). There are three participants: a human interrogator (C) in one room, and a human (B) and a machine (A) in other rooms. The interrogator communicates with both only through a text terminal, asks any questions, and must decide which of the two is the machine. The machine tries to answer so as to be taken for the human.
Measuring intelligence. If, after a set time (Turing suggested about 5 minutes of questioning), the interrogator cannot reliably tell the machine from the human (e.g. is wrong in at least about 30% of trials), the machine is said to have passed the test and to exhibit human-level intelligent behaviour.
Capabilities a machine needs to pass:
- Natural language processing to communicate.
- Knowledge representation to store what it knows or hears.
- Automated reasoning to answer questions and draw new conclusions.
- Machine learning to adapt and detect patterns.
The total Turing test adds a video signal and physical objects, which also requires computer vision and robotics.
Limitations. It tests only behaviour, not real understanding (Searle's Chinese Room argument), is subjective, and rewards deception and human-like mistakes rather than rational intelligence.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
How agent can be configured used PEAS framework? Illustrate with example
Answer
PEAS framework. To design a rational agent we first specify its task environment with four components:
- P – Performance measure: the criterion that decides how successful the agent is.
- E – Environment: the surroundings in which the agent operates.
- A – Actuators: the means by which the agent acts on the environment.
- S – Sensors: the means by which the agent perceives the environment.
Specifying PEAS fixes what the agent has to perceive, what it may do and what counts as good behaviour, so that the agent program (simple reflex, model-based, goal-based, utility-based) can then be chosen.
Example 1: automated taxi driver.
| Component | Description |
|---|---|
| Performance measure | Safe, fast, legal, comfortable trip; maximise profit; minimise fuel use and violations |
| Environment | Roads, other traffic, pedestrians, customers, weather |
| Actuators | Steering, accelerator, brake, signal, horn, display |
| Sensors | Cameras, sonar/lidar, speedometer, GPS, odometer, engine sensors, keyboard/microphone |
Example 2: medical diagnosis system.
| Component | Description |
|---|---|
| Performance measure | Healthy patient, minimal cost, correct diagnoses |
| Environment | Patient, hospital, staff |
| Actuators | Display of questions, tests, diagnoses, treatments |
| Sensors | Keyboard entry of symptoms, findings and patient's answers |
Thus, using PEAS the agent is configured by deciding its sensors, actuators and the performance measure that guides its decisions.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Construct semantic network for following facts
Ram is person. Persons are humans. All human have nose. Humans are instances of mammals. Ram has weight of 60 kg. Weight of Ram is less than weight of Sita.
Answer
A semantic network represents knowledge as a graph: nodes are concepts/objects/values and labelled arcs are relations between them (is-a, instance-of, has-part, weight, less-than). Properties are inherited along is-a links.
Nodes and links for the given facts.
| From | Link | To |
|---|---|---|
| Ram | instance-of (is a) | Person |
| Person | is-a (subclass) | Human |
| Human | has-part | Nose |
| Human | instance-of (as stated) | Mammal |
| Ram | weight | 60 kg |
| Ram | weight less-than (weight of Ram < weight of Sita) | Sita |
Diagram.
Mammal
^
| instance-of
Human ----has-part----> Nose
^
| is-a
Person
^
| instance-of
Ram ----weight----> 60 kg
|
+--- weight less-than ---> Sita (weight of Sita)
Inference by inheritance: Ram is a Person, a Person is a Human, and a Human has a nose, so Ram has a nose. Similarly Ram inherits membership of Mammal through Human. The less-than arc states that Ram's weight is below Sita's weight, so Sita weighs more than 60 kg.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What is iscrossover operation in genetic algorithm? Given following chromosomes show the result of one-point and two point crossover.
C1 = 01100010
C2 = 10101100
Choose appropriate crossover points as per your own suggestions.
Answer
Crossover is the genetic operator that combines the genetic material of two parent chromosomes to produce new offspring, exchanging parts of the strings at chosen crossover points. It is the main source of new combinations in a genetic algorithm and is applied with a probability (typically 0.6 to 0.9).
Parents:
- C1 = 01100010
- C2 = 10101100
One-point crossover (point after the 3rd bit):
- C1 = 011 | 00010
- C2 = 101 | 01100
Swapping the tails:
- Offspring 1 = 011 + 01100 = 01101100
- Offspring 2 = 101 + 00010 = 10100010
Two-point crossover (points after the 2nd and 5th bits):
- C1 = 01 | 100 | 010
- C2 = 10 | 101 | 100
Swapping the middle segments:
- Offspring 1 = 01 + 101 + 010 = 01101010
- Offspring 2 = 10 + 100 + 100 = 10100100
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What is expert system? How its works? Mention role of inference engine in expert system.
Answer
Expert system. An expert system is a computer program that emulates the decision-making ability of a human expert in a narrow domain, using a knowledge base of facts and rules, and an inference mechanism to reach conclusions and explain them. Examples: MYCIN (diagnosis of blood infections), DENDRAL, XCON.
Components and working.
- Knowledge base: domain facts and heuristic rules (usually IF–THEN) acquired from experts.
- Working memory: facts about the current case.
- Inference engine: applies the rules to the facts to derive new facts and conclusions.
- User interface: the user enters the problem and receives advice.
- Explanation facility: tells the user how and why a conclusion was reached.
- Knowledge acquisition module: lets the knowledge engineer add and update knowledge.
Working: the user supplies symptoms/data through the interface; they are stored in working memory; the inference engine matches them against the rules in the knowledge base, fires applicable rules, adds new facts, and repeats until a conclusion is reached; the result and explanation are presented to the user.
Role of the inference engine. It is the "brain" of the system. It:
- Matches the rule conditions with the facts in working memory.
- Resolves conflicts when several rules apply (conflict resolution by priority, specificity or recency).
- Executes the chosen rule and updates working memory.
- Controls the reasoning strategy: forward chaining (data-driven, from facts to conclusions) or backward chaining (goal-driven, from a hypothesis back to supporting facts).
- Handles uncertainty (certainty factors) and supports the explanation facility.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
How semantic and pragmatic analysis is done in natural language processing.
Answer
Semantic analysis. After parsing, semantic analysis maps the syntactic structure to a context-independent meaning representation, normally logic or a frame.
- Lexical semantics: pick the correct word sense (e.g. bank = river side or financial institution) using the dictionary and surrounding words.
- Compositional semantics: the meaning of the sentence is built from the meanings of its parts following the parse tree, e.g. "Ram eats rice" becomes .
- Case/thematic roles: identify agent, object, instrument.
- Selectional restrictions: reject meaningless combinations such as "The rice eats Ram".
Pragmatic analysis. It interprets the sentence in terms of the actual context, the speaker's intention and world knowledge, so that the real meaning is obtained.
- Reference resolution: resolving pronouns and references using previous discourse. "Ram took the book from the shelf and read it": it = the book.
- Speech acts / intention: "Can you pass the salt?" is a request, not a question about ability.
- Context and world knowledge: "It is cold here" may mean "close the window".
- Discourse structure: connecting sentences into a coherent whole.
Example: "I saw the man with a telescope." Syntax and semantics give two readings (I used a telescope; the man had a telescope), and pragmatics uses the context to select the intended one.
Semantic analysis therefore answers "what does the sentence literally mean", and pragmatic analysis answers "what does the speaker actually mean in this situation".
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
How philosophy, sociology and economics influence the study of artificial intelligence?
Answer
Artificial intelligence draws on many disciplines. Three of them contribute as follows.
Philosophy.
- Whether formal rules can draw valid conclusions: Aristotle's syllogisms and logic led to the formal logic used in knowledge representation and reasoning.
- How the mind arises from a physical brain (dualism vs materialism), and where knowledge comes from (rationalism, empiricism). Empiricism underlies machine learning.
- Raised the questions of whether machines can think (Turing, Searle's Chinese Room), free will, and the ethics of intelligent machines.
- Utilitarian ideas about how an agent should choose actions to maximise outcomes influence rational-agent design.
Sociology.
- Studies how intelligent behaviour emerges in groups, which inspired multi-agent systems, swarm intelligence and cooperation or negotiation between agents.
- Studies the social effects of AI: employment, privacy, bias and fairness, trust, and acceptance of automation.
- Shapes human–computer interaction, chatbots and social robots, and ethical and legal norms for AI.
Economics.
- Decision theory and utility theory: how to choose actions to maximise expected utility under uncertainty. This is the basis of rational agents.
- Game theory: how rational agents behave when other agents' actions affect their payoff (multi-agent decisions, auctions, negotiation).
- Operations research and Markov decision processes: sequential decision making, resource scheduling and optimisation.
- Economic motives (productivity, cost) drive AI investment and applications.
Together these fields provide the logic, decision-making models and social context that AI builds upon.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What is prosterior probability? Consider a scenario that a patient have liver disease is 15% probability. A test says that 5% of patients are alcholic. Among those patients diagnosed with liver disease, 7% are alcoholic. Now computer the chance of having liver disease, if the patient is alcoholic.
Answer
Posterior probability. The posterior probability is the revised probability of a hypothesis after observing evidence . It is computed from the prior and the likelihood by Bayes' theorem:
Numerical. Let = the patient has liver disease and = the patient is alcoholic.
- (prior)
Required: .
The chance that an alcoholic patient has liver disease is 0.21 (21%), higher than the prior 15%.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Define admissible heuristic with an example. Explain the working mechanism and limitations of hill climbing search.
Answer
Admissible heuristic. A heuristic estimates the cost of the cheapest path from node to a goal. It is admissible if it never overestimates the true cost:
where is the actual least cost from to the goal. With an admissible heuristic, A* (tree search) is optimal.
Example. For route finding between cities, the straight-line distance to the destination is admissible, because no road can be shorter than the straight line. In the 8-puzzle, the number of misplaced tiles and the sum of Manhattan distances of tiles from their goal positions are both admissible, since each move shifts one tile by one square, so at least (or ) moves are needed.
Hill climbing search. It is a local search that keeps only the current state and repeatedly moves to the best neighbouring state, with no memory of the path and no look-ahead beyond the neighbours.
Working mechanism (steepest-ascent):
- Start with an initial state (current).
- Generate all neighbours of current and evaluate them using the objective/heuristic function.
- If the best neighbour is better than current, move to it and go to step 2.
- Otherwise (no neighbour is better) stop and return current.
Variants: simple hill climbing (take the first better neighbour), steepest-ascent (take the best), stochastic hill climbing (random better neighbour), and random-restart hill climbing.
Limitations.
- Local maxima: a state better than all its neighbours but not the global best; the search gets stuck.
- Plateau (flat area): neighbours have equal value, so there is no direction in which to move, and the search may wander.
- Ridges: a sequence of local maxima that cannot be climbed with single-step moves; the search oscillates.
- Not complete and not optimal; the result depends on the starting state.
- No backtracking, so it cannot recover from a bad choice.
Remedies: random restarts, allowing sideways moves, simulated annealing, and stochastic hill climbing.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
How do you define problem? What are criteria for defining problem? Compare Constraint Satisfaction Problem and Real World Problem in detail with appropriate example.
Answer
Defining a problem. A problem is formally defined by five components:
- Initial state: where the agent starts, e.g. In(Kathmandu).
- Actions: the set of actions available in each state, e.g. Go(Pokhara).
- Transition model: the state that results from doing an action in a state, .
- Goal test: checks whether a state is a goal, e.g. In(Pokhara).
- Path cost: a function assigning a numeric cost to each path (sum of step costs, e.g. distance).
A solution is a sequence of actions from the initial state to a goal state; an optimal solution has the lowest path cost. The initial state, actions and transition model together form the state space.
Criteria for defining a good problem.
- The initial state and the goal must be stated precisely.
- The formulation must contain the relevant detail only (abstraction), removing irrelevant details but keeping it valid and useful.
- Actions must be well defined and executable, with a clear transition model.
- The goal test must be checkable, and the path cost must express what is to be minimised.
- The abstract solution must be expandable into a real solution, and the state space of manageable size.
Constraint Satisfaction Problem (CSP) vs real-world problem.
| Aspect | CSP | Real-world problem |
|---|---|---|
| Formulation | Variables , domains and constraints | States, actions, transition model, goal test and path cost |
| State | A (partial) assignment of values to variables | Complex, with many physical details |
| Goal | A complete assignment satisfying all constraints | A practical objective that may involve optimising cost |
| Solution | The assignment itself (the path does not matter) | Often a sequence of actions (path) |
| Methods | Backtracking, forward checking, constraint propagation (arc consistency), heuristics (MRV, degree) | Search algorithms (A*, etc.), planning, optimisation, learning |
| Nature | Well defined, toy-like, fixed rules | Messy, uncertain, dynamic, requires abstraction |
| Examples | Map colouring, N-queens, Sudoku, scheduling | Route finding, travelling salesperson, VLSI layout, robot navigation, airline scheduling |
Example of CSP (map colouring): variables are the regions (e.g. Western Australia, Northern Territory, Queensland, ...), the domain is {red, green, blue}, and the constraint is that adjacent regions have different colours. Any complete assignment that satisfies all constraints is a solution.
Example of a real-world problem (route finding): the states are locations, the actions are road segments, and the path cost is distance or time. The agent must search for the cheapest route from the source to the destination while handling traffic and other uncertainties.
Many real-world problems (timetabling, scheduling) can be modelled as CSPs, which allows the efficient CSP algorithms to be used.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Define Expert System with example. What are stages of expert system development ? Explain.
Answer
Expert system. An expert system is an AI program that captures the specialised knowledge of human experts in a narrow domain and uses it, through an inference engine, to give advice or make decisions at the expert's level, with the ability to explain its reasoning.
Example: MYCIN. It diagnoses bacterial blood infections and recommends antibiotics. It uses about 500 IF–THEN rules with certainty factors, e.g. IF the stain of the organism is gram-positive AND its morphology is coccus THEN there is suggestive evidence (0.7) that the organism is staphylococcus. Other examples: DENDRAL (chemical structure), PROSPECTOR (mineral exploration), XCON (computer configuration).
Basic structure: knowledge base, inference engine, working memory, user interface, explanation facility and knowledge acquisition module.
Stages of expert system development.
- Identification: define the problem, the scope and the goals; identify the domain expert, knowledge engineer, users and the resources needed.
- Conceptualisation: the knowledge engineer works with the expert to find the key concepts, relations and the problem-solving strategy (knowledge acquisition by interviews, observation, documents).
- Formalisation (design): map the concepts into a formal representation such as rules, frames or semantic networks; choose the inference strategy (forward or backward chaining) and the tools/shell (e.g. CLIPS, Prolog).
- Implementation: program the knowledge base and inference engine, and build the user interface and explanation facility; produce a working prototype.
- Testing (validation and verification): run the system on test cases, compare with the expert's results, find errors in rules, and refine.
- Maintenance and deployment: install the system for users, train them, update the knowledge as the domain changes, and fix faults.
The process is iterative: the testing results frequently lead back to earlier stages to refine the knowledge, and the system grows by rapid prototyping.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
How syntactic and semantic analyses are performed in natural language processing?
Answer
Natural language processing proceeds through levels, and syntactic and semantic analysis are the two middle levels that turn a string of words into a structure and then into a meaning.
Syntactic analysis (parsing)
Syntactic analysis checks whether a sentence is well formed according to a grammar and assigns it a structure (parse tree). It is performed as follows.
- Lexical analysis: the sentence is split into tokens and each word is looked up in a lexicon to get its part of speech (noun, verb, determiner, etc.).
- Grammar: a context-free grammar (CFG) gives the rewrite rules, for example
- Parsing: a parser (top-down, bottom-up, chart parser, or ATN) applies the rules to build the tree.
For "The boy hit the ball" the parse is . A sentence like "Hit the the boy" fails to parse and is rejected. Ambiguous sentences ("I saw the man with a telescope") give more than one tree.
Semantic analysis
Semantic analysis finds the meaning of the syntactically correct sentence and represents it in a form the computer can use, independent of the surface wording.
- Word meanings: each word is mapped to its sense in the lexicon, and word sense disambiguation chooses the right one ("bank" of a river or a money bank) using context.
- Compositional semantics: the meaning of a phrase is built from the meanings of its parts, following the parse tree. Each grammar rule has an attached semantic rule, for example the verb phrase "hit the ball" becomes and the whole sentence becomes .
- Output representation: the result is a logical form such as predicate logic, a semantic network, or a frame.
- Consistency checks: selectional restrictions reject sentences that are grammatical but meaningless ("Colourless green ideas sleep furiously", or "The table ate the boy").
Thus syntax decides whether the sentence is grammatical and gives its structure, and semantics uses that structure to produce a context-free meaning that later pragmatic analysis interprets in context.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What do you mean by Rational Agent? What are differences between Utility based agent and model based agent?
Answer
Rational agent
An agent is anything that perceives its environment through sensors and acts on it through actuators. A rational agent is one that, for each possible percept sequence, selects the action that is expected to maximise its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge it has. Rationality depends on four things: the performance measure, the agent's prior knowledge of the environment, the actions it can perform, and the percept sequence to date. Rationality is not omniscience: it maximises expected, not actual, performance. For example, a vacuum-cleaner agent that cleans a dirty square and moves on when the square is clean is rational for a performance measure of "clean squares over time".
Utility-based agent versus model-based agent
| Basis | Model-based agent | Utility-based agent |
|---|---|---|
| Idea | Keeps an internal state describing the parts of the world it cannot see, using a model of how the world evolves and how its actions affect it | Also has a utility function that measures how desirable a state is, and picks the action with the highest expected utility |
| Goal | Acts by condition-action rules on the updated state; it has no notion of how good an outcome is | Compares different ways of reaching the goal and chooses the best (quickest, safest, cheapest) |
| Handling conflicts | Cannot trade off conflicting objectives | Resolves conflicting goals and handles uncertainty by weighing probabilities with utilities |
| Components | State, world model, rules | State, world model, goals, utility function |
| Example | Automatic car that tracks other cars it can no longer see | Taxi that selects the route that is fast, safe and fuel-efficient, not just any route that reaches the destination |
So a model-based agent answers "what is the world like now?", whereas a utility-based agent additionally answers "how happy will I be in the state that results from this action?".
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What is state space representation? Illustrate with one example.
Answer
State space representation
State space representation formulates a problem as a search over a graph. It is defined by:
- States: all possible configurations of the problem; the set of all of them is the state space.
- Initial state: where the search starts.
- Operators (actions): rules that move from one state to another.
- Goal test: a condition that identifies the goal state(s).
- Path cost: a cost for each step, so that the best solution is the cheapest path.
A solution is a path (sequence of operators) from the initial state to a goal state.
Example: water jug problem
There is a 4-litre jug and a 3-litre jug, with no measuring marks. Get exactly 2 litres in the 4-litre jug.
- State: with = litres in the 4-litre jug () and = litres in the 3-litre jug ().
- Initial state: . Goal: for any .
- Operators:
- Fill the 4-litre jug: if .
- Fill the 3-litre jug: if .
- Empty either jug on the ground: or .
- Pour the 3-litre jug into the 4-litre jug until the latter is full: if , .
- Pour the 4-litre jug into the 3-litre jug until the latter is full: if , .
- Pour everything from one jug into the other when it fits: if , , or if , .
One solution path:
The steps are: fill the 3-litre jug; pour it into the 4-litre jug; fill the 3-litre jug again; pour into the 4-litre jug until full (leaving 2 litres in the 3-litre jug); empty the 4-litre jug; pour the 2 litres into the 4-litre jug. The 4-litre jug now holds 2 litres, so the goal is reached in 6 steps. Searching this graph with BFS, DFS or A* finds such paths.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What is forward chaining? Explain with appropriate example.
Answer
Forward chaining
Forward chaining is a data-driven inference method. It starts from the known facts in the knowledge base, repeatedly finds rules whose premises (antecedents) are all satisfied, fires them to add their conclusions as new facts, and continues until the goal (query) is derived or no new facts can be added. It uses Generalised Modus Ponens on definite clauses.
Algorithm
- Put all known facts in working memory.
- Find every rule whose premises all match facts in working memory.
- Fire a rule (using conflict resolution if several match) and add its conclusion if it is new.
- If the query is now in working memory, stop with success. If no rule can add a new fact, stop with failure. Otherwise go to step 2.
Example
Rules:
- R1:
- R2:
- R3:
- R4:
Facts: , , , .
Query: ?
- Pass 1: R1 fires with , adding ; R2 fires with , adding ; R3 fires with , adding .
- Pass 2: R4 now has all premises with , , , so is added.
The query is in working memory, so West is a criminal. Forward chaining is sound and complete for definite clauses, but it may derive many facts irrelevant to the query.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Convert Following Sentences into Predicate
a) All animal who can bark are dog.
b) Someone is firing a gun
c) All tigers are not fierce
Answer
(a) All animals who can bark are dogs.
(b) Someone is firing a gun.
(or, treating the gun as an object, ).
(c) All tigers are not fierce.
This says that no tiger is fierce. (The alternative reading, "not all tigers are fierce", would be , which is equivalent to ; the usual intended meaning is the first.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Define game. Write the benefits and limitations of depth limited search.
Answer
Game
In AI, a game is a competitive multi-agent environment in which the agents' goals conflict, so each agent must consider the opponent's possible replies. Games such as chess, tic-tac-toe and checkers are usually deterministic, turn-taking, two-player, zero-sum games of perfect information. A game is defined by the initial state, the players, the legal moves (actions), the result of a move, a terminal test (win, lose, draw) and a utility function giving the final payoff. Games are solved with adversarial search such as minimax with alpha-beta pruning.
Depth-limited search
Depth-limited search is depth-first search with a predefined depth limit : nodes at depth are treated as if they had no successors. In games the cut-off nodes are evaluated with a heuristic evaluation function instead of the true terminal utility.
Benefits
- It needs little memory, only space, like DFS.
- It always terminates, because the depth is bounded, so it avoids the infinite-path problem of plain DFS.
- It is fast and gives an answer within time limits, which is essential in large games where the full tree is far too big (chess has about positions).
- If the depth of the goal is known, it finds the goal efficiently.
Limitations
- It is incomplete if the goal lies deeper than ().
- It is not optimal if , because a deeper, costlier solution may be found first.
- Choosing a good limit is hard without knowing the depth of the solution.
- In games, the result depends on the quality of the evaluation function, and the horizon effect can cause bad moves because a disaster just beyond the limit is not seen.
- Time is still , exponential in the limit.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What is fuzzy logic? Discuss the different operators used in genetic algorithm.
Answer
Fuzzy logic
Fuzzy logic is a form of many-valued logic, introduced by Lotfi Zadeh, in which the truth of a statement is a degree between 0 and 1 rather than only true or false. It models vagueness such as "hot", "tall" or "high speed". A fuzzy set has a membership function . For example, a temperature of 35 °C may belong to the set "hot" with . A fuzzy system has four steps: fuzzification (crisp input to membership degrees), rule evaluation using IF-THEN rules, aggregation of the rule outputs, and defuzzification (for example the centroid) to a crisp output. The standard fuzzy operators are:
- Union:
- Intersection:
- Complement:
Operators of a genetic algorithm
A genetic algorithm evolves a population of candidate solutions (chromosomes) by repeatedly applying three operators, guided by a fitness function.
- Selection (reproduction): fitter chromosomes are chosen as parents with higher probability, using roulette-wheel selection, tournament selection or rank selection. This passes good traits to the next generation.
- Crossover (recombination): two parents exchange parts of their strings to produce offspring. In single-point crossover at point 3, parents and give children and . Variants are two-point and uniform crossover. It is applied with a high probability (about 0.6 to 0.9).
- Mutation: randomly flips bits (or changes genes) with a small probability, for example . It maintains diversity and prevents premature convergence to a local optimum.
The cycle of selection, crossover and mutation is repeated until a stopping condition (maximum generations or acceptable fitness) is reached.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Give an example of reinforcement learning. Explain the types of ANN.
Answer
Reinforcement learning: example
In reinforcement learning an agent learns by interacting with an environment, receiving rewards or penalties for its actions, and learning a policy that maximises the cumulative reward. There is no labelled training data.
Example: a robot learning to escape a maze. At each cell (state) it chooses to move up, down, left or right (action). It receives per step, for hitting a wall and for reaching the exit. After many trials, using an algorithm such as Q-learning, , it learns the shortest route. Other examples are a chess program (AlphaGo) learning from wins and losses, and a self-driving car learning to drive.
Types of artificial neural networks
- Single-layer feedforward network (perceptron): the inputs connect directly to the output neurons. It can solve only linearly separable problems.
- Multilayer feedforward network (MLP): one or more hidden layers between input and output; signals flow in one direction, and it is trained by backpropagation. It can learn non-linear functions.
- Recurrent network: has feedback connections, so the output depends on past states. It is used for sequences such as speech, text and time series (Elman, Hopfield networks, LSTM).
- Convolutional neural network (CNN): uses convolution and pooling layers, mainly for image recognition.
- Self-organising map (Kohonen network): unsupervised, maps high-dimensional input to a low-dimensional grid by competitive learning.
- Radial basis function network: uses radial basis functions as activation in the hidden layer, for function approximation and classification.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Writes short note of the following(any TWO)
a. Pragmatic Analysis
b. Unification and lifting
c. Turing test
Answer
(a) Pragmatic analysis
Pragmatic analysis is the last level of natural language understanding. It interprets the meaning of a sentence in its real context: the situation, the speaker's intention, the previous discourse and world knowledge. Semantic analysis gives literal meaning; pragmatics gives the intended meaning. For example, "Can you pass the salt?" is literally a question about ability but pragmatically a request; "It is cold here" may mean "please close the window". Pragmatic analysis also resolves references ("He" in "Ram told Hari that he was late"), understands indirect speech acts, handles irony and presupposition, and applies discourse knowledge from earlier sentences. It is done with context models, discourse structure, and a knowledge base about the speaker, the listener and the world.
(b) Unification and lifting
Unification is the process of finding a substitution that makes two logical expressions identical. such that . For example:
- and unify with .
- and unify with .
- and fail without standardising apart (variables renamed), because cannot be both and .
The algorithm returns the most general unifier (MGU), and uses an occurs check to prevent from unifying with .
Lifting means applying inference rules directly at the level of first-order expressions with variables, rather than first converting to propositional logic by instantiating all variables. Generalised Modus Ponens is a lifted rule: from and with , infer . Lifting is much more efficient, because it uses only the substitutions that are needed, and unification is the tool that makes it possible.
(c) Turing test
Proposed by Alan Turing in 1950 ("Computing Machinery and Intelligence") as an operational definition of intelligence. A human interrogator asks written questions to two hidden parties, a human and a computer. If after the conversation the interrogator cannot reliably tell which is the machine, the machine is said to have passed and to be intelligent. To pass, the computer needs natural language processing, knowledge representation, automated reasoning and machine learning. The total Turing test adds a video signal and objects to pass through the hatch, which also requires computer vision and robotics. Criticism includes Searle's Chinese Room argument that imitating behaviour is not understanding.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Prepare state space graph for the following puzzle problem, where only move left, move right, move up and move down actions are allowed. On the so constructed state space, label the states as A, B, C, ……Z and use the greedy best to test whether it finds the goal or not.
Initial State:
1 2 Goal State: 1 --- --- 2 Assume the path cost from one step to another as 1 and heuristic function, f(n), as a number of misplaced cells.
Answer
State representation
Write a state as the cell of tile 1 and the cell of tile 2, using TL, TR (top row) and BL, BR (bottom row). The two blank cells are implied. A move slides a tile into an adjacent empty cell (left, right, up or down). Two tiles on four cells give states, labelled:
| State | Grid (row 1 / row 2) | (tile 1, tile 2) | |
|---|---|---|---|
| A (initial) | 1 2 / _ _ | (TL, TR) | 2 |
| B | _ 2 / 1 _ | (BL, TR) | 2 |
| C | 1 _ / _ 2 | (TL, BR) | 2 |
| D | _ 2 / _ 1 | (BR, TR) | 2 |
| E | 2 _ / 1 _ | (BL, TL) | 2 |
| F | _ _ / 1 2 | (BL, BR) | 2 |
| G | 1 _ / 2 _ | (TL, BL) | 1 |
| H | _ _ / 2 1 | (BR, BL) | 1 |
| I | 2 1 / _ _ | (TR, TL) | 1 |
| J | _ 1 / _ 2 | (TR, BR) | 1 |
| K | 2 _ / _ 1 | (BR, TL) | 2 |
| L (goal) | _ 1 / 2 _ | (TR, BL) | 0 |
The heuristic is the number of misplaced tiles compared with the goal (tile 1 should be in TR, tile 2 in BL). Every move costs 1.
State space graph (edges, all moves reversible)
- A: B, C
- B: A, D, E, F
- C: A, F, G, J
- D: B, K
- E: B, K
- F: B, C
- G: C, L
- H: K, L
- I: K, L
- J: C, L
- K: D, E, H, I
- L: G, H, I, J
Greedy best-first search (always expand the open node with the smallest ; ties broken alphabetically; visited states are not re-opened)
| Step | Expanded | New nodes added to open () | Open list after |
|---|---|---|---|
| 1 | A (2) | B (2), C (2) | B, C |
| 2 | B (2) | D (2), E (2), F (2) | C, D, E, F |
| 3 | C (2) | G (1), J (1) (F already open) | G, J, D, E, F |
| 4 | G (1) | L (0) (C already closed) | L, J, D, E, F |
| 5 | L (0) | goal test succeeds |
Greedy best-first search finds the goal L. The solution path, following parent links, is
that is: move tile 2 down, move tile 2 left, move tile 1 right, at a path cost of 3. This is also optimal here, since each tile must move at least once and tile 2 needs two moves. The search used only to choose nodes, so it is not guaranteed to be optimal in general, but it finds the goal in this puzzle.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Write the rules to convert statements in predicate logic into CNF form. Convert the following sentences into FOPL.
All students of BSC CSIT are intelligent person.
All friends of intelligent person are smart.
Laxmi is a friend of Rojina.
Rojina is smart.
All beautiful students are girl.
Laxmi is beautiful.
Using resolution algorithm infer that “Laxmi is smart”.
Answer
Rules for converting predicate logic to CNF
- Eliminate implications and biconditionals: replace by and by .
- Move negation inward (De Morgan and quantifier rules): , , , , .
- Standardise variables apart: give each quantifier its own variable name.
- Skolemise: remove each existential quantifier by replacing its variable with a Skolem constant, or a Skolem function of the universally quantified variables that precede it.
- Drop universal quantifiers: all remaining variables are universal.
- Distribute over : , to get a conjunction of clauses.
- Split the conjunction into separate clauses (and rename variables so that no two clauses share one).
Conversion to FOPL
Predicates: is "x is a student of BSc CSIT", , , is "x is a friend of y", , , .
Goal: .
The sentences name no person who is intelligent, so the intended reading is that Rojina, the friend of Laxmi, is a student of BSc CSIT. This is added as 7. . Without it, cannot be derived, since nothing makes Rojina intelligent.
Clauses (CNF)
- C1:
- C2:
- C3:
- C4:
- C5:
- C6:
- C7:
- C8 (negated goal):
Resolution refutation
- C8 and C2 with give R1: .
- R1 and C3 with give R2: .
- R2 and C1 with give R3: .
- R3 and C7 give the empty clause .
The empty clause is a contradiction, so the negated goal is false and is proved. (C5 and C6 are not needed for this proof.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
What is the role of activation function in ANN. How sigmoid function works? Discuss about perceptron learning.
Answer
Role of the activation function
A neuron computes the net input and passes it through an activation function . The activation function:
- decides whether and how strongly the neuron fires (a threshold or squashing action);
- introduces non-linearity, without which a network of many layers would collapse into a single linear map and could not learn problems such as XOR;
- limits the output to a fixed range (for example 0 to 1), which keeps values stable;
- for backpropagation, must be differentiable so gradients can be computed.
Common functions are the step, sigmoid, tanh and ReLU.
Sigmoid function
It squashes any real input into . Large positive gives output near 1, large negative gives near 0, and ; for example and . The output can be read as a probability or firing level. Its derivative is simple:
which makes backpropagation cheap (the error term of an output neuron is ). Its drawbacks are that it saturates for large (vanishing gradients) and its output is not zero-centred.
Perceptron learning
The perceptron (Rosenblatt) is a single neuron with a step activation: if , otherwise 0. It is trained by supervised learning:
- Initialise weights and bias (small values or 0) and choose a learning rate .
- For each training pair compute .
- Update: and . Nothing changes when the output is correct.
- Repeat over the training set (epochs) until there are no errors.
By the perceptron convergence theorem, this converges in a finite number of steps if the classes are linearly separable; for XOR it never converges.
Example, learning AND with , starting at , (patterns in the order 00, 01, 10, 11):
| Epoch | Updates made | Weights after |
|---|---|---|
| 1 | 11 wrongly gives 0 | , |
| 2 | 00 gives 1; 01 gives 1; 11 gives 0 | , |
| 3 | 01; 10; 11 | , |
| 4 | 10; 11 | , |
| 5 | 01 | , |
| 6 | no errors | , |
Final check: gives 1; gives 0; gives 0; gives 0. The perceptron has learnt AND.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What is Turing Test? What properties an agent should have to pass the Turing Test?
Answer
Turing test
The Turing test, proposed by Alan Turing in 1950, is an operational test for machine intelligence. A human interrogator holds a written (text) conversation with two hidden participants, one a human and one a computer, and asks any questions. If, after the interview, the interrogator cannot reliably tell which is the computer, the computer passes the test and is considered intelligent, since it behaves indistinguishably from a human.
Properties an agent needs to pass it
- Natural language processing: to communicate successfully in a human language such as English.
- Knowledge representation: to store what it knows or hears.
- Automated reasoning: to use the stored information to answer questions and draw new conclusions.
- Machine learning: to adapt to new circumstances and to detect and extrapolate patterns.
The total Turing test also includes a video signal, so the interrogator can test perception, and a hatch for passing physical objects. This needs two more properties:
- Computer vision: to perceive objects.
- Robotics: to manipulate objects and move about.
These six disciplines make up most of AI.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What are the properties of intelligent agent? How simple reflex agents work? Give an example of simple reflex agent.
Answer
Properties of an intelligent agent
- Autonomy: operates without constant human intervention and controls its own actions.
- Reactivity: perceives its environment and responds in time to changes in it.
- Pro-activeness (goal-directed behaviour): takes initiative to achieve its goals rather than only reacting.
- Social ability: communicates and cooperates with other agents or people.
- Rationality: chooses the actions that maximise its performance measure.
- Learning and adaptability: improves its performance with experience.
- Persistence and mobility: continues over time, and may move between environments.
Simple reflex agent
A simple reflex agent selects actions on the basis of the current percept only, ignoring the percept history. It uses condition-action rules ("if condition then action"). Working: the sensors give the current percept; the agent interprets it into a description of the current state; it finds the first rule whose condition matches that state; and the actuators perform the action of that rule. It works only if the environment is fully observable and the correct decision can be made from the current percept alone. In a partially observable environment it can loop forever.
Example: a two-square vacuum cleaner agent, with percept (location, status):
- if status = Dirty then Suck
- else if location = A then Right
- else if location = B then Left
A thermostat ("if temperature below set point, turn heater on") and an automatic door are also simple reflex agents.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Why alpha beta pruning is necessary? How alpha beta pruning is done in game search, illustrate with an example.
Answer
Why alpha-beta pruning is necessary
Minimax must examine every node of the game tree, so the number of positions grows as , which is impractical for real games (chess with , ). Alpha-beta pruning gives the same result as minimax but skips branches that cannot influence the final decision. With good move ordering it reduces the time to about , so it can search twice as deep in the same time.
How it works
Two values are carried down the tree:
- : the best (highest) value found so far for MAX along the path (initially );
- : the best (lowest) value found so far for MIN along the path (initially ).
Pruning rule: stop exploring the remaining children of a node as soon as . At a MIN node, if a child value , MAX will never choose this node, so prune. At a MAX node, if a child value , MIN will never allow it, so prune.
Example
Root is MAX with three MIN children, each having three leaves:
- A: 3, 12, 8
- B: 2, 4, 6
- C: 1, 9, 7
- Node A: first leaf 3 gives ; leaves 12 and 8 do not lower it, so A . At the root .
- Node B (with ): first leaf 2 gives B . MAX already has 3 from A, so B can never be chosen. The leaves 4 and 6 are pruned.
- Node C: first leaf 1 gives C . The leaves 9 and 7 are pruned.
The root value is , so MAX chooses the move to A. Four of nine leaves were never evaluated, and the answer equals that of full minimax.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
How knowledge is represented using frames? Represent following knowledge using frames.
Ram is name of an employee. His age is 27. He is male. He belongs to the department HR, where the number of employees is 110 and the average salary of the department is Rs. 45000. All departments are under Tribhuvan University. The organization type of Tribhuvan University is Educational.
Answer
Knowledge representation using frames
A frame is a data structure that represents a stereotyped object, concept or situation. A frame has a name and a set of slots (attributes), each slot holding a value, a default, a range or restriction, or a procedure (if-needed or if-added, called a demon). Frames are organised in a hierarchy using the slots is-a and instance-of, so a frame inherits slot values from its parent frame. Frames group all the knowledge about an object in one place, support inheritance and defaults, and are the basis of object-oriented representation.
Representation of the given knowledge
Frame: Tribhuvan University
instance-of : University
organization type: Educational
Frame: Department
part-of : Tribhuvan University
(all departments are under Tribhuvan University)
Frame: HR
instance-of : Department
number of employees : 110
average salary : Rs. 45000
Frame: Employee
slots : name, age, sex, department
Frame: Ram
instance-of : Employee
name : Ram
age : 27
sex : Male
department : HR
Ram inherits through HR (a Department) the fact that it is under Tribhuvan University, and the organization type Educational is obtained by following the chain Ram, HR, Department, Tribhuvan University. This inheritance is what saves repeating the information in each frame.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Define selection, crossover, and mutation operations in genetic algorithm.
Answer
A genetic algorithm (GA) evolves a population of chromosomes (candidate solutions, often bit strings) using a fitness function. Each generation uses three operations.
Selection
Selection chooses which individuals of the current population become parents, giving fitter ones a higher chance, so that good genes spread. Methods are roulette-wheel selection (probability proportional to fitness, ), tournament selection (the best of randomly chosen individuals wins), and rank selection. Elitism may copy the best individuals unchanged to the next generation.
Crossover (recombination)
Crossover combines the genetic material of two parents to create offspring that inherit features of both, exploring new regions of the search space. It is applied with a probability (crossover rate, typically 0.6 to 0.9). In single-point crossover a random cut point is chosen and the tails are swapped:
Other forms are two-point, uniform and arithmetic crossover.
Mutation
Mutation randomly alters one or more genes of a chromosome with a very small probability (for example 0.001 to 0.01 per gene), for example flipping a bit: . It restores lost genetic material, maintains diversity and helps the search escape local optima.
The process (evaluate fitness, select, cross over, mutate) repeats until a termination condition is met.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Using your own assumptions, design PEAS framework for following intelligent agents.
a. Covid-19 prediction system
b. Vaccine recommender system.
Answer
PEAS stands for Performance measure, Environment, Actuators and Sensors.
(a) Covid-19 prediction system
- Performance measure: accuracy, precision and recall of the predictions of cases, deaths or hospital load; low false-negative rate; timeliness of the forecast.
- Environment: population and its demographic data, hospitals and testing labs, government and health-ministry databases, mobility and travel data, the virus's behaviour (variants), weather.
- Actuators: display of predicted case counts and risk maps, alert messages to health authorities and the public, reports and dashboards, recommendations for lockdown or resource allocation.
- Sensors: data feeds of daily test results and case reports, hospital admission records, vaccination records, mobility and contact data, symptom surveys and keyboard input of parameters.
(b) Vaccine recommender system
- Performance measure: correctness and safety of the recommended vaccine (fit with age and health conditions), coverage of high-risk people, user acceptance, minimal wastage of stock, no adverse effects from missing contraindications.
- Environment: patients and their medical records, health workers, vaccination centres, vaccine stock and cold chain, vaccination guidelines and schedules.
- Actuators: screen showing the recommended vaccine, dose and date, notifications and appointment reminders by SMS or app, reports to the health worker and stock system.
- Sensors: user input (age, sex, allergies, pregnancy, chronic diseases), electronic health record, previous vaccination history, stock database, and guideline updates.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Describe the components of expert system.
Answer
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 (for example MYCIN for diagnosis). Its main components are:
- Knowledge base: stores the domain knowledge, as facts and rules (IF-THEN), frames or semantic nets, collected from experts. The quality of the system depends on it.
- Inference engine: the reasoning part that applies the knowledge base to the facts of the current case to derive conclusions. It uses forward chaining (data-driven) or backward chaining (goal-driven), and a conflict-resolution strategy when several rules match.
- Working memory (case database): holds the facts and intermediate results of the current problem.
- User interface: lets the user enter the problem and receive the answer, in natural language, menus or forms.
- Explanation facility: explains how a conclusion was reached ("how") and why a question is asked ("why"), which builds the user's trust.
- Knowledge acquisition facility: helps the knowledge engineer to collect, encode and update knowledge from domain experts and other sources.
Flow: the user's query goes through the interface to the inference engine, which matches it with the knowledge base and working memory, and the result and explanation are returned to the user.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Why pragmatic analysis is necessary in NLP? How pragmatic analysis is done?
Answer
Why pragmatic analysis is necessary
Syntactic and semantic analysis give the structure and the literal meaning of a sentence, but the same sentence can mean different things depending on who says it, to whom, and in what situation. Without pragmatics a system cannot understand what the speaker really intends. It is necessary to:
- recover the intended meaning rather than the literal meaning: "Can you open the window?" is a request, not a question about ability;
- resolve references to earlier sentences or to the situation (pronouns, "here", "now", "that");
- interpret indirect speech acts, irony, politeness and implied meaning ("It's cold in here");
- use world knowledge and discourse context to disambiguate sentences that remain ambiguous after semantic analysis;
- produce an appropriate response in dialogue systems, translation and question answering.
How pragmatic analysis is done
- Take the output of the semantic analysis (logical form) of the sentence.
- Use the context: the earlier discourse, the speaker, the hearer, time and place, and the goals of the conversation.
- Resolve reference and anaphora, for example "Sita gave Gita a book. She thanked her." by matching pronouns to the most likely entities using recency, gender and the sense of the sentence.
- Identify the speech act (assertion, question, request, promise) and the speaker's intention, using plan-based reasoning and rules such as Grice's maxims.
- Draw on world knowledge and common-sense rules from the knowledge base to infer the implied meaning and fill in missing information.
- Produce the final interpretation, which is a representation of the intended meaning that the system can act on.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
How iterative deepening search is used to find path from initial state to goal state in state space representation of any problem? Illustrate with an example.
Answer
Iterative deepening search (IDS)
In a state space representation the problem is a graph of states connected by operators. Iterative deepening depth-first search combines the benefits of depth-first and breadth-first search. It runs depth-limited DFS repeatedly with limits , increasing the limit by one each iteration, until the goal is found. In each iteration the search goes down to depth , treats nodes at that depth as leaves, and starts again from the initial state if no goal was found.
Algorithm
- Set .
- Run depth-limited DFS from the initial state with limit .
- If the goal state is found, return the path from the initial state to it.
- Otherwise set and repeat from step 2.
Example
State space tree: A is the initial state; A has children B and C; B has children D and E; C has children F and G; G is the goal.
- : visit A only. Not the goal.
- : visit A, B, C. Not found.
- : visit A, B, D, E, C, F, G. G is the goal, so stop.
The path from the initial state to the goal is
Properties
- Complete when the branching factor is finite, and optimal when all step costs are equal (it finds the shallowest goal, like BFS).
- Time and space only , where is the branching factor and the depth of the shallowest goal.
- The repeated work at upper levels is small, because most nodes are at the deepest level: the nodes at the bottom are generated once, the ones above them twice, and so on, which adds little overhead.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
How can you relate synapse, dendrite, and axon in biological neural networks with the elements of artificial neural networks? Create a multi-layer ANN with input layer, hidden layer, and output layer. Assume necessary inputs and weights to the ANN and illustrate a single iteration of backpropagation algorithm to train the ANN.
Answer
Biological and artificial neural networks
| Biological neuron | Artificial neuron |
|---|---|
| Dendrites receive signals from other neurons | Input connections carrying inputs |
| Synapse (its strength decides how much of a signal passes) | Weight on each connection (learned) |
| Cell body (soma) sums the signals and fires above a threshold | Summing unit followed by the activation function |
| Axon carries the output signal to other neurons | Output , passed on to the next layer |
Learning in the brain changes the synaptic strengths, and in an ANN learning changes the weights.
Network
A 2-2-1 feedforward network with sigmoid units and no bias, to keep the arithmetic short.
- Input layer: , .
- Hidden layer: neurons and with weights (), (), (), ().
- Output neuron with weights (), ().
- Target , learning rate .
Forward pass
Error: , i.e. .
Backward pass (error terms)
Output neuron:
Hidden neurons:
Weight updates ()
| Weight | Calculation | New value |
|---|---|---|
Check after one iteration: the forward pass with the new weights gives , and output . The error has fallen from to (towards the target 0.5), so one iteration of backpropagation has moved the output in the right direction. Repeating the iteration reduces the error further.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
What is Skolem constant? How is Skolemization done during resolution? Represent the following statements into FOPL.
- All movies are not hit.
- Sarangi is a movie.
- All movies which have good script are hit.
- Sarangi has a good script but Sarangi is sentimental.
- There is a movie which is comedy.
Answer
Skolem constant
Skolemization removes existential quantifiers. If an existentially quantified variable is not within the scope of any universal quantifier, it is replaced by a new constant that appears nowhere else, called a Skolem constant. For example, becomes , where stands for "some particular movie, whose name we do not know". If the existential variable lies inside universal quantifiers, it is replaced by a Skolem function of those universal variables.
Skolemization during resolution
Resolution needs clauses without quantifiers. Skolemization is step 4 of converting a sentence to clause form:
- Eliminate implications and move negations inward.
- Standardise variables apart.
- For each : if no precedes it, replace by a fresh Skolem constant; otherwise replace by a fresh Skolem function of all universally quantified variables to its left.
- Drop the universal quantifiers.
Examples: becomes . becomes , so may depend on . The new clause is satisfiable exactly when the original is, so refutation by resolution stays valid.
Representation in FOPL
Predicates: , , , , .
- All movies are not hit:
- Sarangi is a movie:
- All movies which have good script are hit:
- Sarangi has a good script but Sarangi is sentimental:
- There is a movie which is comedy:
In clause form, statement 5 is Skolemised to , and statement 1 becomes . Taken literally, statements 1 to 4 conflict: from 2, 3 and 4, follows, while 1 and 2 give .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
How is informed search different from uninformed search? Create a state space with appropriate heuristics, now illustrate how hill climbing search expands nodes to reach a goal. Modify the state space heuristics and demonstrate when the hill climbing will not be complete.
Answer
Informed versus uninformed search
| Basis | Uninformed (blind) search | Informed (heuristic) search |
|---|---|---|
| Knowledge | Uses only the problem definition (states, operators, goal test) | Uses problem-specific knowledge in a heuristic function , the estimated cost from to the goal |
| Direction | Expands nodes in a fixed order (BFS, DFS, UCS, IDS) | Expands the most promising node first (greedy, A*, hill climbing) |
| Efficiency | Explores many irrelevant nodes; high time and space | Usually far fewer nodes expanded, so faster |
| Completeness/optimality | BFS and UCS are complete and optimal | Depends on the algorithm (A* is optimal with an admissible ; hill climbing is neither) |
State space with heuristics
Graph edges: S-A, S-B, A-C, A-D, C-E, E-G (G is the goal). Heuristic values (estimated distance to goal, lower is better):
| Node | S | A | B | C | D | E | G |
|---|---|---|---|---|---|---|---|
| 8 | 6 | 7 | 4 | 6 | 2 | 0 |
Hill climbing starts at the initial node and repeatedly moves to the best neighbour, stopping if no neighbour is better than the current node; it keeps no tree and does not backtrack.
- At S (): neighbours A (6), B (7). The best is A (6 < 8), so move to A.
- At A (): neighbours C (4), D (6). The best is C (4 < 6), so move to C.
- At C (): neighbour E (2) < 4, so move to E.
- At E (): neighbour G (0) < 2, so move to G.
Path: . The goal is reached.
Modified heuristics where hill climbing is not complete
Keep the same graph but change the heuristic of E to 5 (E looks worse than C, though it is the way to the goal):
| Node | S | A | B | C | D | E | G |
|---|---|---|---|---|---|---|---|
| 8 | 6 | 7 | 4 | 6 | 5 | 0 |
- S moves to A (6 < 8), and A moves to C (4 < 6).
- At C (): the only other neighbour is E with , and A (6) is worse. No neighbour is better, so the search stops at C.
C is a local minimum: it is not the goal () yet every neighbour is worse, so the algorithm halts without reaching G even though G is reachable through E. Hill climbing is therefore incomplete. The same failure occurs on plateaux (equal values, no direction to move) and ridges. Remedies are random restarts, simulated annealing, sideways moves, or best-first/A* search.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is intelligence? Describe the foundation of AI.
Answer
Intelligence
Intelligence is the ability to learn from experience, acquire and apply knowledge, reason, solve problems, understand language, perceive the environment and adapt to new situations in order to achieve goals. Artificial intelligence is the study and design of agents that exhibit this ability, definable as systems that think like humans, act like humans, think rationally or act rationally.
Foundations of AI
AI draws on several disciplines:
- Philosophy: logic, reasoning and rationality (Aristotle's syllogisms), the mind as a physical system, the source of knowledge, and the link between knowledge and action.
- Mathematics: formal logic, computability and algorithms (Turing, Gödel), probability and statistics for uncertainty, and complexity (tractability and NP-completeness).
- Economics: decision theory and utility, game theory and Markov decision processes for acting rationally under uncertainty.
- Neuroscience: how the brain processes information with neurons, which inspired artificial neural networks.
- Psychology: cognitive models of human perception, memory, learning and problem solving, and behaviourism.
- Computer engineering: the hardware (fast processors, memory, GPUs) and software that make AI practical.
- Control theory and cybernetics: machines that regulate themselves through feedback to maximise an objective.
- Linguistics: the structure of language and knowledge representation, the basis of natural language processing.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is reinforcement learning? Configure an ANN neuron to simulate OR gate.
Answer
Reinforcement learning (RL) is a type of machine learning in which an agent learns to behave by interacting with an environment. At each step the agent observes a state, takes an action, and receives a numerical reward (or penalty). The agent is not told the correct action; it must discover, by trial and error, a policy that maximises the expected cumulative reward. Examples are game playing, robot navigation and self-driving control. Key elements are the agent, environment, state, action, reward and policy.
ANN neuron to simulate the OR gate
Use a single McCulloch-Pitts / perceptron neuron with two binary inputs , weights , threshold and a step activation:
Choose and .
| net | OR target | |||
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 2 | 1 | 1 |
The output matches the OR truth table for all four inputs, so the neuron with , (equivalently bias ) implements the OR gate.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
How uniform cost search is used to search goal in the state apace ? Illustrate with example.
Answer
Uniform cost search (UCS) is an uninformed search that expands the node with the lowest path cost (cost from the start node to ). It is implemented with a priority queue ordered by . When all step costs are equal it behaves like breadth-first search. It is complete (for positive step costs) and optimal, because the first time a goal is selected for expansion it is reached by the cheapest path.
Algorithm
- Put the start node in the priority queue with cost 0.
- Remove the node with the smallest . If it is the goal, return the path and cost.
- Otherwise expand it: for each successor, compute and insert it; if a node is already in the queue with higher cost, replace it by the cheaper one.
- Repeat until the queue is empty (failure) or the goal is removed.
Example. Edges (cost): S-A (1), S-B (5), S-C (15), A-G (10), B-G (5), C-G (5). Start S, goal G.
| Step | Node expanded | Queue after expansion (node : g) |
|---|---|---|
| 1 | S (0) | A:1, B:5, C:15 |
| 2 | A (1) | B:5, G:11, C:15 |
| 3 | B (5) | G:10 (via B, replaces 11), C:15 |
| 4 | G (10) | goal selected |
The optimal path is S - B - G with cost . A depth-first or breadth-first search could have returned S - A - G (cost 11), but UCS keeps expanding in order of cost and so returns the cheapest path.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
How can you represent knowledge using scripts? Create a knowlege base using script based on your own assumption.
Answer
A script is a structured knowledge representation for a stereotyped sequence of events in a particular context (Schank and Abelson). It describes what normally happens, in what order, who takes part and what objects are used, so that an agent can fill in missing details and predict what comes next. Scripts are built from:
- Entry conditions: what must be true before the script can start.
- Props: objects involved.
- Roles: the people (actors) involved.
- Track: the variant of the general script.
- Scenes: the ordered sequence of events, written using conceptual-dependency primitives (PTRANS, ATRANS, MTRANS, INGEST, etc.).
- Results: conditions true after the script finishes.
Knowledge base: Restaurant script (own assumption)
- Script: Restaurant. Track: Fast-food/dine-in restaurant.
- Props: tables, menu, food, bill, money.
- Roles: customer (C), waiter (W), cook (K), cashier (S).
- Entry conditions: C is hungry; C has money; the restaurant is open.
- Scene 1, Entering: C PTRANS C into restaurant; C ATTEND eyes to tables; C MBUILD where to sit; C PTRANS C to table; C MOVE C to sitting position.
- Scene 2, Ordering: C MTRANS signal to W; W PTRANS menu to C; C MBUILD choice of food; C MTRANS order to W; W MTRANS order to K.
- Scene 3, Eating: K ATRANS food to W; W ATRANS food to C; C INGEST food.
- Scene 4, Exiting: W ATRANS bill to C; C ATRANS money to S; C PTRANS C out of restaurant.
- Results: C is not hungry; C has less money; the restaurant has more money; C may be pleased or displeased.
Use. Given "Ram went to a restaurant and ordered momo. He paid and left", the script lets the system infer that Ram sat down, was served and ate the momo, even though this was not stated.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is robotics? How machine vision is used in robotics?
Answer
Robotics is the branch of engineering and computer science that deals with the design, construction, operation and application of robots, which are programmable machines that sense their environment, make decisions and act on the physical world. A robot has sensors (perception), a controller/processor (decision making, planning) and actuators (motors, grippers). Applications include industrial manufacturing, surgery, space exploration, warehouse logistics and autonomous vehicles.
Machine vision in robotics. Machine vision gives a robot the ability to "see" through cameras and image processing so that it can understand its surroundings and act on them. The typical pipeline is:
- Image acquisition: cameras (2D, stereo or depth/RGB-D) capture images.
- Pre-processing: noise removal, contrast enhancement, filtering.
- Segmentation and feature extraction: edges, corners, regions and colours are extracted to separate objects from background.
- Object recognition and pose estimation: features are matched with models (or classified by a neural network) to identify objects and find their position and orientation.
- Decision and action: the result guides motion planning and control of the arm or vehicle.
Uses: pick-and-place and bin picking of parts; inspection of products for defects; visual servoing (guiding the arm using the camera feedback); navigation and obstacle avoidance in mobile robots, with stereo vision for depth; localisation and mapping (SLAM); reading barcodes and labels; and human-robot interaction through face and gesture recognition.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Define fuzzy logic. Construct a fuzzy rule base expert system with your own considerations of fuzzy set.
Answer
Fuzzy logic is a form of many-valued logic in which the truth of a statement is a degree between 0 and 1 rather than strictly true or false. It uses fuzzy sets, where an element belongs to a set with a membership value , so it can model vague human concepts such as "warm", "fast" or "high". Fuzzy reasoning uses linguistic variables, membership functions and IF-THEN rules.
Fuzzy rule base expert system (own considerations): room fan speed controller
Input: Temperature (Cold, Warm, Hot). Input: Humidity (Low, High). Output: Fan speed (Slow, Medium, Fast).
Fuzzy sets for temperature (in C), triangular membership:
- Cold: at , falling to 0 at 25.
- Warm: rises from 0 at 15 to 1 at 25, falls to 0 at 35.
- Hot: rises from 0 at 25 to 1 at .
Rule base
| Rule | IF Temperature | AND Humidity | THEN Fan speed |
|---|---|---|---|
| R1 | Cold | any | Slow |
| R2 | Warm | Low | Slow |
| R3 | Warm | High | Medium |
| R4 | Hot | Low | Medium |
| R5 | Hot | High | Fast |
Working. Steps of the system are: (1) fuzzification of crisp inputs; (2) rule evaluation, with AND taken as min; (3) aggregation of rule outputs, with max; (4) defuzzification, e.g. by centroid.
Example: temperature C and humidity high (). Then and . Rule R3 fires with strength (Medium) and R5 fires with (Fast). The aggregated output lies between Medium and Fast with equal weights, so after centroid defuzzification the fan speed is set to a value between medium and fast, about 3/4 of the maximum speed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
How is minmax algorithm used in game search? Consider state space is defined by a collection of pairs like (A, B) representing paths between states A and B. Construct state space for following and use a minmax algorithm
(A, B), (A, C), (B, D), (D, E), (C, F), (C, G), (D, H), (D, I), (E, J), (F, K), (F, L), (G, M), (G, N).
The utilities for states H, I, J, K, L, M, N are 1, 3, 2, 6, 3, 4, 1 respectively.
Answer
Minimax in game search. Minimax is used in two-player zero-sum games. The game is represented as a tree of states. MAX tries to maximise the utility and MIN tries to minimise it, and each assumes the opponent plays optimally. Leaf (terminal) nodes get utility values; these are backed up the tree: a MAX node takes the maximum of its children and a MIN node takes the minimum. At the root MAX chooses the move leading to the largest backed-up value.
State space from the given pairs. A is the root with children B and C. B has child D. C has children F and G. D has children E, H, I. E has child J. F has children K, L. G has children M, N.
A (MAX)
├── B (MIN)
│ └── D (MAX)
│ ├── E (MIN)
│ │ └── J (MAX) = 2
│ ├── H (MIN) = 1
│ └── I (MIN) = 3
└── C (MIN)
├── F (MAX)
│ ├── K = 6
│ └── L = 3
└── G (MAX)
├── M = 4
└── N = 1
Levels alternate: A is MAX, B and C are MIN, D, F and G are MAX, and the nodes below them are MIN (J, being a leaf below E, is MAX).
Back-up of values
- E (MIN) has the single child J = 2, so E = 2.
- D (MAX) = max(E, H, I) = max(2, 1, 3) = 3.
- B (MIN) has the single child D, so B = 3.
- F (MAX) = max(6, 3) = 6.
- G (MAX) = max(4, 1) = 4.
- C (MIN) = min(F, G) = min(6, 4) = 4.
- A (MAX) = max(B, C) = max(3, 4) = 4.
Result. The minimax value of the root is 4, so MAX should move from A to C. The expected play is then C to G (MIN picks the smaller of 6 and 4), and MAX takes M with utility 4.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Justify which type of environments resembles following agents.
- Mission Game with fxed 6 states having two players.
- Tesla Driverless Robovan where road conditions are changing.
- Game Result Predicting Agent where current prediction state is independent of previous state.
Answer
Environments are classified by observability, determinism, episodic or sequential nature, static or dynamic nature, discreteness and number of agents.
1. Mission game with a fixed set of 6 states and two players.
- Multi-agent (competitive): two players act against each other.
- Discrete: a fixed, finite number (6) of states.
- Static: the world does not change while the player is thinking; it changes only when a player moves (turn-based).
- Fully observable and deterministic (the next state is fixed by the current state and the moves, apart from the opponent's choices, so it is strategic).
- Sequential: each move affects later moves.
2. Tesla driverless robovan with changing road conditions.
- Dynamic: traffic, weather and road conditions change continuously while the vehicle decides.
- Partially observable: sensors see only part of the surroundings (occlusions, noise).
- Stochastic: the outcome of an action is uncertain because other drivers and pedestrians are unpredictable.
- Continuous: speed, position and steering take continuous values.
- Sequential and multi-agent (other road users).
3. Game result predicting agent where the current prediction is independent of the previous state.
- Episodic: each prediction is an independent episode; the previous decision does not affect the next one. It is a single-agent, usually static and discrete environment (the agent only receives data and outputs a prediction), and it is partially observable and stochastic, since the real outcome of a game is uncertain.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 10 marks
What is model free reinforcement learning? Differentiate between active and passive reinforcement learning. Describe the different operators used in genetic algorithm.
Answer
Model-free reinforcement learning. In reinforcement learning the agent learns a policy that maximises cumulative reward. A model-free method learns directly from experience (state, action, reward, next state) without learning or using a model of the environment, i.e. without knowing the transition probabilities or the reward function. It estimates value functions or the policy directly from sampled interaction. Examples are Q-learning, SARSA, TD learning and policy-gradient methods. The Q-learning update is
where is the learning rate and the discount factor. Model-free methods are simple and work when the environment dynamics are unknown, but need many samples. Model-based methods, in contrast, learn or are given the model and plan with it.
Active vs passive reinforcement learning
| Basis | Passive RL | Active RL |
|---|---|---|
| Policy | The policy is fixed; the agent just executes it | The agent must decide which policy/actions to follow |
| Goal | Evaluate how good the given policy is (learn utilities ) | Learn the optimal policy |
| Exploration | Not needed | Must balance exploration and exploitation |
| Methods | Direct utility estimation, adaptive dynamic programming, TD learning | Q-learning, SARSA, active ADP with exploration |
| Analogy | Learner watching a fixed strategy | Learner choosing its own moves |
Operators of a genetic algorithm. A genetic algorithm evolves a population of candidate solutions (chromosomes) over generations using these operators.
- Selection: chooses fitter individuals as parents, so better solutions are more likely to reproduce. Methods include roulette-wheel, tournament and rank selection.
- Crossover (recombination): combines parts of two parent chromosomes to create offspring. In single-point crossover a point is chosen and tails are swapped: parents 1101|001 and 0010|110 give children 1101110 and 0010001. There are also two-point and uniform crossover.
- Mutation: randomly flips or changes genes with a small probability (e.g. 1101110 to 1100110). It maintains diversity and prevents premature convergence to a local optimum.
- Elitism (optional): copies the best individuals unchanged into the next generation.
The cycle of evaluating fitness, selection, crossover and mutation repeats until a stopping condition (a satisfactory fitness or a maximum number of generations) is met.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
How do you define rational? Can AI choose between right and wrong? Justify.
Answer
Rationality. An agent is rational if, for each possible percept sequence, it selects the action that is expected to maximise its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge it has. Rationality at any time depends on four things: (1) the performance measure that defines success, (2) the agent's prior knowledge of the environment, (3) the actions it can perform, and (4) its percept sequence to date. Rationality is not omniscience (it maximises expected, not actual, performance) and it is not perfection.
Can AI choose between right and wrong? An AI system can only choose between right and wrong in the sense that it was designed to. It has no inherent moral understanding or conscience. A rational agent optimises the performance measure or objective function given to it by humans; if that objective encodes ethical constraints (rules such as "never harm a pedestrian", or values learned from human feedback), the agent will act in ways we call right, but "right" is defined by the designers and the data, not discovered by the machine itself. Hence:
- A rational agent is not automatically a moral agent. If the performance measure ignores harm, a perfectly rational agent may behave wrongly.
- AI may reflect biases present in its training data, so it can make unfair choices.
- Ethical dilemmas (e.g. a self-driving car choosing between two harms) have no single correct answer and need human value judgements.
- Therefore responsibility remains with the humans who design, train and deploy the system, who must include ethical constraints, transparency and human oversight.
So AI can follow encoded ethical rules and distinguish right from wrong according to a given specification, but it cannot truly judge morality on its own.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
What do you mean by PEAS description? Give an example.
Answer
PEAS description. PEAS is a framework for specifying the task environment of an intelligent agent. It stands for:
- P - Performance measure: the criteria by which the success of the agent is judged.
- E - Environment: the surroundings in which the agent operates.
- A - Actuators: the means by which the agent acts on the environment.
- S - Sensors: the means by which the agent perceives the environment.
Specifying PEAS is the first step in designing an agent because it states clearly what the agent must achieve and with what resources.
Example: automated taxi driver
| Component | Description |
|---|---|
| Performance measure | Safe, fast, legal, comfortable trip; minimum fuel use and fare cost; maximum profit |
| Environment | Roads, other traffic, pedestrians, traffic signals, weather, customers |
| Actuators | Steering, accelerator, brake, indicators, horn, display/speaker |
| Sensors | Cameras, radar/LiDAR, GPS, speedometer, odometer, accelerometer, microphone, engine sensors |
Another example is a medical diagnosis system: performance = healthy patient, low cost; environment = patient, hospital, staff; actuators = display of questions, tests and diagnoses; sensors = keyboard entry of symptoms and findings.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Apply the hill climbing search algorithm to solve the following problem. Assume the heuristic function h(n) = +1 for all blocks in the support structure if the block is correctly positioned, otherwise -1.
Initial State:
Goal State:
Answer
Setup. Stacks are written from bottom to top: initial state A, D, C, B (A on the table, B on top); goal D, C, B, A (D on the table, A on top). Only one block (the top block of a stack) can be moved at a time, onto the table or onto another clear block.
Heuristic. is the sum over the four blocks of +1 if the block has the correct support structure (it is in the same position as in the goal, resting on the correct blocks) and -1 otherwise. Hill climbing moves to the neighbour with the best and stops if no neighbour is better than the current state.
Initial state : the goal needs D at the bottom, so every block is wrong.
Neighbours. Only B is clear, so the moves are: B to table giving . For this state, A, D, C are wrong (A is at the bottom but should be D) and B is alone on the table (should be on C), so . A strict hill climber needs a neighbour with , and there is none, so it stops at once: the initial state is a plateau (flat local maximum) for this heuristic.
Allowing sideways moves (plateau moves) the search proceeds:
| Step | Move | State | |
|---|---|---|---|
| 0 | start | [A,D,C,B] | -4 |
| 1 | B to table | [A,D,C], [B] | -4 |
| 2 | C to table | [A,D], [B], [C] | -4 |
| 3 | D to table | [A], [B], [C], [D] | D correct: +1, others -1 = -2 |
| 4 | C onto D | [D,C], [A], [B] | +2 -2 = 0 |
| 5 | B onto C | [D,C,B], [A] | +3 -1 = 2 |
| 6 | A onto B | [D,C,B,A] | +4 (goal) |
From step 3 onward every move improves , so the search reaches the goal .
Conclusion. With this heuristic, simple (strict) hill climbing gets stuck at the start because the first moves give no improvement; it succeeds only if sideways moves are allowed, or with a better heuristic that looks at the whole structure. This shows the weakness of hill climbing: plateaus and local maxima.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Why do we need posterior probability? Design a semantic network for the following statements: Dogs hate cats. Tom is a cat. Puppy is a dog. Cats chase rats. Rats are clever.
Answer
Why posterior probability is needed. The posterior probability is the probability of a hypothesis after the evidence has been observed. It is needed because agents must update their beliefs when new evidence arrives, to make decisions under uncertainty (for example diagnosing a disease from symptoms, or filtering spam from words). It is computed using Bayes' theorem:
where is the prior, the likelihood and the evidence. It is useful because the likelihood is often easy to obtain while is what we actually need.
Semantic network. A semantic network is a graph in which nodes are concepts/objects and labelled arcs are relations. For the statements:
Nodes: Dog, Cat, Rat, Puppy, Tom, Clever.
Puppy --is-a--> Dog --hates--> Cat <--is-a-- Tom
Cat --chases--> Rat --is--> Clever
Arcs:
- Puppy --instance-of--> Dog
- Tom --instance-of--> Cat
- Dog --hates--> Cat
- Cat --chases--> Rat
- Rat --has-property--> Clever
Inference: following the arcs, Puppy (a dog) hates Tom (a cat) by inheritance, and Tom chases rats, which are clever.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Design a Hebb net to implement the logical OR function.
Answer
A Hebb net learns by the Hebb rule: when input and target are both active, the connection is strengthened.
Use bipolar inputs and targets (1 = true, -1 = false). Initially . The OR function:
| 1 | 1 | 1 |
| 1 | -1 | 1 |
| -1 | 1 | 1 |
| -1 | -1 | -1 |
Training
| Input | |||||||
|---|---|---|---|---|---|---|---|
| (1, 1) | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| (1, -1) | 1 | 1 | -1 | 1 | 2 | 0 | 2 |
| (-1, 1) | 1 | -1 | 1 | 1 | 1 | 1 | 3 |
| (-1, -1) | -1 | 1 | 1 | -1 | 2 | 2 | 2 |
Final weights: .
Testing with :
- (1, 1): , so .
- (1, -1): , so .
- (-1, 1): , so .
- (-1, -1): , so .
All outputs match the targets, so the net with , implements OR.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Given the premises: All living things are either animal or plant. Plants need sunlight for photosynthesis. Mustard is a living thing but it is not an animal. Does mustard need sunlight for photosynthesis?
Answer
Formalisation in first-order logic
Query: ?
Proof by resolution (refutation). Clauses:
- C1:
- C2:
- C3:
- C4:
- C5 (negated goal):
Steps:
- C1 and C3 with : (C6).
- C6 and C4: (C7).
- C7 and C2 with : (C8).
- C8 and C5: empty clause (contradiction).
Conclusion. Yes. Mustard is living, so it is an animal or a plant; it is not an animal, so it is a plant; plants need sunlight for photosynthesis, so mustard needs sunlight.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
What are the phases for developing an expert system? Explain.
Answer
An expert system is a computer program that emulates the decision-making ability of a human expert in a narrow domain using a knowledge base and an inference engine. Its development follows these phases.
- Identification (problem assessment): define the problem, decide whether an expert system is suitable, identify the domain expert, the knowledge engineer and the users, and set the goals and resources.
- Conceptualisation: analyse the problem and decide the key concepts, relations and the type of reasoning (e.g. diagnosis, classification) needed.
- Knowledge acquisition: the knowledge engineer collects knowledge from experts (by interviews, observation and documents) and from data.
- Formalisation (representation): choose a knowledge representation such as production rules, frames or semantic networks, and select the inference strategy (forward or backward chaining) and tools (shell, Prolog, CLIPS).
- Implementation: build the knowledge base, inference engine, explanation facility and user interface into a working prototype.
- Testing (validation and verification): run the system on test cases, compare with the expert's results, fix errors and refine rules.
- Deployment and maintenance: install the system, train users, and update the knowledge base as the domain changes.
The process is iterative: faults found during testing send the developer back to earlier phases.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Why do machines need to understand and generate natural language? What might be the challenges? Explain.
Answer
Why machines need to understand and generate natural language. Natural language (Nepali, English, etc.) is the most natural way for humans to communicate. If machines can understand and generate it, people can use computers without learning programming languages or special commands. It also lets machines process the huge amount of knowledge that exists as text. Applications include:
- Machine translation (Nepali to English).
- Chatbots, virtual assistants and voice interfaces.
- Question answering and information retrieval/search.
- Text summarisation, sentiment analysis and spam filtering.
- Speech recognition and text-to-speech, and automatic report generation.
Challenges
- Ambiguity: lexical ambiguity (the word "bank"), syntactic ambiguity ("I saw the man with the telescope") and semantic ambiguity.
- Context and world knowledge: meaning depends on the situation, earlier sentences and common sense; pronoun resolution ("he", "it") needs it.
- Idioms, sarcasm and figurative language: meaning is not literal.
- Variation and rich morphology: dialects, slang, spelling errors, code-mixing (Nepali written in Roman script), and free word order in languages like Nepali.
- Low-resource languages: little annotated data and few tools for languages such as Nepali.
- Generation challenges: producing fluent, coherent and factually correct text with the right tone.
- Bias and ethics: models may learn bias from the training text.
- Computation and speech issues: noise, accents and the large resources needed for large models.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
List any one example of static and dynamic environment for an agent. Why and when do you prefer rule based systems?
Answer
Static and dynamic environment examples
- Static: a crossword puzzle (or a chess game with no clock). The environment does not change while the agent is deliberating, so the agent need not keep watching the world or worry about time.
- Dynamic: a self-driving car in traffic (or a robot in a crowded room). The environment keeps changing while the agent thinks, so a slow decision may become wrong, and the agent must keep sensing.
Why and when rule-based systems are preferred. A rule-based system represents knowledge as IF-THEN rules and uses an inference engine to apply them. It is preferred when:
- The domain knowledge is well understood and can be written explicitly as rules by experts (for example medical diagnosis protocols, tax or loan eligibility rules, configuration of equipment).
- The problem is narrow and well-bounded, so the rules are manageable in number.
- Transparency and explanation are needed: the system can show which rules led to a decision, which is important in legal, medical and financial uses.
- There is not enough data to train a machine-learning model, but there are human experts.
- The knowledge must be easy to modify: rules can be added or changed independently without retraining.
- Decisions must be consistent, predictable and fast, and expert knowledge needs to be preserved and shared.
They are not suitable when rules are too many, too uncertain or hard to state (for example image recognition), where learning-based approaches work better.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from TU BSc CSIT 2076 Fourth Semester Artificial Intelligence (TU IOST board exam, 2076), TU BSc CSIT 2078 Fourth Semester Artificial Intelligence (TU IOST board exam, 2078), TU BSc CSIT 2079 Fourth Semester Artificial Intelligence (TU IOST board exam, 2079), TU BSc CSIT 2080 Fourth Semester Artificial Intelligence (TU IOST board exam, 2080), TU BSc CSIT 2081 Fourth Semester Artificial Intelligence (TU IOST board exam, 2081), TU BSc CSIT 2082 Fourth Semester Artificial Intelligence (TU IOST board exam, 2082), TU BSc CSIT 2076 Fourth Semester Computer Networks (TU IOST board exam, 2076), TU BSc CSIT 2078 Fourth Semester Computer Networks (TU IOST board exam, 2078), TU BSc CSIT 2079 Fourth Semester Computer Networks (TU IOST board exam, 2079), TU BSc CSIT 2080 Fourth Semester Computer Networks (TU IOST board exam, 2080), TU BSc CSIT 2081 Fourth Semester Computer Networks (TU IOST board exam, 2081), TU BSc CSIT 2082 Fourth Semester Computer Networks (TU IOST board exam, 2082), TU BSc CSIT 2076 Fourth Semester Database Management System (TU IOST board exam, 2076), TU BSc CSIT 2078 Fourth Semester Database Management System (TU IOST board exam, 2078), TU BSc CSIT 2079 Fourth Semester Database Management System (TU IOST board exam, 2079), TU BSc CSIT 2080 Fourth Semester Database Management System (TU IOST board exam, 2080), TU BSc CSIT 2081 Fourth Semester Database Management System (TU IOST board exam, 2081), TU BSc CSIT 2082 Fourth Semester Database Management System (TU IOST board exam, 2082), TU BSc CSIT 2076 Fourth Semester Operating System (TU IOST board exam, 2076), TU BSc CSIT 2078 Fourth Semester Operating System (TU IOST board exam, 2078), TU BSc CSIT 2079 Fourth Semester Operating System (TU IOST board exam, 2079), TU BSc CSIT 2080 Fourth Semester Operating System (TU IOST board exam, 2080), TU BSc CSIT 2081 Fourth Semester Operating System (TU IOST board exam, 2081), TU BSc CSIT 2082 Fourth Semester Operating System (TU IOST board exam, 2082), TU BSc CSIT 2076 Fourth Semester Theory of Computation (TU IOST board exam, 2076), TU BSc CSIT 2078 Fourth Semester Theory of Computation (TU IOST board exam, 2078), TU BSc CSIT 2079 Fourth Semester Theory of Computation (TU IOST board exam, 2079), TU BSc CSIT 2080 Fourth Semester Theory of Computation (TU IOST board exam, 2080), TU BSc CSIT 2081 Fourth Semester Theory of Computation (TU IOST board exam, 2081) and TU BSc CSIT 2082 Fourth Semester Theory of Computation (TU IOST board exam, 2082). Answers are written for this site; check them against your class notes.