You are on page 1of 28

What is AI?

• People have been, since ages, irresistibly drawn to the idea


of creating intelligence outside the human body.

• Examples are numerous in Greek and European mythology

• More recent examples include the story of Frankenstein, and


the Star War robot characters

• Ever since the first computers were built, scientist have been
trying to make them intelligent

1
What is AI?

• The branch of computer science called Artificial Intelligence


is said to have been born at a conference held at
Dartmouth, USA, in 1956

• The scientists attending that conference represented several


different disciplines: mathematics, neurology,
psychology, electrical engineering, etc

• They had one thing in common:


They all were trying to use the recently developed
computers to simulate various aspects of human
intelligence

2
What is AI?

• Artificial Intelligence may be defined as the branch of


computer science that is concerned with the
automation of intelligent behavior

• Intelligence itself is not very well defined or understood

• So we will first study the problems, methodologies and


techniques investigated by AI researchers and
then try to find a definition of the field

3
What is AI?

• Artificial Intelligence may be defined as the branch of


computer science that is concerned with the
automation of intelligent behavior

• An exact definition of intelligence is not easy to formulate

• However, there are some general abilities which are


universally considered as intelligent

• According to Douglas Hofstadter these are:


- To respond to situations very flexibly
If the same response is exhibited each time,
the behavior is called mechanical

4
What is AI?

- To make sense out of ambiguous or contradictory


messages

- To recognize the relative importance of different


elements of a situation

- To find similarities between situations despite


differences which may separate them

- To draw distinctions between situations despite


similarities which may link them

These abilities are largely due to knowledge and


experience, which allows you to place an information
in its wider context 5
What is AI?

• Many methods and techniques have been developed


under the umbrella of AI to simulate intelligent
behavior

• However, we are still far away from the goals set by


Hollywood movies like Terminator

6
State Space Search

7
Problem Spaces

• Water Jug Problem


- We have two jugs of 4 gallon and 3 gallons capacity
- The jugs do not have any measuring markers
- How can we get exactly 2 gallons of water into the
4 gallon jug?

• We can solve the problem in our heads and encode the rules
or
• We can define the possible states for the problem and make
a list of legal or valid operations

• Our start state is (0,0) and our goal state is (2,n)

8
Problem Spaces

9
Problem Spaces

10
Problem Spaces
• The problem can now be seen as that of moving around in
the state space from one legal state to another

• The transition between states is by application of the


operators defined

• There are different possible strategies for selecting one of


the different possible states at each step

11
Problem Spaces
For defining any problem as a state space search we must:

• Define a state space that contains all the possible


configurations of the relevant objects. This does not
mean that all the states should be defined explicitly.
Example: (x,y) for water jug problem

• Specify one or more states as initial and one or more states


as final or goal states

• Specify a set of rules (operators) that describe the actions


available

12
Problem Spaces

13
Blind Search

• Uninformed search
We are not informed about the quality of our choices

14
Blind Search

15
Blind Search

16
Blind Search

17
Blind Search

18
Depth First Search
Method
• When a state is examined, all of its children and their
descendants are examined before any of its siblings
• The siblings are considered only when no further descendants
of a state can be found

19
Depth First Search

20
Depth First Search

21
Depth First Search
Advantages
• It quickly goes deep into search space, hence it is efficient for
search spaces with many branches
• Requires less memory since only the nodes on the current
path are stored

Disadvantages
• Shortest path is not guaranteed. A state may be reached
by a longer path when it is encountered the first time. It
may get lost deep in a graph, missing shorter paths to a
goal. If the shortest path is required each state may be
stored as a triplet (state, parent, length-of-path)

Note that cost means computational cost expended when finding


a path and not the actual travel cost of traversing that path
22
Breadth First Search

Method
• It explores the space in a level by level fashion. Only when
no there are no more states to be explored at a given
level does the algorithm move on to the next level

23
Breadth First Search

24
Breadth First Search

Advantages
• It is guaranteed to find the shortest path from the start
state to the goal state
• Because there is no chance that duplicate states may be
found along a better path, the algorithm simply
discards any duplicate states

Disadvantages
• If the branching factor is high and the goal is at deep levels,
this algorithm is not useful.
The memory required is high since at every level, all
of the tree that has been so far generated must be
stored

25
Depth first versus Breadth first

• To choose between depth first and breadth first, examine


the problem space carefully and consult experts in
the area.
Example: In chess, breadth first is not feasible

• If nothing is known about the search space a middle ground


between depth first and breadth first search may be
considered
- Non deterministic search
- Depth first with iterative deepening

26
Non-deterministic Search

• The node to expand is chosen at random from among the


open nodes

27
Depth First Search with Iterative Deepening

• A depth bound is used on depth-first search

• It performs a complete depth first search to a given depth.


If goal is not found, the depth bound is increased

• No information about the state space is retained between


iterations

• Since the number of nodes in a given level of the tree grows


exponentially with depth, almost all the time is spent
in the deepest level, even though shallower levels are
generated an arithmetically increasing number of
times

28

You might also like