0% found this document useful (0 votes)
88 views12 pages

L1A Introduction To AI and Search

This document defines intelligence and the different types of human intelligence. It then discusses four views of defining artificial intelligence: acting humanly through the Turing test, thinking humanly through cognitive modeling, thinking rationally through laws of thought, and acting rationally as a rational agent. The document provides a general definition of AI as attempting to provide computational models of intelligent human activities like learning and decision making. It discusses the theoretical foundations and main branches of AI as well as reasons for studying AI, such as to better understand intelligence and because intelligent systems can be useful.

Uploaded by

Macloud Kamula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views12 pages

L1A Introduction To AI and Search

This document defines intelligence and the different types of human intelligence. It then discusses four views of defining artificial intelligence: acting humanly through the Turing test, thinking humanly through cognitive modeling, thinking rationally through laws of thought, and acting rationally as a rational agent. The document provides a general definition of AI as attempting to provide computational models of intelligent human activities like learning and decision making. It discusses the theoretical foundations and main branches of AI as well as reasons for studying AI, such as to better understand intelligence and because intelligent systems can be useful.

Uploaded by

Macloud Kamula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

INTRODUCTION

Definition of Intelligence
 Human intelligence, mental quality that consists of the abilities to learn from experience, adapt to new
situations, understand and handle abstract concepts, and use knowledge to manipulate one’s environment.

 Intelligence is the computational part of the ability to achieve goals in the world. Varying kinds and degrees
of intelligence occur in people, many animals and some machines.

Types of Intelligence
i) General intelligence: - Abilities that allow us to be flexible and adaptive thinkers, not necessarily tied to
acquired knowledge
ii) Linguistic-verbal intelligence: - Use words and language in various forms / Ability to manipulate language
to express oneself poetically. Linguistic intelligence is evident in poets, novelists, journalists, and effective
public speakers.
iii) Logical-Mathematical intelligence: - Ability to detect patterns / Approach problems logically / Reason
deductively. Logical intelligence is usually well developed in mathematicians, scientists, and detectives.
iv) Musical intelligence: - Recognize nonverbal sounds: pitch, rhythm, and tonal patterns. This intelligence
enables us to recognize, create, reproduce, and reflect on music, as demonstrated by composers,
conductors, musicians, vocalist, and sensitive listeners.
v) Spatial intelligence: - Typically thinks in images and pictures / Used in both arts and sciences. Core
capacities include mental imagery, spatial reasoning, image manipulation, graphic and artistic skills, and an
active imagination. Sailors, pilots, sculptors, painters, and architects all exhibit spatial intelligence.
vi) Intrapersonal intelligence: - Ability to understand oneself, including feelings and motivations / can
discipline themselves to accomplish a wide variety of tasks. Intra-personal intelligence involves not only an
appreciation of the self, but also of the human condition. It is evident in psychologist, spiritual leaders, and
philosophers.
vii) Interpersonal intelligence: - Ability to "read people"—discriminate among other individuals especially their
moods, intentions, motivations. Teachers, social workers, actors, and politicians all exhibit interpersonal
intelligence.
viii) Naturalist intelligence: - Ability to recognize and classify living things like plants, animals. Generally,
naturalist intelligence designates the human ability to discriminate among living things (plants, animals) as
well as sensitivity to other features of the natural world (clouds, rock configurations).
ix) Bodily-Kinesthetic intelligence: - Use one’s mental abilities to coordinate one’s own bodily movements.
This intelligence also involves a sense of timing and the perfection of skills through mind–body union.
Athletes, dancers, surgeons, and crafts people exhibit well-developed bodily kinesthetic intelligence

Definition of Artificial Intelligence (AI)


So far, there is no generally accepted definition of Artificial Intelligence. Textbooks either skirt the issue, or
emphasize particular aspects

Four Views of defining AI


The following are various views of defining artificial intelligence

i). Acting humanly: The Turing Test approach


The Turing Test, proposed by Alan Turing, 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

Artificial Intelligence ~ Wainaina Page 1 of 12


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. To pass the test, the computer would need to possess the following
capabilities:
i). Natural language processing to enable it to communicate successfully in English (or some other human
language);
ii). Knowledge representation to store information provided before or during the interrogation;
iii). Automated reasoning to use the stored information to answer questions and to draw new conclusions;
iv). Machine learning to adapt to new circumstances and to detect and extrapolate patterns.

Within AI, there has not been a big effort to try to pass the Turing test. The issue of acting like a human comes
up primarily when AI programs have to interact with people, as when an expert system explains how it came to
its diagnosis, or a natural language processing system has a dialogue with a user.
Note: Emphasis is on how to tell if a machine is intelligent, not on how to make it intelligent

ii). Thinking humanly: The cognitive modeling approach


Emphasis on the way systems work or “think”- information processing psychology. It requires scientific
theories of internal activities of the brain -- how to validate?
There are two ways to do this:
 Through introspection-trying to catch our own thoughts as they go by—or
 Through psychological experiments.
Once there is a sufficiently precise theory of the mind, it becomes possible to express the theory as a computer
program. If the program's input/output and timing behavior matches human behavior, that is evidence that some
of the program's mechanisms may also be operating in humans
Both approaches (Cognitive Science and Cognitive Neuroscience) are now distinct from AI

iii). Thinking rationally: The laws of thought approach


The Greek philosopher Aristotle was one of the first to attempt to codify “right thinking,” that is, irrefutable
reasoning processes. His famous syllogisms provided patterns for argument structures that always gave correct
conclusions given correct premises. For example,”Socrates is a man; all men are mortal; therefore Socrates is
mortal.” These laws of thought were supposed to govern the operation of the mind, and initiated the field of
logic.
By 1965, programs existed that could, given enough time and memory, take a description of a problem in
logical notation and find the solution to the problem, if one exists. (If there is no solution, the program might
never stop looking for it.). Direct line through mathematics and philosophy to modern AI
Problems:
• Not all intelligent behaviour is mediated by logical deliberation
• What is the purpose of thinking? What thoughts should I have?

iv). Acting rationally: The rational agent approach


Acting rationally means acting so as to achieve one's goals, given one's beliefs i.e. what is expected to maximize
goal achievement, given the available information. An agent is just something that perceives and acts. In this
approach, AI is viewed as the study and construction of rational agents.
The study of AI as rational agent design has two advantages.
• It is more general than the “laws of thought” approach, because correct inference is only a useful
mechanism for achieving rationality, and not a necessary one.
• It is more amenable to scientific development than approaches based on human behavior or human
thought, because the standard of rationality is clearly defined and completely general.

General Definition of AI
Artificial Intelligence is the field of computing that attempts at providing computational models of some human
activities, which are considered intelligent activities, such as learning, acting, decision making, evolving etc. AI,
therefore, relates strongly to fields such as psychology, biology and sociology.

Artificial Intelligence ~ Wainaina Page 2 of 12


AI is both science and engineering
 The science of understanding intelligent entities - of developing theories which attempt to explain and
predict the nature of such entities
 The engineering of intelligent entities

Reasons for Learning Artificial Intelligence


i). The field of artificial intelligence, 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.
ii). 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.

Developing AI Systems
There are two main streams in developing AI systems: quantitative and qualitative approaches.
i). Quantitative approaches sometimes referred to as numerical approaches, because they use quantities in
analysing the problems. Neural nets, fuzzy logic, genetic algorithms are all examples of the quantitative
approaches.
ii). Qualitative approaches sometimes referred to as symbolic approaches, because they use qualities of the
problem to solve the problem. Logic, rules, lists based systems are examples of qualitative AI systems.

Theoretical Foundations to AI
 Computer Science (tools for testing theories, programmability, speed, storage, actions)
 Mathematics (Formalization of tasks and problems, logic, computation, probability)
 Psychology (human reasoning, behaviourism, cognitive psychology)
 Philosophy (nature of belief, rationality, theories of language, reasoning, learning, the mind)
 Linguistics (structure and meaning of language, knowledge representation, natural language processing)
 Human Biology (how brain works)

Main Branches of AI
i) Machine Vision: This is area dealing with visual recognition of objects. Cameras and sensors are used. The
challenges in it involve mapping visual realities to representations that allow easy pattern recognition. With
maturity computers can recognize their owners; vehicles can find their way around; robots can conduct
errands in the house etc.

ii) Speech Synthesis and Recognition: This is an area that attempt to find how to make computers recognize
voice inputs and respond vocally. The main challenges include speech recognition and generation. On
maturity computers can talk, discuss and take voice commands.

iii) Machine Learning: Here the investigation is focused on making computers acquire knowledge, skills and
be adaptive. The challenges include knowledge acquisition, knowledge representation, learning operators
and how to help humans learn. On maturity computers will learn from experience, solve problems and be
adaptive.

iv) Robotics: Here the investigation is focused on movement and positioning of arms and other parts. The main
challenges include the arm positioning and locating positions. On maturity the robots will be used for
additional domestic and industrial applications. Currently they are used for such industrial applications such
as assembling and welding.

Artificial Intelligence ~ Wainaina Page 3 of 12


v) Natural Language and Understanding: Here investigations consider grammars and semantics of
languages. The challenges include getting uniform grammar and semantic representations; and
understanding. On maturity, the computers should be able to communicate in natural language and
understand.

vi) Problem Solving: This is an area that originally attempted to build a general problem solver. Its focus was
later revised to specialized problem solvers such as expert systems. Its main challenges include finding out
how to formulate the problems, looking or searching for solutions, representing knowledge. On maturity,
computers will solve various problems and problem solving can be embedded into many industrial
applications.

Characteristics of AI Programs
a) Symbolic Processing: - Symbolic processing is reasoning about objects represented by symbols, and their
properties and relationships, rather than numerical calculations. Generally A.I. programs primarily use
symbolic representations: collections of symbols that represent: objects, properties of objects, relationships
among objects and rules about classes of objects.

b) Knowledge Representation: - Knowledge is the general principles that are stored in the program and used
for reasoning about novel situations. This knowledge is represented by some kind of data structures in the
machine's memory that reflect the complexity of the real world. Several kinds of knowledge need to be
represented such as factual Data, general principles, hypothetical data etc.

c) Search: - This is a method for finding a solution to a problem when no direct method exists. Search
programs find a solution for a problem by trying different sequences of actions (operators) until a solution
is found.

d) Heuristics: - Are similar to rules of thumb where you need not rethink completely what to do every time a
similar problem is encountered.

e) Inferencing: - This is a form of reasoning with facts and rules using heuristics or some search strategies.

Artificial Intelligence ~ Wainaina Page 4 of 12


SEARCHING TECHNIQUE
Searching is the process of looking for the solution of a problem through a set of possibilities (state space or
search space). The solution is a path from the current state to the goal state.

Search fits in nearly every area of A.I. in the following ways:


 Natural Language: A parser searches for the best ways of assigning structure and meaning to sentences
that are ambiguous.
 Planning: A planner searches for a sequence of actions that will accomplish a goal.
 Perception: The raw input is often ambiguous; the perception program searches for a consistent set of
interpretations of parts of the input.
 Learning: A learning program searches for a compact description of a set of training instances.
 Expert Systems: Search finds rules applicable to the current problem.

Examples of Search Problems


 Route finding
– Search routes for one that reaches destination
 Theorem proving
– Search chains of reasoning for proof
 Machine learning
– Search through concepts for one which achieves target categorisation

Search Terminology
 States: “places” the search can visit
 Search space: the set of possible states
 Search path: Sequence of states the agent actually visits
 Solution:
– A state which solves the given problem, either known or has a checkable property
– May be more than one solution
 Strategy: How to choose the next state in the path at any given state

Process of Searching
Searching proceeds as follows:
1. Check the current state;
2. Execute allowable actions to move to the next state;
3. Check if the new state is the solution state; if it is not then the new state becomes the current
state and the process is repeated until a solution is found or the state space is exhausted.

Search problem
The search problem consists of finding a solution plan, which is a path from the current state to the goal state.

Specifying a Search Problem


1. Initial state
– Where the search starts
2. Operators
– Function taking one state to another state
– How the agent moves around search space
3. Goal test
– How the agent knows if solution state found
Representing search problems
A search problem is represented using a directed graph. The states are represented as nodes while the allowed
steps or actions are represented as arcs.

Artificial Intelligence ~ Wainaina Page 5 of 12


Example: Search Problem
On holiday in Kenya; currently in Kisumu.
 Formulate goal:
– be in Nairobi
 Formulate problem:
– states: various cities
– actions: drive between cities
 Find solution:
– sequence of cities, e.g., Kisumu, Kericho, Kakamega, Nakuru, Narok

Example: The 8-puzzle

 states? locations of tiles


 actions? move blank left, right, up, down
 goal test? = goal state (given)
 path cost? 1 per move

Example of a search Problem


Three blocks A, B, C on a table are considered. A block can be grasped when there is no other block on top of
it. Only one block can be moved at a time.

Possible moves
 Put a block on table;
 Put a block on top of another block;
 Remove a block from the top of another and place on top of another block.

Search Problem
Initial state (current state)
C
A
B

Goal state (final state)


A
B
C

Artificial Intelligence ~ Wainaina Page 6 of 12


State space C B
A A A A
B BC BC C

C B
B B C C
A AC ABC AB A

B C
AC AB

A A
B C
C B

The state space has 13 elements or nodes. The solution to our problem is any member of the set of all paths
from original to goal state such as the path indicated in bold.

Search Strategies
A search strategy is defined by picking the order of node expansion. Different search strategies are evaluated in
terms of four criteria:
1. Completeness: is the strategy guaranteed to find a solution when there is one?
2. Time complexity: how long does it take to find a solution?
3. Space complexity: how much memory does it need to perform the search?
4. Optimality: does the strategy find the highest quality solution when there are several different solutions?

Time and space complexity are measured in terms of


 b: maximum branching factor of the search tree
 d: depth of the least-cost solution
 m: maximum depth of the state space (may be ∞)

Example Search Problem


 A genetics professor
– Wants to name her new baby boy
– Using only the letters D,N & A
 Search through possible strings (states)
– D,DN,DNNA,NA,AND,DNAN, etc.
– 3 operators: add D, N or A onto end of string
– Initial state is an empty string
 Goal test
– Look up state in a book of boys’ names, e.g. DAN

Types of Searches
There are two broad classes of searches:
i) Uninformed search (blind / Exhaustive search)
ii) Informed search (Heuristic/ Guided search)

Artificial Intelligence ~ Wainaina Page 7 of 12


1) Uninformed search:
This is a search that has no information about its domain. The only thing that a blind search can do is
distinguish a non-goal state from a goal state. The following are the various uniform search algorithms:
i). Breadth-first search
ii). Depth-first search
iii). Iterative deepening search
iv). Bidirectional search

i) Breadth-first search:- Expand shallowest unexpanded node


Implementation:
FIFO queue, i.e., new successors go at end

The following are characteristics of breadth-first searches:


a) Very systematic and all paths of length l will be considered before paths of length l + 1.
b) If there is a solution, breadth-first is guaranteed to find it.
c) If there are several solutions, breadth-first will always find the shallowest goal state first.
d) Not preferred in terms of time and space complexities. I.e. for a problem has a path length of d, the
maximum number of nodes expanded is 1 + b + b2 + b3 + … + bd , Where b is the branching factor.

Note: Breadth first search can only be used for small problems. If we have larger problems to solve then there
are better blind search strategies that can be used as depth first search.

ii) Depth-first search:- Expand deepest unexpanded node


Implementation:
LIFO queue, i.e., put successors at front

Artificial Intelligence ~ Wainaina Page 8 of 12


The following are characteristics of breadth-first searches:
a) It has modest memory requirements. For a state space with a branching factor of b and a maximum
depth of m, depth first search requires storage of bm nodes.
b) Depth first search is neither complete nor optimal. i.e. If depth first search goes down an infinite branch
it will not terminate if it does not find a goal state. If it does find a solution there may be a better solution
at a higher level in the tree.

2) Informed search: -
Is a search that uses domain-dependent (heuristic) information in order to search the space more efficiently.
The idea behind a heuristic search is to explore the node that is most likely to be nearest to a goal state. To
do this, a heuristic function which tells us how close we are to a goal state is used. Heuristic is used as an
estimate, based on domain-specific information that is computable from the current state description, of
how close we are to a goal
The following are the various heuristic search algorithms:
i). Uniform-cost search
ii). Hill climbing
iii). Greedy search
iv). A* search
v). IDA* search

i). Uniform-cost search:- Looks for the cheapest path from the start node to a goal node. i.e. this method
always extends the cheapest path found so far. In this way it is guaranteed to find the cheapest path, if
one exists. Generally, uniform cost search will find the cheapest solution provided that the cost of the
path never decreases as we proceed along the path. If this requirement is not met then we never know
when we will meet a negative cost. The result of this would be a need to carry out an exhaustive search
of the entire tree.

Example of a problem (2)


The figure below contains a representation of a map. The nodes represent cities, and the links represent
direct road connections between cities. The number associated to a link represents the length of the
corresponding road.

Artificial Intelligence ~ Wainaina Page 9 of 12


The search problem is to find a path from a city S to a city G

A 4 4
B C
3

S 5
5

4 G
D E F 3
2 4

Using the problem defined above, find the shortest route from S to G; that is S is the initial state and G
is the goal state
step 1
S
3 4
step 2 step 3
A 3 4 D
4 5 5 2
step 5
B 7 8 D A 9 6 E step 4

4 5 5 4

C 11 12 E 11 B F 10 step 6

3
G 13

In summary, uniform cost search will find the cheapest solution provided that the cost of the path never
decreases as we proceed along the path. If this requirement is not met then we never know when we will
meet a negative cost. The result of this would be a need to carry out an exhaustive search of the entire
tree.

ii). Hill climbing:- Hill climbing is depth-first search with a heuristic measurement that orders choices as
nodes are expanded. It always selects the most promising successor of the node last expanded. For
instance, one may consider that the most promising successor of a node is the one that has the shortest
straight-line distance to the goal city G. In figure below, the straight line distances between each city and
G is indicated in square brackets.

[8. 5] [6] [3]


A 4 4
B C
3

[10] S 5
5

4 G
D E F 3
2 4
[8] [6] [3]

The hill climbing search from S to G proceeds as follows:

Artificial Intelligence ~ Wainaina Page 10 of 12


S

A 8.5 8 D

A 8.5 6 E

6 B F 3

G
iii). Greedy Search: - The node closest to the goal state, as determined by an evaluation function f(n) = h(n),
is expanded first. Generally it selects node to expand that is believed to be closest (hence it's "greedy")
to a goal node (i.e., smallest f value).
A Heuristic Function (h(n)) is a function that calculates the cost of reaching the goal state from the node
n.
Issues:
 Finds solution quickly
 Doesn’t always find the best solution, since it evaluates the immediate best choice, not the long
term options.
 Can fall prey to false starts i.e expands a node that leads to a dead end (not complete).

iv). The search algorithm A*: - is a refinement of the greedy search due to the fact that it is neither optimal
nor complete. The goal of the A* algorithm is to find a minimal cost-path joining the start node and a
goal node. It uses the following evaluation function to estimate the promise of a node n:

f*(n) = g*(n) + h*(n)


where:
g*(n) estimates the minimum cost of a path from the start node to node n;
h*(n) estimates the minimum cost from node n to a goal.
The node chosen for expansion is the one for which f* is minimum.

Notice that A* is very similar to the uniform-cost search, except that it uses a different function (which
is a heuristic function) to estimate the promise of a node.
In fact, A* reduces to uniform-cost search if h*(n) is always considered to be 0.

Example
Use A* algorithm to find the path from city S to city G by using the following functions:

[8.5] [6] [3]


A 4 4
B C
3

[10] S 5
5

4 G
D E F 3
2 4
[8] [6] [3]

In the above figure, the value of h* for each node is represented in square brackets. That is, h*(D) = 8.

Artificial Intelligence ~ Wainaina Page 11 of 12


Solution:

step 1 S
g*(A)=3 3 4 g*(D)=4
h*(A)=8.5 h*(D)=8
f*(A)=3+8.5 A 11.5 12 D f*(D)=4+8
step 2 4 5 5 2 step 3

7+6 B 13 8+8=16 D 9+8.5 A 17.5 12 E 6+6


step 5 step 4
4 5 5 4

C 14 18 E 11+6 B 17 13 F 10+3
step 6
3
13 G

A* search of a path from S to G.

Applications of Search Methods


Route Finding
• routing in computer networks;
• automated travel advisory systems;
• airline travel planning systems.
Touring and Traveling Salesperson Problems
• planning trips for traveling salespersons;
• planning movements for automatic circuit board drills.
VLSI Layout
• cell layout on the chip;
• channel routing between the cells.
Robot Navigation
• In a two dimensional space (moving on a surface);
• In a multidimensional space (when the robot has arms and legs that must be controlled).
Assembly Sequencing
• checking the feasibility of the steps in a sequence (a geometrical search problem).

Artificial Intelligence ~ Wainaina Page 12 of 12

You might also like