1. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
We lose ourselves in books, we find ourselves
there too.
Kristin Martz
Artificial
Intelligence
1
2. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Course Summary
Artificial Intelligence (AI) is a field that has a long history
but is still constantly and actively growing and changing. In
this course, you’ll learn the basics of modern AI as well as
some of the representative applications of AI. Along the
way, we also hope to excite you about the numerous
applications and huge possibilities in the field of AI, which
continues to expand human capability beyond our
imagination.
2
3. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Introduction to AI
Humankind has given itself the scientific name homo sapiens—man
the wise—because our mental capacities are so important to our
everyday lives and our sense of self. The field of artificial
intelligence, or AI, attempts to understand intelligent entities. Thus,
one reason to study it is to learn more about ourselves. But unlike
philosophy and psychology, which are also concerned with
intelligence, AI strives to build intelligent entities as well as
understand them. Another reason to study AI is that these constructed
intelligent entities are interesting and useful in their own right. AI has
produced many significant and impressive products even at this early
stage in its development. Although no one can predict the future in
detail, it is clear that computers with human-level intelligence (or
better) would have a huge impact on our everyday lives and on the
future course of civilization.
3
4. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Brain
The an actual human brain:
1. Not solid, its soft and squishy.
2. Similar to soft gelatin.
3. The typical brain is about 2% of a body weight.
4. Its consumes 20% of the total energy produced by the body.
5. During early pregnancy neurons develop at the rate 250,000
neurons per minute.
6. There are approximately 100 billion neurons in the adult human
brain.
7. Each neuron connects with approximately 40,000 synapses.
4
5. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
8. There are as many as 10,000 specific types of neurons in the brain
9. Your brain can process information as fast as 432 kph (268 mph),
that's faster than formula 1 race cars which top out at 386 kph
(240 mph).
10. It can also generate about 12-25 watts of electricity, which is
enough to power a low wattage LED light.
11. Our brains are getting smaller and smaller, over the past 10-
20,000 years the size of the average human brain has shrunk by
the size of a tennis ball.
# The University of Utah
5
6. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Turing Test
The Turing Test, proposed by Alan Turing (Turing, 1950), was
designed to provide a satisfactory operational definition of
intelligence. Turing defined intelligent behavior as the ability to
achieve human-level performance in all cognitive tasks, sufficient to
fool an interrogator. Roughly speaking, the test he proposed is that the
computer should be interrogated by a human via a teletype, and
passes the test if the interrogator cannot tell if there is a computer or a
human at the other end.
6
7. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Turing Test
The computer would need to possess the following capabilities:
1. natural language processing to enable it to communicate
successfully in English (or some other human language);
2. knowledge representation to store information provided before
or during the interrogation;
3. automated reasoning to use the stored information to answer
questions and to draw new conclusions;
4. machine learning to adapt to new circumstances and to detect
and extrapolate patterns.
7
8. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Turing Test
Turing's test deliberately avoided direct physical interaction between
the interrogator and the computer, because physical simulation of a
person is unnecessary for intelligence. However, the so-called total
Turing Test includes a video signal so that the interrogator can test the
subject's perceptual abilities, as well as the opportunity for the
interrogator to pass physical objects ``through the hatch.'' To pass the
total Turing Test, the computer will need:
• Computer vision to perceive objects.
• Robotics to move them about.
8
9. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Structures and Strategies for State
Space Search
1. Graph Theory.
2. The State Space Representing of Problems.
3. Strategies for State Space Search.
9
10. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Graph Theory
A graph is a set of labeled nodes or states that are connected
by arcs. labels are used to differentiate nodes. In a state space
graph, the nodes represent different states of a problem to be
solved.
The arcs of a graph can have direction associated which
introduces a direct graph, also arcs can be labeled so that
similar nodes can be differentiated.
A rooted graph is a graph with one initial node connected to
the other nodes.
A tree is a graph were each node is connected to the other by
one unique arc, hence, there is no cycling in a tree.
10
11. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Graph Theory
The question here is who is liz’s parent?
Parent(X,liz);
Ans= tom.
11
lara tom
bob liz
ann pat
jin
12. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Graph Theory
12
13. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Graph Theory
13
14. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Examples
14
Initial State
Goal
An example of a graph
where H is a initial state
and the E is a Goal.
15. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Initial State
Q) What’s the solution path to the goal?
16. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
8 Puzzle Examples
Initial State Goal
321
48
567
321
46
578
17. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
8 Puzzle Examples
Initial State
Goal
18. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
8 Puzzle Examples
Initial State Goal
321
48
567
321
476
58
19. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
8 Puzzle Examples
Initial State Goal
31
428
567
31
468
257
Home Work..?
20. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Travelling Salesman Problem
The travelling salesman problem (TSP) asks the
following question: Given a list of cities and the distances
between each pair of cities, what is the shortest possible
route that visits each city exactly once and returns to the
origin city? It is an NP-hard problem in combinatorial
optimization, important in operations research and
theoretical computer science.
20
21. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Travelling Salesman Problem
21
An instance of the traveling salesperson problem.
22. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Travelling Salesman Problem
Search of the traveling salesperson problem. Each arc is marked with
the total weight of all paths from the start node (A) to its endpoint.
22
23. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
The State Space Representing of Problems
• The state space is a graph representation of a problem, where
the nodes of a graph represent partial solutions in the problem
space, and the arcs are steps taken in the problem solving
process.
• The root of the graph represents the initial state of a problem.
The graph must identify one or more goal nodes, where the
solution to the problem in hand is found.
• State space search characterizes problem solving as the process
of finding a solution path from the start state to a goal.
23
24. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
State Space Search
A state space is represented by [N,A,S,GD]. where
-N is the set of nodes or states in a graph.
-A is the set of arcs or links between the nodes.
-S is a nonempty subset of N, represents the start node.
-GD is a nonempty subset of N, represents the goal nodes.
Note: A solution path is the path taken to reach a goal.
24
25. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Strategies for State Space Search
1. Uninformed Search Strategies:
i. Depth first search (DFS)
ii. Breadth first search (BFS)
iii. Iterative deepening search
2. Informed Search Strategies (Heuristic Search):
i. Hill climbing, Simulated Annealing, Tabu search
ii. Best first search
iii. Greedy search
iv. A* search
25
26. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Strategies for State Space Search
1. Uninformed Search Strategies:
• A problem determines the graph and the goal but not which path to select
from the frontier. This is the job of a search strategy. A search strategy
specifies which paths are selected from the frontier. Different strategies
are obtained by modifying how the selection of paths in the frontier is
implemented.
2. Informed Search Strategies (Heuristic Search):
26
27. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Depth first search (DFS)
The first strategy is depth-first search. In depth-first search, the
frontier acts like a last-in first-out stack. The elements are added to
the stack one at a time. The one selected and taken off the frontier at
any time is the last element that was added.
Implementing the frontier as a stack results in paths being pursued in
a depth-first manner - searching one path to its completion before
trying an alternative path. This method is said to
involve backtracking: The algorithm selects a first alternative at each
node, and it backtracks to the next alternative when it has pursued all
of the paths from the first selection. Some paths may be infinite when
the graph has cycles or infinitely many nodes, in which case a depth-
first search may never stop.
27
28. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Depth first search (DFS)
28
29. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Depth first search (DFS)
29
30. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Depth first search (DFS)
30
31. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Depth first search (DFS)
31
32. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
In breadth-first search the frontier is implemented as a FIFO (first-in, first-
out) queue. Thus, the path that is selected from the frontier is the one that
was added earliest. This approach implies that the paths from the start node
are generated in order of the number of arcs in the path. One of the paths
with the fewest arcs is selected at each stage.
Breadth-first search is useful when:
1. Space is not a problem.
2. You want to find the solution containing the fewest arcs.
3. Few solutions may exist, and at least one has a short path length; and
4. Infinite paths may exist, because it explores all of the search space, even
with infinite paths.
- It is a poor method when all solutions have a long path length or there is
some heuristic knowledge available. It is not used very often because of
its space complexity.
32
33. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
33
34. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
34
35. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
35
36. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
36
37. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Breadth first search (BFS)
37
38. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative Deepening search
In computer science, iterative deepening search or more
specifically iterative deepening depth-first search[1] (IDS
or IDDFS) is a state space/graph search strategy in which a
depth-limited version of depth-first search is run repeatedly
with increasing depth limits until the goal is found. IDDFS
is equivalent to breadth-first search, but uses much less
memory; on each iteration, it visits the nodes in the search
tree in the same order as depth-first search, but the
cumulative order in which nodes are first visited is
effectively breadth-first.
38
39. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative Deepening search
39
40. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative deepening search
40
41. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative Deepening search
41
Depth limit 0#
A1
42. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative Deepening search
42
Depth limit 1#
A1
BFCD2
FCD3
CD4
D5
43. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Iterative Deepening search
43
Depth limit 1#
A1
BFCD2
EFCD3
FCD4
JGCD5
GCD – G is Goal
44. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Backtracking Graph
SL =State List (Path from State to the top).
NSL =New State List (All Opened states without DE).
DE =Dead Ends (States that is dead).
CS =Current State.
44
45. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016 45
Quiz: DFS, BFS, IDS, Min Cost: Goal is P, M, M, M
46. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016 46
Quiz:
DFS, BFS, IDS, Min Cost: Goal is P, M, M, M
Sol:
DFS: A B E I L M K P
BFS: A B C H E F G K I J N M
IDS: A C G M
Min Cost: A C F J N M
A C G N M
47. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
47
Example1: Backtracking search of a hypothetical state space.
48. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
A trace of backtrack on the graph DFS
48
49. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
A trace of backtrack on the graph BFS
49
DENSLSLCSi
[ ][A][A]A0
[A][BCD][BA]B1
[BA][CDEF][CBA]C2
[CBA][DEFG][DCBA]D3
[DCBA][EFG][EDCBA]E4
[EDCBA][FGHI][FEDCBA]F5
[FEDCBA][GHIJ][GFEDCBA]G6
[GFEDCBA][HIJ][HGFEDCBA]H7
[HGFEDCBA][IJ][IHGFEDCBA]I8
[IHGFEDCBA][J][JIHGFEDCBA]J9
[JIHGFEDCBA][ ][ ][ ]10
50. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
A trace of backtrack on the graph IDS
50
DENSLSLCSi
[ ][A][A]A0
[ ][ABCD][BA]B1
[ ][ABCDEF][CA]C2
[ ][ABCDEFG][DA]D3
[D][ABCEFG][EBA]E4
[D][ABCEFGHI][FBA]F5
[D][ABCEFGHIJ][GCA]G6
[GD][ABCEFHIJ][HEBA]H7
[HGD][ABCEFIJ][IEBA]I8
[HGDIE][ABCFJ][JFBA]J9
[JIHGFEDCBA][ ][ ][ ]10
51. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
51
Example2: Graph for depth-first search examples.
52. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
52
Example2: Graph for depth-first search examples.
Open [A]; Close [].
Open [BA]; Close [].
Open [EBA]; Close [].
Open [KEBA]; Close [].
Open [SKEBA]; Close [].
Open [LEBA]; Close [SK].
Open [TLEBA]; Close [SK].
Open [FBA]; Close [SKTLE].
Open [MFBA]; Close [SKTLE].
Open [CA]; Close [SKTLEMFB]. …
and so on until either U is founded or Open is [ ].
53. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
53
Q1) Graph for breadth-first search examples?
54. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
Back Tracking Graph
54
Example2: Graph for breadth-first search examples.
55. Renas R. Rekany Artificial Intelligence Nawroz University
Keep Reading as long as you breathComSci: Renas R. Rekany Oct2016
THE END
Reference:
1. Artificial Intelligence Structure and Strategies for
Complex Problem Solving. 4th edition George F. Luger
Addison Wesley.
55