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 LogicAnswerHideWhat 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]
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)whereais 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))wheref(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):
| Step | Operation |
|---|---|
| 1 | Eliminate implications and biconditionals |
| 2 | Move negations inward (using De Morgan's laws) |
| 3 | Standardize variables apart |
| 4 | Move quantifiers to the left (Prenex Normal Form) |
| 5 | Skolemize: eliminate existential quantifiers |
| 6 | Drop universal quantifiers |
| 7 | Convert to Conjunctive Normal Form (CNF) |
| 8 | Write as a set of clauses |
Rules of Skolemization:
-
Case 1: If
∃xappears outside the scope of any universal quantifier, replacexwith a Skolem constant (e.g.,a,b,c).∃x Movie(x)becomesMovie(SK1)whereSK1is a Skolem constant. -
Case 2: If
∃xappears within the scope of universal quantifiers∀y1, ∀y2, ..., replacexwith a Skolem function of those variables.∀x ∃y HasScript(x, y)becomes∀x HasScript(x, f(x))wheref(x)is a Skolem function.
3. Representation of Statements into FOPL
Predicates Used:
Movie(x): x is a movieHit(x): x is a hitGoodScript(x): x has a good scriptSentimental(x): x is sentimentalComedy(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
| Statement | FOPL Representation |
|---|---|
| All movies are not hit | ∀x Movie(x) ⇒ ¬Hit(x) |
| Sarangi is a movie | Movie(Sarangi) |
| All movies with good script are hit | ∀x [Movie(x) ∧ GoodScript(x)] ⇒ Hit(x) |
| Sarangi has good script but is sentimental | GoodScript(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 ProcessingAnswerHideHow natural language generation differs from natural language understanding? How morphological analysis is done in NLP? [5]
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.
| Aspect | NLU (Natural Language Understanding) | NLG (Natural Language Generation) |
|---|---|---|
| Definition | The 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. |
| Direction | Natural Language --> Machine Representation | Machine Representation --> Natural Language |
| Task | Takes 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 Challenge | The 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 Involved | Morphological analysis, syntactic analysis, semantic analysis. | Deep generation, syntactic generation. |
| Difficulty | Harder than NLG (language has ambiguity, context, etc.). | Less hard than NLU. |
| Analogy | Like 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:
| Word | Morpheme Breakdown | Analysis |
|---|---|---|
unhappy | un- + happy | Prefix un- negates the adjective |
books | book + -s | Noun + plural marker |
running | run + -ning | Verb + present participle |
quickly | quick + -ly | Adjective + 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 NetworksAnswerHideHow 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]
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:
| Weight | Connection | Value |
|---|---|---|
| $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 Element | Artificial Element | Function |
|---|---|---|
| Dendrite | Input connections carrying $x_j$ | Receive incoming signals |
| Synapse | Weight $w_{ij}$ | Modulate signal strength; learning adjusts these |
| Axon | Neuron output line | Transmits 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
| Weight | Old | New |
|---|---|---|
| $w_{13}$ | 0.4 | 0.4026 |
| $w_{23}$ | 0.2 | 0.2016 |
| $w_{14}$ | 0.3 | 0.3030 |
| $w_{24}$ | 0.5 | 0.5018 |
| $w_{35}$ | 0.6 | 0.6199 |
| $w_{45}$ | 0.7 | 0.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 SearchAnswerHideHow 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]
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):
| Node | h(n) | Neighbors |
|---|---|---|
| A | 10 | B, C |
| B | 7 | D, E |
| C | 8 | F |
| D | 4 | G |
| E | 5 | - |
| F | 6 | - |
| G | 0 | GOAL |
Modified state space (Part 4):
| Node | h(n) | Neighbors |
|---|---|---|
| A | 10 | B, C |
| B | 7 | D, E |
| E | 3 | X |
| D | 5 | G |
| X | 4 | (dead end) |
| G | 0 | GOAL |
No data is missing since the values are self-created and internally consistent.
STEP 2 - SOLVE
Part 1: Informed vs Uninformed Search
| Feature | Uninformed (Blind) Search | Informed (Heuristic) Search |
|---|---|---|
| Knowledge | Uses only the problem definition; no extra info | Uses domain-specific heuristic $h(n)$ |
| Guidance | Explores blindly in fixed order | Guided toward goal by $h(n)$ |
| Efficiency | Explores more nodes; usually slower | Explores fewer nodes; usually faster |
| Optimality/Completeness | Some (e.g., BFS) are complete/optimal | Depends on heuristic (A* optimal if admissible) |
| Examples | BFS, DFS, DLS, IDDFS, Uniform Cost, Bidirectional | Greedy 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$):
| Step | Current | Neighbors ($h$) | Best (lower than current?) | Move |
|---|---|---|---|---|
| 1 | A (10) | B(7), C(8) | B(7) < 10 ✓ | B |
| 2 | B (7) | D(4), E(5) | D(4) < 7 ✓ | D |
| 3 | D (4) | G(0) | G(0) < 4 ✓ | G |
| 4 | G (0) | - | GOAL reached | STOP |
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:
| Step | Current | Neighbors ($h$) | Best | Move |
|---|---|---|---|---|
| 1 | A (10) | B(7), C(8) | B(7) < 10 | B |
| 2 | B (7) | D(5), E(3) | E(3) < 5, so E preferred over D | E |
| 3 | E (3) | X(4) | X(4) > 3 → no improvement | STOP (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:
- Local minimum/maximum (shown above),
- Plateau (all neighbors equal),
- 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 PerspectivesAnswerHideHow can you define AI from the dimension of behavioural process? When a machine is said to pass Turing Test? [5]
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...AnswerHideWhat 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]
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)whereais 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))wheref(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):
| Step | Operation |
|---|---|
| 1 | Eliminate implications and biconditionals |
| 2 | Move negations inward (using De Morgan's laws) |
| 3 | Standardize variables apart |
| 4 | Move quantifiers to the left (Prenex Normal Form) |
| 5 | Skolemize: eliminate existential quantifiers |
| 6 | Drop universal quantifiers |
| 7 | Convert to Conjunctive Normal Form (CNF) |
| 8 | Write as a set of clauses |
Rules of Skolemization:
-
Case 1: If
∃xappears outside the scope of any universal quantifier, replacexwith a Skolem constant (e.g.,a,b,c).∃x Movie(x)becomesMovie(SK1)whereSK1is a Skolem constant. -
Case 2: If
∃xappears within the scope of universal quantifiers∀y1, ∀y2, ..., replacexwith a Skolem function of those variables.∀x ∃y HasScript(x, y)becomes∀x HasScript(x, f(x))wheref(x)is a Skolem function.
3. Representation of Statements into FOPL
Predicates Used:
Movie(x): x is a movieHit(x): x is a hitGoodScript(x): x has a good scriptSentimental(x): x is sentimentalComedy(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
| Statement | FOPL Representation |
|---|---|
| All movies are not hit | ∀x Movie(x) ⇒ ¬Hit(x) |
| Sarangi is a movie | Movie(Sarangi) |
| All movies with good script are hit | ∀x [Movie(x) ∧ GoodScript(x)] ⇒ Hit(x) |
| Sarangi has good script but is sentimental | GoodScript(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, 2076AnswerHideHow 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]
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:
| Weight | Connection | Value |
|---|---|---|
| $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 Element | Artificial Element | Function |
|---|---|---|
| Dendrite | Input connections carrying $x_j$ | Receive incoming signals |
| Synapse | Weight $w_{ij}$ | Modulate signal strength; learning adjusts these |
| Axon | Neuron output line | Transmits 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
| Weight | Old | New |
|---|---|---|
| $w_{13}$ | 0.4 | 0.4026 |
| $w_{23}$ | 0.2 | 0.2016 |
| $w_{14}$ | 0.3 | 0.3030 |
| $w_{24}$ | 0.5 | 0.5018 |
| $w_{35}$ | 0.6 | 0.6199 |
| $w_{45}$ | 0.7 | 0.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, 2076AnswerHideHow natural language generation differs from natural language understanding? How morphological analysis is done in NLP? [5]
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.
| Aspect | NLU (Natural Language Understanding) | NLG (Natural Language Generation) |
|---|---|---|
| Definition | The 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. |
| Direction | Natural Language --> Machine Representation | Machine Representation --> Natural Language |
| Task | Takes 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 Challenge | The 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 Involved | Morphological analysis, syntactic analysis, semantic analysis. | Deep generation, syntactic generation. |
| Difficulty | Harder than NLG (language has ambiguity, context, etc.). | Less hard than NLU. |
| Analogy | Like 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:
| Word | Morpheme Breakdown | Analysis |
|---|---|---|
unhappy | un- + happy | Prefix un- negates the adjective |
books | book + -s | Noun + plural marker |
running | run + -ning | Verb + present participle |
quickly | quick + -ly | Adjective + 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, 2076AnswerHideHow 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]
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):
| Node | h(n) | Neighbors |
|---|---|---|
| A | 10 | B, C |
| B | 7 | D, E |
| C | 8 | F |
| D | 4 | G |
| E | 5 | - |
| F | 6 | - |
| G | 0 | GOAL |
Modified state space (Part 4):
| Node | h(n) | Neighbors |
|---|---|---|
| A | 10 | B, C |
| B | 7 | D, E |
| E | 3 | X |
| D | 5 | G |
| X | 4 | (dead end) |
| G | 0 | GOAL |
No data is missing since the values are self-created and internally consistent.
STEP 2 - SOLVE
Part 1: Informed vs Uninformed Search
| Feature | Uninformed (Blind) Search | Informed (Heuristic) Search |
|---|---|---|
| Knowledge | Uses only the problem definition; no extra info | Uses domain-specific heuristic $h(n)$ |
| Guidance | Explores blindly in fixed order | Guided toward goal by $h(n)$ |
| Efficiency | Explores more nodes; usually slower | Explores fewer nodes; usually faster |
| Optimality/Completeness | Some (e.g., BFS) are complete/optimal | Depends on heuristic (A* optimal if admissible) |
| Examples | BFS, DFS, DLS, IDDFS, Uniform Cost, Bidirectional | Greedy 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$):
| Step | Current | Neighbors ($h$) | Best (lower than current?) | Move |
|---|---|---|---|---|
| 1 | A (10) | B(7), C(8) | B(7) < 10 ✓ | B |
| 2 | B (7) | D(4), E(5) | D(4) < 7 ✓ | D |
| 3 | D (4) | G(0) | G(0) < 4 ✓ | G |
| 4 | G (0) | - | GOAL reached | STOP |
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:
| Step | Current | Neighbors ($h$) | Best | Move |
|---|---|---|---|---|
| 1 | A (10) | B(7), C(8) | B(7) < 10 | B |
| 2 | B (7) | D(5), E(3) | E(3) < 5, so E preferred over D | E |
| 3 | E (3) | X(4) | X(4) > 3 → no improvement | STOP (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:
- Local minimum/maximum (shown above),
- Plateau (all neighbors equal),
- 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, 2076AnswerHideHow uniform cost search is used to search goal in the state apace? Illustrate with example. [5]
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
- Insert the start node into a priority queue ordered by path cost (minimum first), with cost $0$.
- Remove the node with the least path cost.
- Goal test at expansion (when popped, not when generated) to guarantee optimality.
- Generate successors; for each, compute $g(\text{child}) = g(\text{parent}) + \text{step cost}$ and insert into the priority queue.
- If a cheaper path to an already-seen node is found, update it.
- 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
| Step | Priority Queue (node, cost) | Expanded | Action |
|---|---|---|---|
| 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
| Criterion | Result |
|---|---|
| Completeness | Complete if every step cost $\ge \varepsilon > 0$ |
| Optimality | Optimal (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, 2076AnswerHideHow can you represent knowledge using scripts? Create a knowlege base using script based on your own assumption. [5]
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, 2076AnswerHideHow can you define AI from the dimension of behavioural process? When a machine is said to pass Turing Test? [5]
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, 2076AnswerHideDiscuss how genetic algorithm works? [5]
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, 2078AnswerHideUsing your own assumptions, design PEAS framework for following intelligent agents. a. Medicine delivery drone b. Covid medicine prescriber. [5]
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, 2076AnswerHideDefine fuzzy logic. Construct a fuzzy rule base expert system with your own considerations of fuzzy set. [5]
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, 2078AnswerHideWhy alpha beta pruning is necessary? How alpha beta pruning is done in game search, illustrate with an example. [5]
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, 2078AnswerHideDescribe the components of expert system. [5]
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, 2079AnswerHideWhat is an agent? How utility agent works? Give an example of utility agent. [5]
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:
- Perceive the current state of the environment through sensors.
- Maintain an internal model of the world (current state).
- Evaluate possible next states using a utility function, which assigns a numerical value (happiness/desirability score) to each state.
- Select the action that leads to the state with the maximum expected utility.
- 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 Action | Utility 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, 2076AnswerHideWhat is machine vision? Describe the components of machine vision. [5]
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, 2076AnswerHideWhat 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]
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