0% found this document useful (0 votes)
13 views28 pages

ai.

The document discusses the Breadth-First Search (BFS) algorithm in artificial intelligence, highlighting its systematic approach to exploring graph and tree structures for tasks like pathfinding and puzzle solving. It also covers various AI approaches, examples of intelligent agents, and the structure of multi-agent systems, emphasizing the importance of machine learning in automating tasks and improving decision-making across industries. Additionally, it outlines the characteristics and examples of expert systems, showcasing their applications in specific domains.
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)
13 views28 pages

ai.

The document discusses the Breadth-First Search (BFS) algorithm in artificial intelligence, highlighting its systematic approach to exploring graph and tree structures for tasks like pathfinding and puzzle solving. It also covers various AI approaches, examples of intelligent agents, and the structure of multi-agent systems, emphasizing the importance of machine learning in automating tasks and improving decision-making across industries. Additionally, it outlines the characteristics and examples of expert systems, showcasing their applications in specific domains.
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/ 28

SHORT

1Q: Breadth First Search (BFS) for


Artificial Intelligence
 

In artificial intelligence, the Breadth-First Search (BFS)


algorithm is an essential tool for exploring and navigating
various problem spaces. By systematically traversing
graph or tree structures, BFS solves tasks such as path
finding, network routing, and puzzle solving. This article
probes into the core concepts of BFS, its algorithms, and
practical applications in AI.

 What is Breadth-First Search?

 Key characteristics of BFS

 Breadth First Search (BFS) Algorithms

 How Breadth-First Search can help in Robot Pathfinding

 Practical Implementations of BFS in Pathfinding of


Robots

What is Breadth-First Search?

The Breadth-First Search is a traversing algorithm used to


satisfy a given property by searching the tree or graph
data structure. It belongs to uninformed or blind search AI
algorithms as It operates solely based on the connectivity
of nodes and doesn't prioritize any particular path over

another based on heuristic knowledge or domain-specific


information. it doesn't incorporate any additional
information beyond the structure of the search space. It is
optimal for unweighted graphs and
is particularly suitable when all actions have the same
cost. Due to its systematic search strategy, BFS

can efficiently explore even infinite state spaces. The


graph structure of BFS allows to work as follows:

 Originally it starts at the root node, then it expands all


of its successors, it systematically explores all its
neighbouring nodes before moving to the next level of
nodes. ( As shown in the above image, It starts from the
root node A then expands its successors B)

 This process of extending the root node’s immediate


neighbours, then to their neighbours, and so on, lasts until
all the nodes within the graph have been visited or until
the specific condition is met. From the above image we
can observe that after visiting the node B it moves to node
C. when the level 1 is completed, it further moves to the
next level i.e 2 and explore node D. it will move
systematically to node E, node F and node G. After visiting
the node G it will terminate.

Key characteristics of BFS

1. First-in-First-Out (FIFO): The FIFO queue is typically


preferred in BFS because the FIFO queue will be

faster than a priority queue and often results in the


correct order of nodes. When FIFO is applied to

BFS, new nodes deeper in the search tree are added to


the back of the queue. The old nodes which

are swallower than the new nodes get expanded first.

2. Early goal test: In traditional BFS implementations, the


algorithm maintains a set of states reached
during the search process. However, instead of storing all
reached states, it selectively stores only

the set of reached states that allow for an early goal test.
This test involves checking whether the

newly generated node meets the goal criteria as soon as


it is generated.

3. Cost-optimal: BFS always aims to find a solution with a


minimum cost prioritizing the shortest

path, when BFS generates nodes at a certain depth d, it


has already explored and generated all the

nodes at the previous depth d-1. Consequently, if a


solution exists within a search space, BFS can

discover it as soon as it reaches that depth level.


Therefore, BFS is said to be a cost-optimal solution.

2Q: Approaches of AI
There are a total of four approaches of AI and that are as
follows:

 Acting humanly (The Turing Test approach): This


approach was

designed by Alan Turing. The ideology behind this


approach is that a

computer passes the test if a human interrogator, after


asking some

written questions, cannot identify whether the written


responses come

from a human or from a computer.


 Thinking humanly (The cognitive modeling approach):
The idea

behind this approach is to determine whether the


computer thinks like a

human.

 Thinking rationally (The “laws of thought” approach):


The idea

behind this approach is to determine whether the


computer thinks

rationally i.e. with logical reasoning.

 Acting rationally (The rational agent approach): The


idea behind this

approach is to determine whether the computer acts


rationally i.e. with

logical reasoning.

 Machine Learning approach: This approach involves


training machines

to learn from data and improve performance on specific


tasks over time. It

is widely used in areas such as image and speech


recognition, natural

language processing, and recommender systems.

 Evolutionary approach: This approach is inspired by the


process of

natural selection in biology. It involves generating and


testing a large
number of variations of a solution to a problem, and then
selecting and

combining the most successful variations to create a new


generation of

solutions.

 Neural Networks approach: This approach involves


building artificial

neural networks that are modeled after the structure and


function of the

human brain. Neural networks can be used for tasks such


as pattern

recognition, prediction, and decision-making.

 Fuzzy logic approach: This approach involves reasoning


with uncertain

and imprecise information, which is common in real-world


situations.

Fuzzy logic can be used to model and control complex


systems in areas

such as robotics, automotive control, and industrial


automation.

 Hybrid approach: This approach combines multiple AI


techniques to

solve complex problems. For example, a hybrid approach


might use

machine learning to analyze data and identify patterns,


and then use
logical reasoning to make decisions based on those
patterns.

3Q:Examples and uses of agents


There are many examples of agents in artificial
intelligence. Here are a few:

 Intelligent personal assistants: These are agents that


are designed to help users with various tasks,

such as scheduling appointments, sending messages, and


setting reminders. Examples of intelligent

personal assistants include Siri, Alexa, and Google


Assistant.

 Autonomous robots: These are agents that are designed


to operate autonomously in the physical

world. They can perform tasks such as cleaning, sorting,


and delivering goods. Examples of

autonomous robots include the Roomba vacuum cleaner


and the Amazon delivery robot.

 Gaming agents: These are agents that are designed to


play games, either against human opponents

or other agents. Examples of gaming agents include


chess-playing agents and poker-playing agents.

 Fraud detection agents: These are agents that are


designed to detect fraudulent behavior in financial

transactions. They can analyze patterns of behavior to


identify suspicious activity and alert
authorities. Examples of fraud detection agents include
those used by banks and credit card

companies.

 Traffic management agents: These are agents that are


designed to manage traffic flow in cities. They

can monitor traffic patterns, adjust traffic lights, and


reroute vehicles to minimize congestion.

Examples of traffic management agents include those


used in smart cities around the world.
Uses Agents of agents
Agents are used in a wide range of applications in
artificial intelligence, including:

 Robotics: Agents can be used to control robots and


automate tasks in manufacturing, transportation,

and other industries.

 Smart homes and buildings: Agents can be used to


control heating, lighting, and other systems in

smart homes and buildings, optimizing energy use and


improving comfort.

 Transportation systems: Agents can be used to manage


traffic flow, optimize routes for autonomous

vehicles, and improve logistics and supply chain


management.

 Healthcare: Agents can be used to monitor patients,


provide personalized treatment plans, and

optimize healthcare resource allocation.

 Finance: Agents can be used for automated trading,


fraud detection, and risk management in the

financial industry.

4Q: STRUCTURE OF AN ARTIFICIAL


INTELLIGENCE AND MULTI AGENT
SYSTEM.
In artificial intelligence, an agent is a computer program
or system that is designed to perceive its

environment, make decisions and take actions to achieve


a specific goal or set of goals. The agent

operates autonomously, meaning it is not directly


controlled by a human operator.

Agents can be classified into different types based on


their characteristics, such as whether they are

reactive or proactive, whether they have a fixed or


dynamic environment, and whether they are single

or multi-agent systems.

 Reactive agents are those that respond to immediate


stimuli from their environment and take

actions based on those stimuli. Proactive agents, on the


other hand, take initiative and plan ahead to

achieve their goals. The environment in which an agent


operates can also be fixed or dynamic. Fixed

environments have a static set of rules that do not


change, while dynamic environments are

constantly changing and require agents to adapt to new


situations.

 Multi-agent systems involve multiple agents working


together to achieve a common goal. These

agents may have to coordinate their actions and


communicate with each other to achieve their

objectives. Agents are used in a variety of applications,


including robotics, gaming, and intelligent
systems. They can be implemented using different
programming languages and techniques, including

machine learning and natural language processing.

. Multi-agent systems
Multi-agent systems (MAS) are systems composed of
multiple interacting autonomous agents.

Each agent in a multi-agent system has its own goals,


capabilities, knowledge, and possibly

different perspectives. These agents can interact with


each other directly or indirectly to achieve

individual or collective goals.

Example: A Multi-Agent System (MAS) example is a traffic


management system. Here, each

vehicle acts as an autonomous agent with its own goals


(e.g., reaching its destination efficiently).

They interact indirectly (e.g., via traffic signals) to


optimize traffic flow, minimizing congestion

and travel time collectively.

Characteristics of Multi-agent systems


 Autonomous Agents: Each agent acts on its own based
on its goals and knowledge.

 Interactions: Agents communicate, cooperate, or


compete to achieve individual or shared objectives.
 Distributed Problem Solving: Agents work together to
solve complex problems more efficiently than

they could alone.

 Decentralization: No central control; agents make


decisions independently, leading to emergent

behaviors.

 Applications: Used in robotics, traffic management,


healthcare, and more, where distributed

decision-making is essential.

5Q: Why is machine learning important?


ML has played an increasingly important role in human
society since its beginnings in the mid

20th century, when AI pioneers like Walter Pitts, Warren


McCulloch, Alan Turing and John von Neumann

laid the field's computational groundwork. Training


machines to learn from data and improve over time

has enabled organizations to automate routine tasks --


which, in theory, frees humans to pursue more

creative and strategic work.

Machine learning has extensive and diverse practical


applications. In finance, ML algorithms help banks

detect fraudulent transactions by analyzing vast amounts


of data in real time at a speed and accuracy

humans cannot match. In healthcare, ML assists doctors


in diagnosing diseases based on medical
images and informs treatment plans with predictive
models of patient outcomes. And in retail, many

companies use ML to personalize shopping experiences,


predict inventory needs and optimize supply

chains.

ML also performs manual tasks that are beyond human


ability to execute at scale -- for example,

processing the huge quantities of data generated daily by


digital devices. This ability to extract patterns

and insights from vast data sets has become a


competitive differentiator in fields like banking and

scientific discovery. Many of today's leading companies,


including Meta, Google and Uber, integrate ML

into their operations to inform decision-making and


improve efficiency.

Machine learning is necessary to make sense of the ever-


growing volume of data generated by modern

societies. The abundance of data humans create can also


be used to further train and fine-tune ML

models, accelerating advances in ML. This continuous


learning loop underpins today's most advanced AI

systems, with profound implications.

Philosophically, the prospect of machines processing vast


amounts of data challenges humans'

understanding of our intelligence and our role in


interpreting and acting on complex information.
Practically, it raises important ethical considerations
about the decisions made by advanced ML models.

Transparency and explainability in ML training and


decision-making, as well as these models' effects on

employment and societal structures, are areas for ongoing


oversight and discussion.

6Q:Machine learning examples by


industry
Enterprise adoption of ML techniques across industries is
transforming business processes. Here are a

few examples:

 Financial services. Capital One uses ML to boost fraud


detection, deliver personalized customer

experiences and improve business planning. The company


is using the MLOps methodology to

deploy the ML applications at scale.

 Pharmaceuticals. Drug makers use ML for drug


discovery, clinical trials and drug

manufacturing. Eli Lilly has built AI and ML models, for


example, to find the best sites for

clinical trials and boost participant diversity. The models


have sharply reduced clinical trial

timelines, according to the company.

 Insurance. Progressive Corp.'s well-known Snapshot


program uses ML algorithms to analyze
driving data, offering lower rates to safe drivers. Other
useful applications of ML in

insurance include underwriting and claims processing.

 Retail. Walmart has deployed My Assistant, a generative


AI tool to help its some 50,000 campus

employees with content generation, summarizing large


documents and acting as an overall

"creative partner." The company is also using the tool to


solicit employee feedback on use

cases.

What are the advantages and


disadvantages of machine learning?
When deployed effectively, ML provides a competitive
advantage to businesses by identifying trends

and predicting outcomes with higher accuracy than


conventional statistics or human intelligence. ML

can benefit businesses in several ways:

 Analyzing historical data to retain customers.

 Launching recommender systems to grow revenue.

 Improving planning and forecasting.

 Assessing patterns to detect fraud.

 Boosting efficiency and cutting costs.

But machine learning also entails a number of business


challenges. First and foremost, it can be
expensive. ML requires costly software, hardware and
data management infrastructure, and ML projects

are typically driven by data scientists and engineers who


command high salaries.

Another significant issue is ML bias. Algorithms trained on


data sets that exclude certain populations or

contain errors can lead to inaccurate models. These


models can fail and, at worst, produce

discriminatory outcomes. Basing core enterprise


processes on biased models can cause businesses

regulatory and reputational harm.

7Q: Characteristics of Expert System


o High Performance: The expert system provides high
performance for solving any type of complex problem of a
specific domain with high efficiency and accuracy.

o Understandable: It responds in a way that can be easily


understandable by the user. It can take input in human
language and provides the output in the same way.

o Reliable: It is much reliable for generating an efficient


and accurate output.

o Highly responsive: ES provides the result for any


complex query within a very short period of time.

8Q:examples of the Expert System:


o DENDRAL: It was an artificial intelligence project that
was made as a chemical analysis expert system. It was
used in organic chemistry to detect unknown organic
molecules with the help of their mass spectra and
knowledge base of chemistry.

o MYCIN: It was one of the earliest backward chaining


expert systems that was designed to find the bacteria
causing infections like bacteraemia and meningitis. It was
also used for the recommendation of antibiotics and the
diagnosis of blood clotting diseases.

o PXDES: It is an expert system that is used to determine


the type and level of lung cancer. To determine the
disease, it takes a picture from the upper body, which
looks like the shadow. This shadow identifies the type and
degree of harm.

o CaDeT: The CaDet expert system is a diagnostic support


system that can detect cancer at early stages.

LONG

1Q: Depth First Search (DFS) for Artificial


Intelligence
 

Depth-first search contributes to its effectiveness and


optimization in artificial intelligence. From

algorithmic insights to real-world implementations, DFS


plays a huge role in optimizing AI systems. Let's

dive into the fundamentals of DFS, its significance in


artificial intelligence, and its practical applications.
 What is a Depth-First Search in AI?

 Edge classes in a Depth-first search tree based on a


spanning tree:

 Depth First Search(DFS) Algorithm

 DFS Behavior Across Different State Space Structures

 DFS Implementation in Robotics Pathfinding

 Applications of DFS in AI

What is a Depth-First Search in AI?


Depth-first search is a traversing algorithm used in tree
and graph-like data structures. It generally starts

by exploring the deepest node in the frontier. Starting at


the root node, the algorithm proceeds to

search to the deepest level of the search tree until nodes


with no successors are reached. Suppose the

node with unexpanded successors is encountered then


the search backtracks to the next deepest node

to explore alternative paths.

Search operation of the depth-first search

Depth-first search (DFS) explores a graph by selecting a


path and traversing it as deeply as possible

before backtracking.

 Originally it starts at the root node, then it expands all


of its one branch until it reaches a dead end,

then backtracks to the most recent unexplored node,


repeating until all nodes are visited or a
specific condition is met. ( As shown in the above image,
starting from node A, DFS explores its

successor B, then proceeds to its descendants until


reaching a dead end at node D. It then backtracks

to node B and explores its remaining successors i.e E. )

 This systematic exploration continues until all nodes


are visited or the search terminates. (In our case

after exploring all the nodes of B. DFS explores the right


side node i.e C then F and and then G. After

exploring the node G. All the nodes are visited. It will


terminate.

Key characteristics of DFS

In simple terms, the DFS algorithms in AI holds the power


of extending the current path as deeply as

possible before considering the other options.

 DFS is not cost-optimal since it doesn't guarantee to


find the shortest paths.

 DFS uses the simple principle to keep track of visited


nodes: It uses a stack to keep track of nodes

that have been visited so far which helps in the


backtracking of the graph. When the DFS encounters

a new node, it adds it to the stack to explore its


neighbours. If it reaches a node with no successors

(leaf node), it works by backtracking such as popping


nodes off the stack to explore the alternative

paths.
 Backtracking search: The variant of DFS is called
backtracking search which uses less memory than

traditional depth-first search. Rather than generating all


the successors, the backtracking search

enables the DFS to generate only one successor at a time.


This approach allows dynamic state

modification, such as generating successors by directly


modifying the current state description

instead of allocating the memory to a brand-new state.


Thus reducing the memory requirements to

store one state description and path of actions.

Edge classes in a Depth-first search tree based on a


spanning tree

The edges of the depth-first search tree can be divided


into four classes based on the spanning tree,

they are

 Forward edges: The forward edge is responsible for


pointing from a node of the tree to one of

its successors.

 Back edges: The back edge holds the power of directing


its edge from a node of the tree to one of

its ancestors.

 Tree edges: When DFS explores the new vertex from the
current vertex, the edge connecting them is

called a tree edge. It is essential while constructing a DFS


spanning tree because it represents the

paths to be followed during the traversal.


 Cross edges: Cross edges are the edges that connect
two vertices that are neither ancestors nor

descendants of each other in the DFS tree.

Edge classes in DFS based on spanning tree

Depth First Search (DFS) Algorithm


function findPath(robot, start, goal):

stack ← empty stack

visited ← empty set

stack.push(start)

while not stack.isEmpty( ):

current ← stack.pop( )

if current == goal:

return "Path found"

visited.add(current)

neighbors ← robot.getNeighbors(current)

for neighbor in neighbors:

if neighbor not in visted:

stack.push(neighbor)

return "Path not found"

Difference between BFS and DFS


 
Breadth-First Search (BFS) and Depth-First Search (DFS)
are two fundamental algorithms used for traversing or
searching graphs and trees. This article covers the basic
difference between Breadth-First

Search and Depth-First Search.

2Q: Learning Agents


Learning agents are a key idea in the field of artificial
intelligence, with the goal of developing
systems that can improve their performance over time
through experience. These agents are

made up of a few important parts: the learning element,


performance element, critic, and

problem generator.

The learning component is responsible for making


enhancements based on feedback received

from the critic, which evaluates the agent’s performance


against a fixed standard. This feedback

allows the learning aspect to adjust the behavior aspect,


which chooses external actions

depending on recognized inputs.

The problem generator suggests actions that may lead to


new and informative experiences,

encouraging the agent to investigate and possibly unearth


improved tactics. Through integrating

feedback from critics and exploring new actions


suggested by the problem generators, the

learning agent can evolve and improve its behavior


gradually.

Learning agents demonstrate a proactive method of


problem-solving, allowing for adjustment to

new environments and increasing competence beyond


initial knowledge limitations. They

represent the concept of continuous improvement, as


every element adjusts dynamically to
enhance overall performance by leveraging feedback from
the surroundings.

Example: An e-commerce platform employs a


recommendation system. Initially, the system may

depend on simple rules or heuristics to recommend items


to users. However, as it collects data on

user preferences, behavior, and feedback (such as


purchases, ratings, and reviews), it enhances

its suggestions gradually. By utilizing machine learning


algorithms, the agent constantly

enhances its model by incorporating previous


interactions, thus enhancing the precision and

significance of product recommendations for each user.


This system’s adaptive learning process

improves anticipating user preferences and providing


personalized recommendations, ultimately

boosting the user experience and increasing engagement


and sales for the platform.

Characteristics of Learning Agents:


 Adaptive Learning: Acquires knowledge or improves
performance over time through experience,

feedback, or exposure to data.

 Flexibility: Capable of adapting to new tasks,


environments, or situations by adjusting internal

representations or behavioral strategies.


 Generalization: Extracts general patterns or principles
from specific experiences, allowing for

transferable knowledge and skills across different


domains.

 Exploration vs. Exploitation: Balances exploration of


new strategies or behaviors with exploitation of

known solutions to optimize learning and performance.

Schematic Diagram of Learning Agents


3Q: Components of Expert System and
development of expert system
An expert system mainly consists of three components:

o User Interface

o Inference Engine

o Knowledge Base

1. User Interface

With the help of a user interface, the expert system


interacts with the user, takes queries as an input in

a readable format, and passes it to the inference engine.


After getting the response from the inference

engine, it displays the output to the user. In other words, it


is an interface that helps a non-expert user

to communicate with the expert system to find a solution.

2. Inference Engine(Rules of Engine)

o The inference engine is known as the brain of the expert


system as it is the main processing unit

of the system. It applies inference rules to the knowledge


base to derive a conclusion or deduce

new information. It helps in deriving an error-free solution


of queries asked by the user.

o With the help of an inference engine, the system


extracts the knowledge from the knowledge

base.

o There are two types of inference engine:


o Deterministic Inference engine: The conclusions drawn
from this type of inference engine are

assumed to be true. It is based on facts and rules.

o Probabilistic Inference engine: This type of inference


engine contains uncertainty in conclusions,

and based on the probability.

Inference engine uses the below modes to derive the


solutions:

o Forward Chaining: It starts from the known facts and


rules, and applies the inference rules to

add their conclusion to the known facts.

o Backward Chaining: It is a backward reasoning method


that starts from the goal and works

backward to prove the known facts.

3. Knowledge Base

o The knowledgebase is a type of storage that stores


knowledge acquired from the different

experts of the particular domain. It is considered as big


storage of knowledge. The more the

knowledge base, the more precise will be the Expert


System.

o It is similar to a database that contains information and


rules of a particular domain or subject.

o One can also view the knowledge base as collections of


objects and their attributes. Such as a

Lion is an object and its attributes are it is a mammal, it is


not a domestic animal, etc.
Components of Knowledge Base

o Factual Knowledge: The knowledge which is based on


facts and accepted by knowledge

engineers comes under factual knowledge.

o Heuristic Knowledge: This knowledge is based on


practice, the ability to guess, evaluation, and

experiences.

Knowledge Representation: It is used to formalize the


knowledge stored in the knowledge base using

the If-else rules.

Knowledge Acquisitions: It is the process of extracting,


organizing, and structuring the domain

knowledge, specifying the rules to acquire the knowledge


from various experts, and store that

knowledge into the knowledge base.

Development of Expert System


Here, we will explain the working of an expert system by
taking an example of MYCIN ES. Below are

some steps to build an MYCIN:

o Firstly, ES should be fed with expert knowledge. In the


case of MYCIN, human experts

specialized in the medical field of bacterial infection,


provide information about the causes,

symptoms, and other knowledge in that domain.

o The KB of the MYCIN is updated successfully. In order to


test it, the doctor provides a new
problem to it. The problem is to identify the presence of
the bacteria by inputting the details of

a patient, including the symptoms, current condition, and


medical history.

o The ES will need a questionnaire to be filled by the


patient to know the general information

about the patient, such as gender, age, etc.

o Now the system has collected all the information, so it


will find the solution for the problem by

applying if-then rules using the inference engine and using


the facts stored within the KB.

o In the end, it will provide a response to the patient by


using the user interface.

You might also like