Unit I AI
Unit I AI
Unit I AI
Unit I
What is Artificial Intelligence
AI is one of the fascinating and universal fields of Computer science which has a great scope in
future. AI holds a tendency to cause a machine to work as a human.
Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made
thinking power."
"It is a branch of computer science by which we can create intelligent machines which can behave
like a human, think like humans, and able to make decisions."
Artificial Intelligence exists when a machine can have human based skills such as learning, reasoning,
and solving problems.
o With the help of AI, you can create such software or devices which can solve real-world
problems very easily and with accuracy such as health issues, marketing, traffic issues, etc.
o With the help of AI, you can create your personal virtual Assistant, such as Cortana, Google
Assistant, Siri, etc.
o With the help of AI, you can build such Robots which can work in an environment where
survival of humans can be at risk.
o AI opens a path for other new technologies, new devices, and new Opportunities.
4. Building a machine which can perform tasks that requires human intelligence such as:
o Proving a theorem
o Playing chess
5. Creating some system which can exhibit intelligent behavior, learn new things by itself,
demonstrate, explain, and can advise to its user.
To achieve the above factors for a machine or software Artificial Intelligence requires the following
discipline:
o Mathematics
o Biology
o Psychology
o Sociology
o Computer Science
o Neurons Study
o Statistics
o Narrow AI is a type of AI which is able to perform a dedicated task with intelligence. The
most common and currently available AI is Narrow AI in the world of Artificial Intelligence.
o Narrow AI cannot perform beyond its field or limitations, as it is only trained for one specific
task. Hence it is also termed as weak AI. Narrow AI can fail in unpredictable ways if it goes
beyond its limits.
o Apple Siri is a good example of Narrow AI, but it operates with a limited pre-defined range of
functions.
o IBM's Watson supercomputer also comes under Narrow AI, as it uses an Expert system
approach combined with Machine learning and natural language processing.
o Some Examples of Narrow AI are playing chess, purchasing suggestions on e-commerce site,
self-driving cars, speech recognition, and image recognition.
2. General AI:
o General AI is a type of intelligence which could perform any intellectual task with efficiency
like a human.
o The idea behind the general AI to make such a system which could be smarter and think like
a human by its own.
o Currently, there is no such system exist which could come under general AI and can perform
any task as perfect as a human.
o The worldwide researchers are now focused on developing machines with General AI.
o As systems with general AI are still under research, and it will take lots of efforts and time to
develop such systems.
3. Super AI:
o Some key characteristics of strong AI include capability include the ability to think, to reason,
solve the puzzle, make judgments, plan, learn, and communicate by its own.
1. Reactive Machines
o Purely reactive machines are the most basic types of Artificial Intelligence.
o Such AI systems do not store memories or past experiences for future actions.
o These machines only focus on current scenarios and react on it as per possible best action.
2. Limited Memory
o Limited memory machines can store past experiences or some data for a short period of
time.
o These machines can use stored data for a limited time period only.
o Self-driving cars are one of the best examples of Limited Memory systems. These cars can
store recent speed of nearby cars, the distance of other cars, speed limit, and other
information to navigate the road.
3. Theory of Mind
o Theory of Mind AI should understand the human emotions, people, beliefs, and be able to
interact socially like humans.
o This type of AI machines is still not developed, but researchers are making lots of efforts and
improvement for developing such AI machines.
4. Self-Awareness
o High Accuracy with less error: AI machines or systems are prone to less errors and high
accuracy as it takes decisions as per pre-experience or information.
o 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.
o High reliability: AI machines are highly reliable and can perform the same action multiple
times with high accuracy.
o 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.
o 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.
o 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.
o Enhanced Security: AI can be very helpful in enhancing security, as It can detect and respond
to cyber threats in real time, helping companies protect their data and systems.
o Aid in Research: AI is very helpful in the research field as it assists researchers by processing
and analysing large datasets, accelerating discoveries in fields such as astronomy, genomics,
and materials science.
o High Cost: The hardware and software requirement of AI is very costly as it requires lots of
maintenance to meet current world requirements.
o 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.
o 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.
o Increase dependency on machines: With the increment of technology, people are getting
more dependent on devices and hence they are losing their mental capabilities.
o 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.
o Complexity: Making and keeping AI systems can be very complicated and need a lot
of knowledge. This can make it hard for some groups or people to use them.
o Job Concerns: As AI gets better, it might take away not just basic jobs but also some
skilled ones. This worries people about losing jobs in different fields.
Challenges of AI
Artificial Intelligence offers incredible advantages, but it also presents some challenges that need to
be addressed:
o Doing the Right Thing: AI should make the right choices, but sometimes it doesn't. It
can make mistakes or do things that aren't fair. We need to teach AI to be better at
making good choices.
o Government and AI: Sometimes, governments use AI to keep an eye on people. This
can be a problem for our freedom. We need to make sure they use AI in a good way.
o Bias in AI: AI can sometimes be a bit unfair, especially when it comes to recognizing
people's faces. This can cause problems, especially for people who aren't like the
majority.
o AI and Social Media: What you see on social media is often decided by AI. But
sometimes, AI shows things that aren't true or are kind of mean. We need to make
sure AI shows the right stuff.
o Legal and Regulatory Challenges: The rapid evolution of AI has outpaced the
development of comprehensive laws and regulations, leading to uncertainty about
issues like liability and responsibility.
Applications of AI
o Helping Doctors See inside the Body Better: AI is like a super helper for doctors when they look
at pictures of the inside of a patient's body, like X-rays or MRIs. It uses smart algorithms to
find things like problems, tumors, or broken bones very accurately. This means doctors can
figure out what's going on faster and more accurately, which is great for patients and for
better diagnosis.
o Detecting Health Problems Early: AI acts as a health detective. It looks at your health
information to find out if you might get certain diseases in the future. When it sees a high
risk, doctors can step in early to help you stay healthy. This is really important for conditions
like diabetes and heart problems because catching them at this time means better treatment
and less trouble for the patient.
o Smart Game Characters: AI is like the brains behind game characters that aren't controlled by
players. They make these characters, called NPCs, act more like real people or clever enemies.
They can learn from what players do and change their behavior, which makes games more
exciting and lifelike. Imagine playing a game where the bad guys learn and adapt to your
moves - that's what AI does.
o Creating Game Worlds with AI: AI can make parts of video games all on its own. It can create
levels, maps, and places to explore without people having to make them by hand. This means
games can have bigger and more interesting worlds because AI does a lot of the work, kind of
like a game world builder. It helps game developers, too.
o Identifying and Prevention of Fraud: AI keeps an eye on bank transactions all the time. They
act like super detectives who can spot strange things happening with money, like someone
using a credit card in a weird way. When they see something fishy, they raise the alarm and
help the bank stop bad people from stealing money. This happens really fast, without needing
people to check every transaction.
o Automated Trading: AI helps a skilled trader who works automatically. It uses various
algorithms to swiftly buy and sell stocks while analyzing all the market information. This
boosts trading strategies, making investments more efficient and profitable.
o Predicting Threats: AI looks at past troubles and keeps an eye on new dangers that are
popping up. By doing this, it can predict what bad things might happen in the future, like a
security breach or a cyberattack. This way, companies can get ready in advance to protect
their important data, sort of like putting up a strong fortress before any attack happens.
o Automated Safety Response: AI acts like a digital guardian that can respond when there's
trouble. If it sees something bad happening, like a cyberattack, it can automatically take
action. It might isolate the part that's under attack. This way, it keeps your important stuff
safe in the digital world.
o Virtual Assistants and Chatbots: AI chatbots and virtual assistants act as digital helpers on
social media. They're quick to respond and can talk to you just like a real person. They answer
your questions, share information, and even help with problems. It's like having an assistant
available 24/7, making your social media experience smoother and more helpful.
o Sentiment Analysis: AI can figure out how people feel on social media. It looks at what they
say in comments and posts and decides if it's a happy, sad, or neutral kind of message. This
helps companies understand what people think so they can react in the right way. It's like
having a mood gauge for the internet so businesses can make their customers happier.
o Self-Driving Cars: AI is like the brain of self-driving cars. It looks at what's happening around
the car using various sensors and decides what the car should do, like turning or stopping. It's
like having a super-smart driver that doesn't need a person. This makes cars drive on their
own, making travel more convenient and safer because there's no need for a human to steer.
o Advanced Driver Assistance Systems (ADAS): AI adds extra smarts to your car to keep you safe.
It possesses the capability to autonomously adjust your vehicle's speed while on the highway,
assist in maintaining your lane, and swiftly engage the brakes when detecting potential
hazards. These intelligent functionalities function akin to a co-pilot, ensuring your safety by
preventing accidents and ensuring your safe arrival at your intended destination.
o Self-Moving Robots: AI makes robots really smart at moving around on their own. It's like
giving them a built-in GPS and a clever brain. They can figure out where to go and how to get
there without bumping into things or needing a person to show them the way. This helps
them do tasks like delivering packages or exploring places on their own, making them super
independent.
o Object Recognition and Manipulation: AI gives robots sharp eyes and clever hands. It helps
them see objects clearly and then pick them up and move them just right. This is super useful,
especially in places like warehouses, where they can do things like sorting and packing items
accurately.
o
An agent can be anything that perceive its environment through sensors and act upon that
environment through actuators. An Agent runs in the cycle of perceiving, thinking, and acting.
o Human-Agent: A human agent has eyes, ears, and other organs which work for sensors and
hand, legs, vocal tract work for actuators.
o Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for sensors and
various motors for actuators.
o Software Agent: Software agent can have keystrokes, file contents as sensory input and act
on those inputs and display output on the screen.
Sensor: Sensor is a device which detects the change in the environment and sends the information
to other electronic devices. An agent observes its environment through sensors.
Actuators: Actuators are the component of machines that converts energy into motion. The
actuators are only responsible for moving and controlling a system. An actuator can be an electric
motor, gears, rails, etc.
Effectors: Effectors are the devices which affect the environment. Effectors can be legs, wheels, arms,
fingers, wings, fins, and display screen.
Intelligent Agents:
An intelligent agent is an autonomous entity which act upon an environment using sensors and
actuators for achieving goals. An intelligent agent may learn from the environment to achieve their
goals. A thermostat is an example of an intelligent agent.
Rational Agent:
A rational agent is an agent which has clear preference, models uncertainty, and acts in a way to
maximize its performance measure with all possible actions. A rational agent is said to perform the
right things. AI is about creating rational agents to use for game theory and decision theory for
various real-world scenarios.
For an AI agent, the rational action is most important because in AI reinforcement learning algorithm,
for each best possible action, agent gets the positive reward and for each wrong action, an agent
gets a negative reward.
Rationality:
The rationality of an agent is measured by its performance measure. Rationality can be judged on the
basis of following points:
Structure of an AI Agent
The task of AI is to design an agent program which implements the agent function. The structure of
an intelligent agent is a combination of architecture and agent program. It can be viewed as:
Following are the main three terms involved in the structure of an AI agent:
PEAS Representation
PEAS is a type of model on which an AI agent works upon. When we define an AI agent or
rational agent, then we can group its properties under PEAS representation model. It is
made up of four words:
o P: Performance measure
o E: Environment
o A: Actuators
o S: Sensors
Here performance measure is the objective for the success of an agent's behavior.
Agent Environment in AI
An environment is everything in the world which surrounds the agent, but it is not a part of an agent
itself. An environment can be described as a situation in which an agent is present.
The environment is where agent lives, operate and provide the agent with something to sense and
act upon it. An environment is mostly said to be non-feministic.
Nature of Environments
As per Russell and Norvig, an environment can have various features from the point of view of an
agent:
2. Static vs Dynamic
3. Discrete vs Continuous
4. Deterministic vs Stochastic
5. Single-agent vs Multi-agent
6. Episodic vs sequential
7. Known vs Unknown
8. Accessible vs Inaccessible
A fully observable environment is easy as there is no need to maintain the internal state to
keep track of the history of the world. For reference, Consider a self-driving car navigating a
busy city. While the car has sensors like cameras, lidar, and radar, it can't see everything at all
times. Buildings, other vehicles, and pedestrians can obstruct its sensors. In this scenario, the
car's environment is partially observable because it doesn't have complete and constant
access to all relevant information. It needs to maintain an internal state and history to make
informed decisions even when some information is temporarily unavailable.
An agent with no sensors in all environments then such an environment is called
unobservable. For reference, think about an agent designed to predict earthquakes but
placed in a sealed, windowless room with no sensors or access to external data. In this
situation, the environment is unobservable because the agent has no way to gather
information about the outside world. It can't sense any aspect of its environment, making it
completely unobservable.
3 Discrete vs Continuous
If in an environment, there are a finite number of percepts and actions that can be
performed within it, then such an environment is called a discrete environment it is called a
continuous environment.
Chess is an example of a discrete environment. In chess, there are a finite number of distinct
chess pieces (e.g., pawns, rooks, knights) and a finite number of squares on the chessboard.
The rules of chess define clear, discrete moves that a player can make. Each piece can be in a
specific location on the board, and players take turns making individual, well-defined moves.
The state of the chessboard is discrete and can be described by the positions of the pieces on
the board.
4 Deterministic vs Stochastic
If an agent's current state and selected action can completely determine the next
state of the environment, then such an environment is called a deterministic environment.
For reference, Chess is a classic example of a deterministic environment. In chess, the rules
are well-defined, and each move made by a player has a clear and predictable outcome
based on those rules. If you move a pawn from one square to another, the resulting state of
the chessboard is entirely determined by that action, as is your opponent's response. There's
no randomness or uncertainty in the outcomes of chess moves because they follow strict
rules. In a deterministic environment like chess, knowing the current state and the actions
taken allows you to completely determine the next state.
A stochastic environment is random and cannot be determined completely by an agent. For
reference, The stock market is an example of a stochastic environment. It's highly influenced
by a multitude of unpredictable factors, including economic events, investor sentiment, and
news. While there are patterns and trends, the exact behavior of stock prices is inherently
random and cannot be completely determined by any individual or agent. Even with access
to extensive data and analysis tools, stock market movements can exhibit a high degree of
unpredictability. Random events and market sentiment play significant roles, introducing
uncertainty.
In a deterministic, fully observable environment, an agent does not need to worry about
uncertainty.
5 Single-agent vs. Multi-agent
If only one agent is involved in an environment, and operating by itself then such an
environment is called a single-agent environment. For example, Solitaire is a classic example
of a single-agent environment. When you play Solitaire, you're the only agent involved. You
make all the decisions and actions to achieve a goal, which is to arrange a deck of cards in a
specific way. There are no other agents or players interacting with you. It's a solitary game
where the outcome depends solely on your decisions and moves. In this single-agent
environment, the agent doesn't need to consider the actions or decisions of other entities.
However, if multiple agents are operating in an environment, then such an environment is
called a multi-agent environment. For reference, A soccer match is an example of a multi-
agent environment. In a soccer game, there are two teams, each consisting of multiple
players (agents). These players work together to achieve common goals (scoring goals and
preventing the opposing team from scoring). Each player has their own set of actions and
decisions, and they interact with both their teammates and the opposing team. The outcome
of the game depends on the coordinated actions and strategies of all the agents on the field.
It's a multi-agent environment because there are multiple autonomous entities (players)
interacting in a shared environment.
The agent design problems in the multi-agent environment are different from single-agent
environments.
Turing Test
The success of an intelligent behaviour of a system can be measured with Turing Test.
Two persons and a machine to be evaluated participate in the test. Out of the two persons, one
plays the role of the tester. Each of them sits in different rooms. The tester is unaware of who is
machine and who is a human. He interrogates the questions by typing and sending them to both
intelligences, to which he receives typed responses.
This test aims at fooling the tester. If the tester fails to determine machine’s response from the
human response, then the machine is said to be intelligent.
Types of AI Agents
o Goal-based agents
o Utility-based agent
o Learning agent
o The Simple reflex agents are the simplest agents. These agents take decisions
on the basis of the current percepts and ignore the rest of the percept history.
o These agents only succeed in the fully observable environment.
o The Simple reflex agent does not consider any part of percepts history during
their decision and action process.
o The Simple reflex agent works on Condition-action rule, which means it maps
the current state to action. Such as a Room Cleaner agent, it works only if
there is dirt in the room.
o Problems for the simple reflex agent design approach:
o They have very limited intelligence
o They do not have knowledge of non-perceptual parts of the current
state
o Mostly too big to generate and to store.
o Not adaptive to changes in the environment.
3. Goal-based agents
4. Utility-based agents
o These agents are similar to the goal-based agent but provide an extra
component of utility measurement which makes them different by providing a
measure of success at a given state.
o Utility-based agent act based not only goals but also the best way to achieve
the goal.
o The Utility-based agent is useful when there are multiple possible alternatives,
and an agent has to choose in order to perform the best action.
o The utility function maps each state to a real number to check how efficiently
each action achieves the goals.
5. Learning Agents
o A learning agent in AI is the type of agent which can learn from its past
experiences, or it has learning capabilities.
o It starts to act with basic knowledge and then able to act and adapt
automatically through learning.
o A learning agent has mainly four conceptual components, which are:
a. Learning element: It is responsible for making improvements by
learning from environment
b. Critic: Learning element takes feedback from critic which describes that
how well the agent is doing with respect to a fixed performance
standard.
c. Performance element: It is responsible for selecting external action
d. Problem generator: This component is responsible for suggesting
actions that will lead to new and informative experiences.
o Hence, learning agents are able to learn, analyze performance, and look for
new ways to improve the performance.