Ai Imp-1
Ai Imp-1
Ans:
Artificial Intelligence:
Artificial intelligence is the simulation of human intelligence processes by machines, especially computer
systems. Specific applications of AI include expert systems, natural language processing, speech
recognition and machine vision.
Main Branches of Artificial Intelligence:
1. Machine Learning: It is one of the most demanding disciplines in advanced technology, and it
generates a lot of excitement every time a new product is released by a firm that uses ML
techniques and algorithms to serve the consumer uniquely.
a. Supervised Learning: Data professionals input labelled training data to algorithms and
establish variables for accessing and detecting correlations in this form of learning. The
algorithm's input and output are both specific/defined. this is the second branches of Artificial
intelligence.
b. Unsupervised Learning: Algorithms that train on unlabeled data analyze datasets to generate
meaningful connections or inferences are examples of this form of learning.
c. Reinforcement Learning: Reinforcement learning is used to educate a computer machine on
how to complete a multi-step process with clearly stated rules.
2. Neural Network: The neural network is a kind of artificial intelligence that uses neurology to
complete tasks while incorporating cognitive science and machinery. In simple terms, a neural
network is a set of algorithms that are used to uncover elemental links across large amounts of data
using a technique that mimics the human brain's operation.
3. Robotics: The design and construction of robots is a fascinating area of research and development.
a. Robotics is a multidisciplinary science and engineering field that includes mechanical
engineering, electrical engineering, computer science, and a variety of other disciplines.
b. Robotics is the science that governs how robots are designed, manufactured, operated, and
used. It deals with the control, intelligent results, and data transformation of computer
systems.
4. Expert Systems: Expert systems were among the earliest effective AI software models. They were
first designed in the 1970s and then increased in the 1980s. This is accomplished by drawing
knowledge from its knowledge base and applying reasoning and insights rules to the user's queries.
The expert system's efficiency is entirely dependent on the expert's knowledge, which is stored in a
knowledge base.
5. Fuzzy Logic: Where it is difficult to determine if a condition is true or false; its fuzzy logic allows for
significant flexibility in reasoning, which leads to mistakes and uncertainties in every situation. Fuzzy
logic, to put it another way, is a strategy for representing and modifying ambiguous information by
determining the degree to which the hypothesis is right.
6. Natural Language Processing: NLP is a branch of computer science and artificial intelligence that
allows computers and humans to communicate using natural language. It's a method of analyzing
human languages using computers. By simulating human natural language, it allows a machine to
comprehend and understand data.
Que2: Show that “If you into the sky and I am alert then, I will see a dim star or if I am not alert then I
will not see a dim star” is valid.
Ans:
Sol: Let us symbolize the statements by using propositional atoms.
P : If you into the sky.
Q : I am alert
R : I will see a dim star.
Formula corresponding to a text:
Ɑ: ((P ⋀ Q)→ R)⋁ (~Q→~R)
Truth Table:
T T T F F T T T T
T T F F T T F T T
T F T T F F T F T
T F F T T F T T T
F T T F F F T T T
F T F F T F T T T
F F T T F F T F T
F F F T T F T T T
This model takes direct feedback to check the correct This model does not take any feedback.
output or not.
It predicts the output. It finds the hidden patterns in data.
Input data is provided to the model along with the only input data is provided to the model.
output.
The goal of supervised learning is to train the model The goal of unsupervised learning is to find the
so that it can predict the output in given data. hidden patterns from unknown dataset.
It needs supervision to train the model. Does not need any supervision to train the model.
Categorize into Classification and Regression Clustering and Associations problems.
problems.
It’s used for those cases where we know the input as only know the input not output data.
well as corresponding outputs.
It includes various algorithms such as Linear It includes various algorithms such as Clustering,
Regression, Logistic ,Support, Vector Machine, KNN, and Apriori algorithm.
Bayesian Logic, etc.
Que7: The values of independent variable x and dependent variable y are given below.
x 0 1 2 3 4
y 2 3 5 4 6
Find the least square regression line y=ax+b. Estimate The Value Of Y When x is 10.
Ans:
a)
x y xy x2
0 2 0 0
1 3 3 1
2 5 10 4
3 4 12 9
4 6 24 16
∑x=10 ∑y=20 ∑xy=49 ∑x2=30
We now calculate a and b using the least square regression formulas for a and b.
a = (nΣx*y - Σx*Σy) / (nΣx2 - (Σx)2) = (5*49 - 10*20) / (5*30 - 102) = 0.9
b = (1/n)(Σy - a*Σx) = (1/5)(20 - 0.9*10) = 2.2
b) Now that we have the least square regression line y = 0.9 x + 2.2, substitute x by 10 to find the value of
the corresponding y.
y = 0.9 * 10 + 2.2 = 11.2
Que8: The values of independent variable x and dependent variable y are given below.
x 0 1 2 3 4
y 2 3 5 6 6
Find the least square regression line y=ax+b. Estimate The Value Of Y When x is 10.
Ans:
a)
x y xy x2
0 2 0 0
1 3 3 1
2 5 10 4
3 6 18 9
4 6 24 16
∑x=10 ∑y=22 ∑xy=52 ∑x2=30
We now calculate a and b using the least square regression formulas for a and b.
a = (nΣx*y - Σx*Σy) / (nΣx2 - (Σx)2) = (5*52 - 10*22) / (5*30 - 102) = 0.8
b = (1/n)(Σy - a*Σx) = (1/5)(22 - 0.8*10) = 2.8
b) Now that we have the least square regression line y = 0.8 x + 2.8, substitute x by 10 to find the value of
the corresponding y.
y = 0.8 * 10 + 2.8 = 10.8
Que9: To evaluate the performance of a trained model confusion matrix plotted which is given
below.
0 1
0 61 3
1 3 104
Ans:
↓ ACTUAL
TP FP
Predict→
FN TN
Que12: Define machine learning? Briefly explain the types of machine learning.
Ans:
Machine Learning:Machine learning is a subset of AI, which enables the machine to automatically learn
from data, improve performance from past experiences, and make predictions.
Types of Machine Learning:
1. Supervised Learning: Supervised learning technique, we train the machines using the "labelled"
dataset, and based on the training, the machine predicts the output.Supervised machine learning
can be classified into two types of problems, which are given below:
● Classification
● Regression
2. Unsupervised ML: In unsupervised learning, the models are trained with the data that is neither
classified nor labelled, and the model acts on that data without any supervision.Unsupervised
Learning can be further classified into two types, which are given below:
● Clustering
● Association
3. Semi-Supervised Learning: Semi-Supervised learning is a type of Machine Learning algorithm that
lies between Supervised and Unsupervised machine learning.
4. Reinforcement Learning: Reinforcement learning works on a feedback-based process, in which an
AI agent (A software component) automatically explore its surrounding by hitting & trail, taking
action, learning from experiences, and improving its performance. Reinforcement learning is
categorized mainly into two types of methods/algorithms:
● Positive Reinforcement Learning
● Negative Reinforcement Learning
Que18: Find the least square regression line for the following dataset.
X 2 2 6 8 10
Y 0 1 2 3 3
Ans:
Sol:
x y x2 xy
2 0 4 0
2 1 4 2
6 2 36 12
8 3 64 24
10 3 100 30
2
∑x=28 ∑y=9 ∑x =208 ∑xy=68
In the last line of the table we have the sum of the numbers in each column. Using them we compute:
The errors in fitting data with the least squares regression line.