Professional Documents
Culture Documents
Introduction To Artifical Intelligence
Introduction To Artifical Intelligence
Introduction To Artifical Intelligence
• Uniprocessor
• Multiprocessor
• Special Purpose Processor
• Array Processor
• Vector Processor
• Parallel Processor
• Distributed Processor
Software Components
• Machine Language
• Assembly language
• High level Language
• LISP Language
• Fourth generation Language
• Object Oriented Language
• Distributed Language
• Natural Language
• Particular Problem Solving Language
Definition of Artificial intelligence
• AI is the study of how to make computers do things which at the moment people do
better. This is ephemeral as it refers to the current state of computer science and it
excludes a major area ; problems that cannot be solved well either by computers or
by people at the moment.
• AI is a field of study that encompasses computational techniques for performing
tasks that apparently require intelligence when performed by humans.
• AI is the branch of computer science that is concerned with the automation of
intelligent behavior. A I is based upon the principles of computer science namely
data structures used in knowledge representation, the algorithms needed to apply
that knowledge and the languages and programming techniques used in their
implementation.
• AI is the field of study that seeks to explain and emulate intelligent behavior in
terms of computational processes.
• AI is about generating representations and procedures that automatically or
autonomously solve problems heretofore solved by humans.
Applications Area of AI
Importance of AI
Game Playing : Brute force based on positions.
Speech Recognition
Understanding Natural Language : understanding of the domain the text is about in addition
to the content text.
Computer Vision : 3D View of objects
Expert Systems knowledge from experts in the field is stored to knowledge base and used in
interpretation of situations. The usefulness of current expert systems depends on their users
having common sense.
Heuristic Classification : put some information in one of a fixed set of categories using
several sources of information
Theorem Proving many practical problems can be cast in terms of theorems. A general
theorem prover can therefore be widely applicable.
Symbolic Mathematics Symbolic mathematics refers to manipulation of formulas, rather than
arithmetic on numeric values viz. Algebra, Differential and Integral Calculus
Sub-fields of Artificial Intelligence
In a monastery in the deepest Tibet there are three crystal columns and
64 golden rings. The rings are different sizes and rest over the columns.
At the beginning of time all the rings rested on the leftmost column, and
since than the monks have toiled ceaselessly moving the rings one by
one between the columns. In moving the rings a larger ring must not be
placed on a smaller ring. Furthermore, only one ring at a time can be
moved from one column to the next. A simplified version of this
problem which will consider involves only 2 or 3 rings instead of 64.
• 8-Puzzle
• The 8-Puzzle involves moving the tiles on the board above into a
particular configuration. The black square on the board represents a
space. The player can move a tile into the space, freeing that position
for another tile to be moved into and so on.
• For example, given the initial state above we may want the tiles to be
moved so that the following goal state may be attained.
Water Jug Problem
Definition:
• Some jugs are given which should have non-calibrated properties. At least
any one of the jugs should have filled with water. Then the process through
which we can divide the whole water into different jugs according to the
question can be called as water jug problem.
Procedure:
• Suppose that you are given 3 jugs A,B,C with capacities 8,5 and 3 liters
respectively but are not calibrated (i.e. no measuring mark will be there).
Jug A is filled with 8 liters of water. By a series of pouring back and forth
among the 3 jugs, divide the 8 liters into 2 equal parts i.e. 4 liters in jug A
and 4 liters in jug B. How?
Solution
Missionaries and Carnivals Problem
Definition:
• In Missionaries and Carnivals Problem, initially there are some missionaries and
some carnivals will be at a side of a river. They want to cross the river. But there is
only one boat available to cross the river. The capacity of the boat is 2 and no one
missionary or no Carnivals can cross the river together. So for solving the problem
and to find out the solution on different states is called the Missionaries and
Carnival Problem.
Procedure:
• Let us take an example. Initially a boatman, Grass, Tiger and Goat is present at the
left bank of the river and want to cross it. The only boat available is one capable of
carrying 2 objects of portions at a time. The condition of safe crossing is that at no
time the tiger present with goat, the goat present with the grass at the either side of
the river. How they will cross the river?
• Representations : B: Boat T: Tiger G: Goat Gr: Grass
Step 1
Step 2
Step 3
Step 4(a)
Step 3
Step 4(b)
Step 5 (a)
Step 5 (b)
Step 6
Step 7
Monkey Banana Problem
Definition:
• “A monkey is in a room. A bunch of bananas is hanging from the ceiling. The
monkey cannot reach the bananas directly. There is a box in the corner of the
room. How can the monkey get the bananas?”
Procedure:
• The solution of the problem is of course that the monkey must push the box under
the bananas, then stand on the box and grab the bananas. But the solution
procedure requires a lot of planning algorithms.
• Initially, the monkey is at location ‘A’, the banana is at location ‘B’ and the box is
at location ‘C’ . The monkey and box have height “low”; but if the monkey climbs
onto the box will have height “High”, the same as the bananas. The action
available to the monkey include:
“GO” from one place to another. “PUSH” an object from one place to another.
“Climb” onto an object. “Grasp” an object.
• Grasping results in holding the object if the monkey and the object are in the same
place at the same height.
• A state space is a set of descriptions or states.
• Each search problem consists of:
• One or more initial states.
• A set of legal actions. Actions are represented by operators or moves applied to
each state. For example, the operators in a state space representation of the 8-
puzzle problem are left, right, up and down.
• One or more goal states.
• The number of operators are problem dependent and specific to a
particular state space representation. The more operators the larger the
branching factor of the state space. Thus, the number of operators should
kept to a minimum, e.g. 8-puzzle: operations are defined in terms of
moving the space instead of the tiles
• State space is generated at run-time not built in advance
• A search algorithm is applied to a state space representation to find a
solution path. Each search algorithm applies a particular search strategy.
Factors To Develop A State Space
Representation
• What is the goal to be achieved?
• What are the legal moves or actions?
• What knowledge needs to be represented in the state description?
• Type of problem - There are basically three types of problems.
• problems only need a representation, e.g. crossword puzzles.
• problems require a yes or no response indicating whether a solution can be found or
not.
• problem are those that require a solution path as an output, e.g. mathematical
theorems, Towers of Hanoi. Here the goal state is known. The problem is to identify
how to attain this state
• Best solution vs. Good enough solution
• some problems a good enough solution is sufficient e.g. theorem proving , eight
squares.
• some problems require a best or optimal solution, e.g. the traveling salesman
problem.
Predicate Logic
• Propositional logic is not powerful enough to express statements such
as
For every number there is a prime larger than that number.
The limit of sin(x)=x as x approaches 0 is 1.
The function x 7! x3 is a bijection.
The set of all real numbers is larger than the set of all natural numbers.
• In order to express such statements we need to enlarge the language of
logic a bit. E.g., the first statement has the following structure:
• for all x – universal quantifier
• there exists a y – existential quantifier
•x<y – binary relation
• and – logical connective
• y is prime – unary relation
We keep all logical connectives. But we add
• constants that denote individual objects,
• variables that range over individual objects,
• quantifiers that express “for all” and “there exists”,
• function symbols that denote functions,
• relation symbols that denote relations
Notation:
• a, b, c, …. for constants, and x, y, z, … for variables,
• ∀ for the universal quantifier, and Ǝ for the existential
quantifier,
• f , g, h, …. for function symbols, and R, P , Q, … for relation
symbols.
• Always allow = for equality
Syntax and Semantics
Predicate logic is very expressive, but we need to clarify
several important items.
• First give a precise definition of what a formula in predicate
logic is. (similar to syntax in programming language)
• Then associate a clear definition of truth (usually called
validity) with these formulae. (similar to semantics of a programming
language)
• To define validity, define structures, domains over which a
formula in predicate logic can be interpreted.
Syntax: Terms and Formulae
• Every function symbol and relation symbol has a fixed
number of arguments, its arity.
Terms are defined inductively by
• Every constant and variable is a term.
• If f is an n-ary function symbol, and t1….. tn are terms, then f
(t1….. tn) is also a term.
An atomic formula is an expression of the form R(t1….. tn
)where R is an n-ary relation symbol, and t1….. tn are terms.
• formulae are defined inductively by
• Every atomic formula is a is a formula.
• If 𝜑 and 𝜓 are formulae, so are (¬𝜑), (𝜑 ^ 𝜓 ), (𝜑 v 𝜓 ), and
(𝜑 → 𝜓 ).
If 𝜑 is a formula and x a variable, then (∃x 𝜑) and (∀x 𝜑) are
also formulae
A variable that is not in the range of a quantifier is free
• ∀(x; y) x and y are free
• ∃x𝜑(x, y) only y is free
• ∀y∃x𝜑 (x, y) nothing free
• A formula without free variables is closed, or a sentence.
• First-order logic
• Whereas propositional logic assumes the world contains facts, first-
order logic (like natural language) assumes the world contains
• Objects: people, houses, numbers, colors, baseball games, wars, …
• Relations: red, round, prime, brother of, bigger than, part of, comes
between,
• Brothers are siblings
• Sibling is symmetric
• One's mother is one's female parent
The owner of Rocco owner(rocco)
The owner of a cat that is chased by a dog will be mad at the owner of the dog
(∀ X) (∀ Y) [(dog(X) ^ cat(Y) ^ chases(X, Y)) → madAt(owner(Y), owner(X))]
Every dog has the barks property (∀ X) (dog(X) → barks(X))
•
Inference rules:
• Generating the conclusions from evidence and facts is termed as Inference.
• Inference rules are the templates for generating valid arguments. Inference rules
are applied to derive proofs in artificial intelligence, and the proof is a sequence
of the conclusion that leads to the desired goal. In inference rules, the implication
among all the connectives plays an important role. Following are some
terminologies related to inference rules:
• Implication: It is one of the logical connectives which can be represented as P → Q. It is a
Boolean expression.
• Converse: The converse of implication, which means the right-hand side proposition goes to
the left-hand side and vice-versa. It can be written as Q → P.
• Contrapositive: The negation of converse is termed as contrapositive, and it can be
represented as ¬ Q → ¬ P.
• Inverse: The negation of implication is called inverse. It can be represented as ¬ P → ¬ Q.
Types of Inference rules:
• 1. Modus Ponens:
• The Modus Ponens rule is one of the most important rules of inference, and
it states that if P and P → Q is true, then we can infer that Q will be true. It
can be represented as:
• Example:
• Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
• Proof by Truth table:
• Modus Tollens:
• The Modus Tollens rule state that if P→ Q is true and ¬ Q is true,
then ¬ P will also true. It can be represented as:
• Example:
• Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
• Hypothetical Syllogism:
• The Hypothetical Syllogism rule state that if P→R is true whenever
P→Q is true, and Q→R is true. It can be represented as the following
notation:
• Example:
• Statement-1: If you have my home key then you can unlock my
home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my money.
P→R
Disjunctive Syllogism:
• The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true,
then Q will be true. It can be represented as:
Example:
• Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
• Addition:
• The Addition rule is one the common inference rule, and it states that
If P is true, then P∨Q will be true.
Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
• Proof by Truth-Table:
•
Simplification:
• The simplification rule state that if P∧ Q is true, then Q or P will also
be true. It can be represented as:
Proof by Truth-Table:
Resolution:
The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be true.
It can be represented as
Proof by Truth-Table:
• State Space Description of a Logic System
• With sound and complete inference rules, graph-based reasoning can
be used to find correct conclusions. In short, logic systems can be
mapped with graph theory and solved with search methods.
And/Or Graphs
• Hypergraphs can be used to accurately depict and/or relations in
graph theory. These graphs can have multiple arcs between nodes. The
and relations will be shown by connecting descendant arcs together
with a line.
• Representation
• Logical expressions as states
• Inference rules as links
• Correctness
• Soundness and completeness of predicate calculus inference rules guarantee
the correctness of conclusions
• Theorem Proof
• State space search
State space graph of the propositional
calculus
• Letters as nodes
• Implications as links
• qp
• rp
• vq
• sr
• tr
• su
And/or graph
• Or – separate
• And – connected
• And/or graph of expression q r p