0% found this document useful (0 votes)
8 views4 pages

C073 AI Assignment2

Uploaded by

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

C073 AI Assignment2

Uploaded by

Viha Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment 2

1. Explain Constraint Satisfaction Problems (CSP).

Definition and Principles: Constraint Satisfaction Problems (CSPs) are mathematical


problems defined as a set of objects whose state must satisfy several constraints and
restrictions. A CSP consists of:

 Variables: The elements that need to be assigned values.


 Domains: The possible values that can be assigned to each variable.
 Constraints: Restrictions on the values that variables can take simultaneously.

Solving Techniques:

 Backtracking Search: This is a depth-first search approach where variables are


assigned values one at a time. If a variable assignment violates a constraint, the
algorithm backtracks to try a different assignment.

Example: In the classic "N-Queens" problem, the objective is to place N queens on


an N×N chessboard so that no two queens threaten each other. The backtracking
algorithm would attempt to place a queen in one column, check for conflicts, and
backtrack if a conflict arises.

 Local Search Techniques: These involve starting with an initial solution and
iteratively improving it by making local changes. Techniques like hill climbing or
simulated annealing can be used.

Example: In a scheduling problem, a local search may start with an initial schedule
and iteratively swap tasks between two time slots to reduce conflicts.

2. Describe the Backtracking Search for CSPs.

Efficiency Improvements:

 Variable Ordering: Selecting the order in which variables are assigned can
significantly impact efficiency. Choosing the most constrained variable (the one
with the fewest legal values) first can lead to quicker failures and less backtracking.
 Value Ordering: Prioritizing values that are likely to lead to a solution can also
enhance efficiency. Using heuristics, like trying the least constraining values first,
can help.

Constraint Propagation and Intelligent Backtracking:

 Constraint Propagation: This technique reduces the domains of variables based on


constraints, simplifying the problem before search begins. For example, if two
variables are constrained to different values, knowing one variable's value can
reduce the possibilities for the other.
 Intelligent Backtracking: This goes beyond simple backtracking by remembering
previously failed assignments and using this information to avoid similar failures in
the future, improving overall efficiency.

3. What is Inductive Learning?

Definition and Types of Learning: Inductive learning involves inferring general principles
from specific examples. Common types include:

 Supervised Learning: The model is trained on labeled data (input-output pairs).


 Unsupervised Learning: The model works with unlabeled data to find patterns.
 Reinforcement Learning: The model learns through feedback from actions taken in
an environment.

Decision Tree Classification: In supervised learning, decision trees classify data by


recursively splitting it based on feature values.

Example: Consider a dataset predicting whether a person buys a product based on age and
income. A simple decision tree might have:

 If age < 30, then classify as "No"


 If age ≥ 30 and income > 50k, then classify as "Yes"
 If age ≥ 30 and income ≤ 50k, then classify as "Maybe"

4. Explain K-Means Clustering in Unsupervised Learning.

K-Means Clustering is an unsupervised learning algorithm used to group data points into a
predefined number of clusters (K). The main objective is to partition the dataset into K
clusters, where each data point belongs to the cluster with the nearest mean (centroid),
minimizing the variance within each cluster.

Steps Involved in the K-Means Clustering Algorithm:

1. Initialization:
o Select K initial centroids randomly from the dataset.

2. Assignment Step:
o Assign each data point to the nearest centroid based on the Euclidean
distance.

3. Update Step:
o Calculate the new centroids by taking the mean of all data points assigned to
each centroid.

4. Convergence Check:
o Check if the centroids have changed. If they have not changed significantly
(or a maximum number of iterations is reached), the algorithm converges and
stops; otherwise, repeat steps 2 and 3.

Example of K-Means Clustering:

Dataset: Consider a simple dataset of points representing customers based on their spending
and income.

Customer Income Spending


1 15,000 500
2 20,000 700
3 25,000 800
4 30,000 1,200
5 35,000 1,500

Steps:

1. Initialization: Randomly select K=2 centroids. For example, (15,000, 500) and
(35,000, 1,500).
2. Assignment:
o Assign each customer to the nearest centroid.

3. Update:
o Calculate new centroids:
 Centroid 1: Mean of points assigned to it.
 Centroid 2: Mean of points assigned to it.

4. Convergence Check: Repeat steps 2 and 3 until centroids do not change


significantly.

After several iterations, you might end up with two clusters of customers based on their
income and spending habits, which can be used for targeted marketing strategies.

5. What is an Expert System?

Definition: An expert system is a computer program that simulates the decision-making


ability of a human expert. It uses a knowledge base and inference rules to solve specific
problems within a particular domain.

Architecture of an Expert System:

1. Knowledge Base:
o Contains domain-specific knowledge, facts, and rules. It is the
core of the expert system.

2. Inference Engine:
o The processing unit that applies logical rules to the knowledge
base to deduce new information or make decisions.

3. User Interface:
o The means through which users interact with the expert system. It
allows users to input data and receive advice or recommendations.

4. Explanation Facility:
o Provides users with insights into the reasoning process of the
system, explaining how conclusions were reached.

5. Knowledge Acquisition Module:


o Helps in updating and refining the knowledge base, often
requiring input from human experts.

Limitations of Expert Systems:

 Limited Knowledge: They only work well within their predefined


knowledge base and may struggle with novel or unforeseen scenarios.
 Lack of Common Sense: Expert systems lack human intuition and
cannot handle ambiguous situations effectively.
 Maintenance: Keeping the knowledge base up to date can be
challenging and time-consuming.
 High Development Cost: Developing an expert system requires
significant time and expertise.

Real-World Applications:

1. Medical Diagnosis: Systems like MYCIN assist doctors in diagnosing


infections and recommending treatments based on symptoms.
2. Financial Services: Expert systems can evaluate loan applications by
assessing various risk factors.
3. Manufacturing: Systems can control production processes and monitor
equipment performance, ensuring optimal operations.

You might also like