Important Questions

CSC266 · Exam intelligence

Artificial Intelligence important questions

From 6 past TU papers: which questions keep coming back, how much they carry, and what is most likely to show up next. Every question links to a model answer.

Most likely in the next examStatistical

Ranked by how often a topic is asked, its marks weight, and whether it is due after skipping the 2081 paper. No guarantees; study the whole syllabus.

1asked 7xavg 9 marks · Predicate Logic
Answer

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.[10]

Skolem Constant, Skolemization, and FOPL Representation

1. Skolem Constant

A Skolem constant is a special constant introduced during the process of Skolemization to eliminate existential quantifiers from a First Order Predicate Logic (FOPL) formula. When an existential quantifier appears in a formula without any enclosing universal quantifier, the existentially quantified variable is replaced by a unique new constant (called a Skolem constant) that represents the specific (but unnamed) individual whose existence is asserted.

Example:

  • Formula: ∃x P(x)
  • After Skolemization: P(a) where a is a Skolem constant.

If the existential quantifier is within the scope of a universal quantifier, the existential variable is replaced by a Skolem function (not a constant) of the universally quantified variables.

Example:

  • Formula: ∀x ∃y Loves(x, y)
  • After Skolemization: ∀x Loves(x, f(x)) where f(x) is a Skolem function.

2. Skolemization During Resolution

Skolemization is the process of removing existential quantifiers from a FOPL formula to prepare it for resolution. Resolution works on clausal form (CNF), and existential quantifiers must be eliminated before conversion to clause form.

Steps of Skolemization (as part of full conversion to clause form):

StepOperation
1Eliminate implications and biconditionals
2Move negations inward (using De Morgan's laws)
3Standardize variables apart
4Move quantifiers to the left (Prenex Normal Form)
5Skolemize: eliminate existential quantifiers
6Drop universal quantifiers
7Convert to Conjunctive Normal Form (CNF)
8Write as a set of clauses

Rules of Skolemization:

  • Case 1: If ∃x appears outside the scope of any universal quantifier, replace x with a Skolem constant (e.g., a, b, c).

    ∃x Movie(x) becomes Movie(SK1) where SK1 is a Skolem constant.

  • Case 2: If ∃x appears within the scope of universal quantifiers ∀y1, ∀y2, ..., replace x with a Skolem function of those variables.

    ∀x ∃y HasScript(x, y) becomes ∀x HasScript(x, f(x)) where f(x) is a Skolem function.


3. Representation of Statements into FOPL

Predicates Used:

  • Movie(x) : x is a movie
  • Hit(x) : x is a hit
  • GoodScript(x) : x has a good script
  • Sentimental(x) : x is sentimental
  • Comedy(x) : x is a comedy

Statement 1: "All movies are not hit."

Every x, if x is a movie, then x is not a hit.

$$\forall x ; Movie(x) \Rightarrow \neg Hit(x)$$


Statement 2: "Sarangi is a movie."

Sarangi is a specific individual (constant).

$$Movie(Sarangi)$$


Statement 3: "All movies which have good script are hit."

Every x, if x is a movie AND x has a good script, then x is a hit.

$$\forall x ; [Movie(x) \wedge GoodScript(x)] \Rightarrow Hit(x)$$


Statement 4: "Sarangi has a good script but Sarangi is sentimental."

Conjunction of two facts about the constant Sarangi.

$$GoodScript(Sarangi) \wedge Sentimental(Sarangi)$$


Statement 5: "There is a movie which is comedy."

There exists some x such that x is a movie and x is a comedy.

$$\exists x ; [Movie(x) \wedge Comedy(x)]$$

After Skolemization (since ∃x has no enclosing universal quantifier, replace x with Skolem constant SK1):

$$Movie(SK1) \wedge Comedy(SK1)$$


Summary Table

StatementFOPL Representation
All movies are not hit∀x Movie(x) ⇒ ¬Hit(x)
Sarangi is a movieMovie(Sarangi)
All movies with good script are hit∀x [Movie(x) ∧ GoodScript(x)] ⇒ Hit(x)
Sarangi has good script but is sentimentalGoodScript(Sarangi) ∧ Sentimental(Sarangi)
There is a movie which is comedy∃x [Movie(x) ∧ Comedy(x)]

Note: Statements 1 and 3 appear contradictory (all movies are not hit vs. movies with good script are hit). This is intentional in the problem, likely to test resolution-based contradiction detection. In resolution, we would derive a contradiction from Movie(Sarangi), GoodScript(Sarangi), Statement 1, and Statement 3.

2asked 5xavg 5 marks · due (skipped 2081) · Natural Language Processing
Answer

How natural language generation differs from natural language understanding? How morphological analysis is done in NLP? [5]

Natural Language Generation vs. Natural Language Understanding, and Morphological Analysis


Part 1: NLG vs. NLU (Differences)

According to the notes, NLP is composed of two parts: NLU and NLG.

AspectNLU (Natural Language Understanding)NLG (Natural Language Generation)
DefinitionThe process of mapping given inputs in natural language into useful (machine) representations and analyzing different aspects of the language.The process of producing meaningful phrases and sentences in the form of natural language from a machine-based representation.
DirectionNatural Language --> Machine RepresentationMachine Representation --> Natural Language
TaskTakes a spoken/typed sentence and works out what it means.Takes a formal representation of what we want to say and works out how to express it in natural language.
Core ChallengeThe system must disambiguate the input sentence to produce the machine representation.The system must make decisions about how to put a concept into words.
Levels InvolvedMorphological analysis, syntactic analysis, semantic analysis.Deep generation, syntactic generation.
DifficultyHarder than NLG (language has ambiguity, context, etc.).Less hard than NLU.
AnalogyLike a reader/listener interpreting meaning.Like a translator converting computer-based representation into natural language.

Part 2: Morphological Analysis in NLP

Definition

Morphological analysis is one of the levels of analysis required in NLU. It is the study and analysis of the internal structure of words -- how words are formed from smaller meaningful units called morphemes.

What is a Morpheme?

A morpheme is the smallest unit of meaning in a language.

  • Free morpheme: Can stand alone as a word. Example: play, book
  • Bound morpheme: Cannot stand alone; must be attached to another morpheme. Example: -ing, -ed, -s, un-

How Morphological Analysis is Done

Morphological analysis involves breaking a word into its constituent morphemes and identifying their roles. The steps are:

Step 1: Tokenization The input sentence is split into individual words (tokens).

Example: "The boys are playing" --> ["The", "boys", "are", "playing"]

Step 2: Stemming / Lemmatization Each word is reduced to its base or root form.

Example:

  • playing --> root: play + suffix: -ing (present participle)
  • boys --> root: boy + suffix: -s (plural)
  • played --> root: play + suffix: -ed (past tense)

Step 3: Identifying Morphological Categories The morphemes are tagged with their grammatical roles:

WordMorpheme BreakdownAnalysis
unhappyun- + happyPrefix un- negates the adjective
booksbook + -sNoun + plural marker
runningrun + -ningVerb + present participle
quicklyquick + -lyAdjective + adverb suffix

Step 4: Applying Morphological Rules Rules such as inflectional morphology (tense, number, gender) and derivational morphology (forming new words) are applied to understand the word's role in the sentence.

Importance in NLP

Morphological analysis is the first and foundational level of NLU. It helps the NLP system:

  • Understand word forms and their base meanings
  • Reduce vocabulary size for further processing
  • Prepare input for syntactic and semantic analysis in subsequent stages

Summary: NLU converts language to meaning (harder), while NLG converts meaning to language (easier). Morphological analysis, the first step in NLU, breaks words into morphemes to understand their structure and grammatical roles.

3asked 6xavg 8 marks · Learning with Neural Networks
Answer

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.[10]

Artificial Neural Networks: Biological Analogy and Backpropagation

STEP 1 - EXTRACT (Given / Assumed Data)

The question requires us to assume inputs and weights, so the worked example below uses these values:

Inputs: $x_1 = 0.5$, $x_2 = 0.3$ Target: $t = 1.0$

Learning rate: $\alpha = 0.5$ Activation: Sigmoid $g(x) = \dfrac{1}{1+e^{-x}}$, derivative $g'(x) = g(x)(1-g(x))$ Biases: $0$

Initial weights:

WeightConnectionValue
$w_{13}$$x_1 \to h_1$0.4
$w_{23}$$x_2 \to h_1$0.2
$w_{14}$$x_1 \to h_2$0.3
$w_{24}$$x_2 \to h_2$0.5
$w_{35}$$h_1 \to o_1$0.6
$w_{45}$$h_2 \to o_1$0.7

Part 1: Biological vs Artificial Neural Network Mapping

Biological ElementArtificial ElementFunction
DendriteInput connections carrying $x_j$Receive incoming signals
SynapseWeight $w_{ij}$Modulate signal strength; learning adjusts these
AxonNeuron output lineTransmits processed signal onward
Soma (cell body)Summation $\Sigma$ + activation $g(\cdot)$Integrates weighted inputs and fires

Summary: dendrites $\to$ inputs, synapses $\to$ weights, soma $\to$ summation + activation, axon $\to$ output. Learning in ANN = adjusting synaptic weights.


Part 2: Network Architecture

A 2-2-1 multilayer network:

 x1 ─w13─┐        ┌─w35─┐
         ├──> h1 ─┤     │
 x2 ─w23─┘        │     ├──> o1 ──> y
                  │     │
 x1 ─w14─┐        │     │
         ├──> h2 ─┴─w45─┘
 x2 ─w24─┘

Part 3: Single Iteration of Backpropagation

Step 1: Forward pass - hidden layer

$$net_{h1} = 0.4(0.5) + 0.2(0.3) = 0.20 + 0.06 = 0.26$$ $$h_1 = g(0.26) = \frac{1}{1+e^{-0.26}} = \frac{1}{1.7711} = 0.5646$$

$$net_{h2} = 0.3(0.5) + 0.5(0.3) = 0.15 + 0.15 = 0.30$$ $$h_2 = g(0.30) = \frac{1}{1+e^{-0.30}} = \frac{1}{1.7408} = 0.5744$$

Step 2: Forward pass - output layer

$$net_{o1} = 0.6(0.5646) + 0.7(0.5744) = 0.3388 + 0.4021 = 0.7409$$ $$y = g(0.7409) = \frac{1}{1+e^{-0.7409}} = \frac{1}{1.4767} = 0.6772$$

Step 3: Output error and delta

$$\delta_{o1} = (t - y)\cdot y(1-y) = (1.0 - 0.6772)(0.6772)(1-0.6772)$$ $$= 0.3228 \times 0.6772 \times 0.3228 = 0.07057$$

Step 4: Hidden layer deltas

$$\delta_{h1} = h_1(1-h_1),(w_{35},\delta_{o1})$$ $$= 0.5646(0.4354)(0.6 \times 0.07057) = 0.2458 \times 0.04234 = 0.01041$$

$$\delta_{h2} = h_2(1-h_2),(w_{45},\delta_{o1})$$ $$= 0.5744(0.4256)(0.7 \times 0.07057) = 0.2445 \times 0.04940 = 0.01208$$

Step 5: Weight updates $;w^{new} = w^{old} + \alpha,\delta,(\text{input to that weight})$

Output layer: $$w_{35}^{new} = 0.6 + 0.5(0.07057)(0.5646) = 0.6 + 0.01992 = 0.6199$$ $$w_{45}^{new} = 0.7 + 0.5(0.07057)(0.5744) = 0.7 + 0.02027 = 0.7203$$

Hidden layer: $$w_{13}^{new} = 0.4 + 0.5(0.01041)(0.5) = 0.4 + 0.00260 = 0.4026$$ $$w_{23}^{new} = 0.2 + 0.5(0.01041)(0.3) = 0.2 + 0.00156 = 0.2016$$ $$w_{14}^{new} = 0.3 + 0.5(0.01208)(0.5) = 0.3 + 0.00302 = 0.3030$$ $$w_{24}^{new} = 0.5 + 0.5(0.01208)(0.3) = 0.5 + 0.00181 = 0.5018$$

Result of one iteration

WeightOldNew
$w_{13}$0.40.4026
$w_{23}$0.20.2016
$w_{14}$0.30.3030
$w_{24}$0.50.5018
$w_{35}$0.60.6199
$w_{45}$0.70.7203

Output moved from $y = 0.6772$ toward target $t = 1.0$; repeating iterations reduces error.


Common mistake: treating $\delta = t - y = 0.3229$ as the output delta. The sigmoid derivative must be included, giving $\delta_{o1} = (t-y),y(1-y) = 0.0706$, and that is the value used in the weight updates. The forward pass gives $h_1 \approx 0.565$, $h_2 \approx 0.574$ and $y \approx 0.677$.

4asked 5xavg 10 marks · Informed Search
Answer

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.[10]

Informed vs Uninformed Search, Hill Climbing, and Incompleteness

STEP 1 - EXTRACT: Given Data

This is a conceptual and design question. There are no fixed numeric inputs provided; the student must construct a state space with heuristics. The state space used below is:

Working state space (Part 3):

Nodeh(n)Neighbors
A10B, C
B7D, E
C8F
D4G
E5-
F6-
G0GOAL

Modified state space (Part 4):

Nodeh(n)Neighbors
A10B, C
B7D, E
E3X
D5G
X4(dead end)
G0GOAL

No data is missing since the values are self-created and internally consistent.


STEP 2 - SOLVE

FeatureUninformed (Blind) SearchInformed (Heuristic) Search
KnowledgeUses only the problem definition; no extra infoUses domain-specific heuristic $h(n)$
GuidanceExplores blindly in fixed orderGuided toward goal by $h(n)$
EfficiencyExplores more nodes; usually slowerExplores fewer nodes; usually faster
Optimality/CompletenessSome (e.g., BFS) are complete/optimalDepends on heuristic (A* optimal if admissible)
ExamplesBFS, DFS, DLS, IDDFS, Uniform Cost, BidirectionalGreedy Best-First, A*, Hill Climbing, AO*

The heuristic function is: $$h(n) = \text{estimated cost of the cheapest path from node } n \text{ to a goal}$$

Informed search leverages $h(n)$ to prioritize promising nodes, which uninformed search cannot do.


Part 2: Hill Climbing Concept

Hill climbing is a local, informed search that:

  • keeps only the current state (no frontier, no memory),
  • always moves to the best neighbor (here, lowest $h$ toward goal),
  • halts when no neighbor improves on the current node.

Part 3: State Space Where Hill Climbing Succeeds

        A (10)
       /   \
    B(7)    C(8)
    /  \      \
  D(4) E(5)   F(6)
   |
  G(0)  <-- GOAL

Execution (choose neighbor with lowest $h$):

StepCurrentNeighbors ($h$)Best (lower than current?)Move
1A (10)B(7), C(8)B(7) < 10 ✓B
2B (7)D(4), E(5)D(4) < 7 ✓D
3D (4)G(0)G(0) < 4 ✓G
4G (0)-GOAL reachedSTOP

Solution path: $A \to B \to D \to G$

Hill climbing succeeds because the heuristic decreases monotonically along the correct path.


Part 4: Modified State Space Where Hill Climbing Fails

We change $D$'s value to $5$ and add a misleading branch $E \to X$ with $h(E)=3$, $h(X)=4$, so the greedy choice leads into a local minimum.

        A (10)
       /   \
    B(7)    C(8)
    /  \      \
  D(5) E(3)   F(6)
   |     \
  G(0)   X(4)  <-- dead-end trap

Execution:

StepCurrentNeighbors ($h$)BestMove
1A (10)B(7), C(8)B(7) < 10B
2B (7)D(5), E(3)E(3) < 5, so E preferred over DE
3E (3)X(4)X(4) > 3 → no improvementSTOP (stuck)

Path followed: $A \to B \to E$ → stuck at $E$ (local minimum).

The actual goal lies on $A \to B \to D \to G$, but at step 2 the greedy heuristic picked $E$ (h=3) over $D$ (h=5). At $E$, the only neighbor $X$ (h=4) is worse, so hill climbing terminates without reaching $G$.

Why incomplete: Hill climbing has no backtracking and no memory, so once it commits to a locally attractive but misleading node it cannot recover. This illustrates the classic failure modes:

  1. Local minimum/maximum (shown above),
  2. Plateau (all neighbors equal),
  3. Ridge (progress only via non-improving sideways moves).

Hence hill climbing is not complete: it can fail to find an existing goal.


Conclusion: Informed search uses $h(n)$ to guide exploration (unlike blind uninformed search). Hill climbing exploits $h(n)$ greedily and works when the heuristic slopes toward the goal, but because it lacks backtracking it becomes incomplete at local minima, plateaus, and ridges.

5asked 4xavg 5 marks · due (skipped 2081) · AI Perspectives
Answer

How can you define AI from the dimension of behavioural process? When a machine is said to pass Turing Test? [5]

AI can be defined from four dimensions based on thinking/acting and humanly/rationally. The behavioural (process) dimension focuses on how a system acts rather than what it thinks internally. The two behavioural approaches are: "A comput...

Most repeated questions

Topics asked at least twice, most-asked first.

asked 7xavg 9 marks · 2081, 2080.1, 2080, 2079, 2078...
Answer

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.[10]

Skolem Constant, Skolemization, and FOPL Representation

1. Skolem Constant

A Skolem constant is a special constant introduced during the process of Skolemization to eliminate existential quantifiers from a First Order Predicate Logic (FOPL) formula. When an existential quantifier appears in a formula without any enclosing universal quantifier, the existentially quantified variable is replaced by a unique new constant (called a Skolem constant) that represents the specific (but unnamed) individual whose existence is asserted.

Example:

  • Formula: ∃x P(x)
  • After Skolemization: P(a) where a is a Skolem constant.

If the existential quantifier is within the scope of a universal quantifier, the existential variable is replaced by a Skolem function (not a constant) of the universally quantified variables.

Example:

  • Formula: ∀x ∃y Loves(x, y)
  • After Skolemization: ∀x Loves(x, f(x)) where f(x) is a Skolem function.

2. Skolemization During Resolution

Skolemization is the process of removing existential quantifiers from a FOPL formula to prepare it for resolution. Resolution works on clausal form (CNF), and existential quantifiers must be eliminated before conversion to clause form.

Steps of Skolemization (as part of full conversion to clause form):

StepOperation
1Eliminate implications and biconditionals
2Move negations inward (using De Morgan's laws)
3Standardize variables apart
4Move quantifiers to the left (Prenex Normal Form)
5Skolemize: eliminate existential quantifiers
6Drop universal quantifiers
7Convert to Conjunctive Normal Form (CNF)
8Write as a set of clauses

Rules of Skolemization:

  • Case 1: If ∃x appears outside the scope of any universal quantifier, replace x with a Skolem constant (e.g., a, b, c).

    ∃x Movie(x) becomes Movie(SK1) where SK1 is a Skolem constant.

  • Case 2: If ∃x appears within the scope of universal quantifiers ∀y1, ∀y2, ..., replace x with a Skolem function of those variables.

    ∀x ∃y HasScript(x, y) becomes ∀x HasScript(x, f(x)) where f(x) is a Skolem function.


3. Representation of Statements into FOPL

Predicates Used:

  • Movie(x) : x is a movie
  • Hit(x) : x is a hit
  • GoodScript(x) : x has a good script
  • Sentimental(x) : x is sentimental
  • Comedy(x) : x is a comedy

Statement 1: "All movies are not hit."

Every x, if x is a movie, then x is not a hit.

$$\forall x ; Movie(x) \Rightarrow \neg Hit(x)$$


Statement 2: "Sarangi is a movie."

Sarangi is a specific individual (constant).

$$Movie(Sarangi)$$


Statement 3: "All movies which have good script are hit."

Every x, if x is a movie AND x has a good script, then x is a hit.

$$\forall x ; [Movie(x) \wedge GoodScript(x)] \Rightarrow Hit(x)$$


Statement 4: "Sarangi has a good script but Sarangi is sentimental."

Conjunction of two facts about the constant Sarangi.

$$GoodScript(Sarangi) \wedge Sentimental(Sarangi)$$


Statement 5: "There is a movie which is comedy."

There exists some x such that x is a movie and x is a comedy.

$$\exists x ; [Movie(x) \wedge Comedy(x)]$$

After Skolemization (since ∃x has no enclosing universal quantifier, replace x with Skolem constant SK1):

$$Movie(SK1) \wedge Comedy(SK1)$$


Summary Table

StatementFOPL Representation
All movies are not hit∀x Movie(x) ⇒ ¬Hit(x)
Sarangi is a movieMovie(Sarangi)
All movies with good script are hit∀x [Movie(x) ∧ GoodScript(x)] ⇒ Hit(x)
Sarangi has good script but is sentimentalGoodScript(Sarangi) ∧ Sentimental(Sarangi)
There is a movie which is comedy∃x [Movie(x) ∧ Comedy(x)]

Note: Statements 1 and 3 appear contradictory (all movies are not hit vs. movies with good script are hit). This is intentional in the problem, likely to test resolution-based contradiction detection. In resolution, we would derive a contradiction from Movie(Sarangi), GoodScript(Sarangi), Statement 1, and Statement 3.

asked 6xavg 8 marks · 2081, 2080, 2079, 2078, 2076
Answer

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.[10]

Artificial Neural Networks: Biological Analogy and Backpropagation

STEP 1 - EXTRACT (Given / Assumed Data)

The question requires us to assume inputs and weights, so the worked example below uses these values:

Inputs: $x_1 = 0.5$, $x_2 = 0.3$ Target: $t = 1.0$

Learning rate: $\alpha = 0.5$ Activation: Sigmoid $g(x) = \dfrac{1}{1+e^{-x}}$, derivative $g'(x) = g(x)(1-g(x))$ Biases: $0$

Initial weights:

WeightConnectionValue
$w_{13}$$x_1 \to h_1$0.4
$w_{23}$$x_2 \to h_1$0.2
$w_{14}$$x_1 \to h_2$0.3
$w_{24}$$x_2 \to h_2$0.5
$w_{35}$$h_1 \to o_1$0.6
$w_{45}$$h_2 \to o_1$0.7

Part 1: Biological vs Artificial Neural Network Mapping

Biological ElementArtificial ElementFunction
DendriteInput connections carrying $x_j$Receive incoming signals
SynapseWeight $w_{ij}$Modulate signal strength; learning adjusts these
AxonNeuron output lineTransmits processed signal onward
Soma (cell body)Summation $\Sigma$ + activation $g(\cdot)$Integrates weighted inputs and fires

Summary: dendrites $\to$ inputs, synapses $\to$ weights, soma $\to$ summation + activation, axon $\to$ output. Learning in ANN = adjusting synaptic weights.


Part 2: Network Architecture

A 2-2-1 multilayer network:

 x1 ─w13─┐        ┌─w35─┐
         ├──> h1 ─┤     │
 x2 ─w23─┘        │     ├──> o1 ──> y
                  │     │
 x1 ─w14─┐        │     │
         ├──> h2 ─┴─w45─┘
 x2 ─w24─┘

Part 3: Single Iteration of Backpropagation

Step 1: Forward pass - hidden layer

$$net_{h1} = 0.4(0.5) + 0.2(0.3) = 0.20 + 0.06 = 0.26$$ $$h_1 = g(0.26) = \frac{1}{1+e^{-0.26}} = \frac{1}{1.7711} = 0.5646$$

$$net_{h2} = 0.3(0.5) + 0.5(0.3) = 0.15 + 0.15 = 0.30$$ $$h_2 = g(0.30) = \frac{1}{1+e^{-0.30}} = \frac{1}{1.7408} = 0.5744$$

Step 2: Forward pass - output layer

$$net_{o1} = 0.6(0.5646) + 0.7(0.5744) = 0.3388 + 0.4021 = 0.7409$$ $$y = g(0.7409) = \frac{1}{1+e^{-0.7409}} = \frac{1}{1.4767} = 0.6772$$

Step 3: Output error and delta

$$\delta_{o1} = (t - y)\cdot y(1-y) = (1.0 - 0.6772)(0.6772)(1-0.6772)$$ $$= 0.3228 \times 0.6772 \times 0.3228 = 0.07057$$

Step 4: Hidden layer deltas

$$\delta_{h1} = h_1(1-h_1),(w_{35},\delta_{o1})$$ $$= 0.5646(0.4354)(0.6 \times 0.07057) = 0.2458 \times 0.04234 = 0.01041$$

$$\delta_{h2} = h_2(1-h_2),(w_{45},\delta_{o1})$$ $$= 0.5744(0.4256)(0.7 \times 0.07057) = 0.2445 \times 0.04940 = 0.01208$$

Step 5: Weight updates $;w^{new} = w^{old} + \alpha,\delta,(\text{input to that weight})$

Output layer: $$w_{35}^{new} = 0.6 + 0.5(0.07057)(0.5646) = 0.6 + 0.01992 = 0.6199$$ $$w_{45}^{new} = 0.7 + 0.5(0.07057)(0.5744) = 0.7 + 0.02027 = 0.7203$$

Hidden layer: $$w_{13}^{new} = 0.4 + 0.5(0.01041)(0.5) = 0.4 + 0.00260 = 0.4026$$ $$w_{23}^{new} = 0.2 + 0.5(0.01041)(0.3) = 0.2 + 0.00156 = 0.2016$$ $$w_{14}^{new} = 0.3 + 0.5(0.01208)(0.5) = 0.3 + 0.00302 = 0.3030$$ $$w_{24}^{new} = 0.5 + 0.5(0.01208)(0.3) = 0.5 + 0.00181 = 0.5018$$

Result of one iteration

WeightOldNew
$w_{13}$0.40.4026
$w_{23}$0.20.2016
$w_{14}$0.30.3030
$w_{24}$0.50.5018
$w_{35}$0.60.6199
$w_{45}$0.70.7203

Output moved from $y = 0.6772$ toward target $t = 1.0$; repeating iterations reduces error.


Common mistake: treating $\delta = t - y = 0.3229$ as the output delta. The sigmoid derivative must be included, giving $\delta_{o1} = (t-y),y(1-y) = 0.0706$, and that is the value used in the weight updates. The forward pass gives $h_1 \approx 0.565$, $h_2 \approx 0.574$ and $y \approx 0.677$.

asked 5xavg 5 marks · 2080.1, 2080, 2079, 2078, 2076
Answer

How natural language generation differs from natural language understanding? How morphological analysis is done in NLP? [5]

Natural Language Generation vs. Natural Language Understanding, and Morphological Analysis


Part 1: NLG vs. NLU (Differences)

According to the notes, NLP is composed of two parts: NLU and NLG.

AspectNLU (Natural Language Understanding)NLG (Natural Language Generation)
DefinitionThe process of mapping given inputs in natural language into useful (machine) representations and analyzing different aspects of the language.The process of producing meaningful phrases and sentences in the form of natural language from a machine-based representation.
DirectionNatural Language --> Machine RepresentationMachine Representation --> Natural Language
TaskTakes a spoken/typed sentence and works out what it means.Takes a formal representation of what we want to say and works out how to express it in natural language.
Core ChallengeThe system must disambiguate the input sentence to produce the machine representation.The system must make decisions about how to put a concept into words.
Levels InvolvedMorphological analysis, syntactic analysis, semantic analysis.Deep generation, syntactic generation.
DifficultyHarder than NLG (language has ambiguity, context, etc.).Less hard than NLU.
AnalogyLike a reader/listener interpreting meaning.Like a translator converting computer-based representation into natural language.

Part 2: Morphological Analysis in NLP

Definition

Morphological analysis is one of the levels of analysis required in NLU. It is the study and analysis of the internal structure of words -- how words are formed from smaller meaningful units called morphemes.

What is a Morpheme?

A morpheme is the smallest unit of meaning in a language.

  • Free morpheme: Can stand alone as a word. Example: play, book
  • Bound morpheme: Cannot stand alone; must be attached to another morpheme. Example: -ing, -ed, -s, un-

How Morphological Analysis is Done

Morphological analysis involves breaking a word into its constituent morphemes and identifying their roles. The steps are:

Step 1: Tokenization The input sentence is split into individual words (tokens).

Example: "The boys are playing" --> ["The", "boys", "are", "playing"]

Step 2: Stemming / Lemmatization Each word is reduced to its base or root form.

Example:

  • playing --> root: play + suffix: -ing (present participle)
  • boys --> root: boy + suffix: -s (plural)
  • played --> root: play + suffix: -ed (past tense)

Step 3: Identifying Morphological Categories The morphemes are tagged with their grammatical roles:

WordMorpheme BreakdownAnalysis
unhappyun- + happyPrefix un- negates the adjective
booksbook + -sNoun + plural marker
runningrun + -ningVerb + present participle
quicklyquick + -lyAdjective + adverb suffix

Step 4: Applying Morphological Rules Rules such as inflectional morphology (tense, number, gender) and derivational morphology (forming new words) are applied to understand the word's role in the sentence.

Importance in NLP

Morphological analysis is the first and foundational level of NLU. It helps the NLP system:

  • Understand word forms and their base meanings
  • Reduce vocabulary size for further processing
  • Prepare input for syntactic and semantic analysis in subsequent stages

Summary: NLU converts language to meaning (harder), while NLG converts meaning to language (easier). Morphological analysis, the first step in NLU, breaks words into morphemes to understand their structure and grammatical roles.

asked 5xavg 10 marks · 2081, 2080.1, 2080, 2079, 2076
Answer

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.[10]

Informed vs Uninformed Search, Hill Climbing, and Incompleteness

STEP 1 - EXTRACT: Given Data

This is a conceptual and design question. There are no fixed numeric inputs provided; the student must construct a state space with heuristics. The state space used below is:

Working state space (Part 3):

Nodeh(n)Neighbors
A10B, C
B7D, E
C8F
D4G
E5-
F6-
G0GOAL

Modified state space (Part 4):

Nodeh(n)Neighbors
A10B, C
B7D, E
E3X
D5G
X4(dead end)
G0GOAL

No data is missing since the values are self-created and internally consistent.


STEP 2 - SOLVE

FeatureUninformed (Blind) SearchInformed (Heuristic) Search
KnowledgeUses only the problem definition; no extra infoUses domain-specific heuristic $h(n)$
GuidanceExplores blindly in fixed orderGuided toward goal by $h(n)$
EfficiencyExplores more nodes; usually slowerExplores fewer nodes; usually faster
Optimality/CompletenessSome (e.g., BFS) are complete/optimalDepends on heuristic (A* optimal if admissible)
ExamplesBFS, DFS, DLS, IDDFS, Uniform Cost, BidirectionalGreedy Best-First, A*, Hill Climbing, AO*

The heuristic function is: $$h(n) = \text{estimated cost of the cheapest path from node } n \text{ to a goal}$$

Informed search leverages $h(n)$ to prioritize promising nodes, which uninformed search cannot do.


Part 2: Hill Climbing Concept

Hill climbing is a local, informed search that:

  • keeps only the current state (no frontier, no memory),
  • always moves to the best neighbor (here, lowest $h$ toward goal),
  • halts when no neighbor improves on the current node.

Part 3: State Space Where Hill Climbing Succeeds

        A (10)
       /   \
    B(7)    C(8)
    /  \      \
  D(4) E(5)   F(6)
   |
  G(0)  <-- GOAL

Execution (choose neighbor with lowest $h$):

StepCurrentNeighbors ($h$)Best (lower than current?)Move
1A (10)B(7), C(8)B(7) < 10 ✓B
2B (7)D(4), E(5)D(4) < 7 ✓D
3D (4)G(0)G(0) < 4 ✓G
4G (0)-GOAL reachedSTOP

Solution path: $A \to B \to D \to G$

Hill climbing succeeds because the heuristic decreases monotonically along the correct path.


Part 4: Modified State Space Where Hill Climbing Fails

We change $D$'s value to $5$ and add a misleading branch $E \to X$ with $h(E)=3$, $h(X)=4$, so the greedy choice leads into a local minimum.

        A (10)
       /   \
    B(7)    C(8)
    /  \      \
  D(5) E(3)   F(6)
   |     \
  G(0)   X(4)  <-- dead-end trap

Execution:

StepCurrentNeighbors ($h$)BestMove
1A (10)B(7), C(8)B(7) < 10B
2B (7)D(5), E(3)E(3) < 5, so E preferred over DE
3E (3)X(4)X(4) > 3 → no improvementSTOP (stuck)

Path followed: $A \to B \to E$ → stuck at $E$ (local minimum).

The actual goal lies on $A \to B \to D \to G$, but at step 2 the greedy heuristic picked $E$ (h=3) over $D$ (h=5). At $E$, the only neighbor $X$ (h=4) is worse, so hill climbing terminates without reaching $G$.

Why incomplete: Hill climbing has no backtracking and no memory, so once it commits to a locally attractive but misleading node it cannot recover. This illustrates the classic failure modes:

  1. Local minimum/maximum (shown above),
  2. Plateau (all neighbors equal),
  3. Ridge (progress only via non-improving sideways moves).

Hence hill climbing is not complete: it can fail to find an existing goal.


Conclusion: Informed search uses $h(n)$ to guide exploration (unlike blind uninformed search). Hill climbing exploits $h(n)$ greedily and works when the heuristic slopes toward the goal, but because it lacks backtracking it becomes incomplete at local minima, plateaus, and ridges.

asked 5xavg 6 marks · 2081, 2080, 2079, 2078, 2076
Answer

How uniform cost search is used to search goal in the state apace? Illustrate with example. [5]

Uniform Cost Search (UCS) in State Space

Given Data

This is a conceptual/descriptive question. No numeric matrices, burst times, or reference strings are provided. The example graph and edge costs are constructed for illustration (as the question requires "an example").


Definition

Uniform Cost Search (UCS) is an uninformed (blind) search strategy that expands the node with the lowest cumulative path cost $g(n)$ from the start node. It is a special case of Best-First Search using the evaluation function:

$$f(n) = g(n)$$

where $g(n)$ = total cost of the path from the start state to node $n$. When all step costs are equal, UCS reduces to Breadth-First Search.


How UCS Searches the Goal

  1. Insert the start node into a priority queue ordered by path cost (minimum first), with cost $0$.
  2. Remove the node with the least path cost.
  3. Goal test at expansion (when popped, not when generated) to guarantee optimality.
  4. Generate successors; for each, compute $g(\text{child}) = g(\text{parent}) + \text{step cost}$ and insert into the priority queue.
  5. If a cheaper path to an already-seen node is found, update it.
  6. Repeat until the goal is popped or the queue is empty.

Illustrated Example

Consider a weighted graph with start $S$ and goal $G$:

Edge costs:

  • $S \to A = 1$
  • $S \to B = 4$
  • $A \to B = 2$
  • $A \to G = 5$
  • $B \to G = 2$

Step-by-Step Trace

StepPriority Queue (node, cost)ExpandedAction
1{(S,0)}S (0)Add A(1), B(4)
2{(A,1),(B,4)}A (1)Add G(1+5=6); B via A = 1+2=3 (better than 4)
3{(B,3),(G,6)}B (3)Add G(3+2=5)
4{(G,5),(G,6)}G (5)Goal found

Optimal Path: $S \to A \to B \to G$ with total cost $= 1 + 2 + 2 = \mathbf{5}$

The alternative $S \to A \to G$ costs $6$, so UCS correctly returns the cheaper path.

Check the path, not just the cost: with $S \to A = 1$ and $A \to B = 2$, node $B$ is reached at cost $3$, so the optimal path is $S \to A \to B \to G$ rather than $S \to B \to G$. The final cost (5) is identical either way.


Performance Measures

CriterionResult
CompletenessComplete if every step cost $\ge \varepsilon > 0$
OptimalityOptimal (least-cost path)
Time Complexity$O\big(b^{1 + \lfloor C^{*}/\varepsilon \rfloor}\big)$
Space Complexity$O\big(b^{1 + \lfloor C^{*}/\varepsilon \rfloor}\big)$

where $C^{*}$ = cost of optimal solution, $\varepsilon$ = minimum step cost, $b$ = branching factor.


Key Points

  • Uses a priority queue ordered by $g(n)$.
  • Optimal and complete for positive step costs.
  • Uninformed counterpart of A* (A* adds heuristic: $f(n)=g(n)+h(n)$).
  • Goal tested at expansion, ensuring no cheaper path is missed.
asked 5xavg 5 marks · 2081, 2080.1, 2080, 2078, 2076
Answer

How can you represent knowledge using scripts? Create a knowlege base using script based on your own assumption. [5]

A script is a structured knowledge representation technique used in AI to represent stereotyped sequences of events in a particular context. It was introduced by Roger Schank and Robert Abelson (1977). A script describes a typical sequen...

asked 4xavg 5 marks · 2080.1, 2080, 2078, 2076
Answer

How can you define AI from the dimension of behavioural process? When a machine is said to pass Turing Test? [5]

AI can be defined from four dimensions based on thinking/acting and humanly/rationally. The behavioural (process) dimension focuses on how a system acts rather than what it thinks internally. The two behavioural approaches are: "A comput...

asked 4xavg 5 marks · 2080.1, 2080, 2078, 2076
Answer

Discuss how genetic algorithm works? [5]

Genetic Algorithms (GAs) are adaptive heuristic search algorithms that belong to the larger part of evolutionary algorithms. They are based on the idea of natural selection and genetics. Historical data are provided to find better soluti...

asked 3xavg 5 marks · 2080.1, 2080, 2078
Answer

Using your own assumptions, design PEAS framework for following intelligent agents. a. Medicine delivery drone b. Covid medicine prescriber. [5]

To design a rational agent, we must specify its task environment using the PEAS framework: - P - Performance Measure - E - Environment - A - Actuators - S - Sensors --- Assumptions: The drone operates in an urban area, picks up medicines...

asked 3xavg 5 marks · 2081, 2079, 2076
Answer

Define fuzzy logic. Construct a fuzzy rule base expert system with your own considerations of fuzzy set. [5]

Fuzzy logic is a form of multi-valued logic derived from fuzzy set theory that deals with approximate reasoning rather than precise (crisp) reasoning. Unlike classical binary logic where variables take only values of 0 (false) or 1 (true...

asked 2xavg 5 marks · 2080, 2078
Answer

Why alpha beta pruning is necessary? How alpha beta pruning is done in game search, illustrate with an example. [5]

In a standard Minimax game tree, every node must be evaluated, which leads to exponential time complexity of O(b^m) where b is the branching factor and m is the maximum depth. This becomes computationally infeasible for games like chess ...

asked 2xavg 5 marks · 2080, 2078
Answer

Describe the components of expert system. [5]

An expert system is a computer program designed to solve complex problems and provide decision-making ability like a human expert. It extracts knowledge from its knowledge base using reasoning and inference rules according to user querie...

asked 2xavg 5 marks · 2080.1, 2079
Answer

What is an agent? How utility agent works? Give an example of utility agent. [5]

What is an Agent? Utility Agent and Example


What is an Agent? (1 mark)

An agent is anything that can perceive its environment through sensors and act upon that environment through actuators. An agent operates in a continuous cycle:

Environment --> Sensors --> Agent --> Actuators --> Environment

An agent takes a percept sequence as input and produces an action as output. The goal of an agent is to act rationally, meaning it selects actions that maximize its expected performance measure based on available knowledge.


How a Utility-Based Agent Works (2 marks)

A utility-based agent is an advanced type of agent that goes beyond simply achieving goals. It uses a utility function to measure how desirable a particular state is, allowing the agent to choose the best possible action among many alternatives.

Working Mechanism:

Percepts --> [State Representation] --> [Utility Function] --> Best Action

Step-by-step working:

  1. Perceive the current state of the environment through sensors.
  2. Maintain an internal model of the world (current state).
  3. Evaluate possible next states using a utility function, which assigns a numerical value (happiness/desirability score) to each state.
  4. Select the action that leads to the state with the maximum expected utility.
  5. Execute the chosen action through actuators.

Key Features:

  • It handles situations where multiple goals conflict with each other.
  • It handles uncertainty by computing expected utility (probability-weighted utility).
  • It does not just ask "Did I achieve the goal?" but rather "How well did I achieve it?"

Formula:

Best Action = argmax [ Σ P(outcome | action) × Utility(outcome) ]

Example of a Utility-Based Agent (2 marks)

Example: Self-Driving Taxi (Automated Taxi)

Consider an automated taxi agent navigating from point A to point B.

Possible ActionUtility Score
Take shortest route (heavy traffic)60
Take longer route (no traffic)75
Take toll route (fast, costs money)70

How it works:

  • The taxi perceives road conditions, traffic, distance, and fuel level.
  • It evaluates each possible route using a utility function that considers:
    • Travel time (less time = higher utility)
    • Passenger comfort (smooth road = higher utility)
    • Fuel cost (less cost = higher utility)
    • Safety (safer route = higher utility)
  • It selects the route with the maximum utility score (longer route with no traffic = 75).
  • This is better than a simple goal-based agent that would just pick the shortest route without considering comfort or traffic.

Why Utility Agent is Better:

  • A goal-based agent only checks: "Did I reach destination? Yes/No"
  • A utility-based agent checks: "Which path gives the best overall experience?"

This makes utility-based agents ideal for stochastic and partially observable environments (like driving) where uncertainty must be handled rationally through probability and utility calculations.

asked 2xavg 5 marks · 2080.1, 2076
Answer

What is machine vision? Describe the components of machine vision. [5]

Machine vision is the ability of a computer to "see". A machine vision system employs one or more video cameras, analog-to-digital conversion (ADC), and digital signal processing (DSP). The resulting data goes to a computer or robot cont...

asked 2xavg 5 marks · 2078, 2076
Answer

What is prosteroir 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. [5]

Symbol Meaning Value ------------------------ $P(L)$ Probability a patient has liver disease $0.15$ $P(A)$ Probability a patient is alcoholic $0.05$ $P(A\mid L)$ Probability a patient is alcoholic given they have liver disease $0.07$ Req...

Study every one of these with model answers, flashcards, and MCQs.

Open CSC266 study modes