BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) Question Paper 2079 Nepal
This is the official BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) question paper for 2079, as set in the regular annual examination. It carries 100 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Artificial Intelligence (PU, CMP 346) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) exam or solving previous years' question papers, this 2079 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt all / any as specified.
(a) Define an intelligent agent and explain the PEAS (Performance measure, Environment, Actuators, Sensors) framework used to specify a task environment. Illustrate the PEAS description for an automated taxi-driving agent. (8)
(b) Classify task environments along the dimensions: fully observable vs. partially observable, deterministic vs. stochastic, episodic vs. sequential, static vs. dynamic, and discrete vs. continuous. For each pair, give one example. (6)
(a) Intelligent Agent and the PEAS Framework
An intelligent agent is anything that perceives its environment through sensors and acts upon that environment through actuators so as to maximize its expected performance measure. It is described by the mapping (agent function) from a percept sequence to an action.
To specify a task environment we use the PEAS framework:
- P – Performance measure: the criterion that defines success of the agent's behaviour.
- E – Environment: the surroundings in which the agent operates.
- A – Actuators: the components through which the agent acts on the environment.
- S – Sensors: the components through which the agent perceives the environment.
PEAS for an Automated Taxi-Driving Agent
| PEAS | Description |
|---|---|
| Performance measure | Safe, fast, legal, comfortable trip; maximize profit; minimize fuel and travel time |
| Environment | Roads, other traffic, pedestrians, traffic signals, weather, customers |
| Actuators | Steering wheel, accelerator, brake, gear, indicator, horn, display |
| Sensors | Cameras, LIDAR/RADAR, GPS, speedometer, odometer, engine sensors, microphone |
(b) Classification of Task Environments
| Dimension | Meaning | Example |
|---|---|---|
| Fully vs. Partially observable | Sensors give complete vs. incomplete state | Chess (fully) vs. Taxi driving (partially) |
| Deterministic vs. Stochastic | Next state fully determined by current state+action vs. has randomness | 8-puzzle (deterministic) vs. Dice game / driving (stochastic) |
| Episodic vs. Sequential | Each action independent vs. current action affects future | Part-picking classifier (episodic) vs. Chess / driving (sequential) |
| Static vs. Dynamic | Environment unchanged vs. changes while agent deliberates | Crossword puzzle (static) vs. Taxi driving (dynamic) |
| Discrete vs. Continuous | Finite distinct states/actions vs. continuous range | Chess (discrete) vs. Taxi driving (continuous) |
Most real-world environments (e.g. taxi driving) are partially observable, stochastic, sequential, dynamic and continuous, which makes them the hardest type.
(a) Explain the A* search algorithm. Define the evaluation function f(n) = g(n) + h(n) and state the conditions of admissibility and consistency of a heuristic. Prove that A* with an admissible heuristic on a tree search is optimal. (10)
(b) Consider a graph where the heuristic and step costs are given below. Trace the order in which A* expands the nodes from start node S to goal node G, showing the f-values at each step:
| Edge | Cost |
|---|---|
| S-A | 1 |
| S-B | 4 |
| A-C | 2 |
| B-C | 1 |
| C-G | 3 |
Heuristics: h(S)=6, h(A)=4, h(B)=2, h(C)=2, h(G)=0. State the final path found and its total cost. (6)
(a) A* Search Algorithm
A* is a best-first informed search that selects for expansion the node with the lowest evaluation function:
where:
- = actual cost of the path from the start node to ,
- = heuristic estimate of the cheapest cost from to the goal,
- = estimated cost of the cheapest solution path through .
A* maintains an OPEN list (frontier, a priority queue ordered by ) and a CLOSED list. It repeatedly removes the node with minimum , generates its successors and stops when the goal is removed from OPEN.
Admissibility and Consistency
- Admissible heuristic: for every node , where is the true cheapest cost to the goal. An admissible heuristic never overestimates.
- Consistent (monotonic) heuristic: for every node and successor reached by action of cost , and . Consistency implies admissibility.
Proof of Optimality (Tree Search, Admissible h)
Let the optimal goal be with cost (since ). Suppose a suboptimal goal with is on the frontier. Let be a node on the optimal path to that is still on the frontier. Then:
(by admissibility)
Since , A* will expand (and continue along the optimal path) before it ever selects . Hence the suboptimal is never returned, so A* is optimal.
(b) Tracing A* from S to G
Given heuristics .
Step 1 — Expand S (). Successors:
- A:
- B:
OPEN: {A=5, B=6}. Expand A (lowest f).
Step 2 — Expand A (). Successor:
- C via A:
OPEN: {C=5, B=6}. Expand C.
Step 3 — Expand C (). Successor:
- G via C:
(Note: B-C would give to C, but C already reached with , which is cheaper, so it is not improved.)
OPEN: {G=6, B=6}. Expand G (goal reached; tie broken by goal).
Result
- Order of expansion: S → A → C → G
- Final path: S → A → C → G
- Total cost:
(a) Explain the resolution refutation procedure in propositional/first-order logic. List the steps to convert a first-order logic sentence into Conjunctive Normal Form (CNF). (7)
(b) Given the following statements:
- All dogs are animals.
- All animals breathe.
- Tommy is a dog.
Represent these in first-order predicate logic, convert them to clausal form, and use resolution to prove that "Tommy breathes." (7)
(a) Resolution Refutation
Resolution refutation is a sound and complete inference procedure that proves a goal from a knowledge base by showing that is unsatisfiable. The single inference rule, resolution, takes two clauses containing complementary literals and produces a new clause (the resolvent) by removing the complementary pair:
If repeated resolution derives the empty clause (, a contradiction), then .
Steps to Convert an FOL Sentence to CNF
- Eliminate implications/biconditionals: replace by .
- Move negation inwards (De Morgan's laws), converting to Negation Normal Form: , etc.
- Standardize variables apart so each quantifier uses a unique variable.
- Skolemize: remove existential quantifiers by introducing Skolem constants/functions.
- Drop universal quantifiers (all remaining variables are implicitly universally quantified).
- Distribute over to obtain a conjunction of clauses.
- Separate into clauses (the set of disjunctions).
(b) Proving "Tommy breathes"
FOL Representation
- All dogs are animals:
- All animals breathe:
- Tommy is a dog:
- Goal:
Clausal Form (CNF)
- Negated goal:
Resolution
| Step | Resolve | Substitution | Resolvent |
|---|---|---|---|
| 5 | (2) & (4) | ||
| 6 | (1) & (5) | ||
| 7 | (3) & (6) | — | (empty clause) |
The empty clause is derived, so is unsatisfiable. Therefore "Tommy breathes" is proved.
(a) Draw the structure of a single artificial neuron (perceptron) and explain the role of weights, bias, summation and activation function. Compare the sigmoid, ReLU and step activation functions. (7)
(b) Explain the backpropagation algorithm used to train a multilayer feed-forward neural network. State why a non-linear, differentiable activation function is required for backpropagation to work. (5)
(a) Single Artificial Neuron (Perceptron)
Structure (described): Inputs each enter through a weighted connection . A bias is added. A summation unit computes the net input, which is passed through an activation function to produce the output .
x1 --w1--\
x2 --w2---> ( Σ + b ) --> [ φ ] --> y
xn --wn--/
Roles:
- Weights (): strength/importance of each input; learned during training.
- Bias (): shifts the activation threshold, allowing the neuron to fire independently of the inputs.
- Summation: computes the weighted sum (net input) .
- Activation function (): introduces non-linearity and maps the net input to the output.
Comparison of Activation Functions
| Function | Formula | Range | Notes |
|---|---|---|---|
| Step | if else | {0,1} | Non-differentiable; used in original perceptron; no gradient |
| Sigmoid | (0,1) | Smooth, differentiable; suffers vanishing gradient & saturation | |
| ReLU | [0,∞) | Cheap, avoids vanishing gradient for positive input; can cause "dying ReLU" |
(b) Backpropagation Algorithm
Backpropagation trains a multilayer feed-forward network by gradient descent on the error, propagating the error backward from output to input layer:
- Initialize weights and biases randomly.
- Forward pass: present an input, compute activations layer by layer up to the output, obtaining predicted output .
- Compute error at the output, e.g. .
- Backward pass: compute the error gradient with respect to each weight using the chain rule, propagating the delta () terms from the output layer back through the hidden layers.
- Update weights: , where is the learning rate.
- Repeat over all training examples/epochs until the error converges.
Why a Non-linear, Differentiable Activation is Required
- Differentiable: backpropagation needs the derivative via the chain rule; a non-differentiable function (like the step) has no usable gradient.
- Non-linear: without non-linearity, a stack of layers collapses to a single linear transformation, so the network could not learn complex, non-linearly-separable patterns.
Section B: Short Answer Questions
Attempt all / any as specified.
Compare Breadth-First Search (BFS) and Depth-First Search (DFS) on the basis of completeness, optimality, time complexity and space complexity. State one situation where DFS is preferred over BFS.
BFS vs. DFS
Let = branching factor, = depth of the shallowest goal, = maximum depth of the search tree.
| Criterion | Breadth-First Search (BFS) | Depth-First Search (DFS) |
|---|---|---|
| Completeness | Complete (if finite) | Not complete (can loop / infinite depth); complete only on finite spaces |
| Optimality | Optimal if all step costs equal | Not optimal |
| Time complexity | ||
| Space complexity | — stores whole frontier | — only current path |
| Data structure | FIFO queue | LIFO stack |
Situation where DFS is preferred: When the search tree is very deep (or memory is limited) and solutions are dense/located deep in the tree — DFS uses far less memory ( vs. ), making it suitable for large state spaces where BFS would exhaust memory.
What is an expert system? Draw the architecture of a typical rule-based expert system and briefly explain the function of the knowledge base, inference engine and user interface. Differentiate between forward chaining and backward chaining.
Expert System
An expert system is an AI program that uses a knowledge base of human expertise and an inference mechanism to solve problems in a specific domain at the level of a human expert (e.g. MYCIN for medical diagnosis).
Architecture of a Rule-Based Expert System (described)
User <--> [User Interface] <--> [Inference Engine] <--> [Knowledge Base]
| ^
[Working Memory] [Knowledge Acquisition]
Components:
- Knowledge Base: stores domain knowledge as facts and IF–THEN production rules supplied by domain experts.
- Inference Engine: the reasoning component that applies the rules to the known facts (using forward or backward chaining) to derive new facts and conclusions.
- User Interface: allows the user to enter queries/facts and presents the system's conclusions and explanations in an understandable form.
Forward vs. Backward Chaining
| Forward Chaining | Backward Chaining |
|---|---|
| Data-driven: starts from known facts | Goal-driven: starts from a hypothesis/goal |
| Applies rules to derive new facts until goal is reached | Works backward to find facts that support the goal |
| Good when many facts lead to few conclusions (e.g. monitoring) | Good when there are few goals to test (e.g. diagnosis) |
| Uses modus ponens moving forward | Searches for rules whose conclusion is the goal |
Explain semantic networks and frames as techniques of knowledge representation. Represent the fact "A penguin is a bird that cannot fly but can swim" using a semantic network.
Semantic Networks and Frames
Semantic Network: A graphical knowledge representation where nodes represent objects/concepts and labelled directed arcs (edges) represent the relationships between them. Common relations are IS-A (class membership/inheritance) and HAS-A (property/part). Inheritance lets subclasses acquire the properties of their superclasses.
Frames: A frame is a structured record-like representation of a stereotyped object or situation. Each frame has slots (attributes) and fillers (slot values), which may include default values, constraints, and procedural attachments (if-needed/if-added demons). Frames support inheritance through is-a links and are convenient for representing structured, object-oriented knowledge.
Semantic Network for "A penguin is a bird that cannot fly but can swim"
Animal
^ is-a
Bird ---- can ----> Fly (general default for birds)
^ is-a
Penguin -- cannot --> Fly
-- can ----> Swim
Description of the network:
- Penguin --IS-A--> Bird --IS-A--> Animal (inheritance hierarchy).
- Bird --can--> Fly (default property of birds).
- Penguin --cannot--> Fly (an exception that overrides the inherited default).
- Penguin --can--> Swim (specific property of penguins).
This demonstrates default reasoning with exceptions: a penguin inherits being a bird/animal but overrides the "can fly" default.
Differentiate between supervised, unsupervised and reinforcement learning with one suitable application example of each. What is meant by overfitting in a learning model and how can it be reduced?
Types of Machine Learning
| Type | Description | Example Application |
|---|---|---|
| Supervised learning | Learns a mapping from inputs to outputs using labelled training data (input–output pairs) | Email spam classification; handwritten digit recognition |
| Unsupervised learning | Finds hidden structure/patterns in unlabelled data (clustering, association) | Customer segmentation; market-basket analysis |
| Reinforcement learning | An agent learns by trial-and-error from rewards/penalties while interacting with an environment | Game playing (e.g. AlphaGo); robot navigation |
Overfitting
Overfitting occurs when a model learns the training data too well — including its noise and random fluctuations — so it has very low training error but performs poorly on unseen test data (poor generalization). It usually arises from an overly complex model relative to the amount of data.
Ways to Reduce Overfitting
- More training data / data augmentation.
- Regularization (L1/L2 penalty), or dropout in neural networks.
- Cross-validation for model/hyperparameter selection.
- Simplify the model (fewer parameters/features); pruning decision trees.
- Early stopping during training.
Explain the hill-climbing search technique. Discuss the problems of local maxima, plateau and ridges encountered in hill climbing, and state one method to overcome each.
Hill-Climbing Search
Hill climbing is a local search / optimization technique that starts from an arbitrary solution and iteratively moves to a neighbouring state that has a better value of the objective (heuristic) function, until no neighbour is better. It is like climbing uphill always choosing the steepest ascent, keeping no record of past states (greedy, memory-efficient).
loop:
neighbor = highest-valued successor of current
if value(neighbor) <= value(current): return current
current = neighbor
Problems and Remedies
| Problem | Description | Method to Overcome |
|---|---|---|
| Local maximum | A peak higher than its neighbours but lower than the global maximum; algorithm halts there | Random-restart hill climbing (restart from random states) or simulated annealing |
| Plateau | A flat region where neighbours have equal value, giving no direction to move | Allow sideways moves (limited) or take a big jump to a distant state |
| Ridge | A sloped area where progress requires moving in a direction not available among the single-step neighbours | Move using a combination of directions / apply several operators at once |
These problems mean simple hill climbing is incomplete and non-optimal; stochastic variants and simulated annealing alleviate them.
List and briefly explain the major stages of Natural Language Processing (NLP): morphological analysis, syntactic analysis, semantic analysis and pragmatic analysis. Why is ambiguity a central challenge in NLP?
Stages of Natural Language Processing
- Morphological / Lexical Analysis: Breaks text into tokens (words) and analyzes word structure — roots, prefixes, suffixes, parts of speech. e.g. "unhappiness" → un + happy + ness.
- Syntactic Analysis (Parsing): Checks the grammatical structure of a sentence and builds a parse tree according to grammar rules; rejects sentences that are not grammatically valid (e.g. "boy the school to went").
- Semantic Analysis: Determines the literal meaning of the sentence by mapping syntactic structures to meaning representations and checking that the combination of words makes sense (e.g. rejecting "colourless green ideas" as meaningless).
- Pragmatic Analysis: Interprets the sentence in its real-world context, handling intentions, references and implied meaning (e.g. understanding "Can you pass the salt?" as a request, not a yes/no question).
(Discourse integration is sometimes listed between semantic and pragmatic stages to handle inter-sentence context/references.)
Why Ambiguity is a Central Challenge
Natural language is inherently ambiguous at every level — lexical (a word with multiple meanings, e.g. "bank"), syntactic (multiple parse trees, e.g. "I saw the man with the telescope"), semantic, and pragmatic/referential. A single sentence can therefore have many valid interpretations, and the correct one depends on context and world knowledge that is hard to encode. Resolving this ambiguity to pick the intended meaning is the core difficulty in NLP.
State the rules of inference: Modus Ponens, Modus Tollens and Universal Instantiation. Using suitable propositional examples, demonstrate the application of Modus Ponens and Modus Tollens.
Rules of Inference
1. Modus Ponens (affirming the antecedent):
If is true and is true, then is true.
2. Modus Tollens (denying the consequent):
If is true and is false, then is false.
3. Universal Instantiation:
From a universally quantified statement, we may infer the statement for any specific instance/constant in the domain.
Demonstrations
Modus Ponens:
- : "It is raining." : "The ground is wet."
- Premise 1: If it is raining, then the ground is wet ().
- Premise 2: It is raining ().
- Conclusion: The ground is wet (). ✓
Modus Tollens:
- Same rule: If it is raining, then the ground is wet ().
- Premise 2: The ground is not wet ().
- Conclusion: It is not raining (). ✓
Write short notes on any TWO of the following: (a) Turing Test (b) Means-Ends Analysis (c) Adversarial search and the Minimax algorithm (d) Fuzzy logic
Short Notes (any two)
(a) Turing Test
Proposed by Alan Turing (1950) as an operational test of machine intelligence (the "Imitation Game"). A human interrogator converses, via text, with two hidden parties — one human and one machine. If the interrogator cannot reliably distinguish the machine from the human, the machine is said to exhibit intelligent behaviour. It tests behavioural indistinguishability (NLP, knowledge, reasoning, learning) rather than internal mechanism.
(b) Means-Ends Analysis (MEA)
A problem-solving technique that combines forward and backward reasoning. It repeatedly: (1) compares the current state with the goal state to find the most significant difference, (2) selects an operator relevant to reducing that difference, and (3) applies it, recursively solving any sub-problem if the operator's preconditions are not met. Used in the GPS (General Problem Solver); effective for goal-directed planning.
(c) Adversarial Search and the Minimax Algorithm
Used for two-player, zero-sum games (e.g. chess, tic-tac-toe). One player (MAX) tries to maximize the score while the opponent (MIN) tries to minimize it. Minimax explores the game tree to a depth, evaluating terminal/leaf nodes, then backs values up: MAX nodes take the maximum of their children, MIN nodes take the minimum. The move leading to the best guaranteed value is chosen. Alpha-beta pruning improves efficiency by cutting off branches that cannot affect the result.
(d) Fuzzy Logic
An extension of classical (Boolean) logic that allows degrees of truth between 0 and 1 rather than strict true/false. Variables belong to fuzzy sets with membership functions (e.g. "tall" might have membership 0.8). It uses linguistic rules (IF temperature is high THEN fan is fast) and processes them via fuzzification, inference, and defuzzification. Widely used in control systems (washing machines, air conditioners) where reasoning under vagueness is needed.
Frequently asked questions
- Where can I find the BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) question paper 2079?
- The full BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) 2079 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
- Does the Artificial Intelligence (PU, CMP 346) 2079 paper come with solutions?
- Yes. Every question on this Artificial Intelligence (PU, CMP 346) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
- How many marks is the BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) 2079 paper?
- The BE Computer Engineering (Pokhara University) Artificial Intelligence (PU, CMP 346) 2079 paper carries 100 full marks and is meant to be completed in 180 minutes, across 12 questions.
- Is practising this Artificial Intelligence (PU, CMP 346) past paper free?
- Yes — reading and attempting this Artificial Intelligence (PU, CMP 346) past paper on Kekkei is completely free.