0% found this document useful (0 votes)
20 views31 pages

Cs AI

The document discusses artificial intelligence including its definition, types, applications, techniques, goals, advantages, and disadvantages. It also discusses problem solving and problem spaces. Artificial intelligence exists when a machine exhibits cognitive abilities like reasoning, learning, perception and problem solving. It has applications in areas like gaming, natural language processing, expert systems, vision systems, speech recognition, handwriting recognition and intelligent robots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views31 pages

Cs AI

The document discusses artificial intelligence including its definition, types, applications, techniques, goals, advantages, and disadvantages. It also discusses problem solving and problem spaces. Artificial intelligence exists when a machine exhibits cognitive abilities like reasoning, learning, perception and problem solving. It has applications in areas like gaming, natural language processing, expert systems, vision systems, speech recognition, handwriting recognition and intelligent robots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

ARITIFICIAL INTELLIGENCE

UNIT 1

S.PADMAVATHI
Asst.Prof in CS
Auxilium college,Regunathapuram
Definition of Artificial Intelligence:
A machine with the ability to perform cognitive functions such as perceiving,
learning, reasoning and solve problems are deemed to hold an artificial
intelligence.

Artificial intelligence exists when a machine has cognitive ability. The


benchmark for AI is the human level concerning reasoning, speech, and vision.

Intelligence is composed of:


 Reasoning
 Learning
 Problem Solving
 Perception
 Linguistic Intelligence
Type of Artificial Intelligence
Artificial intelligence can be divided into three subfields:
 Artificial intelligence
 Machine learning
 Deep learning

Need for Artificial Intelligence


 To create expert systems which exhibit intelligent behavior with the
capability to learn, demonstrate, explain and advice its users.
 Helping machines find solutions to complex problems like humans do
and applying them as algorithms in a computer-friendly manner
Applications of AI
AI has been dominant in various fields such as −

Gaming − AI plays crucial role in strategic games such as chess, poker,


tic-tac-toe, etc., where machine can think of large number of possible
positions based on heuristic knowledge.

Natural Language Processing − It is possible to interact with the


computer that understands natural language spoken by humans.

Expert Systems − There are some applications which integrate machine,


software, and special information to impart reasoning and advising. They
provide explanation and advice to the users.
Vision Systems − These systems understand, interpret, and
comprehend visual input on the computer.

For example,
o A spying aeroplane takes photographs, which are used to figure out
spatial information or map of the areas.
o Doctors use clinical expert system to diagnose the patient.
o Police use computer software that can recognize the face of criminal
with the stored portrait made by forensic artist.
Speech Recognition: Some intelligent systems are capable
of hearing and comprehending the language in terms of
sentences and their meanings while a human talks to it. It can
handle different accents, slang words, noise in the
background, change in human’s noise due to cold, etc.

Handwriting Recognition: The handwriting recognition


software reads the text written on paper by a pen or on
screen by a stylus. It can recognize the shapes of the letters
and convert it into editable text.
Examples:Tic Tac Toe
 The game Tic Tac Toe is also known as Noughts and Crosses or Xs and Os ,the
player needs to take turns marking the spaces in a 3x3 grid with their own marks,if
3 consecutive marks (Horizontal, Vertical,Diagonal) are formed then the player
who owns these moves get won.
Assume ,
Player 1 - X
Player 2 – O
 The programs in this series increase in:
 Their Complexity
 Their use of generalizations
 The clarity of their knowledge
 The extensibility of their approach.Thus, they move toward being representations
of what we call AI techniques
Intelligent Robots − Robots are able to perform the tasks
given by a human. They have sensors to detect physical data
from the real world such as light, heat, temperature,
movement, sound, bump, and pressure. They have efficient
processors, multiple sensors and huge memory, to exhibit
intelligence. In addition, they are capable of learning from
their mistakes and they can adapt to the new environment.
AI Technique
In the real world, the knowledge has some unwelcomed properties −
 Its volume is huge, next to unimaginable.
 It is not well-organized or well-formatted.
 It keeps changing constantly.

AI Technique is a manner to organize and use the knowledge


efficiently in such a way that −
 It should be perceivable by the people who provide it.
 It should be easily modifiable to correct errors.
 It should be useful in many situations though it is incomplete or
inaccurate.
AI techniques elevate the speed of execution of the complex program it is
equipped with
Goals of Artificial Intelligence
Following are the main goals of Artificial Intelligence:
 Replicate human intelligence
 Solve Knowledge-intensive tasks
 An intelligent connection of perception and action
Building a machine which can perform tasks that requires human intelligence
such as:

 Proving a theorem
 Playing chess
 Plan some surgical operation
 Driving a car in traffic
Creating some system which can exhibit intelligent behavior, learn new
things by itself, demonstrate, explain, and can advise to its user.
Advantages of Artificial Intelligence
 Following are some main advantages of Artificial Intelligence:
 High Accuracy with less errors: AI machines or systems are prone to less errors and high
accuracy as it takes decisions as per pre-experience or information.
 High-Speed: AI systems can be of very high-speed and fast-decision making, because of
that AI systems can beat a chess champion in the Chess game.
 High reliability: AI machines are highly reliable and can perform the same action multiple
times with high accuracy.
 Useful for risky areas: AI machines can be helpful in situations such as defusing a bomb,
exploring the ocean floor, where to employ a human can be risky.
 Digital Assistant: AI can be very useful to provide digital assistant to the users such as AI
technology is currently used by various E-commerce websites to show the products as per
customer requirement.
 Useful as a public utility: AI can be very useful for public utilities such as a self-driving
car which can make our journey safer and hassle-free, facial recognition for security
purpose, Natural language processing to communicate with the human in human-
language, etc.
Disadvantages of Artificial Intelligence
 High Cost: The hardware and software requirement of AI is very costly as it requires lots

of maintenance to meet current world requirements.

 Can't think out of the box: Even we are making smarter machines with AI, but still they

cannot work out of the box, as the robot will only do that work for which they are

trained, or programmed.

 No feelings and emotions: AI machines can be an outstanding performer, but still it does

not have the feeling so it cannot make any kind of emotional attachment with human,

and may sometime be harmful for users if the proper care is not taken.

 Increase dependency on machines: With the increment of technology, people are

getting more dependent on devices and hence they are losing their mental capabilities.

 No Original Creativity: As humans are so creative and can imagine some new ideas but

still AI machines cannot beat this power of human intelligence and cannot be creative

and imaginative.
PROBLEMS, PROBLEM SPACES AND SEARCH

To solve the problem of building a system you should take the following steps:

1.Define the problem accurately including detailed specifications and what


constitutes a suitable solution.

2. Scrutinize the problem carefully, for some features may have a central affect on
the chosen method of solution.

3. Segregate and represent the background knowledge needed in the solution of


the problem.

4. Choose the best solving techniques for the problem to solve a solution.

Problem solving is a process of generating solutions from observed data.

• a ‘problem’ is characterized by a set of goals,

• a set of objects, and

• a set of operations. These could be ill-defined and may evolve during problem
solving.
A ‘problem space’ is an abstract space.

A problem space encompasses all valid states that can be generated by the
application of any combination of operators on any combination of objects.
The problem space may contain one or more solutions.
A solution is a combination of operations and objects that achieve the goals.
• A ‘search’ refers to the search for a solution in a problem space.
Search proceeds with different types of ‘search control strategies’.
The depth-first s search and breadth-first search are the two common
search strategies.
General Problem Solving

Problem solving has been the key area of concern for Artificial Intelligence.

Problem solving is a process of generating solutions from observed or given data. It is


however not always possible to use direct methods (i.e. go directly from data to
solution). Instead, problem solving often needs to use indirect or modelbased
methods.

Problem definitions

A problem is defined by its ‘elements’ and their ‘relations’. To provide a formal


description of a problem, we need to do the following:

a. a.Define a state space that contains all the possible configurations of the relevant
objects, including some impossible ones.

b. b. Specify one or more states that describe possible situations, from which the
problem solving process may start. These states are called initial states.

c. c. Specify one or more states that would be acceptable solution to the problem

These states are called goal states.


Specify a set of rules that describe the actions (operators) available.
The problem can then be solved by using the rules, in combination with an
appropriate control strategy, to move through the problem space until a path
from an initial state to a goal state is found. This process is known as ‘search’.
Thus:
 Search is fundamental to the problem-solving process.
 Search is a general mechanism that can be used when a more direct method
is not known.
 Search provides the framework into which more direct methods for solving
subparts of a problem can be embedded. A very large number of AI
problems are formulated as search problems.
 Problem space
A problem space is represented by a directed graph, where nodes represent
search state and paths represent the operators applied to change the state.
Problem solving:

The term, Problem Solving relates to analysis in AI. Problem solving


may be characterized as a systematic search through a range of possible
actions to reach some predefined goal or solution. Problem-solving
methods are categorized as special purpose and general purpose.

• A special-purpose method is tailor-made for a particular problem,


often exploits very specific features of the situation in which the
problem is embedded.

• A general-purpose method is applicable to a wide variety of


problems. One General-purpose technique used in AI is ‘means-end
analysis’: a step-by step, or incremental, reduction of the difference
between current state and final goal.
DEFINING PROBLEM AS A STATE SPACE SEARCH:

State Space Search A state space represents a problem in terms of states


and operators that change states. A state space consists of:
 A representation of the states the system can be in. For example, in a
board game, the board represents the current state of the game.
 A set of operators that can change one state into another state. In a
board game, the operators are the legal moves from any given state.
Often the operators are represented as programs that change a state
representation to represent the new state.
 An initial state.
 A set of final states; some of these may be desirable, others undesirable.
This set is often represented implicitly by a program that detects
terminal states
The Water Jug Problem
In this problem, we use two jugs called four and three; four holds a
maximum of four gallons of water and three a maximum of three gallons
of water. How can we get two gallons of water in the four jug?
The state space is a set of prearranged pairs giving the number of gallons
of water in the pair of jugs at any time, i.e., (four, three) where four = 0, 1,
2, 3 or 4 and three = 0, 1, 2 or 3.
The start state is (0, 0) and the goal state is (2, n) where n may be any but it
is limited to three holding from 0 to 3 gallons of water or empty. Three and
four shows the name and numerical number shows the amount of water in
jugs for solving the water jug problem. The major production rules for
solving this problem are shown below:
Example:

4L=0 3L=0 4L=0 3L=3 4L=3 3L=0 4L=3 3L=3

4L=4 3L=2 4L=0 3L=2 4L=2 3L=0


Rule State Process

1. Fill 4-lit Jug (x,y) n<4 (4,y)

2. Fill 3-lit Jug(x,y) y<3 (3,n)

3. n,y /n>0 (0,y)empty-4 lit jug

4. (x,y) /y>0 (x,0) empty-3 lit jug

5. x,y, x+y>=4^y>0 Pour water from 3 lit jug into 4 lit is full.
Jug an fill 4 lit full.

6. x,y/x+y>=3^n>0 Pour water from 4 lit jug into 3 lit jug


(n-(3-y),3) until 3lit jug is full.
7. x,y/x+y<=4^y>0 (x+y,0) pour all water from 3 lit jug into
4 lit jug.
8. x,y/x+y<=3^x>0 (0, x+y) pour all water from 4 lit jug into
3 lit jug.
9. (0,2) (0,2) pour 2 lit water from 3 lit jug into 4
lit jug.
Gallon in the 4 Gallon Jug Gallon in the 3 Gallon Jug

0 0

0 3

3 0

3 3

4 2

0 2

2 0
Criteria for success:
 Task define clearly
 Test the possible solution
 Solution is analysis
 Implement procedure of define task
 Design Experiment

 Algorithm
 Analyze Implement
PRODUCTION SYSTEMS
 Production systems provide appropriate structures for performing and
describing search processes. A production system has four basic
components as enumerated below.
 A set of rules each consisting of a left side that determines the
applicability of the rule and a right side that describes the operation to
be performed if the rule is applied.
 database of current facts established during the process of inference
 A control strategy that specifies the order in which the rules will be
compared with facts in the database and also specifies how to resolve
conflicts in selection of several rules or selection of more facts.
 A rule firing module.
The production rules operate on the knowledge database.

1. Each rule has a precondition—that is, either satisfied or not by

the knowledge database.

2. If the precondition is satisfied, the rule can be applied.

3. Application of the rule changes the knowledge database.

4. The control system chooses which applicable rule should be

applied and ceases computation when a termination condition on the

knowledge database is satisfied.


Control Strategies
The word ‘search’ refers to the search for a solution in a problem space.
Search proceeds with different types of ‘search control strategies’. A
strategy is defined by picking the order in which the nodes expand. The
Search strategies are evaluated along the following dimensions:
Completeness, Time complexity, Space complexity, Optimality (the
search- related terms are first explained, and then the search algorithms
and control strategies are illustrated next).
Depth first search:
Depth-first search (DFS) is an algorithm for traversing or searching tree or
graph data structures.
The algorithm starts at the root node (selecting some arbitrary node as the
root node in the case of a graph) and explores as far as possible along each
branch before backtracking. Example: A

Algorithm:
B C
Push the root node on a stack
While (stack is not empty)
D E F G
(a) pop a node
If it is goal node
Push all the children of node in the stack ABDECFG
Return failure.
ADVANTAGE OF DFS:

1. Consumes less memory

2. Find the larger distance element in less time

DISADVANTAGE OF DFS:

May not find optimal solution to the problem

May get trapped in searching useless path


Breadth-first search (BFS)
Breadth-first search (BFS is an algorithm for traversing or searching tree or graph
data structures. It starts at the tree root (or some arbitrary node of a graph,
sometimes referred to as a ‘search key’), and explores all of the neighbor nodes
at the present depth prior to moving on to the nodes at the next depth level.

Algorithm:

Put the root node on a queue Example: A

While (queue is not empty)


B C
(a) Remove a node from queue

Goal node  success

Put all the child of node in queue D E F G


Return failure

ABCDEFG
ADVANTAGES OF BFS:
(i) Used to find the shortest path between vertices.
(ii) Always find optimal solution.
(iii) There is nothing lie useless path in BFS. Since, it search as level by
level.
(iv) Find the closet goal in less time.
DISADVANTAGES OF BFS:
(i) All of the connected vertices must be store is memory so consumes
more memory.

You might also like