Unit 1 AI
Unit 1 AI
● Learning. This aspect of AI programming focuses on acquiring data and creating rules for how to turn it
into actionable information. The rules, which are called algorithms, provide computing devices with
step-by-step instructions for how to complete a specific task.
● Reasoning. This aspect of AI programming focuses on choosing the right algorithm to reach a desired
outcome.
● Self-correction. This aspect of AI programming is designed to continually fine-tune algorithms and ensure
they provide the most accurate results possible.
● Creativity. This aspect of AI uses neural networks, rules-based systems, statistical methods and other AI
techniques to generate new images, new text, new music and new ideas.
Strong AI vs. weak AI
AI can be categorized as weak or strong.
● Weak AI, also known as narrow AI, is designed and trained to complete a specific task.
Industrial robots and virtual personal assistants, such as Apple's Siri, use weak AI.
● Strong AI, also known as artificial general intelligence (AGI), describes programming that
can replicate the cognitive abilities of the human brain. When presented with an unfamiliar
task, a strong AI system can use fuzzy logic to apply knowledge from one domain to
another and find a solution autonomously. In theory, a strong AI program should be able
○ Atomic sentences are the most basic atomic sentences using connectives.
sentences of first-order logic. These First-order logic statements can be divided into two
parts:
sentences are formed from a predicate
○ Subject: Subject is the main part of the
symbol followed by a parenthesis with
statement.
a sequence of terms. ○ Predicate: A predicate can be defined as a
○ We can represent atomic sentences as relation, which binds two atoms together in a
statement.
Predicate (term1, term2, ......, term n).
Consider the statement: "x is an integer.", it consists
Example: Ravi and Ajay are brothers: => of two parts, the first part x is the subject of the
statement and second part "is an integer," is known
Brothers(Ravi, Ajay). as a predicate.
Chinky is a cat: => cat (Chinky).
Quantifiers in First-order logic:
○ A quantifier is a language element which generates quantification, and quantification specifies the quantity of
specimen in the universe of discourse.
○ These are the symbols that permit to determine or identify the range and scope of the variable in the logical
expression. There are two types of quantifier:
a. Universal Quantifier, (for all, everyone, everything)
b. Existential quantifier, (for some, at least one).
Universal Quantifier:
Universal quantifier is a symbol of logical representation, which specifies that the statement within its range is true for
everything or every instance of a particular thing.
○ For all x
○ For each x
○ For every x.
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement within its scope is true for at least one
instance of something.
It is denoted by the logical operator ∃, which resembles as inverted E. When it is used with a predicate variable then it is
called as an existential quantifier.
If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
1. Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal.
2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction, where P and Q are the
propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can
be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
Procedural knowledge
Examples of procedural language
Declarative knowledge
Examples of declarative knowledge
Difference between procedural & declarative knowledge
Logic programming
● Prolog is a logic programming language. It has important role in artificial intelligence.
● Unlike many other programming languages, Prolog is intended primarily as a declarative programming
language.
● In prolog, logic is expressed as relations (called as Facts and Rules).
● In prolog, We declare some facts. These facts constitute the Knowledge Base of the system. We can query
against the Knowledge Base.
● We get output as affirmative if our query is already in the knowledge Base or it is implied by Knowledge
Base, otherwise we get output as negative.
● So, Knowledge Base can be considered similar to database, against which we can query. Prolog facts are
expressed in definite pattern. Facts contain entities and their relation. Entities are written within the
parenthesis separated by comma (, ). Their relation is expressed at the start and outside the parenthesis.
● Every fact/rule ends with a dot (.). So, a typical prolog fact goes as follows :
Advantages :
1. LISP (another logic programming language) dominates over prolog with respect to I/O features.
2. Sometimes input and output is not easy.
Applications :
Prolog is highly used in artificial intelligence(AI). Prolog is also used for pattern matching over
natural language parse trees.
Mathematical foundations: Matrix Theory and Statistics for Machine Learning.
Matrix Theory:
Population:
In statistics, the population comprises all observations (data points) about the subject under study.
An example of a population is studying the voters in an election. In the 2019 Lok Sabha elections, nearly 900 million
voters were eligible to vote in 543 constituencies.
Sample:
In statistics, a sample is a subset of the population. It is a small portion of the total observed population.
Measures of central tendency are the measures that are used to describe the distribution of data using a
single value. Mean, Median and Mode are the three measures of central tendency.
Mean:
The arithmetic mean is the average of all the data points.
If there are n number of observations and xi is the ith observation, then mean is:
Median:
Median is the middle value that divides the data into two equal parts once it sorts the data in ascending order.
If the total number of data points (n) is odd, the median is the value at position (n+1)/2.
When the total number of observations (n) is even, the median is the average value of observations at n/2 and
(n+2)/2 positions.
The median() function in Python can help you find the median value of a column. From the above data
frame, you can find the median salary as:
Mode:
The mode is the observation (value) that occurs most
frequently in the data set. There can be over one mode in a
dataset.
155, 157, 160, 159, 162, 160, 161, 165, 160, 158
The mode salary from the data frame can be calculated as:
Variance and Standard Deviation
Variance is used to measure the variability in the data from the mean.
Thank you…