0% found this document useful (0 votes)
22 views48 pages

Wa0254.

Uploaded by

Prathyusha Reddy
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)
22 views48 pages

Wa0254.

Uploaded by

Prathyusha Reddy
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/ 48

Artificial Intelligence

UNIT - I
by
Ms.S.Sowmya
Assistant Professor
Department of Computer Science & Engineering

BVRIT HYDERABAD College of Engineering for Women


Name of the Course AI
Year & Semester B.Tech III Year I Sem
Section CSE- C
Name of the Faculty Ms.Y Divya
Lecture Hour | Date 2022
Name of the Topic Introduction to AI

BVRIT HYDERABAD College of Engineering for Women


Goals of this course

This class is a introduction to artificial intelligence (AI)

Course Objectives: To train the students to understand different types of AI agents, various AI search
algorithms, fundamentals of knowledge representation, building of simple knowledge-based systems
and to apply knowledge representation, reasoning.

BVRIT HYDERABAD College of Engineering for Women


UNIT-1
Why Should I Study this course?

Examples What Is AI ???


An area of study concerned with understanding the activities of the human mind and replicating
those activities on a computer.

( This can be taken as generic definition of Artificial Intelligence)

BVRIT HYDERABAD College of Engineering for Women


Why Should I Study
Whatthis course?
Is Artificial Intelligence (AI)?

•Artificial
Examples intelligence (AI) refers to the simulation of human intelligence in machines that are
programmed to think like humans and mimic their actions.
•The term may also be applied to any machine that exhibits traits associated with a human mind
such as learning and problem-solving.
•The ideal characteristic of artificial intelligence is its ability to rationalize and take actions that
have the best chance of achieving a specific goal.
•A subset of artificial intelligence is machine learning, which refers to the concept that computer
programs can automatically learn from and adapt to new data without being assisted by humans.
•Deep learning techniques enable this automatic learning through the absorption of huge amounts of
unstructured data such as text, images, or video.

BVRIT HYDERABAD College of Engineering for Women


KEY TAKEAWAYS OF THE UNIT

•Artificial intelligence refers to the simulation of human intelligence in machines.

•The goals of artificial intelligence include learning, reasoning, and perception.

•AI is being used across different industries including finance and healthcare.

•Weak AI tends to be simple and single-task oriented, while strong AI carries on tasks that

are more complex and human-like.

BVRIT HYDERABAD College of Engineering for Women


Understanding Artificial Intelligence (AI)

•When most people hear the term artificial intelligence, the first thing they usually think of is robots.
•That's because big-budget films and novels weave stories about human-like machines that wreak havoc on
Earth. But nothing could be further from the truth.
•Artificial intelligence is based on the principle that human intelligence can be defined in a way that a machine
can easily mimic it and execute tasks, from the most simple to those that are even more complex.
•The goals of artificial intelligence include mimicking human cognitive activity. Researchers and developers in
the field are making surprisingly rapid strides in mimicking activities such as learning, reasoning, and
perception, to the extent that these can be concretely defined.
•Some believe that innovators may soon be able to develop systems that exceed the capacity of humans to learn
or reason out any subject.
• But others remain skeptical because all cognitive activity is laced with value judgements that are subject to
human experience.

BVRIT HYDERABAD College of Engineering for Women


Views of AI fall into four categories:

Thinking humanly Thinking rationally

Acting humanly Acting rationally

The course advocates "acting rationally"

BVRIT HYDERABAD College of Engineering for Women


Acting humanly: Turing Test

Turing (1950) "Computing machinery and intelligence":


"Can machines think?" → "Can machines behave intelligently?"
Operational test for intelligent behavior: the Imitation Game

Predicted that by 2000, a machine might have a 30% chance of fooling a lay
person for 5 minutes
Anticipated all major arguments against AI in following 50 years
Suggested major components of AI: knowledge, reasoning, language
understanding, learning

BVRIT HYDERABAD College of Engineering for Women


Thinking humanly: cognitive modeling

1960s "cognitive revolution": information-processing psychology

Requires scientific theories of internal activities of the brain

-- How to validate? Requires


1) Predicting and testing behavior of human subjects (top-down)
or 2) Direct identification from neurological data (bottom-up)

Both approaches (roughly, Cognitive Science and Cognitive Neuroscience)


are now distinct from AI

BVRIT HYDERABAD College of Engineering for Women


Thinking rationally: "laws of thought"

Aristotle: what are correct arguments/thought processes?

Several Greek schools developed various forms of logic: notation and rules of
derivation for thoughts; may or may not have proceeded to the idea of
mechanization

Direct line through mathematics and philosophy to modern AI

Problems:
1. Not all intelligent behavior is mediated by logical deliberation
2. What is the purpose of thinking? What thoughts should I have?

BVRIT HYDERABAD College of Engineering for Women


Acting rationally: rational agent

Rational behavior: doing the right thing

The right thing: that which is expected to maximize goal achievement, given the
available information

Doesn't necessarily involve thinking – e.g., blinking reflex – but thinking should be in
the service of rational action

BVRIT HYDERABAD College of Engineering for Women


Applications of Artificial Intelligence

•The applications for artificial intelligence are endless.


•The technology can be applied to many different sectors and industries.
• AI is being tested and used in the healthcare industry for dosing drugs and different treatment in patients, and for surgical
procedures in the operating room.
•Other examples of machines with artificial intelligence include computers that play chess and self-driving cars.
•Each of these machines must weigh the consequences of any action they take, as each action will impact the end result. In
chess, the end result is winning the game.
• For self-driving cars, the computer system must account for all external data and compute it to act in a way that prevents a
collision.
•Artificial intelligence also has applications in the financial industry, where it is used to detect and flag activity in banking
and finance such as unusual debit card usage and large account deposits—all of which help a bank's fraud department.
•Applications for AI are also being used to help streamline and make trading easier. This is done by making supply, demand,
and pricing of securities easier to estimate.

BVRIT HYDERABAD College of Engineering for Women


Categorization of Artificial Intelligence

Artificial intelligence can be divided into two following two categories:

Weak artificial intelligence embodies a system designed to carry out one particular job.
• Weak AI systems include video games such as the chess example from above and personal
assistants such as Amazon's Alexa and Apple's Siri. You ask the assistant a question, it answers it for
you.

Strong artificial intelligence systems are systems that carry on the tasks considered to be human-like.
These tend to be more complex and complicated systems.
• They are programmed to handle situations in which they may be required to problem solve
without having a person intervene.
• These kinds of systems can be found in applications like self-driving cars or in hospital operating
rooms.

BVRIT HYDERABAD College of Engineering for Women


AI Prehistory
• Philosophy
• Logic, methods of reasoning, mind as physical system, foundation of learning, language, rationality
• Mathematics
• Formal representation and proof, algorithms, computation, (un)decidability, (in)tractability, probability
• Economics
• Utility, decision theory
• Neuroscience
• Physical substrate for mental activity
• Psychology
• Adaptation, phenomena of perception and motor control, experimental techniques (psychophysics, etc.)
• Computer engineering
• Building fast computer
• Control theory
• Homeostatic systems, stability, simple optimal agent designs
• Linguistics
• Knowledge representation, grammar

BVRIT HYDERABAD College of Engineering for Women


Artificial Intelligence problems

1. Lack of technical knowledge


To integrate, deploy and implement AI applications in the enterprise, the organization must have the
knowledge of the current AI advancement and technologies as well as its shortcomings. The lack of technical
know-how is hindering the adoption of this niche domain in most of the organization. Only 6% enterprises,
currently, having a smooth ride adopting AI technologies. Enterprise requires a specialist to identify the
roadblocks in the deployment process. Skilled human resources would also help the teamwork with Return
on in tracking of adopting AI/ML solutions.

2. The price factor


Small and mid-sized organization struggles a lot when it comes to adopting AI technologies as it is a costly
affair. Even big firms like Facebook, Apple, Microsoft, Google, Amazon (FAMGA) allocate a separate budget
for adopting and implementing AI technologies.

BVRIT HYDERABAD College of Engineering for Women


3. Data acquisition and storage
• One of the biggest Artificial Intelligence problems is data acquisition and storage. Business AI systems depend on
sensor data as its input.
• For validation of AI, a mountain of sensor data is collected. Irrelevant and noisy datasets may cause obstruction as
they are hard to store and analyze.
• AI works best when it has a good amount of quality data available to it. The algorithm becomes strong and
performs well as the relevant data grows.
4. Rare and expensive workforce
• As mentioned above, adoption and deployment of AI technologies require specialists like data scientists, data
engineer and other SMEs (Subject Matter Experts).
• These experts are expensive and rare in the current marketplace.
• Small and medium-sized enterprises fall short of their tight budget to bring in the manpower according to the
requirement of the project.
BVRIT HYDERABAD College of Engineering for Women
5. Issue of responsibility
• The implementation of AI application comes with great responsibility.
• Any specific individual must bear the burden of any sort of hardware malfunctions.
• Earlier, it was relatively easy to determine whether an incident was the result of the actions of a user,
developer or manufacturer.
6. Ethical challenges
• One of the major AI problems that are yet be tackled are the ethics and morality. The way how the developers
are technically grooming the AI bots to perfection where it can flawlessly imitate human conversations,
making it increasingly tough to spot a difference between a machine and a real customer service rep.
• Artificial intelligence algorithm predicts based on the training given to it.
• The algorithm will label things as per the assumption of data it is trained on.
• Hence, it will simply ignore the correctness of data, for example- if the algorithm is trained on data that
reflects racism or sexism, the result of prediction will mirror back it instead of correcting it automatically.

BVRIT HYDERABAD College of Engineering for Women


7. Lack of computation speed
• AI, Machine learning and deep learning solutions require a high degree of computation speeds offered only by high-
end processors.
• Larger infrastructure requirements and pricing associated with these processors has become a hindrance in their
general adoption of the AI technology.
• In this scenario, cloud computing environment and multiple processors running in parallel offer a potent alternative
to cater to these computational requirements.
• As the volume of data available for processing grows exponentially, the computation speed requirements will grow
with it. It is imperative to develop next-gen computational infrastructure solutions.
8. Legal Challenges
• An AI application with an erroneous algorithm and data governance can cause legal challenges for the company. This
is yet again one of the biggest Artificial Intelligence problems that a developer faces in a real world.
• Flawed algorithm made with an inappropriate set of data can leave a colossal dent in an organization’s profit. An
erroneous algorithm will always make incorrect and unfavourable predictions.
BVRIT HYDERABAD College of Engineering for Women
9. AI Myths & Expectation:
• There’s a quite discrepancy between the actual potential of the AI system and the expectations of this
generation.
• Media says, Artificial Intelligence, with its cognitive capabilities, will replace human’s jobs.
• However, the IT industry has a challenge on their hands to address these lofty expectations by accurately
conveying that AI is just a tool that can operate only with the indulgence of human brains.
• AI can definitely boost the outcome of something that will replace human roles like automation of routine or
common work, optimizations of every industrial work, data-driven predictions, etc.
10. Difficulty of assessing vendors
• In any emerging field, a tech procurement is quite challenging as AI is particularly vulnerable.
• Businesses face a lot of problems to know how exactly they can use AI effectively as many non-AI companies
engage in AI washing, some organizations overstate.

BVRIT HYDERABAD College of Engineering for Women


What is Agent and Environment?
An agent is anything that can perceive its environment through sensors and acts upon that environment through
effectors.
•A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to the sensors, and other
organs such as hands, legs, mouth, for effectors.
•A robotic agent replaces cameras and infrared range finders for the sensors, and various motors and actuators for
effectors.
•A software agent has encoded bit strings as its programs and actions.

BVRIT HYDERABAD College of Engineering for Women


Agent Terminology

Performance Measure of Agent − It is the criteria, which determines how successful an agent is.
Behavior of Agent − It is the action that agent performs after any given sequence of percepts.
Percept − It is agent’s perceptual inputs at a given instance.
Percept Sequence − It is the history of all that an agent has perceived till date.
Agent Function − It is a map from the precept sequence to an action.

BVRIT HYDERABAD College of Engineering for Women


Types of Environments in AI

An environment in artificial intelligence is the surrounding of the agent. The agent takes input from the
environment through sensors and delivers the output to the environment through actuators. There are several types
of environments:
1. Fully Observable vs Partially Observable
2. Deterministic vs Stochastic
3. Competitive vs Collaborative
4. Single-agent vs Multi-agent
5. Static vs Dynamic
6. Discrete vs Continuous

BVRIT HYDERABAD College of Engineering for Women


1. Fully Observable vs Partially Observable
When an agent sensor is capable to sense or access the complete state of an agent at
each point of time, it is said to be a fully observable environment else it is partially
observable .
Maintaining a fully observable environment is easy as there is no need to keep track of
the history of the surrounding.
An environment is called unobservable when the agent has no sensors in all
environments.
Example:
Chess – the board is fully observable, so are the opponent’s moves
Driving – the environment is partially observable because what’s around the corner
is not known

BVRIT HYDERABAD College of Engineering for Women


2. Deterministic vs Stochastic
When an uniqueness in the agent’s current state completely determines the next state of the agent, the environment
is said to be deterministic.
Stochastic environment is random in nature which is not unique and cannot be completely determined by the agent.
Example:
Chess – there would be only few possible moves for a coin at the current state and these moves can be determined
Self Driving Cars – the actions of a self driving car are not unique, it varies time to time
3. Competitive vs Collaborative
An agent is said to be in a competitive environment when it competes against another agent to optimize the output.
Game of chess is competitive as the agents compete with each other to win the game which is the output.
An agent is said to be in a collaborative environment when multiple agents cooperate to produce the desired output.
When multiple self-driving cars are found on the roads, they cooperate with each other to avoid collisions and reach
their destination which is the output desired.
BVRIT HYDERABAD College of Engineering for Women
4. Single-agent vs Multi-agent
An environment consisting of only one agent is said to be a single agent environment.
A person left alone in a maze is an example of single agent system.
An environment involving more than one agent is a multi agent environment.
The game of football is multi agent as it involves 10 players in each team.

5. Dynamic vs Static
An environment that keeps constantly changing itself when the agent is up with some action is said to be dynamic.
A roller coaster ride is dynamic as it is set in motion and the environment keeps changing every instant.
An idle environment with no change in it’s state is called a static environment.
An empty house is static as there’s no change in the surroundings when an agent enters.

6. Discrete vs Continuous
If an environment consists of a finite number of actions that can be deliberated in the environment to obtain the output, it is
said to be a discrete environment.
The game of chess is discrete as it has only a finite number of moves. The number of moves might vary with every game, but
still, it’s finite.
The environment in which the actions performed cannot be numbered ie. is not discrete, is said to be continuous.
Self-driving cars are an example of continuous environments as their actions are driving, parking, etc. which cannot be
numbered.
BVRIT HYDERABAD College of Engineering for Women
The Structure of Agents

An intelligent agent is a combination of Agent Program and Architecture.


Intelligent Agent = Agent Program + Architecture
Agent Program is a function that implements the agent mapping from percepts to actions. There exists a variety of basic
agent program designs, reflecting the kind of information made explicit and used in the decision process. The designs
vary in efficiency, compactness, and flexibility. The appropriate design of the agent program depends on the nature of
the environment.
Architecture is a computing device used to run the agent program.
To perform the mapping task four types of agent programs are used. They are:

1. Simple reflex agents


2. Model-based reflex agents
3. Goal-based agents
4. Utility-based agents

BVRIT HYDERABAD College of Engineering for Women


Agent and Environments
An agent perceives it’s environment through Sensors and
acts upon the processed o/p through actuators.

E
N
Agent Sensors
V
I
R

Agent function O
N
M
E
Actuator
N
T

BVRIT HYDERABAD College of Engineering for Women


PEAS

• PEAS: Performance measure, Environment, Actuators, Sensors


• Must first specify the setting for intelligent agent design
• Consider, e.g., the task of designing an automated taxi driver:

➢Performance measure
➢Environment
➢Actuators
➢Sensors

BVRIT HYDERABAD College of Engineering for Women


Task Environment
Performance
Agent type measure Environment Actuators Sensors

Safe, fast, Roads, other Steering, Cameras,


Taxi driver legal, traffic, accelerator, sonar,
comfortable pedestrians, brake, signal, speedometer,
trip, maximize customers horn, display GPS, odometer,
profit accelerometer,
engine sensors,
keyboard

BVRIT HYDERABAD College of Engineering for Women


Define PEAS for Medical Diagnosis System

Agent: Medical diagnosis system


Performance measure: Healthy patient, minimize costs, lawsuits
Environment: Patient, hospital, staff
Actuators: Screen display (questions, tests, diagnoses, treatments, referrals)
Sensors: Keyboard (entry of symptoms, findings, patient's answers)

BVRIT HYDERABAD College of Engineering for Women


1.Simple reflex agents
The simplest kind of agent is the simple reflex agent. It responds directly to percepts i.e. these agent select actions on
the basis of the current percept, ignoring the rest of the percept history.
An agent describes about how the condition action rules allow the agent to make the connection from percept to
action.

BVRIT HYDERABAD College of Engineering for Women


2.Model-based reflex agents (Agents that keep track of the world)

• The most effective way to handle partial observability is for the agent
―to keep track of the part of the world it cant see now. That is, the
agent which combines the current percept with the old internal state
to generate updated description of the current state.
• The current percept is combined with the old internal state and it
derives a new current state is updated in the state description is also.
This updation requires two kinds of knowledge in the agent program.
First, we need some information about how the world evolves
independently of the agent. Second, we need some information about
how the agents own actions affect the world.
• The above two knowledge implemented in simple Boolean circuits or
in complete scientific theories is called a model of the world. An agent
that uses such a model is called a model- based agent.
BVRIT HYDERABAD College of Engineering for Women
3.Goal-based agents
• An agent knows the description of current state and also needs
some sort of goal information that describes situations that are
desirable. The action matches with the current state is selected
depends on the goal state.
• The goal based agent is more flexible for more than one
destination also. After identifying one destination, the new
destination is specified, goal based agent is activated to come up
with a new behavior. Search and Planning are the subfields of AI
devoted to finding action sequences that achieve the agents goals.
• The goal-based agent appears less efficient, it is more flexible
because the knowledge that supports its decisions is represented
explicitly and can be modified. The goal-based agent‘s behavior
can easily be changed to go to a different location.

BVRIT HYDERABAD College of Engineering for Women


4. Utility-based agents (the quality of being useful)

• An agent generates a goal state with high – quality behavior


(utility) that is, if more than one sequence exists to reach the
goal state then the sequence with more reliable, safer,
quicker and cheaper than others to be selected.
• A utility function maps a state (or sequence of states) onto a
real number, which describes the associated degree of
happiness. The utility function can be used for two different
cases: First, when there are conflicting goals, only some of
which can be achieved (for e.g., speed and safety), the utility
function specifies the appropriate tradeoff. Second, when the
agent aims for several goals, none of which can be achieved
with certainty, then the success can be weighted up against
the importance of the goals.

BVRIT HYDERABAD College of Engineering for Women


Steps to solve an AI problem :
Goal Formulation: This one is the first and simple step in problem-solving. It organizes finite steps to formulate a goals
which require some action to achieve the goal. Today the formulation of the goal is based on AI agents.
Problem formulation: It is one of the core steps of problem-solving which decides what action should be taken to achieve the
formulated goal. In AI this core part is dependent upon software agent which consisted of the following components to
formulate the associated problem. Following are components to formulate the associated problem:
Initial State: This state requires an initial state for the problem which starts the AI agent towards a specified goal. In this state
new methods also initialize problem domain solving by a specific class.
Action: This stage of problem formulation works with function with a specific class taken from the initial state and all possible
actions done in this stage.
Transition: This stage of problem formulation integrates the actual action done by the previous action stage and collects the final
stage to forward it to their next stage.
Goal test: This stage determines that the specified goal achieved by the integrated transition model or not, whenever the goal
achieves stop the action and forward into the next stage to determines the cost to achieve the goal.
Path costing: This component of problem-solving numerical assigned what will be the cost to achieve the goal. It requires all
hardware software and human working cost.
BVRIT HYDERABAD College of Engineering for Women
Data Structure - Breadth First Traversal
Breadth First Search (BFS) algorithm traverses a graph in a breadthward motion and uses a queue to remember to get
the next vertex to start a search, when a dead end occurs in any iteration.
As in the example given above, BFS algorithm traverses from A to B to E to F first then to C and G lastly to D. It
employs the following rules.
Rule 1 − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Insert it in a queue.
Rule 2 − If no adjacent vertex is found, remove the first vertex from the queue.
Rule 3 − Repeat Rule 1 and Rule 2 until the queue is empty.
Step Traversal Description
1Initialize the queue.
2We start from visiting S (starting node), and mark it as visited.
3We then see an unvisited adjacent node from S. In this example, we have three nodes but alphabetically we
choose A, mark it as visited and enqueue it.
4.Next, the unvisited adjacent node from S is B. We mark it as visited and enqueue it.
5.Next, the unvisited adjacent node from S is C. We mark it as visited and enqueue it.
6.Now, S is left with no unvisited adjacent nodes. So, we dequeue and find A.
7.From A we have D as unvisited adjacent node. We mark it as visited and enqueue it.
At this stage, we are left with no unmarked (unvisited) nodes. But as per the algorithm we keep on dequeuing in
order to get all unvisited nodes. When the queue gets emptied, the program is over.

BVRIT HYDERABAD College of Engineering for Women


BVRIT HYDERABAD College of Engineering for Women
Initialize the queue.

We start from visiting S (starting node),


and mark it as visited.

We then see an unvisited adjacent node


from S. In this example, we have three
nodes but alphabetically we choose A,
mark it as visited and enqueue it.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Breadth First Traversal
Next, the unvisited adjacent
node from S is B. We mark it
as visited and enqueue it.

Next, the unvisited adjacent node from S is C.


We mark it as visited and enqueue it.

Now, S is left with no unvisited adjacent nodes.


So, we dequeue and find A.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Breadth First Traversal

From A we have D as unvisited adjacent node.


We mark it as visited and enqueue it.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Depth First Traversal

Depth First Search (DFS) algorithm traverses a graph in a depthward motion and
uses a stack to remember to get the next vertex to start a search, when a dead end
occurs in any iteration.

BVRIT HYDERABAD College of Engineering for Women


As in the example given above, DFS algorithm traverses from S to A to D to G
to E to B first, then to F and lastly to C. It employs the following rules.
Rule 1 − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Push
it in a stack.
Rule 2 − If no adjacent vertex is found, pop up a vertex from the stack. (It will
pop up all the vertices from the stack, which do not have adjacent vertices.)
Rule 3 − Repeat Rule 1 and Rule 2 until the stack is empty.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Depth First Traversal

Initialize the stack.

Mark S as visited and put it


onto the stack. Explore any
unvisited adjacent node
from S. We have three nodes
and we can pick any of them.
For this example, we shall take
the node in an alphabetical
order.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Depth First Traversal

Mark A as visited and put it onto the


stack. Explore any unvisited adjacent
node from A. Both S and D are
adjacent to A but we are concerned for
unvisited nodes only.

Visit D and mark it as visited and put


onto the stack. Here, we
have B and C nodes, which are adjacent
to D and both are unvisited. However,
we shall again choose in an alphabetical
order.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Depth First Traversal

We choose B, mark it as visited and put onto


the stack. Here B does not have any unvisited
adjacent node. So, we pop B from the stack.

We check the stack top for return to the


previous node and check if it has any unvisited
nodes. Here, we find D to be on the top of the
stack.

BVRIT HYDERABAD College of Engineering for Women


Data Structure - Depth First Traversal

Only unvisited adjacent


node is from D is C now.
So we visit C, mark it as
visited and put it onto the
stack.

As C does not have any unvisited adjacent node so we keep popping the stack
until we find a node that has an unvisited adjacent node.
In this case, there's none and we keep popping until the stack is empty.

BVRIT HYDERABAD College of Engineering for Women

You might also like