Skip to main content

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 SS, goal GG and two other nodes AA, BB. Edge costs (local costs) and heuristic values:

EdgeCost
SS–AA1
SS–BB3
BB–GG3
NodeSSAABBGG
h(n)h(n)2130

The true cost to the goal is h∗(S)=6h^*(S)=6, h∗(A)=7h^*(A)=7, h∗(B)=3h^*(B)=3, h∗(G)=0h^*(G)=0. Since h≤h∗h\le h^* everywhere, hh is admissible. It is also consistent: for example h(S)=2≤c(S,A)+h(A)=1+1h(S)=2\le c(S,A)+h(A)=1+1 and h(A)=1≤c(A,S)+h(S)=1+2h(A)=1\le c(A,S)+h(S)=1+2.

Greedy best-first search (f(n) = h(n)) is not complete. It always expands the node with the smallest hh, ignoring the cost so far and (in tree search) repeated states.

StepExpandedFrontier after expansion (node : h)
1SS (h=2)AA:1, BB:3
2AA (h=1)SS:2, BB:3
3SS (h=2)AA:1, BB:3, BB:3
4AA (h=1)SS:2, BB:3, ...

From AA the only successor is SS, and h(S)=2<h(B)=3h(S)=2<h(B)=3, so SS is chosen again, then AA again, and so on. The search oscillates S→A→S→A…S\to A\to S\to A\dots forever and node BB (the only way to GG) 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 gg grows with every move, a looping path eventually has a larger ff than the path that reaches the goal.

StepExpanded (g, f)New nodes added (g, f)
1SS (0, 2)AA (1, 2), BB (3, 6)
2AA (1, 2)SS (2, 4)
3SS (2, 4)AA (3, 4), BB (5, 8)
4AA (3, 4)SS (4, 6)
5BB (3, 6)GG (6, 6), SS (6, 8)
6GG (6, 6) is selected: goal test succeeds

(Ties at f=6f=6 are broken in favour of the goal/shallower node; any other tie-break only delays by finitely many steps, since each further loop S→A→SS\to A\to S raises ff by 2.)

Solution: S→B→GS\to B\to G with cost 3+3=63+3=6, 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 ≥ϵ>0\ge\epsilon>0) 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 α\alpha follows from a knowledge base KBKB:

  1. Convert every sentence of KBKB to first-order logic.
  2. Convert to clause (conjunctive normal) form: eliminate →\rightarrow, move ¬\neg inward, standardise variables, Skolemise ∃\exists, drop ∀\forall.
  3. Negate the query, convert it to clauses and add it to the set.
  4. Repeatedly pick two clauses containing complementary literals, unify them (finding a most general unifier θ\theta) and add the resolvent.
  5. If the empty clause (□\square) is derived, the set is contradictory, so KB⊨αKB\models\alpha.

Conversion to FOPL.

  1. ∀x  loves(Pugu,x)→star(x)\forall x\; loves(Pugu,x)\rightarrow star(x)
  2. ∀x  hero(x)∧¬rehearse(x)→¬act(x)\forall x\; hero(x)\wedge\neg rehearse(x)\rightarrow\neg act(x)
  3. hero(Anmol)hero(Anmol)
  4. ∀x  hero(x)∧¬work(x)→¬rehearse(x)\forall x\; hero(x)\wedge\neg work(x)\rightarrow\neg rehearse(x)
  5. ∀x  ¬act(x)→¬star(x)\forall x\; \neg act(x)\rightarrow\neg star(x)

Goal: ¬work(Anmol)→¬loves(Pugu,Anmol)\neg work(Anmol)\rightarrow\neg loves(Pugu,Anmol). Its negation is ¬work(Anmol)∧loves(Pugu,Anmol)\neg work(Anmol)\wedge loves(Pugu,Anmol).

Clause form.

  • C1: ¬loves(Pugu,x)∨star(x)\neg loves(Pugu,x)\vee star(x)
  • C2: ¬hero(x)∨rehearse(x)∨¬act(x)\neg hero(x)\vee rehearse(x)\vee\neg act(x)
  • C3: hero(Anmol)hero(Anmol)
  • C4: ¬hero(x)∨work(x)∨¬rehearse(x)\neg hero(x)\vee work(x)\vee\neg rehearse(x)
  • C5: act(x)∨¬star(x)act(x)\vee\neg star(x)
  • C6: ¬work(Anmol)\neg work(Anmol) (negated goal)
  • C7: loves(Pugu,Anmol)loves(Pugu,Anmol) (negated goal)

Resolution proof.

StepResolveUnifierResolvent
8C1, C7x/Anmolx/Anmolstar(Anmol)star(Anmol)
9C5, C8x/Anmolx/Anmolact(Anmol)act(Anmol)
10C2, C3x/Anmolx/Anmolrehearse(Anmol)∨¬act(Anmol)rehearse(Anmol)\vee\neg act(Anmol)
11C10, C9nonerehearse(Anmol)rehearse(Anmol)
12C4, C3x/Anmolx/Anmolwork(Anmol)∨¬rehearse(Anmol)work(Anmol)\vee\neg rehearse(Anmol)
13C12, C11nonework(Anmol)work(Anmol)
14C13, C6none□\square (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 x1,…,xnx_1,\dots,x_n with weights w1,…,wnw_1,\dots,w_n and a bias bb. It first forms the net input

net=∑i=1nwixi+bnet=\sum_{i=1}^{n}w_ix_i+b

and then applies an activation function ff to give the output

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

Common activation functions are:

  • Step / threshold: f(net)=1f(net)=1 if net≥0net\ge0, else 00 (or −1-1 for the bipolar case).
  • Sigmoid: f(net)=11+e−netf(net)=\dfrac{1}{1+e^{-net}}.
  • Tanh: f(net)=tanh⁡(net)f(net)=\tanh(net).

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 xix_i and target (output) yy the weight update is

winew=wiold+xi y,bnew=bold+yw_i^{new}=w_i^{old}+x_i\,y,\qquad b^{new}=b^{old}+y

Training algorithm.

  1. Initialise all weights and bias to 00.
  2. For each training pair (x,t)(x,t): set the activation y=ty=t, update wi=wi+xitw_i=w_i+x_it and b=b+tb=b+t.
  3. 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.

x1x_1x2x_2tt
111
1-1-1
-11-1
-1-1-1

Start with w1=w2=b=0w_1=w_2=b=0.

PatternΔw1=x1t\Delta w_1=x_1tΔw2=x2t\Delta w_2=x_2tΔb=t\Delta b=tw1w_1w2w_2bb
(1, 1)111111
(1, -1)-11-1020
(-1, 1)1-1-111-1
(-1, -1)11-122-2

Final weights: w1=2, w2=2, b=−2w_1=2,\ w_2=2,\ b=-2.

Check: with y=sign(2x1+2x2−2)y=\text{sign}(2x_1+2x_2-2):

  • (1,1)(1,1): 2>0⇒12>0\Rightarrow 1
  • (1,−1)(1,-1): −2⇒−1-2\Rightarrow -1
  • (−1,1)(-1,1): −2⇒−1-2\Rightarrow -1
  • (−1,−1)(-1,-1): −6⇒−1-6\Rightarrow -1

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:

  1. 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).

  2. 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.

  1. 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).

  2. 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.

  3. 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).

  4. 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).

  5. 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).

  6. Single-agent vs multi-agent. Only one agent acts (crossword) versus several competing or cooperating agents (chess is competitive; taxi driving is partly cooperative).

  7. 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 g(n)g(n). It uses a priority queue ordered by g(n)g(n), and the goal test is applied when a node is selected for expansion (not when generated). It is complete (if every step cost ≥ϵ>0\ge\epsilon>0) and optimal.

Algorithm.

  1. Put the start node in the priority queue with g=0g=0.
  2. Remove the node with the smallest gg. If it is a goal, return the path.
  3. Otherwise expand it; for every child compute g(child)=g(parent)+costg(child)=g(parent)+cost and insert it (or update it if a cheaper path to an already-queued state is found).
  4. Repeat from step 2.

Example. State space with start SS and goal GG:

EdgeCost
S→AS\to A1
S→BS\to B5
S→CS\to C15
A→GA\to G10
B→GB\to G5
C→GC\to G5
StepNode expandedFrontier (node : g)
1SS (0)AA:1, BB:5, CC:15
2AA (1)BB:5, GG:11 (via A), CC:15
3BB (5)GG:10 (via B, better than 11), CC:15
4GG (10)goal selected, stop

The path found is S→B→GS\to B\to G with cost 5+5=105+5=10. Note that the path S→A→GS\to A\to G (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) and instance-of links, 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 (11) or does not belong (00). In a fuzzy set AA on a universe XX, each element xx has a degree of membership μA(x)∈[0,1]\mu_A(x)\in[0,1], given by the membership function μA:X→[0,1]\mu_A:X\to[0,1]. A value near 11 means strong membership, near 00 weak membership. A fuzzy set is written

A={(x,μA(x))∣x∈X}=∑iμA(xi)/xiA=\{(x,\mu_A(x))\mid x\in X\}=\sum_i \mu_A(x_i)/x_i

Constructing a fuzzy set. Let X={10,20,30,40,50,60,70}X=\{10,20,30,40,50,60,70\} and let AA = "numbers close to 40", with the triangular membership function

μA(x)=max⁡(0,  1−∣x−40∣30)\mu_A(x)=\max\Big(0,\;1-\frac{|x-40|}{30}\Big)

xx10203040506070
μA(x)\mu_A(x)00.330.6710.670.330

For example μA(20)=1−20/30=0.33\mu_A(20)=1-20/30=0.33 and μA(30)=1−10/30=0.67\mu_A(30)=1-10/30=0.67.

Hence

A={0/10,  0.33/20,  0.67/30,  1/40,  0.67/50,  0.33/60,  0/70}A=\{0/10,\;0.33/20,\;0.67/30,\;1/40,\;0.67/50,\;0.33/60,\;0/70\}

Here 40 fully belongs to the set, 30 and 50 belong to degree 0.670.67, 20 and 60 to degree 0.330.33, 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.

  1. Initialise: generate a random population of NN chromosomes.
  2. Evaluate: compute the fitness f(c)f(c) of every chromosome.
  3. Repeat until the termination condition (a chromosome of sufficient fitness is found, or a maximum number of generations is reached):
    1. Selection: choose parents with probability proportional to fitness (roulette-wheel, tournament or rank selection).
    2. Crossover: with probability pcp_c, pair parents and exchange parts of their strings at a random crossover point to create offspring; otherwise copy the parents.
    3. Mutation: with a small probability pmp_m, flip each bit of the offspring.
    4. Replacement: form the new population from the offspring (optionally keeping the best individuals, i.e. elitism).
    5. Evaluate the fitness of the new population.
  4. 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
150.12
160.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 [0,1][0,1]; 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 P(L=130∣W=15)P(L=130\mid W=15). By the definition of conditional probability:

P(L=130∣W=15)=P(L=130, W=15)P(W=15)P(L=130\mid W=15)=\frac{P(L=130,\,W=15)}{P(W=15)}

From the table, P(L=130,W=15)=0.42P(L=130,W=15)=0.42.

The marginal probability of width 15 is the sum of its row:

P(W=15)=0.12+0.42+0.06=0.60P(W=15)=0.12+0.42+0.06=0.60

Therefore

P(L=130∣W=15)=0.420.60=0.7P(L=130\mid W=15)=\frac{0.42}{0.60}=0.7

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.

  1. Image acquisition: a camera (CCD/CMOS, stereo or depth camera) converts the scene into a digital image.
  2. Pre-processing: noise removal, smoothing, contrast enhancement.
  3. Segmentation and edge detection: separate objects from the background and find boundaries.
  4. Feature extraction: corners, shapes, colour and texture.
  5. 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:

  • S→NP  VPS\rightarrow NP\;VP
  • NP→Det  NNP\rightarrow Det\;N
  • VP→V  NPVP\rightarrow V\;NP

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:

∃x ∃y  boy(x)∧apple(y)∧eats(x,y)\exists x\,\exists y\; boy(x)\wedge apple(y)\wedge eats(x,y)

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: traffic(x)traffic(x), driver(x)driver(x), chases(x,y)chases(x,y), catches(x,y)catches(x,y), horn(x)horn(x), smart(x)smart(x), frustrated(x)frustrated(x).

  1. Every traffic chases a driver: ∀x  traffic(x)→∃y  (driver(y)∧chases(x,y))\forall x\;traffic(x)\rightarrow\exists y\;(driver(y)\wedge chases(x,y))
  2. Every driver who horns is smart: ∀x  driver(x)∧horn(x)→smart(x)\forall x\;driver(x)\wedge horn(x)\rightarrow smart(x)
  3. No traffic catches any smart driver: ∀x∀y  traffic(x)∧smart(y)→¬catches(x,y)\forall x\forall y\;traffic(x)\wedge smart(y)\rightarrow\neg catches(x,y)
  4. Any traffic who chases some driver but does not catch him is frustrated: ∀x∀y  traffic(x)∧driver(y)∧chases(x,y)∧¬catches(x,y)→frustrated(x)\forall x\forall y\;traffic(x)\wedge driver(y)\wedge chases(x,y)\wedge\neg catches(x,y)\rightarrow frustrated(x)

Goal: (∀x  driver(x)→horn(x))→(∀x  traffic(x)→frustrated(x))(\forall x\;driver(x)\rightarrow horn(x))\rightarrow(\forall x\;traffic(x)\rightarrow frustrated(x)).

Negated goal: (∀x  driver(x)→horn(x))∧∃x  (traffic(x)∧¬frustrated(x))(\forall x\;driver(x)\rightarrow horn(x))\wedge\exists x\;(traffic(x)\wedge\neg frustrated(x)).

Clause form (Skolem function f(x)f(x) for the driver chased by xx, constant aa for the unfrustrated traffic):

  • C1: ¬traffic(x)∨driver(f(x))\neg traffic(x)\vee driver(f(x))
  • C2: ¬traffic(x)∨chases(x,f(x))\neg traffic(x)\vee chases(x,f(x))
  • C3: ¬driver(x)∨¬horn(x)∨smart(x)\neg driver(x)\vee\neg horn(x)\vee smart(x)
  • C4: ¬traffic(x)∨¬smart(y)∨¬catches(x,y)\neg traffic(x)\vee\neg smart(y)\vee\neg catches(x,y)
  • C5: ¬traffic(x)∨¬driver(y)∨¬chases(x,y)∨catches(x,y)∨frustrated(x)\neg traffic(x)\vee\neg driver(y)\vee\neg chases(x,y)\vee catches(x,y)\vee frustrated(x)
  • C6: ¬driver(x)∨horn(x)\neg driver(x)\vee horn(x) (negated goal)
  • C7: traffic(a)traffic(a) (negated goal)
  • C8: ¬frustrated(a)\neg frustrated(a) (negated goal)

Resolution proof.

StepResolveUnifierResolvent
9C7, C1x/ax/adriver(f(a))driver(f(a))
10C7, C2x/ax/achases(a,f(a))chases(a,f(a))
11C9, C6x/f(a)x/f(a)horn(f(a))horn(f(a))
12C3, C9x/f(a)x/f(a)¬horn(f(a))∨smart(f(a))\neg horn(f(a))\vee smart(f(a))
13C12, C11nonesmart(f(a))smart(f(a))
14C4, C7x/ax/a¬smart(y)∨¬catches(a,y)\neg smart(y)\vee\neg catches(a,y)
15C14, C13y/f(a)y/f(a)¬catches(a,f(a))\neg catches(a,f(a))
16C5, C7x/ax/a¬driver(y)∨¬chases(a,y)∨catches(a,y)∨frustrated(a)\neg driver(y)\vee\neg chases(a,y)\vee catches(a,y)\vee frustrated(a)
17C16, C9y/f(a)y/f(a)¬chases(a,f(a))∨catches(a,f(a))∨frustrated(a)\neg chases(a,f(a))\vee catches(a,f(a))\vee frustrated(a)
18C17, C10nonecatches(a,f(a))∨frustrated(a)catches(a,f(a))\vee frustrated(a)
19C18, C15nonefrustrated(a)frustrated(a)
20C19, C8none□\square

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:

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

where xix_i are inputs, wiw_i weights, bb the bias and ff 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 ll computes a(l)=f(W(l)a(l−1)+b(l))\mathbf a^{(l)}=f(W^{(l)}\mathbf a^{(l-1)}+\mathbf b^{(l)}).

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 yy with the target tt, measure the error (e.g. E=12∑(t−y)2E=\tfrac12\sum(t-y)^2), 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 α\alpha, 0<α≤10<\alpha\le1):

  1. Initialise weights wiw_i and bias bb to small random values (or 00).
  2. For each training pair (x,t)(x,t) in the training set:
    1. Compute net=∑wixi+bnet=\sum w_ix_i+b.
    2. Compute the output y=1y=1 if net>θnet>\theta, y=0y=0 (or −1-1) otherwise.
    3. If y≠ty\ne t, update: wi←wi+α(t−y)xiw_i\leftarrow w_i+\alpha(t-y)x_i and b←b+α(t−y)b\leftarrow b+\alpha(t-y).
  3. 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.

ComponentDescription
Performance measureSafe, fast, legal, comfortable trip; maximise profit; minimise fuel use and violations
EnvironmentRoads, other traffic, pedestrians, customers, weather
ActuatorsSteering, accelerator, brake, signal, horn, display
SensorsCameras, sonar/lidar, speedometer, GPS, odometer, engine sensors, keyboard/microphone

Example 2: medical diagnosis system.

ComponentDescription
Performance measureHealthy patient, minimal cost, correct diagnoses
EnvironmentPatient, hospital, staff
ActuatorsDisplay of questions, tests, diagnoses, treatments
SensorsKeyboard 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.

FromLinkTo
Raminstance-of (is a)Person
Personis-a (subclass)Human
Humanhas-partNose
Humaninstance-of (as stated)Mammal
Ramweight60 kg
Ramweight 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 pcp_c (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.

  1. Knowledge base: domain facts and heuristic rules (usually IF–THEN) acquired from experts.
  2. Working memory: facts about the current case.
  3. Inference engine: applies the rules to the facts to derive new facts and conclusions.
  4. User interface: the user enters the problem and receives advice.
  5. Explanation facility: tells the user how and why a conclusion was reached.
  6. 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 eats(Ram,rice)eats(Ram, rice).
  • 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 P(H∣E)P(H\mid E) is the revised probability of a hypothesis HH after observing evidence EE. It is computed from the prior P(H)P(H) and the likelihood P(E∣H)P(E\mid H) by Bayes' theorem:

P(H∣E)=P(E∣H) P(H)P(E)P(H\mid E)=\frac{P(E\mid H)\,P(H)}{P(E)}

Numerical. Let DD = the patient has liver disease and AA = the patient is alcoholic.

  • P(D)=0.15P(D)=0.15 (prior)
  • P(A)=0.05P(A)=0.05
  • P(A∣D)=0.07P(A\mid D)=0.07

Required: P(D∣A)P(D\mid A).

P(D∣A)=P(A∣D) P(D)P(A)=0.07×0.150.05=0.01050.05=0.21P(D\mid A)=\frac{P(A\mid D)\,P(D)}{P(A)}=\frac{0.07\times0.15}{0.05}=\frac{0.0105}{0.05}=0.21

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 h(n)h(n) estimates the cost of the cheapest path from node nn to a goal. It is admissible if it never overestimates the true cost:

0≤h(n)≤h∗(n)for every node n,h(goal)=00\le h(n)\le h^*(n)\quad\text{for every node }n,\qquad h(\text{goal})=0

where h∗(n)h^*(n) is the actual least cost from nn 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 h1h_1 and the sum of Manhattan distances of tiles from their goal positions h2h_2 are both admissible, since each move shifts one tile by one square, so at least h1h_1 (or h2h_2) 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):

  1. Start with an initial state (current).
  2. Generate all neighbours of current and evaluate them using the objective/heuristic function.
  3. If the best neighbour is better than current, move to it and go to step 2.
  4. 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:

  1. Initial state: where the agent starts, e.g. In(Kathmandu).
  2. Actions: the set of actions available in each state, e.g. Go(Pokhara).
  3. Transition model: the state that results from doing an action in a state, RESULT(s,a)RESULT(s,a).
  4. Goal test: checks whether a state is a goal, e.g. In(Pokhara).
  5. 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.

AspectCSPReal-world problem
FormulationVariables XiX_i, domains DiD_i and constraints CCStates, actions, transition model, goal test and path cost
StateA (partial) assignment of values to variablesComplex, with many physical details
GoalA complete assignment satisfying all constraintsA practical objective that may involve optimising cost
SolutionThe assignment itself (the path does not matter)Often a sequence of actions (path)
MethodsBacktracking, forward checking, constraint propagation (arc consistency), heuristics (MRV, degree)Search algorithms (A*, etc.), planning, optimisation, learning
NatureWell defined, toy-like, fixed rulesMessy, uncertain, dynamic, requires abstraction
ExamplesMap colouring, N-queens, Sudoku, schedulingRoute 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.

  1. Identification: define the problem, the scope and the goals; identify the domain expert, knowledge engineer, users and the resources needed.
  2. 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).
  3. 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).
  4. Implementation: program the knowledge base and inference engine, and build the user interface and explanation facility; produce a working prototype.
  5. Testing (validation and verification): run the system on test cases, compare with the expert's results, find errors in rules, and refine.
  6. 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.

  1. 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.).
  2. Grammar: a context-free grammar (CFG) gives the rewrite rules, for example
    • S→NP VPS \rightarrow NP\ VP
    • NP→Det NNP \rightarrow Det\ N
    • VP→V NPVP \rightarrow V\ NP
    • Det→the, N→boy∣ball, V→hitDet \rightarrow the,\ N \rightarrow boy \mid ball,\ V \rightarrow hit
  3. 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 S→[NP [Det the] [N boy]] [VP [V hit] [NP [Det the] [N ball]]]S \rightarrow [NP\ [Det\ the]\ [N\ boy]]\ [VP\ [V\ hit]\ [NP\ [Det\ the]\ [N\ ball]]]. 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.

  1. 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.
  2. 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 λx. Hit(x,Ball)\lambda x.\ Hit(x, Ball) and the whole sentence becomes Hit(Boy,Ball)Hit(Boy, Ball).
  3. Output representation: the result is a logical form such as predicate logic, a semantic network, or a frame.
  4. 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

BasisModel-based agentUtility-based agent
IdeaKeeps 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 itAlso has a utility function that measures how desirable a state is, and picks the action with the highest expected utility
GoalActs by condition-action rules on the updated state; it has no notion of how good an outcome isCompares different ways of reaching the goal and chooses the best (quickest, safest, cheapest)
Handling conflictsCannot trade off conflicting objectivesResolves conflicting goals and handles uncertainty by weighing probabilities with utilities
ComponentsState, world model, rulesState, world model, goals, utility function
ExampleAutomatic car that tracks other cars it can no longer seeTaxi 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:

  1. States: all possible configurations of the problem; the set of all of them is the state space.
  2. Initial state: where the search starts.
  3. Operators (actions): rules that move from one state to another.
  4. Goal test: a condition that identifies the goal state(s).
  5. 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: (x,y)(x, y) with xx = litres in the 4-litre jug (0≤x≤40 \le x \le 4) and yy = litres in the 3-litre jug (0≤y≤30 \le y \le 3).
  • Initial state: (0,0)(0, 0). Goal: (2,y)(2, y) for any yy.
  • Operators:
    • Fill the 4-litre jug: (x,y)→(4,y)(x,y) \rightarrow (4,y) if x<4x<4.
    • Fill the 3-litre jug: (x,y)→(x,3)(x,y) \rightarrow (x,3) if y<3y<3.
    • Empty either jug on the ground: (x,y)→(0,y)(x,y)\rightarrow(0,y) or (x,0)(x,0).
    • Pour the 3-litre jug into the 4-litre jug until the latter is full: (x,y)→(4, y−(4−x))(x,y)\rightarrow(4,\,y-(4-x)) if x+y≥4x+y\ge 4, y>0y>0.
    • Pour the 4-litre jug into the 3-litre jug until the latter is full: (x,y)→(x−(3−y), 3)(x,y)\rightarrow(x-(3-y),\,3) if x+y≥3x+y\ge 3, x>0x>0.
    • Pour everything from one jug into the other when it fits: (x,y)→(x+y,0)(x,y)\rightarrow(x+y,0) if x+y≤4x+y\le 4, y>0y>0, or (0,x+y)(0,x+y) if x+y≤3x+y\le 3, x>0x>0.

One solution path:

(0,0)→(0,3)→(3,0)→(3,3)→(4,2)→(0,2)→(2,0)(0,0)\rightarrow(0,3)\rightarrow(3,0)\rightarrow(3,3)\rightarrow(4,2)\rightarrow(0,2)\rightarrow(2,0)

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

  1. Put all known facts in working memory.
  2. Find every rule whose premises all match facts in working memory.
  3. Fire a rule (using conflict resolution if several match) and add its conclusion if it is new.
  4. 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: Missile(x)→Weapon(x)Missile(x) \rightarrow Weapon(x)
  • R2: Enemy(x,America)→Hostile(x)Enemy(x, America) \rightarrow Hostile(x)
  • R3: Missile(x)∧Owns(Nono,x)→Sells(West,x,Nono)Missile(x) \wedge Owns(Nono, x) \rightarrow Sells(West, x, Nono)
  • R4: American(p)∧Weapon(q)∧Sells(p,q,r)∧Hostile(r)→Criminal(p)American(p) \wedge Weapon(q) \wedge Sells(p,q,r) \wedge Hostile(r) \rightarrow Criminal(p)

Facts: American(West)American(West), Missile(M1)Missile(M1), Owns(Nono,M1)Owns(Nono, M1), Enemy(Nono,America)Enemy(Nono, America).

Query: Criminal(West)Criminal(West)?

  • Pass 1: R1 fires with x=M1x=M1, adding Weapon(M1)Weapon(M1); R2 fires with x=Nonox=Nono, adding Hostile(Nono)Hostile(Nono); R3 fires with x=M1x=M1, adding Sells(West,M1,Nono)Sells(West, M1, Nono).
  • Pass 2: R4 now has all premises with p=Westp=West, q=M1q=M1, r=Nonor=Nono, so Criminal(West)Criminal(West) 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.

∀x (Animal(x)∧CanBark(x)→Dog(x))\forall x\ (Animal(x) \wedge CanBark(x) \rightarrow Dog(x))

(b) Someone is firing a gun.

∃x (Person(x)∧Firing(x,Gun))\exists x\ (Person(x) \wedge Firing(x, Gun))

(or, treating the gun as an object, ∃x ∃g (Person(x)∧Gun(g)∧Fires(x,g))\exists x\,\exists g\,(Person(x) \wedge Gun(g) \wedge Fires(x, g))).

(c) All tigers are not fierce.

∀x (Tiger(x)→¬Fierce(x))\forall x\ (Tiger(x) \rightarrow \neg Fierce(x))

This says that no tiger is fierce. (The alternative reading, "not all tigers are fierce", would be ¬∀x (Tiger(x)→Fierce(x))\neg\forall x\,(Tiger(x)\rightarrow Fierce(x)), which is equivalent to ∃x (Tiger(x)∧¬Fierce(x))\exists x\,(Tiger(x)\wedge\neg Fierce(x)); 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 ll: nodes at depth ll 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 O(bl)O(bl) 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 104010^{40} positions).
  • If the depth of the goal is known, it finds the goal efficiently.

Limitations

  • It is incomplete if the goal lies deeper than ll (l<dl<d).
  • It is not optimal if l>dl>d, 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 O(bl)O(b^l), 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 AA has a membership function μA(x)∈[0,1]\mu_A(x)\in[0,1]. For example, a temperature of 35 °C may belong to the set "hot" with μ=0.7\mu = 0.7. 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: μA∪B(x)=max⁡(μA(x),μB(x))\mu_{A\cup B}(x)=\max(\mu_A(x),\mu_B(x))
  • Intersection: μA∩B(x)=min⁡(μA(x),μB(x))\mu_{A\cap B}(x)=\min(\mu_A(x),\mu_B(x))
  • Complement: μAˉ(x)=1−μA(x)\mu_{\bar A}(x)=1-\mu_A(x)

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.

  1. 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.
  2. Crossover (recombination): two parents exchange parts of their strings to produce offspring. In single-point crossover at point 3, parents 101∣10101|10 and 010∣01010|01 give children 1010110101 and 0101001010. Variants are two-point and uniform crossover. It is applied with a high probability (about 0.6 to 0.9).
  3. Mutation: randomly flips bits (or changes genes) with a small probability, for example 10110→1001010110\rightarrow10010. 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 −1-1 per step, −10-10 for hitting a wall and +100+100 for reaching the exit. After many trials, using an algorithm such as Q-learning, Q(s,a)←Q(s,a)+α[r+γmax⁡a′Q(s′,a′)−Q(s,a)]Q(s,a)\leftarrow Q(s,a)+\alpha[r+\gamma\max_{a'}Q(s',a')-Q(s,a)], 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

  1. Single-layer feedforward network (perceptron): the inputs connect directly to the output neurons. It can solve only linearly separable problems.
  2. 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.
  3. 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).
  4. Convolutional neural network (CNN): uses convolution and pooling layers, mainly for image recognition.
  5. Self-organising map (Kohonen network): unsupervised, maps high-dimensional input to a low-dimensional grid by competitive learning.
  6. 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 θ\theta that makes two logical expressions identical. UNIFY(p,q)=θUNIFY(p,q)=\theta such that SUBST(θ,p)=SUBST(θ,q)SUBST(\theta,p)=SUBST(\theta,q). For example:

  • Knows(John,x)Knows(John,x) and Knows(John,Jane)Knows(John,Jane) unify with θ={x/Jane}\theta=\{x/Jane\}.
  • Knows(John,x)Knows(John,x) and Knows(y,Mother(y))Knows(y,Mother(y)) unify with θ={y/John, x/Mother(John)}\theta=\{y/John,\ x/Mother(John)\}.
  • Knows(John,x)Knows(John,x) and Knows(x,Jane)Knows(x,Jane) fail without standardising apart (variables renamed), because xx cannot be both JohnJohn and JaneJane.

The algorithm returns the most general unifier (MGU), and uses an occurs check to prevent xx from unifying with f(x)f(x).

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 p1′,…,pn′p_1',\dots,p_n' and (p1∧⋯∧pn→q)(p_1\wedge\dots\wedge p_n\rightarrow q) with SUBST(θ,pi′)=SUBST(θ,pi)SUBST(\theta,p_i')=SUBST(\theta,p_i), infer SUBST(θ,q)SUBST(\theta,q). 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:
12
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 4×3=124\times3=12 states, labelled:

StateGrid (row 1 / row 2)(tile 1, tile 2)hh
A (initial)1 2 / _ _(TL, TR)2
B_ 2 / 1 _(BL, TR)2
C1 _ / _ 2(TL, BR)2
D_ 2 / _ 1(BR, TR)2
E2 _ / 1 _(BL, TL)2
F_ _ / 1 2(BL, BR)2
G1 _ / 2 _(TL, BL)1
H_ _ / 2 1(BR, BL)1
I2 1 / _ _(TR, TL)1
J_ 1 / _ 2(TR, BR)1
K2 _ / _ 1(BR, TL)2
L (goal)_ 1 / 2 _(TR, BL)0

The heuristic h(n)h(n) 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 hh; ties broken alphabetically; visited states are not re-opened)

StepExpandedNew nodes added to open (hh)Open list after
1A (2)B (2), C (2)B, C
2B (2)D (2), E (2), F (2)C, D, E, F
3C (2)G (1), J (1) (F already open)G, J, D, E, F
4G (1)L (0) (C already closed)L, J, D, E, F
5L (0)goal test succeeds

Greedy best-first search finds the goal L. The solution path, following parent links, is

A→C→G→LA \rightarrow C \rightarrow G \rightarrow L

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 hh 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

  1. Eliminate implications and biconditionals: replace P→QP\rightarrow Q by ¬P∨Q\neg P\vee Q and P↔QP\leftrightarrow Q by (¬P∨Q)∧(P∨¬Q)(\neg P\vee Q)\wedge(P\vee\neg Q).
  2. Move negation inward (De Morgan and quantifier rules): ¬(P∨Q)≡¬P∧¬Q\neg(P\vee Q)\equiv\neg P\wedge\neg Q, ¬(P∧Q)≡¬P∨¬Q\neg(P\wedge Q)\equiv\neg P\vee\neg Q, ¬∀x P≡∃x ¬P\neg\forall x\,P\equiv\exists x\,\neg P, ¬∃x P≡∀x ¬P\neg\exists x\,P\equiv\forall x\,\neg P, ¬¬P≡P\neg\neg P\equiv P.
  3. Standardise variables apart: give each quantifier its own variable name.
  4. 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.
  5. Drop universal quantifiers: all remaining variables are universal.
  6. Distribute ∨\vee over ∧\wedge: P∨(Q∧R)≡(P∨Q)∧(P∨R)P\vee(Q\wedge R)\equiv(P\vee Q)\wedge(P\vee R), to get a conjunction of clauses.
  7. Split the conjunction into separate clauses (and rename variables so that no two clauses share one).

Conversion to FOPL

Predicates: CSIT(x)CSIT(x) is "x is a student of BSc CSIT", Intelligent(x)Intelligent(x), Smart(x)Smart(x), Friend(x,y)Friend(x,y) is "x is a friend of y", Beautiful(x)Beautiful(x), Student(x)Student(x), Girl(x)Girl(x).

  1. ∀x (CSIT(x)→Intelligent(x))\forall x\,(CSIT(x)\rightarrow Intelligent(x))
  2. ∀x ∀y (Intelligent(y)∧Friend(x,y)→Smart(x))\forall x\,\forall y\,(Intelligent(y)\wedge Friend(x,y)\rightarrow Smart(x))
  3. Friend(Laxmi,Rojina)Friend(Laxmi, Rojina)
  4. Smart(Rojina)Smart(Rojina)
  5. ∀x (Beautiful(x)∧Student(x)→Girl(x))\forall x\,(Beautiful(x)\wedge Student(x)\rightarrow Girl(x))
  6. Beautiful(Laxmi)Beautiful(Laxmi)

Goal: Smart(Laxmi)Smart(Laxmi).

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. CSIT(Rojina)CSIT(Rojina). Without it, Smart(Laxmi)Smart(Laxmi) cannot be derived, since nothing makes Rojina intelligent.

Clauses (CNF)

  • C1: ¬CSIT(x)∨Intelligent(x)\neg CSIT(x)\vee Intelligent(x)
  • C2: ¬Intelligent(y)∨¬Friend(x,y)∨Smart(x)\neg Intelligent(y)\vee\neg Friend(x,y)\vee Smart(x)
  • C3: Friend(Laxmi,Rojina)Friend(Laxmi,Rojina)
  • C4: Smart(Rojina)Smart(Rojina)
  • C5: ¬Beautiful(x)∨¬Student(x)∨Girl(x)\neg Beautiful(x)\vee\neg Student(x)\vee Girl(x)
  • C6: Beautiful(Laxmi)Beautiful(Laxmi)
  • C7: CSIT(Rojina)CSIT(Rojina)
  • C8 (negated goal): ¬Smart(Laxmi)\neg Smart(Laxmi)

Resolution refutation

  1. C8 and C2 with {x/Laxmi}\{x/Laxmi\} give R1: ¬Intelligent(y)∨¬Friend(Laxmi,y)\neg Intelligent(y)\vee\neg Friend(Laxmi,y).
  2. R1 and C3 with {y/Rojina}\{y/Rojina\} give R2: ¬Intelligent(Rojina)\neg Intelligent(Rojina).
  3. R2 and C1 with {x/Rojina}\{x/Rojina\} give R3: ¬CSIT(Rojina)\neg CSIT(Rojina).
  4. R3 and C7 give the empty clause □\square.

The empty clause is a contradiction, so the negated goal is false and Smart(Laxmi)Smart(Laxmi) 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 net=∑iwixi+bnet=\sum_i w_ix_i+b and passes it through an activation function y=f(net)y=f(net). 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

σ(z)=11+e−z\sigma(z)=\frac{1}{1+e^{-z}}

It squashes any real input into (0,1)(0,1). Large positive zz gives output near 1, large negative zz gives near 0, and σ(0)=0.5\sigma(0)=0.5; for example σ(2)=0.881\sigma(2)=0.881 and σ(−2)=0.119\sigma(-2)=0.119. The output can be read as a probability or firing level. Its derivative is simple:

σ′(z)=σ(z) (1−σ(z))\sigma'(z)=\sigma(z)\,(1-\sigma(z))

which makes backpropagation cheap (the error term of an output neuron is (t−o) o (1−o)(t-o)\,o\,(1-o)). Its drawbacks are that it saturates for large ∣z∣|z| (vanishing gradients) and its output is not zero-centred.

Perceptron learning

The perceptron (Rosenblatt) is a single neuron with a step activation: y=1y=1 if ∑wixi+b>0\sum w_ix_i+b>0, otherwise 0. It is trained by supervised learning:

  1. Initialise weights and bias (small values or 0) and choose a learning rate η\eta.
  2. For each training pair (x,t)(x,t) compute yy.
  3. Update: wi←wi+η (t−y) xiw_i\leftarrow w_i+\eta\,(t-y)\,x_i and b←b+η (t−y)b\leftarrow b+\eta\,(t-y). Nothing changes when the output is correct.
  4. 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 η=1\eta=1, starting at w=(0,0)w=(0,0), b=0b=0 (patterns in the order 00, 01, 10, 11):

EpochUpdates madeWeights after
111 wrongly gives 0w=(1,1)w=(1,1), b=1b=1
200 gives 1; 01 gives 1; 11 gives 0w=(2,1)w=(2,1), b=0b=0
301; 10; 11w=(2,1)w=(2,1), b=−1b=-1
410; 11w=(2,2)w=(2,2), b=−1b=-1
501w=(2,1)w=(2,1), b=−2b=-2
6no errorsw=(2,1)w=(2,1), b=−2b=-2

Final check: 11→2+1−2=1>011\rightarrow 2+1-2=1>0 gives 1; 10→010\rightarrow0 gives 0; 01→−101\rightarrow-1 gives 0; 00→−200\rightarrow-2 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

  1. Natural language processing: to communicate successfully in a human language such as English.
  2. Knowledge representation: to store what it knows or hears.
  3. Automated reasoning: to use the stored information to answer questions and draw new conclusions.
  4. 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:

  1. Computer vision: to perceive objects.
  2. 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 O(bd)O(b^d), which is impractical for real games (chess with b≈35b\approx35, d≈100d\approx100). 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 O(bd/2)O(b^{d/2}), so it can search twice as deep in the same time.

How it works

Two values are carried down the tree:

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

Pruning rule: stop exploring the remaining children of a node as soon as α≥β\alpha\ge\beta. At a MIN node, if a child value ≤α\le\alpha, MAX will never choose this node, so prune. At a MAX node, if a child value ≥β\ge\beta, 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
  1. Node A: first leaf 3 gives β=3\beta=3; leaves 12 and 8 do not lower it, so A =3=3. At the root α=3\alpha=3.
  2. Node B (with α=3\alpha=3): first leaf 2 gives B ≤2≤α\le2\le\alpha. MAX already has 3 from A, so B can never be chosen. The leaves 4 and 6 are pruned.
  3. Node C: first leaf 1 gives C ≤1≤α=3\le1\le\alpha=3. The leaves 9 and 7 are pruned.

The root value is max⁡(3, ≤2, ≤1)=3\max(3,\ \le2,\ \le1)=3, 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, pi=fi/∑fjp_i=f_i/\sum f_j), tournament selection (the best of kk 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:

P1=1 1 0 ∣ 1 0 1,P2=0 0 1 ∣ 1 1 0  ⇒  C1=1 1 0 1 1 0, C2=0 0 1 1 0 1\text{P1}=1\,1\,0\,|\,1\,0\,1,\quad \text{P2}=0\,0\,1\,|\,1\,1\,0 \;\Rightarrow\; \text{C1}=1\,1\,0\,1\,1\,0,\ \text{C2}=0\,0\,1\,1\,0\,1

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: 1 1 0 1 1 0→1 1 1 1 1 01\,1\,0\,1\,1\,0\rightarrow1\,1\,1\,1\,1\,0. 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:

  1. 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.
  2. 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.
  3. Working memory (case database): holds the facts and intermediate results of the current problem.
  4. User interface: lets the user enter the problem and receive the answer, in natural language, menus or forms.
  5. Explanation facility: explains how a conclusion was reached ("how") and why a question is asked ("why"), which builds the user's trust.
  6. 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

  1. Take the output of the semantic analysis (logical form) of the sentence.
  2. Use the context: the earlier discourse, the speaker, the hearer, time and place, and the goals of the conversation.
  3. 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.
  4. Identify the speech act (assertion, question, request, promise) and the speaker's intention, using plan-based reasoning and rules such as Grice's maxims.
  5. Draw on world knowledge and common-sense rules from the knowledge base to infer the implied meaning and fill in missing information.
  6. 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 l=0,1,2,…l=0,1,2,\dots, increasing the limit by one each iteration, until the goal is found. In each iteration the search goes down to depth ll, treats nodes at that depth as leaves, and starts again from the initial state if no goal was found.

Algorithm

  1. Set l=0l=0.
  2. Run depth-limited DFS from the initial state with limit ll.
  3. If the goal state is found, return the path from the initial state to it.
  4. Otherwise set l=l+1l=l+1 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.

  • l=0l=0: visit A only. Not the goal.
  • l=1l=1: visit A, B, C. Not found.
  • l=2l=2: visit A, B, D, E, C, F, G. G is the goal, so stop.

The path from the initial state to the goal is

A→C→GA\rightarrow C\rightarrow G

Properties

  • Complete when the branching factor is finite, and optimal when all step costs are equal (it finds the shallowest goal, like BFS).
  • Time O(bd)O(b^d) and space only O(bd)O(bd), where bb is the branching factor and dd 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 neuronArtificial neuron
Dendrites receive signals from other neuronsInput connections carrying inputs xix_i
Synapse (its strength decides how much of a signal passes)Weight wiw_i on each connection (learned)
Cell body (soma) sums the signals and fires above a thresholdSumming unit net=∑wixi+bnet=\sum w_ix_i+b followed by the activation function f(net)f(net)
Axon carries the output signal to other neuronsOutput y=f(net)y=f(net), 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 σ(z)=1/(1+e−z)\sigma(z)=1/(1+e^{-z}) and no bias, to keep the arithmetic short.

  • Input layer: x1=0.35x_1=0.35, x2=0.9x_2=0.9.
  • Hidden layer: neurons h1h_1 and h2h_2 with weights w13=0.1w_{13}=0.1 (x1→h1x_1\to h_1), w23=0.8w_{23}=0.8 (x2→h1x_2\to h_1), w14=0.4w_{14}=0.4 (x1→h2x_1\to h_2), w24=0.6w_{24}=0.6 (x2→h2x_2\to h_2).
  • Output neuron oo with weights w35=0.3w_{35}=0.3 (h1→oh_1\to o), w45=0.9w_{45}=0.9 (h2→oh_2\to o).
  • Target t=0.5t=0.5, learning rate η=1\eta=1.

Forward pass

neth1=0.35(0.1)+0.9(0.8)=0.755,oh1=σ(0.755)=0.6803net_{h1}=0.35(0.1)+0.9(0.8)=0.755,\quad o_{h1}=\sigma(0.755)=0.6803

neth2=0.35(0.4)+0.9(0.6)=0.68,oh2=σ(0.68)=0.6637net_{h2}=0.35(0.4)+0.9(0.6)=0.68,\quad o_{h2}=\sigma(0.68)=0.6637

neto=0.6803(0.3)+0.6637(0.9)=0.8014,y=σ(0.8014)=0.6903net_o=0.6803(0.3)+0.6637(0.9)=0.8014,\quad y=\sigma(0.8014)=0.6903

Error: t−y=0.5−0.6903=−0.1903t-y=0.5-0.6903=-0.1903, i.e. E=12(t−y)2=0.0181E=\tfrac12(t-y)^2=0.0181.

Backward pass (error terms)

Output neuron:

δo=(t−y) y(1−y)=(−0.1903)(0.6903)(0.3097)=−0.04068\delta_o=(t-y)\,y(1-y)=(-0.1903)(0.6903)(0.3097)=-0.04068

Hidden neurons:

δh1=oh1(1−oh1) δo w35=(0.6803)(0.3197)(−0.04068)(0.3)=−0.002654\delta_{h1}=o_{h1}(1-o_{h1})\,\delta_o\,w_{35}=(0.6803)(0.3197)(-0.04068)(0.3)=-0.002654

δh2=oh2(1−oh2) δo w45=(0.6637)(0.3363)(−0.04068)(0.9)=−0.008172\delta_{h2}=o_{h2}(1-o_{h2})\,\delta_o\,w_{45}=(0.6637)(0.3363)(-0.04068)(0.9)=-0.008172

Weight updates (Δw=η δ (input to that weight)\Delta w=\eta\,\delta\,\text{(input to that weight)})

WeightCalculationNew value
w35w_{35}0.3+(−0.04068)(0.6803)0.3+(-0.04068)(0.6803)0.27230.2723
w45w_{45}0.9+(−0.04068)(0.6637)0.9+(-0.04068)(0.6637)0.87300.8730
w13w_{13}0.1+(−0.002654)(0.35)0.1+(-0.002654)(0.35)0.09910.0991
w23w_{23}0.8+(−0.002654)(0.9)0.8+(-0.002654)(0.9)0.79760.7976
w14w_{14}0.4+(−0.008172)(0.35)0.4+(-0.008172)(0.35)0.39710.3971
w24w_{24}0.6+(−0.008172)(0.9)0.6+(-0.008172)(0.9)0.59260.5926

Check after one iteration: the forward pass with the new weights gives oh1=0.6797o_{h1}=0.6797, oh2=0.6620o_{h2}=0.6620 and output y=0.6820y=0.6820. The error has fallen from 0.19030.1903 to 0.18200.1820 (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, ∃x Movie(x)\exists x\,Movie(x) becomes Movie(C1)Movie(C_1), where C1C_1 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:

  1. Eliminate implications and move negations inward.
  2. Standardise variables apart.
  3. For each ∃y\exists y: if no ∀\forall precedes it, replace yy by a fresh Skolem constant; otherwise replace yy by a fresh Skolem function f(x1,…,xn)f(x_1,\dots,x_n) of all universally quantified variables to its left.
  4. Drop the universal quantifiers.

Examples: ∃x Comedy(x)\exists x\,Comedy(x) becomes Comedy(C1)Comedy(C_1). ∀x ∃y Loves(x,y)\forall x\,\exists y\,Loves(x,y) becomes ∀x Loves(x,f(x))\forall x\,Loves(x,f(x)), so yy may depend on xx. The new clause is satisfiable exactly when the original is, so refutation by resolution stays valid.

Representation in FOPL

Predicates: Movie(x)Movie(x), Hit(x)Hit(x), GoodScript(x)GoodScript(x), Sentimental(x)Sentimental(x), Comedy(x)Comedy(x).

  1. All movies are not hit: ∀x (Movie(x)→¬Hit(x))\forall x\,(Movie(x)\rightarrow\neg Hit(x))
  2. Sarangi is a movie: Movie(Sarangi)Movie(Sarangi)
  3. All movies which have good script are hit: ∀x (Movie(x)∧GoodScript(x)→Hit(x))\forall x\,(Movie(x)\wedge GoodScript(x)\rightarrow Hit(x))
  4. Sarangi has a good script but Sarangi is sentimental: GoodScript(Sarangi)∧Sentimental(Sarangi)GoodScript(Sarangi)\wedge Sentimental(Sarangi)
  5. There is a movie which is comedy: ∃x (Movie(x)∧Comedy(x))\exists x\,(Movie(x)\wedge Comedy(x))

In clause form, statement 5 is Skolemised to Movie(C1)∧Comedy(C1)Movie(C_1)\wedge Comedy(C_1), and statement 1 becomes ¬Movie(x)∨¬Hit(x)\neg Movie(x)\vee\neg Hit(x). Taken literally, statements 1 to 4 conflict: from 2, 3 and 4, Hit(Sarangi)Hit(Sarangi) follows, while 1 and 2 give ¬Hit(Sarangi)\neg Hit(Sarangi).

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

BasisUninformed (blind) searchInformed (heuristic) search
KnowledgeUses only the problem definition (states, operators, goal test)Uses problem-specific knowledge in a heuristic function h(n)h(n), the estimated cost from nn to the goal
DirectionExpands nodes in a fixed order (BFS, DFS, UCS, IDS)Expands the most promising node first (greedy, A*, hill climbing)
EfficiencyExplores many irrelevant nodes; high time and spaceUsually far fewer nodes expanded, so faster
Completeness/optimalityBFS and UCS are complete and optimalDepends on the algorithm (A* is optimal with an admissible hh; 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 hh (estimated distance to goal, lower is better):

NodeSABCDEG
hh8674620

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 (h=8h=8): neighbours A (6), B (7). The best is A (6 < 8), so move to A.
  • At A (h=6h=6): neighbours C (4), D (6). The best is C (4 < 6), so move to C.
  • At C (h=4h=4): neighbour E (2) < 4, so move to E.
  • At E (h=2h=2): neighbour G (0) < 2, so move to G.

Path: S→A→C→E→GS\rightarrow A\rightarrow C\rightarrow E\rightarrow G. 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):

NodeSABCDEG
hh8674650
  • S moves to A (6 < 8), and A moves to C (4 < 6).
  • At C (h=4h=4): the only other neighbour is E with h=5>4h=5>4, 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 (h≠0h\ne0) 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:

  1. 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.
  2. Mathematics: formal logic, computability and algorithms (Turing, Gödel), probability and statistics for uncertainty, and complexity (tractability and NP-completeness).
  3. Economics: decision theory and utility, game theory and Markov decision processes for acting rationally under uncertainty.
  4. Neuroscience: how the brain processes information with neurons, which inspired artificial neural networks.
  5. Psychology: cognitive models of human perception, memory, learning and problem solving, and behaviourism.
  6. Computer engineering: the hardware (fast processors, memory, GPUs) and software that make AI practical.
  7. Control theory and cybernetics: machines that regulate themselves through feedback to maximise an objective.
  8. 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 x1,x2x_1, x_2, weights w1,w2w_1, w_2, threshold θ\theta and a step activation:

y={1if w1x1+w2x2≥θ0otherwisey = \begin{cases} 1 & \text{if } w_1x_1 + w_2x_2 \ge \theta \\ 0 & \text{otherwise} \end{cases}

Choose w1=w2=1w_1 = w_2 = 1 and θ=1\theta = 1.

x1x_1x2x_2net =x1+x2= x_1 + x_2yyOR target
00000
01111
10111
11211

The output matches the OR truth table for all four inputs, so the neuron with w1=w2=1w_1=w_2=1, θ=1\theta=1 (equivalently bias b=−1b=-1) 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 g(n)g(n) (cost from the start node to nn). It is implemented with a priority queue ordered by g(n)g(n). 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

  1. Put the start node in the priority queue with cost 0.
  2. Remove the node with the smallest gg. If it is the goal, return the path and cost.
  3. Otherwise expand it: for each successor, compute g=g(parent)+step costg = g(\text{parent}) + \text{step cost} and insert it; if a node is already in the queue with higher cost, replace it by the cheaper one.
  4. 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.

StepNode expandedQueue after expansion (node : g)
1S (0)A:1, B:5, C:15
2A (1)B:5, G:11, C:15
3B (5)G:10 (via B, replaces 11), C:15
4G (10)goal selected

The optimal path is S - B - G with cost 5+5=105 + 5 = 10. 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:

  1. Image acquisition: cameras (2D, stereo or depth/RGB-D) capture images.
  2. Pre-processing: noise removal, contrast enhancement, filtering.
  3. Segmentation and feature extraction: edges, corners, regions and colours are extracted to separate objects from background.
  4. 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.
  5. 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 μ(x)∈[0,1]\mu(x)\in[0,1], 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 ∘^\circC), triangular membership:

  • Cold: μ=1\mu = 1 at ≤15\le 15, 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 ≥35\ge 35.

Rule base

RuleIF TemperatureAND HumidityTHEN Fan speed
R1ColdanySlow
R2WarmLowSlow
R3WarmHighMedium
R4HotLowMedium
R5HotHighFast

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 30∘30^\circC and humidity high (μHigh=0.6\mu_{High}=0.6). Then μWarm(30)=(35−30)/10=0.5\mu_{Warm}(30) = (35-30)/10 = 0.5 and μHot(30)=(30−25)/10=0.5\mu_{Hot}(30) = (30-25)/10 = 0.5. Rule R3 fires with strength min⁡(0.5,0.6)=0.5\min(0.5, 0.6) = 0.5 (Medium) and R5 fires with min⁡(0.5,0.6)=0.5\min(0.5, 0.6)=0.5 (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 P(s′∣s,a)P(s'|s,a) 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

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

where α\alpha is the learning rate and γ\gamma 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

BasisPassive RLActive RL
PolicyThe policy π\pi is fixed; the agent just executes itThe agent must decide which policy/actions to follow
GoalEvaluate how good the given policy is (learn utilities Uπ(s)U^\pi(s))Learn the optimal policy π∗\pi^*
ExplorationNot neededMust balance exploration and exploitation
MethodsDirect utility estimation, adaptive dynamic programming, TD learningQ-learning, SARSA, active ADP with exploration
AnalogyLearner watching a fixed strategyLearner choosing its own moves

Operators of a genetic algorithm. A genetic algorithm evolves a population of candidate solutions (chromosomes) over generations using these operators.

  1. Selection: chooses fitter individuals as parents, so better solutions are more likely to reproduce. Methods include roulette-wheel, tournament and rank selection.
  2. 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.
  3. 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.
  4. 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

ComponentDescription
Performance measureSafe, fast, legal, comfortable trip; minimum fuel use and fare cost; maximum profit
EnvironmentRoads, other traffic, pedestrians, traffic signals, weather, customers
ActuatorsSteering, accelerator, brake, indicators, horn, display/speaker
SensorsCameras, 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: →\rightarrow A,D,C,BA, D, C, B Goal State: →\rightarrow D,C,B,AD, C, B, A

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. h(n)h(n) 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 hh and stops if no neighbour is better than the current state.

Initial state [A,D,C,B][A,D,C,B]: the goal needs D at the bottom, so every block is wrong. h=−1−1−1−1=−4h = -1-1-1-1 = -4

Neighbours. Only B is clear, so the moves are: B to table giving [A,D,C],[B][A,D,C],[B]. 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 h=−4h=-4. A strict hill climber needs a neighbour with h>−4h>-4, 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:

StepMoveStatehh
0start[A,D,C,B]-4
1B to table[A,D,C], [B]-4
2C to table[A,D], [B], [C]-4
3D to table[A], [B], [C], [D]D correct: +1, others -1 = -2
4C onto D[D,C], [A], [B]+2 -2 = 0
5B onto C[D,C,B], [A]+3 -1 = 2
6A onto B[D,C,B,A]+4 (goal)

From step 3 onward every move improves hh, so the search reaches the goal D,C,B,AD,C,B,A.

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 P(H∣E)P(H|E) is the probability of a hypothesis HH after the evidence EE 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:

P(H∣E)=P(E∣H) P(H)P(E)P(H|E) = \frac{P(E|H)\,P(H)}{P(E)}

where P(H)P(H) is the prior, P(E∣H)P(E|H) the likelihood and P(E)P(E) the evidence. It is useful because the likelihood P(E∣H)P(E|H) is often easy to obtain while P(H∣E)P(H|E) 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.

wi(new)=wi(old)+xit,b(new)=b(old)+tw_i(\text{new}) = w_i(\text{old}) + x_i t,\qquad b(\text{new}) = b(\text{old}) + t

Use bipolar inputs and targets (1 = true, -1 = false). Initially w1=w2=b=0w_1=w_2=b=0. The OR function:

x1x_1x2x_2tt
111
1-11
-111
-1-1-1

Training

Input (x1,x2,1)(x_1,x_2,1)ttΔw1\Delta w_1Δw2\Delta w_2Δb\Delta bw1w_1w2w_2bb
(1, 1)1111111
(1, -1)11-11202
(-1, 1)1-111113
(-1, -1)-111-1222

Final weights: w1=2, w2=2, b=2w_1 = 2,\ w_2 = 2,\ b = 2.

Testing with y=sign(b+w1x1+w2x2)y=\text{sign}(b + w_1x_1 + w_2x_2):

  • (1, 1): 2+2+2=62+2+2 = 6, so y=1y=1.
  • (1, -1): 2+2−2=22+2-2 = 2, so y=1y=1.
  • (-1, 1): 2−2+2=22-2+2 = 2, so y=1y=1.
  • (-1, -1): 2−2−2=−22-2-2 = -2, so y=−1y=-1.

All outputs match the targets, so the net with w1=w2=2w_1=w_2=2, b=2b=2 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

  1. ∀x [ Living(x)→Animal(x)∨Plant(x) ]\forall x\,[\,Living(x) \rightarrow Animal(x) \lor Plant(x)\,]
  2. ∀x [ Plant(x)→NeedsSunlight(x) ]\forall x\,[\,Plant(x) \rightarrow NeedsSunlight(x)\,]
  3. Living(Mustard)Living(Mustard)
  4. ¬Animal(Mustard)\neg Animal(Mustard)

Query: NeedsSunlight(Mustard)NeedsSunlight(Mustard)?

Proof by resolution (refutation). Clauses:

  • C1: ¬Living(x)∨Animal(x)∨Plant(x)\neg Living(x) \lor Animal(x) \lor Plant(x)
  • C2: ¬Plant(x)∨NeedsSunlight(x)\neg Plant(x) \lor NeedsSunlight(x)
  • C3: Living(Mustard)Living(Mustard)
  • C4: ¬Animal(Mustard)\neg Animal(Mustard)
  • C5 (negated goal): ¬NeedsSunlight(Mustard)\neg NeedsSunlight(Mustard)

Steps:

  1. C1 and C3 with x=Mustardx=Mustard: Animal(Mustard)∨Plant(Mustard)Animal(Mustard) \lor Plant(Mustard) (C6).
  2. C6 and C4: Plant(Mustard)Plant(Mustard) (C7).
  3. C7 and C2 with x=Mustardx=Mustard: NeedsSunlight(Mustard)NeedsSunlight(Mustard) (C8).
  4. 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.

  1. 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.
  2. Conceptualisation: analyse the problem and decide the key concepts, relations and the type of reasoning (e.g. diagnosis, classification) needed.
  3. Knowledge acquisition: the knowledge engineer collects knowledge from experts (by interviews, observation and documents) and from data.
  4. 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).
  5. Implementation: build the knowledge base, inference engine, explanation facility and user interface into a working prototype.
  6. Testing (validation and verification): run the system on test cases, compare with the expert's results, fix errors and refine rules.
  7. 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

  1. Ambiguity: lexical ambiguity (the word "bank"), syntactic ambiguity ("I saw the man with the telescope") and semantic ambiguity.
  2. Context and world knowledge: meaning depends on the situation, earlier sentences and common sense; pronoun resolution ("he", "it") needs it.
  3. Idioms, sarcasm and figurative language: meaning is not literal.
  4. Variation and rich morphology: dialects, slang, spelling errors, code-mixing (Nepali written in Roman script), and free word order in languages like Nepali.
  5. Low-resource languages: little annotated data and few tools for languages such as Nepali.
  6. Generation challenges: producing fluent, coherent and factually correct text with the right tone.
  7. Bias and ethics: models may learn bias from the training text.
  8. 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:

  1. 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).
  2. The problem is narrow and well-bounded, so the rules are manageable in number.
  3. Transparency and explanation are needed: the system can show which rules led to a decision, which is important in legal, medical and financial uses.
  4. There is not enough data to train a machine-learning model, but there are human experts.
  5. The knowledge must be easy to modify: rules can be added or changed independently without retraining.
  6. 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.