AI Notes - 1
AI Notes - 1
"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."
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 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.
Artificial Intelligence has various applications in today's society. It is becoming essential for
today's time because it can solve complex problems with an efficient way in multiple industries,
such as Healthcare, entertainment, finance, education, etc. AI is making our daily life more
comfortable and fast.
Following are some sectors which have the application of Artificial Intelligence:
1. AI Application in E-Commerce
Personalized Shopping
Artificial Intelligence technology is used to create recommendation engines through which you
can engage better with your customers. These recommendations are made in accordance with
their browsing history, preference, and interests. It helps in improving your relationship with
your customers and their loyalty towards your brand.
AI-powered Assistants
Virtual shopping assistants and chatbots help improve the user experience while shopping
online. Natural Language Processing is used to make the conversation sound as human and
personal as possible. Moreover, these assistants can have real-time engagement with your
customers. Did you know that on amazon.com, soon, customer service could be handled by
chatbots?
Fraud Prevention
Credit card frauds and fake reviews are two of the most significant issues that E-Commerce
companies deal with. By considering the usage patterns, AI can help reduce the possibility of
credit card frauds taking place. Many customers prefer to buy a product or service based on
customer reviews. AI can help identify and handle fake reviews.
Although the education sector is the one most influenced by humans, Artificial Intelligence has
slowly begun to seep its roots in the education sector as well. Even in the education sector, this
slow transition of Artificial Intelligence has helped increase productivity among faculties and
helped them concentrate more on students than office or administration work.
Artificial Intelligence can help educators with non-educational tasks like task-related duties like
facilitating and automating personalized messages to students, back-office tasks like grading
paperwork, arranging and facilitating parent and guardian interactions, routine issue feedback
facilitating, managing enrollment, courses, and HR-related topics.
Digitization of content like video lectures, conferences, and text book guides can be made using
Artificial Intelligence. We can apply different interfaces like animations and learning content
through customization for students from different grades.
Artificial Intelligence helps create a rich learning experience by generating and providing audio
and video summaries and integral lesson plans.
Voice Assistants
Without even the direct involvement of the lecturer or the teacher, a student can access extra
learning material or assistance through Voice Assistants. Through this, printing costs of
temporary handbooks and also provide answers to very common questions easily.
Personalized Learning
Artificial Intelligence has a lot of influence on our lifestyle. Let us discuss a few of them.
Autonomous Vehicles
Automobile manufacturing companies like Toyota, Audi, Volvo, and Tesla use machine learning
to train computers to think and evolve like humans when it comes to driving in any environment
and object detection to avoid accidents.
Spam Filters
The email that we use in our day-to-day lives has AI that filters out spam emails sending them to
spam or trash folders, letting us see the filtered content only. The popular email provider, Gmail,
has managed to reach a filtration capacity of approximately 99.9%.
Facial Recognition
Our favorite devices like our phones, laptops, and PCs use facial recognition techniques by using
face filters to detect and identify in order to provide secure access. Apart from personal usage,
facial recognition is a widely used Artificial Intelligence application even in high security-related
areas in several industries.
Recommendation System
Various platforms that we use in our daily lives like e-commerce, entertainment websites, social
media, video sharing platforms, like youtube, etc., all use the recommendation system to get user
data and provide customized recommendations to users to increase engagement. This is a very
widely used Artificial Intelligence application in almost all industries.
4. Applications of Artificial intelligence in Navigation
Based on research from MIT, GPS technology can provide users with accurate, timely, and
detailed information to improve safety. The technology uses a combination of Convolutional
Neural Network and Graph Neural Network, which makes lives easier for users by automatically
detecting the number of lanes and road types behind obstructions on the roads. AI is heavily used
by Uber and many logistics companies to improve operational efficiency, analyze road traffic,
and optimize routes.
Robotics is another field where artificial intelligence applications are commonly used. Robots
powered by AI use real-time updates to sense obstacles in its path and pre-plan its journey
instantly.
Did you know that companies use intelligent software to ease the hiring process?
Artificial Intelligence helps with blind hiring. Using machine learning software, you can examine
applications based on specific parameters. AI drive systems can scan job candidates' profiles, and
resumes to provide recruiters an understanding of the talent pool they must choose from.
Artificial Intelligence finds diverse applications in the healthcare sector. AI applications are used
in healthcare to build sophisticated machines that can detect diseases and identify cancer cells.
Artificial Intelligence can help analyze chronic conditions with lab and other medical data to
ensure early diagnosis. AI uses the combination of historical data and medical intelligence for
the discovery of new drugs.
8. Applications of Artificial Intelligence in Agriculture
Artificial Intelligence is used to identify defects and nutrient deficiencies in the soil. This is done
using computer vision, robotics, and machine learning applications, AI can analyze where weeds
are growing. AI bots can help to harvest crops at a higher volume and faster pace than human
laborers.
Another sector where Artificial Intelligence applications have found prominence is the gaming
sector. AI can be used to create smart, human-like NPCs to interact with the players.
It can also be used to predict human behavior using which game design and testing can be
improved. The Alien Isolation games released in 2014 uses AI to stalk the player throughout the
game. The game uses two Artificial Intelligence systems - ‘Director AI’ that frequently knows
your location and the ‘Alien AI,’ driven by sensors and behaviors that continuously hunt the
player.
A boom of AI (1980-1987)
o Year 1980: After AI winter duration, AI came back with "Expert System". Expert
systems were programmed that emulate the decision-making ability of a human expert.
o In the Year 1980, the first national conference of the American Association of Artificial
Intelligence was held at Stanford University.
Now AI has developed to a remarkable level. The concept of Deep learning, big data, and data
science are now trending like a boom. Nowadays companies like Google, Facebook, IBM, and
Amazon are working with AI and creating amazing devices. The future of Artificial Intelligence
is inspiring and will come with high intelligence.
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 Super AI is a level of Intelligence of Systems at which machines could surpass human
intelligence, and can perform any task better than human with cognitive properties. It is
an outcome of general 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.
o Super AI is still a hypothetical concept of Artificial Intelligence. Development of such
systems in real is still world changing task.
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 are still not developed, but researchers are making lots of
efforts and improvement for developing such AI machines.
4. Self-Awareness
o Self-awareness AI is the future of Artificial Intelligence. These machines will be super
intelligent, and will have their own consciousness, sentiments, and self-awareness.
o These machines will be smarter than human mind.
o Self-Awareness AI does not exist in reality still and it is a hypothetical concept.
Examples of Agent:
A software agent has Keystrokes, file contents, received network packages which act as
sensors and displays on the screen, files, sent network packets acting as actuators.
A Human-agent has eyes, ears, and other organs which act as sensors, and hands, legs,
mouth, and other body parts acting as actuators.
A Robotic agent has Cameras and infrared range finders which act as sensors and various
motors acting as actuators.
Types of Agents
Agents can be grouped into five classes based on their degree of perceived intelligence and
capability:
Simple Reflex Agents
Model-Based Reflex Agents
Goal-Based Agents
Utility-Based Agents
Learning Agent
Simple reflex agents
Simple reflex agents ignore the rest of the percept history and act only on the basis of
the current percept. Percept history is the history of all that an agent has perceived to date.
The agent function is based on the condition-action rule. A condition-action rule is a rule that
maps a state i.e, condition to an action. If the condition is true, then the action is taken, else
not. This agent function only succeeds when the environment is fully observable. For simple
reflex agents operating in partially observable environments, infinite loops are often
unavoidable. It may be possible to escape from infinite loops if the agent can randomize its
actions.
Problems with Simple reflex agents are :
Very limited intelligence.
No knowledge of non-perceptual parts of the state.
Usually too big to generate and store.
If there occurs any change in the environment, then the collection of rules need to be
updated.
It works by finding a rule whose condition matches the current situation. A model-based agent
can handle partially observable environments by the use of a model about the world. The
agent has to keep track of the internal state which is adjusted by each percept and that
depends on the percept history. The current state is stored inside the agent which maintains
some kind of structure describing the part of the world which cannot be seen.
Updating the state requires information about :
how the world evolves independently from the agent, and
how the agent’s actions affect the world.
Goal-based agents
These kinds of agents take decisions based on how far they are currently from
their goal(description of desirable situations). Their every action is intended to reduce its
distance from the goal. This allows the agent a way to choose among multiple possibilities,
selecting the one which reaches a goal state. The knowledge that supports its decisions is
represented explicitly and can be modified, which makes these agents more flexible. They
usually require search and planning. The goal-based agent’s behavior can easily be changed.
Utility-based agents
The agents which are developed having their end uses as building blocks are called utility -
based agents. When there are multiple possible alternatives, then to decide which one is best,
utility-based agents are used. They choose actions based on a preference (utility) for each
state. Sometimes achieving the desired goal is not enough. We may look for a quicker, safer,
cheaper trip to reach a destination. Agent happiness should be taken into consideration. Utility
describes how “happy” the agent is. Because of the uncertainty in the world, a utility agent
chooses the action that maximizes the expected utility. A utility function maps a state onto a
real number which describes the associated degree of happiness.
Learning Agent :
A learning agent in AI is the type of agent that can learn from its past experiences or it has
learning capabilities. It starts to act with basic knowledge and then is able to act and adapt
automatically through learning.
A learning agent has mainly four conceptual components, which are:
1. Learning element: It is responsible for making improvements by learning from the
environment
2. Critic: The learning element takes feedback from critics which describes how well the
agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. Problem Generator: This component is responsible for suggesting actions that will lead to
new and informative experiences.
What is Production system in AI?
A production system is an artificial intelligence program that consists of some rules and the
procedures or processes for following them. This set of rules can be termed as ‘production’.
They enhance action selection and automated planning.
This system consists of a global database that contains all the information required to execute
tasks, a set of rules that are applied to the data from the global database, and a control system
that applies the rules. In production systems, knowledge is encoded in declarative statements.
Knowledge representation creates a system that is used to run AI applications.
This partly explains why production systems are used in the creation of AI programs and the
automation of machines. Some of the machines that can be automated using these systems
include computers, manufacturing tools, and mobile applications. These systems execute search
algorithms and exhibit problem-solving skills that can be displayed by humans.
Features of a Production System in AI
The following are the main features of a production system in AI:
Simplicity: The system utilizes IF-THEN statements that make problem-solving simple.
Modularity: Knowledge can be coded in separate segments, which allows adjustments to
be made in the system without challenges. It is possible to delete, modify or feature the
knowledge without facing challenges.
Modifiability: It is possible to modify or change the rules in this system as per the
requirements. With this feature, the production system can undergo iterative
improvement.
Knowledge-Intensive: The production system relies on knowledge to a large extent. It
employs a language that is spoken by humans, e.g. English. English sentences enable the
system to draw productive conclusions based on production rules.
Adaptability: The system can adapt to situations accordingly. It implements pattern-
directed control, which enhances the hierarchical control of search in the event of
complexities.
Global database
This contains the architecture of the production system and acts as a central data structure. All
the information and data used in the execution of tasks is stored in this database. The production
rules of the system operate here.
There are two types of global databases: temporary and permanent. The temporary global
database consists of short-term actions that are based on circumstances. In a permanent global
database, there are fixed actions that cannot be altered.
Production rules
The data gathered from the global database applies some rules within the production system.
These rules are called the production rules. Some certain pre-conditions and post-conditions that
bind these rules. The global database checks these conditions so that the rules can be applied. If a
particular pre-condition is accepted by the central data structure, the rule will be executed. In this
case, the central data structure will adjust accordingly. If the global database does not accept the
pre-condition, no action is taken. In this case, the database doesn’t change.
A control system
The application of rules in the system is examined by the control system. When a pre-condition
is accepted by the global database, the control system decides the rule that needs to be applied.
When the correct output is given, the control system terminates the production system.
This system helps to resolve conflicts in the production system. For example, if multiple
conditions are occurring simultaneously, the control system will resolve the conflict by
specifying the sequence.
Monotonic system This system allows the simultaneous application of rules. This means
that the application of one rule does not prevent another rule from being applied at the
same time.
Partially commutative system Here, the order of operation is important. If a given set of
rules is employed to convert a start state A into a different state B, then the same results
can be attained using any permutation of these production rules.
Non-monotonic system This system helps in solving problems that were ignored. It can
be executed without backtracking to initial states when an incorrect path was taken. The
Non-monotonic system provides an efficient way of solving problems.
Commutative system This system is used when the order of operation is not an
important issue of consideration. It is ideal for solving problems in a situation where
changes can be reversed. This is unlike in a partially commutative system, where the
order of operation is crucial and changes are irreversible.
Disadvantages
1. The production system does not store the output results for future reference, which may
limit learning.
2. When various conflicting rules are employed, the control system establishes the best
possible production rule to be applied. This may lead to reduced efficiency of the system.
3. Combination or merging of rules may lead to opaqueness, especially when there is little
prioritization of production rules. This problem can be solved by predetermining the
priority of rules.
In a washing machine, the condition-action rules enable the system to allow water and wash
clothes based on the size and nature of clothes. If the size is large, the system will take the action
of allowing large amounts of water. If the clothes are greasy, the machine will wash them for a
long period.
When flying a plane at the cruising phase, the aim is to maintain the same level of attitude
(cruising attitude). If the plane is flying at a different attitude, the IF-THEN conditions will be
applied to bring the plane back to the desired level of attitude. These conditions are also used in
planes to control various automated processes.
In autonomous cars, the production system uses the IF-THEN conditions to avoid collision with
objects or other cars. The following shows examples of how these conditions are applied in
autonomous cars.
Conflict resolution
Automated processes or machines make work easy since they do what humans can do faster and
accurately. However, automation may sometimes be faced with challenges of breakdown or
conflicts in the system. A production system is programmed to resolve these conflicts using
the IF-THEN conditions. In situations where the system cannot resolve the conflict, it provides
the recommended action.A good example is when a car or an automated machine is not working
properly. The following are some of the IF-THEN conditions that can be applied.
1. IF the engine is not turning, THEN ask the driver to check the battery.
2. IF the engine is not turning AND the battery is working, THEN ask the driver to test the
starter motor.
Search Algorithms in Artificial Intelligence
Search algorithms are one of the most important areas of Artificial Intelligence. This topic will explain all
about the search algorithms in AI.
Problem-solving agents:
In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational
agents or Problem-solving agents in AI mostly used these search strategies or algorithms to solve a
specific problem and provide the best result. Problem-solving agents are the goal-based agents and use
atomic representation. In this topic, we will learn various problem-solving search algorithms.
Uninformed/Blind Search:
The uninformed search does not contain any domain knowledge such as closeness, the location of the
goal. It operates in a brute-force way as it only includes information about how to traverse the tree and
how to identify leaf and goal nodes. Uninformed search applies a way in which search tree is searched
without any information about the search space like initial state operators and test for the goal, so it is also
called blind search.It examines each node of the tree until it achieves the goal node.
o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search
Informed Search
Informed search algorithms use domain knowledge. In an informed search, problem information is
available which can guide the search. Informed search strategies can find a solution more efficiently than
an uninformed search strategy. Informed search is also called a Heuristic search.
A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a
good solution in reasonable time.
Uninformed Search Algorithms
Uninformed search is a class of general-purpose search algorithms which operates in brute force-way.
Uninformed search algorithms do not have additional information about state or search space other than
how to traverse the tree, so it is also called blind search.
1. Breadth-first Search:
o Breadth-first search is the most common search strategy for traversing a tree or graph. This
algorithm searches breadthwise in a tree or graph, so it is called breadth-first search.
o BFS algorithm starts searching from the root node of the tree and expands all successor node at
the current level before moving to nodes of next level.
o The breadth-first search algorithm is an example of a general-graph search algorithm.
o Breadth-first search implemented using FIFO queue data structure.
Advantages:
Disadvantages:
o It requires lots of memory since each level of the tree must be saved into memory to expand the
next level.
o BFS needs lots of time if the solution is far away from the root node.
Example:
In the below tree structure, we have shown the traversing of the tree using BFS algorithm from the root
node S to goal node K. BFS search algorithm traverse in layers, so it will follow the path which is shown
by the dotted arrow, and the traversed path will be:
1. S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K
Completeness: BFS is complete, which means if the shallowest goal node is at some finite depth, then
BFS will find a solution.
Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the node.
2. Depth-first Search
o Depth-first search isa recursive algorithm for traversing a tree or graph data structure.
o It is called the depth-first search because it starts from the root node and follows each path to its
greatest depth node before moving to the next path.
o DFS uses a stack data structure for its implementation.
o The process of the DFS algorithm is similar to the BFS algorithm.
Advantage:
o DFS requires very less memory as it only needs to store a stack of the nodes on the path from root
node to the current node.
o It takes less time to reach to the goal node than BFS algorithm (if it traverses in the right path).
Disadvantage:
o There is the possibility that many states keep re-occurring, and there is no guarantee of finding
the solution.
o DFS algorithm goes for deep down searching and sometime it may go to the infinite loop.
Example:
In the below search tree, we have shown the flow of depth-first search, and it will follow the order as:
It will start searching from root node S, and traverse A, then B, then D and E, after traversing E, it will
backtrack the tree as E has no other successor and still goal node is not found. After backtracking it will
traverse node C and then G, and here it will terminate as it found goal node.
Completeness: DFS search algorithm is complete within finite state space as it will expand every node
within a limited search tree.
Optimal: DFS search algorithm is non-optimal, as it may generate a large number of steps or high cost to
reach to the goal node.