AI With ML (Unit-2)
AI With ML (Unit-2)
Sc(CA&IT)
M.Sc(CA&IT)
Sem – 9
Asst. Proffesor
Minhaz Modasiya
Mail: [email protected]
GROWMORE INSTITUTE OF M.SC(CA&IT)
www.growmore.ac.in
UNIT – II
Knowledge Representation
Humans are best at understanding, reasoning, and interpreting
knowledge. Human knows things, which is knowledge and as per their
knowledge they perform various actions in the real world. But how
machines do all these things comes under knowledge
representation and reasoning. Hence we can describe Knowledge
representation as following:
(i) Logic and theorem proving technique are monotonic in nature. The
derived axioms hold good under all circumstances. Real world is never
monotonic for information obtained is seldom complete.
(ii) Logic does not provide facilities for handling uncertainty. Every
information it deals has to be either correct or incorrect but never
partially.
(v) One major constraint in logic is that unless you are sure that a
solution exists. the search will not terminate. We will be going on adding
clause after clause but the solution will be still elusive.
(vi) Heuristics, which form the private knowledge of the experts are
difficult to be codified in logic.
Propositional Logic:
Propositional logic (PL) is the simplest form of logic where all the
statements are made by propositions. A proposition is a declarative
statement which is either true or false. It is a technique of knowledge
representation in logical and mathematical form.
Example:
1. a) It is Sunday.
2. b) The Sun rises from West (False proposition)
3. c) 3+3= 7(False proposition)
4. d) 5 is a prime number.
a. Atomic Propositions
b. Compound propositions
Example:
Example:
Predicate Logic:
ADVANTAGES:
DISADVANTAGES:
Frames:
A frame is a collection of data describing a particular aspect of the world,
including objects, events, and relations between them.
A frame is a data structure that represents a "snapshot" of the world at
a particular moment in time. It contains all of the information that an AI
system needs to know about the world in order to make decisions.
5. The fuzzy logic system: This type of AI uses a set of rules that are
not precise to make decisions.
Conceptual Dependency:
In 1977, Rogar C. Schank has developed a Conceptual Dependency
structure. The Conceptual Dependency is used to represent
knowledge of Artificial Intelligence. It should be powerful enough to
represent these concepts in the sentence of natural language. It states
that different sentence which has the same meaning should have some
unique representation. There are 5 types of states in Conceptual
Dependency:
1. Entities
2. Actions
3. Conceptual cases
4. Conceptual dependencies
5. Conceptual tense
Scripts:
A script is a structured representation describing a stereotyped
sequence of events in a particular context.
Scripts are used in natural language understanding systems to
organize a knowledge base in terms of the situations that the system
should understand. Scripts use a frame-like structure to represent the
commonly occurring experience like going to the movies eating in a
restaurant, shopping in a supermarket, or visiting an ophthalmologist.
A script is a structure that prescribes a set of circumstances that could
be expected to follow from one another. It is similar to a chain of
situations that could be anticipated. Like a script for a play, the script’s
structure is defined in terms of – (a) Actors (b) Roles (c) Props (d)
Scenes
Reasoning
The reasoning is the mental process of deriving logical conclusion and
making predictions from available knowledge, facts, and beliefs. Or we
can say, "Reasoning is a way to infer facts from existing data." It is a
general process of thinking rationally, to find valid conclusions.
Types of Reasoning
In artificial intelligence, reasoning can be divided into the following categories:
o Deductive reasoning
o Inductive reasoning
o Abductive reasoning
o Common Sense Reasoning
o Monotonic Reasoning
o Non-monotonic Reasoning
1. Deductive reasoning:
Deductive reasoning is deducing new information from logically related known
information. It is the form of valid reasoning, which means the argument's
conclusion must be true when the premises are true.
Example:
2. Inductive Reasoning:
Inductive reasoning is a form of reasoning to arrive at a conclusion using limited
sets of facts by the process of generalization. It starts with the series of specific
facts or data and reaches to a general statement or conclusion.
Example:
Premise: All of the pigeons we have seen in the zoo are white.
3. Abductive reasoning:
Abductive reasoning is a form of logical reasoning which starts with single or
multiple observations then seeks to find the most likely explanation or
conclusion for the observation.
Example:
Conclusion It is raining.
It relies on good judgment rather than exact logic and operates on heuristic
knowledge and heuristic rules.
Example:
The above two statements are the examples of common sense reasoning which a
human mind can easily understand and assume.
5. Monotonic Reasoning:
In monotonic reasoning, once the conclusion is taken, then it will remain the
same even if we add some other information to existing information in our
knowledge base. In monotonic reasoning, adding knowledge does not decrease
the set of prepositions that can be derived.
To solve monotonic problems, we can derive the valid conclusion from the
available facts only, and it will not be affected by new facts.
Example:
6. Non-monotonic Reasoning
In Non-monotonic reasoning, some conclusions may be invalidated if we add
some more information to our knowledge base.
Example: Let suppose the knowledge base contains the following knowledge:
Baye ̳s theorem:
Bayes theorem is also known as the Bayes Rule or Bayes Law. It is
used to determine the conditional probability of event A when event B
has already happened. The general statement of Bayes’ theorem is
“The conditional probability of an event A, given the occurrence of
another event B, is equal to the product of the event of B, given A and
the probability of A divided by the probability of event B.” i.e.
P(A|B) = P(B|A)P(A) / P(B)
where,
P(A) and P(B) are the probabilities of events A and B
P(A|B) is the probability of event A when event B happens
P(B|A) is the probability of event B when A happens.
Conditional Probability
The probability of an event A based on the occurrence of another
event B is termed conditional Probability. It is denoted as P(A|B) and
represents the probability of A when event B has already happened.
Joint Probability
When the probability of two more events occurring together and at the
same time is measured it is marked as Joint Probability. For two
events A and B, it is denoted by joint probability is denoted
as, P(A∩B).
Random Variables
Real-valued variables whose possible values are determined by
random experiments are called random variables. The probability of
finding such variables is the experimental probability.
where,
P(A) and P(B) are the probabilities of events A and B also P(B) is
never equal to zero.
P(A|B) is the probability of event A when event B happens
P(B|A) is the probability of event B when A happens.
Bayesian Network:
Bayesian belief network is key computer technology for dealing with
probabilistic events and to solve a problem which has uncertainty. We
can define a Bayesian network as:
Bayesian Network can be used for building models from data and
experts opinions, and it consists of two parts:
o Causal Component
o Actual numbers
Fuzzy Logic:
The 'Fuzzy' word means the things that are not clear or are vague. Sometimes,
we cannot decide in real life that the given problem or statement is either true
or false. At that time, this concept provides many values between the true and
false and gives the flexibility to find the best solution to that problem.
Fuzzy logic contains the multiple logical values and these values are the truth values of
a variable or problem between 0 and 1. This concept was introduced by Lofti
Zadeh in 1965 based on the Fuzzy Set Theory. This concept provides the possibilities
which are not given by computers, but similar to the range of possibilities generated by
humans.
In the Boolean system, only two possibilities (0 and 1) exist, where 1 denotes the
absolute truth value and 0 denotes the absolute false value. But in the fuzzy
system, there are multiple possibilities present between the 0 and 1, which are
partially false and partially true.
1. This concept is flexible and we can easily understand and implement it.
2. It is used for helping the minimization of the logics created by the human.
3. It is the best method for finding the solution of those problems which are
suitable for approximate or uncertain reasoning.
4. It always offers two values, which denote the two possible solutions for a
problem and statement.
5. It allows users to build or create the functions which are non-linear of arbitrary
complexity.
6. In fuzzy logic, everything is a matter of degree.
7. In the Fuzzy logic, any system which is logical can be easily fuzzified.
8. It is based on natural language processing.
9. It is also used by the quantitative analysts for improving their algorithm's
execution.
10. It also allows users to integrate with the programming.
1. Rule Base
2. Fuzzification
3. Inference Engine
4. Defuzzification
1. Rule Base
Rule Base is a component used for storing the set of rules and the If-Then
conditions given by the experts are used for controlling the decision-making
systems. There are so many updates that come in the Fuzzy theory recently,
which offers effective methods for designing and tuning of fuzzy controllers.
These updates or developments decreases the number of fuzzy set of rules.
2. Fuzzification
Fuzzification is a module or component for transforming the system inputs, i.e.,
it converts the crisp number into fuzzy steps. The crisp numbers are those inputs
which are measured by the sensors and then fuzzification passed them into the
control systems for further processing. This component divides the input signals
into following five states in any Fuzzy Logic system:
3. Inference Engine
This component is a main component in any Fuzzy Logic system (FLS), because
all the information is processed in the Inference Engine. It allows users to find
the matching degree between the current fuzzy input and the rules. After the
matching degree, this system determines which rule is to be added according to
the given input field. When all rules are fired, then they are combined for
developing the control actions.
4. Defuzzification
Defuzzification is a module or component, which takes the fuzzy set inputs
generated by the Inference Engine, and then transforms them into a crisp
value. It is the last step in the process of a fuzzy logic system. The crisp value is
a type of value which is acceptable by the user. Various techniques are present
to do this, but the user has to select the best one for reducing the errors.
Game Playing:
Game Playing is an important domain of artificial intelligence. Games
don’t require much knowledge; the only knowledge we need to provide is
the rules, legal moves and the conditions of winning or losing the game.
Both players try to win the game. So, both of them try to make the best
move possible at each turn. Searching techniques like BFS(Breadth First
Search) are not accurate for this as the branching factor is very high, so
searching will take a lot of time. So, we need another search procedures
that improve –
Generate procedure so that only good moves are generated.
Test procedure so that the best move can be explored first.
Game playing is a popular application of artificial intelligence that
involves the development of computer programs to play games, such as
chess, checkers, or Go. The goal of game playing in artificial intelligence
is to develop algorithms that can learn how to play games and make
decisions that will lead to winning outcomes.
One of the earliest examples of successful game playing AI is the
chess program Deep Blue, developed by IBM, which defeated the
world champion Garry Kasparov in 1997. Since then, AI has been
applied to a wide range of games, including two-player games,
multiplayer games, and video games.
Planning Techniques:
Artificial intelligence is an important technology in the future. Whether it is
intelligent robots, self-driving cars, or smart cities, they will all use different
aspects of artificial intelligence!!! But Planning is very important to make any
such AI project.
What is a Plan?
We require domain description, task specification, and goal description for any
planning system. A plan is considered a sequence of actions, and each action
has its preconditions that must be satisfied before it can act and some effects
that can be positive or negative.
So, we have Forward State Space Planning (FSSP) and Backward State Space
Planning (BSSP) at the basic level.
o The non-interlaced planners of the early 1970s were unable to solve this
problem. Therefore it is considered odd.
o When two sub-goals, G1 and G2, are given, a non-interleaved planner either
produces a plan for G1 that is combined with a plan for G2 or vice versa.
o In the block-world problem, three blocks labeled 'A', 'B', and 'C' are allowed to
rest on a flat surface. The given condition is that only one block can be moved at
a time to achieve the target.
The start position and target position are shown in the following diagram.
o Choose the best rule to apply the next rule based on the best available
guess.
o Apply the chosen rule to calculate the new problem condition.
o Find out when a solution has been found.
o Detect dead ends so they can be discarded and direct system effort in
more useful directions.
o Find out when a near-perfect solution is found.