0% found this document useful (0 votes)
3 views7 pages

Seesional Solution,.. AI

The document provides a comprehensive overview of key concepts in artificial intelligence and machine learning, including definitions of local and global maxima, goal and problem formulation, various algorithm techniques, and classification models. It discusses the advantages of Random Forest over SVM, describes Linear Discriminant Analysis and Linear Regression, and explains the Random Forest algorithm in detail. Additionally, it covers AI agents, search algorithms like Breadth First Search, and provides a solution to the 8-puzzle problem using Depth First Search.

Uploaded by

Mohammed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Seesional Solution,.. AI

The document provides a comprehensive overview of key concepts in artificial intelligence and machine learning, including definitions of local and global maxima, goal and problem formulation, various algorithm techniques, and classification models. It discusses the advantages of Random Forest over SVM, describes Linear Discriminant Analysis and Linear Regression, and explains the Random Forest algorithm in detail. Additionally, it covers AI agents, search algorithms like Breadth First Search, and provides a solution to the 8-puzzle problem using Depth First Search.

Uploaded by

Mohammed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q1.

Short and precise answers (1 Mark each)

a) What is local maximum and global maximum?

• Local Maximum: A point in the search space that is higher (better) than all its immediate neighbors but
not necessarily the highest in the entire domain.

• Global Maximum: The absolute highest point in the entire search space, representing the best possible
solution for the objective function.

b) Define the terms goal formulation and problem formulation.

• Goal Formulation: The process of deciding what we want to achieve (the objective or destination).

• Problem Formulation: The process of deciding how to achieve the goal by defining the states, actions,
and transitions (the search space) to be considered.

c) Write four different Algorithm techniques in Machine Learning.

1. Supervised Learning

2. Unsupervised Learning

3. Semi-supervised Learning

4. Reinforcement Learning

(Alternatively: Regression, Classification, Clustering, Dimensionality Reduction)

d) What are types of classification models?

The two main types of classification models are:

1. Binary Classification: Classifying data into two distinct classes (e.g., Spam vs. Not Spam).

2. Multi-class Classification: Classifying data into three or more classes (e.g., recognizing handwritten
digits 0-9).

(Note: One could also categorize them as Generative vs. Discriminative models).

e) Why is Random Forest better than SVM?

Random Forest is generally considered "better" in practical scenarios because it is more robust to outliers and
noise, handles missing data well, and requires less data preprocessing (like scaling/normalization) compared
to SVM.
Q2. Descriptive Questions (6 Marks each)

a) Describe Linear Discriminant Analysis (LDA) for classification problem.

Linear Discriminant Analysis (LDA) is a supervised dimensionality reduction and classification technique.

• Objective: The primary goal of LDA is to project a dataset onto a lower-dimensional space with good
class-separability in order to avoid overfitting ("curse of dimensionality") and reduce computational
costs.

• Core Principle: LDA tries to find a linear combination of features that separates two or more classes of
objects or events. Ideally, it seeks to:

1. Maximize the distance between means of different classes (Maximize "Between-class


Variance", $S_B).

2. Minimize the variation (scatter) within each class (Minimize "Within-class Variance", S(w).
𝑆(𝐵)
• Fisher’s Criterion: The optimal projection is found by maximizing the 𝐽(𝑤) = 𝑆(𝑤)

• Assumptions: LDA assumes that the data is normally distributed (Gaussian) and that each class has
identical covariance matrices.

• Application: It is widely used in pattern recognition, such as face recognition and medical disease
classification.

b) Describe linear regression model and discuss its limitations.

Linear Regression Model:

Linear Regression is a statistical method for modeling the relationship between a dependent variable (target, y)
and one or more independent variables (features,x).

• Goal: The algorithm aims to find the "Line of Best Fit" that minimizes the sum of squared differences
(residuals) between the observed values and the predicted values.

Limitations of Linear Regression:

1. Assumption of Linearity: It assumes a straight-line relationship between variables. If the relationship


is curved or complex, linear regression will underfit the data.

2. Sensitive to Outliers: A single outlier can significantly pull the regression line, leading to inaccurate
predictions.

3. Multicollinearity: If independent variables are highly correlated with each other, it becomes difficult to
determine the individual effect of each variable.

4. Homoscedasticity: It assumes constant variance of errors. If the variance changes (e.g., errors
increase as $x$ increases), the model becomes unreliable.
Q3. Descriptive Questions (6 Marks each)

a) Describe Random Forest algorithm in machine learning.

Random Forest is an ensemble learning method used for both classification and regression. It operates by
constructing a multitude of decision trees at training time.

• Ensemble Method (Bagging): Random Forest is based on "Bagging" (Bootstrap Aggregating). It creates
multiple subsets of the original dataset (with replacement).

• How it works:

1. Bootstrapping: Several random samples of data are taken from the training set.

2. Tree Construction: A Decision Tree is built for each sample. However, unlike a standard tree, at
each node split, the algorithm only considers a random subset of features (not all features). This
decorrelates the trees.

3. Aggregation:

▪ For Classification: The algorithm uses "Majority Voting." The class predicted by the
most trees becomes the final output.

▪ For Regression: It takes the average (mean) of the predictions from all the individual
trees.

• Key Advantage: By averaging multiple trees, Random Forest reduces the high variance (overfitting)
typically seen in single decision trees, making the model more robust and accurate.

b) Discuss, When would you prefer Random Forest over SVM?

While both Support Vector Machines (SVM) and Random Forests (RF) are powerful classifiers, you would prefer
Random Forest in the following scenarios:

1. Large Datasets: SVMs (especially with non-linear kernels) generally have a time complexity of O(n2) or
O(n3), making them very slow on large datasets. Random Forests are faster to train and scale better with
large data.

2. Handling Missing Data & Outliers: Random Forest handles missing values effectively and is robust to
outliers. SVM is very sensitive to noise and outliers, which can shift the hyperplane significantly.

3. No Need for Feature Scaling: SVM requires feature scaling (normalization/standardization) because it
calculates distances. Random Forest is based on partitioning data (rules), so the scale of variables
does not affect the model.

4. Interpretability (Feature Importance): If you need to know which features are driving the decision,
Random Forest provides a clear "Feature Importance" score. SVMs are often "black boxes" where
interpreting the weights of a non-linear kernel is difficult.

5. Mixed Data Types: If your dataset contains a mix of categorical and numerical variables, Random
Forest handles them naturally. SVMs strictly require numerical input and one-hot encoding for
categorical data, which increases dimensionality.
Sessonal -1
Based on the examination paper provided, here are the solutions to the questions.

Q1. Short and precise answer of following questions (1 Mark each)

a) What is meant by Artificial Intelligence?

Artificial Intelligence (AI) is a branch of computer science concerned with creating systems that can perform
tasks typically requiring human intelligence, such as visual perception, speech recognition, decision-making,
and language translation.

b) Blind Search is used for which situations?

Blind search (or uninformed search) is used in situations where there is no domain-specific knowledge
available about the cost or distance from the current state to the goal (e.g., searching a maze without a map).

c) What is an agent in AI?

An agent is any entity that perceives its environment through sensors and acts upon that environment through
actuators to achieve specific goals.

d) List properties of Environment.

Common properties of an environment include:

• Fully Observable vs. Partially Observable

• Deterministic vs. Stochastic

• Static vs. Dynamic

• Discrete vs. Continuous

• Episodic vs. Sequential

e) Define Procedural Domain Knowledge in a rule-based AI system.

Procedural domain knowledge refers to knowledge about "how to do" something. In rule-based systems, this is
typically encoded as production rules (If-Then rules) that dictate what actions to take when specific conditions
are met.

f) Describe a deterministic environment.

A deterministic environment is one where the next state of the environment is completely determined by the
current state and the action executed by the agent, with no randomness or uncertainty involved.

Q2. Describe following AI Agents with an example. Discuss their limitations (6 Marks each)

a) Goal-based Agents

• Description: Goal-based agents utilize knowledge about the current state of the world and a set of
goals (desirable situations) to decide their actions. Unlike reflex agents, they consider the future
consequences of their actions ("What will happen if I do X?") to plan a sequence of steps that reaches
the goal.

• Example: A GPS Navigation System. It has a goal (reach a destination) and a model of the map. It
searches for a path (sequence of turns) that transitions the car from the current location to the goal
location.

• Limitations:
o Computationally Expensive: Searching and planning for a goal can be slow in complex
environments.

o Requires Accurate Model: If the internal model of the world is incorrect (e.g., map is outdated),
the plan may fail.

b) Model-based Reflex Agents

• Description: These agents maintain an internal state (a model) that keeps track of aspects of the
world that they cannot currently see. This allows them to handle partial observability. The agent
combines its current percept with its internal state to determine the best action based on rules.

• Example: A Self-Driving Car at a blinking traffic light. Even if the light blinks "off" for a split second, the
agent remembers (via its internal model) that the light was red a moment ago and decides to remain
stopped.

• Limitations:

o Local Scope: It still acts primarily on rules (reflexes) rather than planning far ahead.

o Memory Overhead: Maintaining a history/state requires memory, and if the environment is


highly dynamic, the model can become outdated quickly.

Q3. Descriptive Questions (6 Marks each)

a) Describe Breadth First Search algorithm. Discuss its merits and limitations.

• Description: Breadth First Search (BFS) is an uninformed search algorithm that explores all the
neighbor nodes at the present depth level before moving on to nodes at the next depth level. It typically
uses a FIFO (First-In-First-Out) Queue data structure.

• Merits:

o Completeness: If a solution exists, BFS is guaranteed to find it.

o Optimality: BFS finds the shallowest (shortest path) solution if all step costs are equal.

• Limitations:

o High Memory Consumption: It must store all nodes at the current level to generate the next
level. The space complexity is $O(b^d)$ (exponential).

o High Time Complexity: It may visit a vast number of nodes before finding a deep solution.

b) For the 8-puzzle problem given below find a solution using DFS (Depth First Search) technique.

• Initial State: [[2, 5, _], [1, 4, 8], [7, 3, 6]]

• Final State: [[1, 2, 3], [4, 5, 6], [7, 8, _]]

Solution Path (Step-by-Step moves of the Blank Space):

Note: DFS explores deep paths. Below is a valid sequence of moves (a branch of the DFS tree) that solves the
puzzle.

Step 0 (Initial):

25_

148

736
Step 1: Move Left (Swap 5)

2_5

148

736

Step 2: Move Left (Swap 2)

_25

148

736

Step 3: Move Down (Swap 1)

125

_48

736

Step 4: Move Right (Swap 4)

125

4_8

736

(At this stage, 1, 2, 4 are in correct positions relative to the goal).

Step 5: Move Down (Swap 3)

125

438

7_6

Step 6: Move Right (Swap 6)

125

438

76_

Step 7: Move Up (Swap 8)

125

43_

768

Step 8: Move Left (Swap 3)

125

4_3

768

Step 9: Move Up (Swap 5)


12_

453

768

Step 10: Move Down (Swap 3)

123

45_

768

Step 11: Move Down (Swap 8)

123

458

76_

Step 12: Move Left (Swap 6)

123

458

7_6

Step 13: Move Up (Swap 5) -> DFS continues...

(The DFS would continue swapping tiles until the configuration 1 2 3 / 4 5 6 / 7 8 _ is reached).

You might also like