Professional Documents
Culture Documents
define AI as:
o Mathematics
o Biology
o Psychology
o Sociology
o Computer Science
o Neurons Study
o Statistics
Application of AI
1. AI in Astronomy
o Artificial Intelligence can be very useful to
solve complex universe problems. AI
technology can be helpful for
understanding the universe such as how it
works, origin, etc.
2. AI in Healthcare
1 Expert Systems
Examples − Flight-tracking systems,
Clinical systems.
3 Neural Networks
Examples − Pattern recognition
systems such as face recognition,
character recognition, handwriting
recognition.
4 Robotics
Examples − Industrial robots for
moving, spraying, painting, precision
checking, drilling, cleaning, coating,
carving, etc.
Ignorable problems can be solved using a simple control structure that never
backtracks. Recoverable problems can be solved using
backtracking. Irrecoverable problems can be solved by recoverable style
methods via planning.
3. Is
the universe of the problem is
predictable?
In Playing Bridge, We cannot know exactly where all the cards are or what the
other players will do on their turns.
Uncertain outcome!
The Travelling Salesman Problem, we have to try all paths to find the shortest
one.
Any path problem can be solved using heuristics that suggest good paths to
explore.
The Water Jug Problem, the path that leads to the goal must be reported.
Playing Chess
Consider again the problem of playing chess. Suppose you had unlimited
computing power available. How much knowledge would be required by a
perfect program? The answer to this question is very little—just the rules for
determining legal moves and some simple control mechanism that
implements an appropriate search procedure.
Additional knowledge about such things as good strategy and tactics could of
course help considerably to constrain the search and speed up the execution
of the program. Knowledge is important only to constrain the search for a
solution.
Reading Newspaper
Now consider the problem of scanning daily newspapers to decide which are
supporting the Democrats and which are supporting the Republicans in some
upcoming election. Again assuming unlimited computing power, how much
knowledge would be required by a computer trying to solve this problem?
This time the answer is a great deal.
Production System in
Artificial Intelligence
If a system with production rules and a rule-
interpreter then the system is known as a production
system. In these systems, the working memory of the
system models human short-term memory while
productions are part of long-term memory.
Initial Final
S.No. Condition Description of action taken
State state
1. (x,y) If x<4 (4,y) Fill the 4 gallon jug completely
2. (x,y) if y<3 (x,3) Fill the 3 gallon jug completely
3. (x,y) If x>0 (x-d,y) Pour some part from the 4 gallon jug
4. (x,y) If y>0 (x,y-d) Pour some part from the 3 gallon jug
5. (x,y) If x>0 (0,y) Empty the 4 gallon jug
6. (x,y) If y>0 (x,0) Empty the 3 gallon jug
(4, y-[4- Pour some water from the 3 gallon jug to fill
7. (x,y) If (x+y)<7
x]) the four gallon jug
(x-[3- Pour some water from the 4 gallon jug to fill
8. (x,y) If (x+y)<7
y],y) the 3 gallon jug.
Pour all water from 3 gallon jug to the 4
9. (x,y) If (x+y)<4 (x+y,0)
gallon jug
Pour all water from the 4 gallon jug to the 3
10. (x,y) if (x+y)<3 (0, x+y)
gallon jug
(4,Y)
1 (X,Y | X<4)
{Fill 4-gallon jug}
(0,Y)
3 (X,Y |X>0)
{Empty 4-gallon jug}
(X,0)
4 (X,Y | Y>0)
{Empty 3-gallon jug}
(4,Y-(4-X))
(X,Y |
5 X+Y>=4 ^ {Pour water from 3-gallon jug into
Y>0) 4-gallon jug until 4-gallon jug is
full}
(X-(3-Y),3)
(X,Y |
6 X+Y>=3 {Pour water from 4-gallon jug into
^X>0) 3-gallon jug until 3-gallon jug is
full}
(X+Y,0)
(X,Y | X+Y<=4
7 {Pour all water from 3-gallon jug into 4-gallon
^Y>0)
jug}
(0,X+Y)
(X,Y | X+Y <=3^
8 {Pour all water from 4-gallon jug into 3-gallon
X>0)
jug}
Rule State Process
(2,0)
9 (0,2) {Pour 2 gallon water from 3 gallon jug into 4
gallon jug}
Initialization:
Start State: (0,0)
Apply Rule 2:
Fill 3-gallon jug
Now the state is (x,3)
Iteration 1:
Current State: (x,3)
Apply Rule 7:
Pour all water from 3-gallon jug into 4-gallon jug
Now the state is (3,0)
Iteration 2:
Current State : (3,0)
Apply Rule 2:
Fill 3-gallon jug
Now the state is (3,3)
Iteration 3:
Current State:(3,3)
Apply Rule 5:
Pour water from 3-gallon jug into 4-gallon jug until 4-
gallon jug is full
Now the state is (4,2)
Iteration 4:
Current State : (4,2)
Apply Rule 3:
Empty 4-gallon jug
Now state is (0,2)
Iteration 5:
Current State : (0,2)
Apply Rule 9:
Pour 2 gallon water from 3 gallon jug into 4 gallon jug
So, here we are trying to solve that how many moves are
required to solve a problem (It depends on number of disk).
The problem
In the missionaries and cannibals problem, three missionaries and three
cannibals must cross a river using a boat which can carry at most two
people, under the constraint that, for both banks
if there are missionaries present on the bank,
they cannot be outnumbered by cannibals (if they were, the cannibals
would eat the missionaries).
The boat cannot cross the river by itself with no people on board. And, in
some variations, one of the cannibals has only one arm and cannot row.
Missionaries and Cannibals
Difficulty Level : Medium
Last Updated : 07 Feb, 2018
Solution:
First let us consider that both the missionaries (M) and
cannibals(C) are on the same side of the river.
Left Right
Initially the positions are : 0M , 0C and 3M , 3C (B)
• Here (B) shows the position of the boat after the action is
performed.
Therefore all the missionaries and cannibals have crossed the
river safely.
Solving
A system for solving the Missionaries and Cannibals problem
whereby the current state is represented by a simple vector ⟨m, c,
b⟩.
The vector's elements represent the number of missionaries,
cannibals, and whether the boat is on the wrong side, respectively.
Since the boat and all of the missionaries and cannibals start on
the wrong side, the vector is initialized to ⟨3,3,1⟩. Actions are
represented using vector subtraction/addition to manipulate the
state vector. For instance, if a lone cannibal crossed the river, the
vector ⟨0,1,1⟩ would be subtracted from the state to yield ⟨3,2,0⟩.
The state would reflect that there are still three missionaries and
two cannibals on the wrong side, and that the boat is now on the
opposite bank. To fully solve the problem, a simple tree is formed
with the initial state as the root. The five possible actions (⟨1,0,1⟩,
⟨2,0,1⟩, ⟨0,1,1⟩, ⟨0,2,1⟩, and ⟨1,1,1⟩) are then subtracted from the
initial state, with the result forming children nodes of the root. Any
node that has more cannibals than missionaries on either bank is
in an invalid state, and is therefore removed from further
consideration. The valid children nodes generated would be ⟨3,2,0⟩,
⟨3,1,0⟩, and ⟨2,2,0⟩. For each of these remaining nodes, children
nodes are generated by adding each of the possible action vectors.
The algorithm continues alternating subtraction and addition for
each level of the tree until a node is generated with the vector
⟨0,0,0⟩ as its value. This is the goal state, and the path from the
root of the tree to this node represents a sequence of actions that
solves the problem.
Travel Salesman
Problem
Algorithm
Travel Salesman Problem:
It is a classical problem in graph theory. It has no
closed, analytic and algorithmic solution. This problem
is soluble for a smaller number(n) of cities but it
breaks down as the number of cities grows.
If there are n-cities, the number of different paths
among them is (n-1)! The time to examine a single
path is proportional to n. So, the total time to search
is n!. If n is large then the time taken is also large.
This phenomenon is known as combinatorial explosion.