Unit 1
Unit 1
INTRODUCTION
Alan Turing devised a test in 1950 to determine whether a machine can think
like a person. This test is known as the Turing Test. Turing claimed that a
machine is intelligent if it can duplicate human responses under particular
conditions in this test.
Turing proposed the Turing Test in his 1950 paper "Computing Machinery
and Intelligence," which addressed the subject of "Can Machine Think?"
The Turing test is based on a modified version of the party game "Imitation
game." This game has three players: one is a computer, another is a human
responder, and the third is a human interrogator who is separated from the
other two players and whose job it is to figure out which of the two is a
machine.
Consider the following scenario: Player A is a computer, Player B is a human,
and Player C is a questioner. The interrogator is aware that one of them is a
machine, but he must determine this based on the questions and responses.
Because all players communicate via keyboard and screen, the outcome is
unaffected by the machine's capacity to transform words into speech.
The questions and answers can be like:
Interrogator: Are you a computer?
PlayerA (Computer): No
Interrogator: Multiply two large numbers such as (256896489*456725896)
Player A: Long pause and give the wrong answer.
If an interrogator is unable to distinguish between a machine and a human in
this game, the computer passes the test, then the machine is said to be
intelligent and capable of thinking like a human." Hugh Loebner, a New York
businessman, announces a prize competition in 1991, promising $100,000 to
the first computer to pass the Turing test. However, no AI programme has ever
come close to passing the Turing test in its purest form "..
1.1.2 Chatbots to attempt the Turing test
ELIZA: Joseph Weizenbaum designed ELIZA, a natural language processing
computer programme. It was made to demonstrate the ability of machines and
humans to communicate. It was one of the first chatterbots to put the Turing
Test to the test.
Parry: Kenneth Colby built Parry, a chatterbot, in 1972. Parry was created to
represent a person suffering from paranoid schizophrenia (most common
chronic mental disorder). "ELIZA with attitude" was how Parry was
described. In the early 1970s, Parry was put to the test using a variant of the
Turing Test.
Eugene Goostman: Eugene Goostman was a chatbot created in 2001 in Saint
Petersburg. This bot has taken part in a number of Turing Tests. Goostman
won the competition billed as the largest-ever Turing test content in June
2012, convincing 29 percent of the judges that it was a human. Goostman had
the appearance of a 13-year-old virtual boy.
Intelligent Agent
A goal-directed agent is an intelligent agent. It sees its environment through its
sensors and acts on it through its actuators, based on observations and built-in
knowledge.
Rational Agent
A rational agent is one that takes the appropriate action in response to each
perception. As a result, the performance measure is maximised, allowing an
agent to be the most successful.
Omniscient Agent
An omniscient agent is one that foresees the real outcome of its actions. In the
real world, however, such agents are impossible to create.
Because a rational agent seeks to attain the best possible result with the
existing perception, which leads to imperfection, rational agents vary from
Omniscient agents. A chess AI is a good example of a rational agent because it
is impossible to predict every conceivable outcome given the present activity,
whereas a tic-tac-toe AI is omniscient because it always knows the outcome in
advance.
Software Agents
It is a programme that operates in a dynamic environment. Because all of the
body parts of software agents are software, they are also known as Softbots.
For instance, video games, flight simulators, and so on.
1.4.1 Behavior of an Agent
An agent's behaviour can be mathematically stated as:
Agent Function:
The mapping of a given percept sequence to an action is known as the agent
function. It's a mathematical explanation in the abstract.
Agent Program:
The agent function is implemented in a practical and physical manner using
the agent programme.
An automatic hand dryer, for example, uses sensors to detect signals (hands).
When we place our hands near the dryer, it activates the heating circuit and
starts blowing air. When the signal detection fades, the heating circuit is
broken and the air blower is turned off.
Rationality of an agent
An intelligent agent is required to act in a way that maximises its performance
metric. As a result, an agent's rationality is determined by four factors:
The criterion of success is defined by the performance metric.
The agent's understanding of the environment is pre-programmed.
The acts that the agent is capable of executing.
Until now, the agent's percept sequence.
Exam results, for example, are determined by both the question paper and our
knowledge.
1.4.2 Task Environment
A task environment is a problem that a rational agent is built to solve. As a
result, Russell and Norvig introduced several ways to categorise task
environments in 2003. However, we need be cognizant of the following terms
before classifying the environments:
Performance Measure: It outlines the sequence of steps taken by the agent to
achieve its goal by measuring various criteria.
Environment: It describes how the agent interacts with various types of
environments.
Actuators: It describes how the agent impacts the environment by performing
predetermined activities.
Sensors: It describes how the agent obtains information from its surroundings.
PEAS is an abbreviation for these terms (Performance measure, Environment,
Actuators, Sensors). Let's take a closer look at each part in the following
example to better understand PEAS terminology:
Agent
Performance Environment Actuators Sensors
Type
Cameras,
Taxi Safe, fast, correct Steering, horn, GPS,
Roads, traffic
Driver destination breaks speedom
eter
Working of an agent program’s components
The purpose of agent components is to provide answers to basic queries such
as "What is the state of the world right now?" and "What do my actions
accomplish?"
We can represent the agent's surroundings in a variety of ways by
discriminating on an axis of increasing expressive strength and complexity, as
shown below:
Atomic Representation: We are unable to split each condition of the world in
this manner. As a result, it lacks any internal structure. The atomic
representation is used in search and game-playing, Hidden Markov Models,
and Markov decision processes.
Factored Representation: Each state is divided into a fixed set of attributes
or variables, each of which has a value. It enables us to portray ambiguity. The
Factored representation is used in constraint fulfilment, propositional logic,
Bayesian networks, and machine learning techniques.
Some variables, like as the current GPS location, can be shared by two
separate factored states, but not by two different atomic states.
Structured Representation: Here, we can express the diverse and varying
relationships that exist between distinct items in the world. Structured
representation is based on relational databases and first-order logic, first-order
probability models, and natural language understanding.
Example Problems
Normally, there are two types of problem approaches:
Toy Problem: Researchers use it to compare the performance of algorithms
because it provides a succinct and clear explanation of the problem.
Real-world Problem: The problems that need to be solved are those that
occur in the real world. It does not require descriptions, unlike a toy problem,
yet we can have a generic formulation of the problem.
Some Toy Problems
8 Puzzle Problem: A 3x3 matrix with movable tiles numbered 1 to 8 and a
blank area is shown. The tile to the left of the vacant spot can be slid into it.
The goal is to achieve a goal state that is similar to the one indicated in the
diagram below.
Our goal is to slide digits into the blank space in the figure to change the
current state to the goal state.
By sliding digits into the vacant space in the above diagram, we can change
the current (Start) state to the desired state.
The problem formulation is as follows:
States: It shows where each numbered tile and the blank tile are located.
Initial State: We Any state can be used as the starting point.
Actions: The blank space's actions are defined here, i.e., left, right, up, or
down.
Transition Model: It returns the final state, which is determined by the
provided state and actions.
Goal test: It determines if we have arrived at the correct goal-state.
Path cost: The path cost is the number of steps in a path where each step costs
one dollar. The 8-puzzle problem is a form of sliding-block problem that is
used to evaluate new artificial intelligence search engines.
8-queens problem: The goal of this issue is to arrange eight queens on a
chessboard in such a way that none of them can attack another queen. A queen
can attack other queens in the same row and column or diagonally.
We can grasp the problem and its correct solution by looking at the diagram
below.
As can be seen in the diagram above, each queen is put on the chessboard in
such a way that no other queen is placed diagonally, in the same row or
column. As a result, it is one viable solution to the eight-queens dilemma.
There are two primary types of formulations for this problem:
Incremental formulation: It begins with an empty state and progresses in
steps, with the operator augmenting a queen at each step.
Following steps are involved in this formulation:
States: On the chessboard, arrange any number of queens from 0 to 8.
Initial State: A chessboard with no pieces
Actions: Fill any empty box with a queen.
Transition model: The chessboard is returned with the queen in a box.
Goal test: Checks if eight queens can be positioned on the chessboard without
being attacked.
Path cost: Because only final states are counted, there is no requirement for
path cost.
There are approximately 1.8 x 1014 potential sequences to analyse in this
formulation.
Complete-state formulation: It begins with all eight queens on the
chessboard and moves them around the board, avoiding attacks.
Following steps are involved in this formulation
States: Each of the eight queens is arranged in a column, with no queen
assaulting the other.
Actions: Move the queen to a secure spot away from the attackers.
This formulation is superior to the incremental formulation since it shrinks the
state space from 1.8 x 1014 to 2057 and makes finding solutions much easier.
Some Real-world problems
Traveling salesperson problem(TSP): It's a problem of touring, because the
salesman can only visit each city once. The goal is to discover the shortest tour
and sell out all of the merchandise in each place.
VLSI Layout problem: Millions of components and connections are placed
on a chip in order to reduce area, circuit delays, and stray capacitances while
increasing manufacturing yield.
The layout problem is split into two parts:
Cell layout: The circuit's primitive components are arranged into cells, each
of which performs a distinct purpose. Each cell is the same size and shape.
The goal is to arrange the cells on the chip so that they do not overlap.
Channel routing: It determines a unique path through the spaces between the
cells for each wire.
Protein Design: The goal is to develop an amino acid sequence that will fold
into a 3D protein with the ability to treat an illness.
Searching for solutions
We've seen a lot of issues. There is now a need to look for solutions to these
problems.
In this section, we'll look at how the agent can use searching to solve an issue.
For solving different kinds of problem, an agent makes use of different
strategies to reach the goal by searching the best possible algorithms. This
process of searching is known as search strategy.
Measuring problem-solving performance
Before delving into other search tactics, it's important to assess an algorithm's
performance. As a result, there are four ways to evaluate an algorithm's
performance:
Completeness: It assesses if the algorithm is certain to discover a solution (if
any solution exist).
Optimality: It determines whether the approach seeks out the best answer.
Time Complexity: The amount of time it takes for an algorithm to find a
solution.
Space Complexity: The amount of memory needed to conduct a search.
The branching factor, or maximum number of successors, the depth of the
shallowest goal node (i.e., the number of steps from the root to the path), and
the maximum length of any path in a state space all influence the algorithm's
complexity.
Application of AI
Artificial intelligence is used in a variety of ways in today's society. It is
becoming increasingly important in today's world because it can efficiently
handle complicated problems in a variety of areas, including healthcare,
entertainment, banking, and education. Our daily lives are becoming more
comfortable and efficient as a result of artificial intelligence.
The following are some of the areas where Artificial Intelligence is used:
1. AI (Astronomy)
Artificial Intelligence (AI) can be extremely helpful in resolving complicated
challenges in the universe. AI technology can assist in gaining a better
understanding of the cosmos, including how it operates, its origin, and so on.
2. AI (Healthcare)
In the previous five to ten years, AI has become more beneficial to the
healthcare business and is expected to have a big impact.
AI is being used in the healthcare industry to make better and faster diagnoses
than humans. AI can assist doctors with diagnosis and can alert doctors when a
patient's condition is deteriorating so that medical assistance can be provided
before the patient is admitted to the hospital.
3. AI (Gaming)
AI can be employed in video games. AI machines can play strategic games
like chess, in which the system must consider a vast number of different
options.
4. AI (Finance)
The banking and AI businesses are the ideal complements to each other.
Automation, chatbots, adaptive intelligence, algorithm trading, and machine
learning are all being used in financial activities.
5. AI (Data Security)
Data security is critical for every business, and cyber-attacks are on the rise in
the digital age. AI can help you keep your data safe and secure. Some
examples are the AEG bot and the AI2 Platform, which are used to better
determine software bugs and cyber-attacks.
6. AI (Social Media)
Facebook, Twitter, and Snapchat, for example, have billions of user accounts
that must be kept and handled in a very efficient manner. AI has the ability to
organise and manage large volumes of data. AI can go through a large amount
of data to find the most recent trends, hashtags, and user requirements.
7. AI (Travel & Transport)
For the travel industry, AI is becoming increasingly important. AI is capable
of doing a variety of travel-related tasks, including making travel
arrangements and recommending hotels, flights, and the best routes to
customers. The travel industry is utilising AI-powered chatbots that can
engage with clients in a human-like manner to provide better and faster
service.
8. AI (Automotive Industry)
Some automotive companies are utilising artificial intelligence to provide a
virtual assistant to their users in order to improve performance. Tesla, for
example, has released TeslaBot, an intelligent virtual assistant.
Various industries are presently working on self-driving automobiles that will
make your ride safer and more secure.
9. AI (Robotics)
In Robotics, Artificial Intelligence plays a significant role. Typically,
conventional robots are programmed to execute a repetitive task; but, using
AI, we may construct intelligent robots that can perform tasks based on their
own experiences rather than being pre-programmed.
Humanoid Robots are the best instances of AI in robotics; recently, the
intelligent Humanoid Robots Erica and Sophia were built, and they can
converse and behave like people.
10. AI (Entertainment)
We already use AI-based applications in our daily lives with entertainment
providers like Netflix and Amazon. These services display software or show
recommendations using machine learning/artificial intelligence (ML/AI)
algorithms.
11. AI (Agriculture)
Agriculture is a field that necessitates a variety of resources, including effort,
money, and time, in order to get the greatest results. Agriculture is becoming
more computerised these days, and AI is becoming more prevalent in this
industry. AI is being used in agriculture in the form of agriculture robotics,
solid and crop monitoring, and predictive analysis. AI in agriculture has the
potential to be extremely beneficial to farmers.
12. AI (E-commerce)
AI is giving the e-commerce industry a competitive advantage, and it is
becoming increasingly demanded in the market. Shoppers can use AI to find
related products in their preferred size, colour, or brand.
13. AI (Education)
Grading can be automated with AI, giving the instructor more time to educate.
As a teaching assistant, an AI chatbot can communicate with students.
In the future, AI could serve as a personal virtual tutor for pupils, available at
any time and from any location.
UNIT II
PROBLEM SOLVING METHODS
Completeness:
The uniform-cost search is complete, so if a solution exists, UCS will discover
it.
Time Complexity:
Let C* is Cost of the optimal solution, and ε is each step to get closer to the
goal node. Then the number of steps is = C*/ε+1. Here we have taken +1, as
we start from state 0 and end to C*/ε.
Hence, the worst-case time complexity of Uniform-cost search isO(b1 + [C*/ε])/.
Space Complexity:
The same logic is for space complexity so, the worst-case space complexity of
Uniform-cost search is O(b1 + [C*/ε]).
Optimal:
Uniform-cost search is always the best option because it only chooses the
cheapest path.
Iterative deepening depth-first Search
The iterative deepening algorithm is a blend of DFS and BFS algorithms. This
search technique determines the appropriate depth limit by gradually raising it
until a goal is discovered.
This algorithm searches in depth first up to a specific "depth limit," then
increases the depth limit for each iteration until the objective node is
discovered.
This search algorithm combines the speed of breadth-first search with the
memory efficiency of depth-first search.
When the search space is huge and the depth of the goal node is unknown, the
iterative search technique is useful for uninformed search.
Advantages
In terms of quick search and memory efficiency, it combines the advantages of
the BFS and DFS search algorithms.
Disadvantages:
The biggest disadvantage of IDDFS is that it duplicates all of the preceding
phase's work.
Example
The iterative deepening depth-first search is seen in the tree structure below.
The IDDFS algorithm iterates until it can't find the goal node any longer. The
algorithm's iteration is described as follows:
1'st Iteration-----> A
2'nd Iteration----> A, B, C
3'rd Iteration------>A, B, D, E, C, F, G
4'th Iteration------>A, B, D, H, I, E, C, F, K, G
The method will find the goal node in the fourth iteration.
Completeness:
If the branching factor is finite, this procedure is complete.
Time Complexity:
Let's suppose b is the branching factor and depth is d then the worst-case time
complexity is O(bd).
Space Complexity:
The space complexity of IDDFS will be O(bd).
Optimal:
If path cost is a non-decreasing function of node depth, the IDDFS algorithm
is optimal.
Bidirectional Search Algorithm
To discover the goal node, the bidirectional search algorithm does two
simultaneous searches, one from the initial state (forward-search) and the
other from the goal node (backward-search). Bidirectional search splits a
single search graph into two small subgraphs, one starting from a beginning
vertex and the other from the destination vertex. When these two graphs
intersect, the search comes to an end.
BFS, DFS, DLS, and other search algorithms can be used in bidirectional
search.
Advantages
Searching in both directions is quick.
It takes less memory to do a bidirectional search.
Disadvantages
The bidirectional search tree is challenging to implement.
In bidirectional search, the objective state should be known ahead of time.
Example
The bidirectional search technique is used in the search tree below. One
graph/tree is divided into two sub-graphs using this approach. In the forward
direction, it begins at node 1 and in the reverse direction, it begins at goal node
16.
The process comes to a halt at node 9, when two searches collide.
Completeness: If we use BFS in both searches, we get a complete bidirectional
search.
Time Complexity: Time complexity of bidirectional search using BFS
is O(bd).
Space Complexity: Space complexity of bidirectional search is O(bd).
Optimal: Bidirectional search is Optimal.
Informed Search Algorithms
So far, we've discussed uninformed search algorithms that scoured the search
space for all possible answers to the problem without having any prior
knowledge of the space. However, an educated search algorithm includes
information such as how far we are from the objective, the cost of the trip, and
how to get to the destination node. This knowledge allows agents to explore
less of the search area and discover the goal node more quickly.
For huge search spaces, the informed search algorithm is more useful. Because
the informed search algorithm is based on the concept of heuristics, it is also
known as heuristic search.
Heuristics function: Informed Search employs a heuristic function to
determine the most promising path. It takes the agent's current state as input
and outputs an estimate of how near the agent is to the goal. The heuristic
method, on the other hand, may not always provide the optimum solution, but
it guarantees that a good solution will be found in a fair amount of time. A
heuristic function determines how close a state is to the desired outcome. It
calculates the cost of an ideal path between two states and is represented by
h(n). The heuristic function's value is always positive.
Admissibility of the heuristic function is given as:
h(n) <= h*(n)
Here h(n) is heuristic cost, and h*(n) is the estimated cost. Hence heuristic
cost should be less than or equal to the estimated cost.
Pure Heuristic Search
The simplest type of heuristic search algorithm is pure heuristic search. It
grows nodes according to their heuristic value h. (n). It has two lists: an OPEN
list and a CLOSED list. It places nodes that have previously expanded in the
CLOSED list, and nodes that have not yet been expanded in the OPEN list.
Each iteration, the lowest heuristic value node n is extended, and all of its
successors are generated, and n is added to the closed list. The algorithm keeps
running until a goal state is discovered.
We shall cover two main algorithms in the informed search, which are listed
below:
Best First Search Algorithm(Greedy search)
A* Search Algorithm
Best-first Search Algorithm (Greedy Search)
The greedy best-first search algorithm always chooses the path that appears to
be the most appealing at the time. It's the result of combining depth-first and
breadth-first search algorithms. It makes use of the heuristic function as well
as search. We can combine the benefits of both methods with best-first search.
At each step, we can use best-first search to select the most promising node.
We expand the node that is closest to the goal node in the best first search
method, and the closest cost is determined using a heuristic function, i.e.
f(n)= g(n).
Were, h(n)= estimated cost from node n to the goal.
The priority queue implements the greedy best first algorithm.
Best first search algorithm:
Stage 1: Place the starting node into the OPEN list.
Stage 2: If the OPEN list is empty, Stop and return failure.
Stage 3: Remove the node n, from the OPEN list which has the lowest value of
h(n), and places it in the CLOSED list.
Stage 4: Expand the node n, and generate the successors of node n.
Stage 5: Check each of node n's descendants to see if any of them is a goal
node. Return success and end the search if any successor node is a goal node;
otherwise, proceed to Stage 6.
Stage 6: The algorithm looks for the evaluation function f(n) for each
successor node, then determines if the node has been in the OPEN or
CLOSED list. Add the node to the OPEN list if it isn't already on both lists.
Stage 7: Return to Stage 2.
Advantages
By combining the benefits of both algorithms, best first search may transition
between BFS and DFS.
This method outperforms the BFS and DFS algorithms in terms of efficiency.
Disadvantages:
In the worst-case scenario, it can act like an unguided depth-first search.
As with DFS, it's possible to get stuck in a loop.
This algorithm isn't the best.
Example:
Consider the search problem below, which we'll solve with greedy best-first
search. Each node is extended at each iteration using the evaluation function
f(n)=h(n), as shown in the table below.
We're going to use two lists in this example: OPEN and CLOSED Lists. The
iterations for traversing the aforementioned example are listed below.
Only the nodes with the lowest value of f(n) are extended at each point in the
search space, and the procedure ends when the goal node is located.
Algorithm of A* search
Stage1: Place the starting node in the OPEN list.
Stage 2: Check if the OPEN list is empty or not, if the list is empty then return
failure and stops.
Stage 3: Select the node from the OPEN list which has the smallest value of
evaluation function (g+h), if node n is goal node then return success and stop,
otherwise
Stage 4: Expand node n and generate all of its successors, and put n into the
closed list. For each successor n', check whether n' is already in the OPEN or
CLOSED list, if not then compute evaluation function for n' and place into
Open list.
Stage 5: Else if node n' is already in OPEN and CLOSED, then it should be
attached to the back pointer which reflects the lowest g(n') value.
Stage 6: Return to Step 2.
Advantages
The A* search algorithm outperforms all other search algorithms.
The A* search algorithm is ideal and comprehensive.
This method is capable of resolving extremely difficult issues.
Disadvantages
Because it is primarily reliant on heuristics and approximation, it does not
always yield the shortest path.
The A* search algorithm has some concerns with complexity.
The fundamental disadvantage of A* is that it requires a lot of memory
because it maintains all created nodes in memory, which makes it unsuitable
for a variety of large-scale issues.
Example
We'll use the A* method to explore the given graph in this example. We'll
calculate the f(n) of each state using the formula f(n)= g(n) + h(n), where g(n)
is the cost of reaching any node from the start state.
We'll use the OPEN and CLOSED lists here.
Solution
Initialization: {(S, 5)}
Iteration1: {(S--> A, 4), (S-->G, 10)}
Iteration2: {(S--> A-->C, 4), (S--> A-->B, 7), (S-->G, 10)}
Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7),
(S-->G, 10)}
Iteration 4 will give the final result, as S--->A--->C--->G it provides the
optimal path with cost 6.
Stratagies
A* algorithm returns the path which occurred first, and it does not search for
all remaining paths.
The efficiency of A* algorithm depends on the quality of heuristic.
A* algorithm expands all nodes which satisfy the condition f(n)<="" li="">
Complete: A* algorithm is complete as long as:
Branching factor is finite.
Cost at every action is fixed.
Optimal: A* search algorithm is optimal if it follows below two conditions:
Admissible: The first requirement for optimality is that h(n) be an admissible
heuristic in A* tree search. An acceptable heuristic is one that is optimistic.
Consistency: For only A* graph-search, the second required condition is
consistency.
A* tree search will always identify the least expensive path if the heuristic
function is accepted.
Time Complexity: The A* search algorithm's time complexity is determined
by the heuristic function, and the number of nodes expanded is proportional to
the depth of the solution d. So, where b is the branching factor, the temporal
complexity is O(bd).
Space Complexity: The space complexity of A* search algorithm is O(b^d)
Heuristic Functions in Artificial Intelligence
Heuristic Functions in AI: As we've already seen, an informed search makes
use of heuristic functions in order to get closer to the goal node. As a result,
there are various ways to get from the present node to the goal node in a
search tree. It is undeniably important to choose a decent heuristic function.
The efficiency of a heuristic function determines its usefulness. The more
knowledge about the problem there is, the longer it takes to solve it.
A heuristic function can help solve some toy problems more efficiently, such
as 8-puzzle, 8-queen, tic-tac-toe, and so on. Let's have a look at how:
Consider the eight-puzzle issue below, which has a start and a target state. Our
goal is to slide the tiles from the current/start state into the goal state in the
correct order. There are four possible movements: left, right, up, and down.
There are various ways to transform the current/start state to the desired state,
but we can solve the problem more efficiently by using the heuristic function
h(n).
The objective state is minimised from h(n)=3 to h(n)=0, as seen in the state
space tree above. However, depending on the requirement, we can design and
employ a number of heuristic functions. A heuristic function h(n) can
alternatively be defined as the knowledge needed to solve a problem more
efficiently, as shown in the previous example. The information can be related
to the nature of the state, the cost of changing states, the characteristics of
target nodes, and so on, and is stated as a heuristic function.
Properties of a Heuristic search Algorithm
The following qualities of a heuristic search algorithm result from the use of
heuristic functions in a heuristic search algorithm:
Admissible Condition: If an algorithm gives an optimal solution, it is said to
be acceptable.
Completeness: If an algorithm ends with a solution, it is said to be complete (if
the solution exists).
Dominance Property: If A1 and A2 are both admissible heuristic algorithms
with h1 and h2 heuristic functions, A1 is said to dominate A2 if h1 is better
than h2 for all node n values.
Optimality Property: If an algorithm is complete, acceptable, and dominates
other algorithms, it is the best and will almost always produce the best result.
Local Search Algorithms and Optimization Problem
The informed and uninformed search expands the nodes in two ways: by
remembering different paths and selecting the best suitable path, which leads
to the solution state required to reach the destination node. But, in addition to
these "classical search algorithms," there are some "local search algorithms"
that ignore path cost and focus just on the solution-state required to reach the
destination node.
Instead of visiting numerous paths and following the neighbours of a single
current node, a local search algorithm completes its mission by following the
neighbours of that node in general.
Although local search algorithms are not systematic, still they have the
following two advantages:
Because they only work on a single path, local search algorithms
consume a little or constant amount of memory.
In huge or infinite state spaces, where classical or systematic
algorithms fail, they frequently discover a suitable solution.
Is it possible to use the local search algorithm to solve a pure optimised
problem?
Yes, for pure optimised issues, the local search technique works. A pure
optimization problem is one that can be solved by all nodes. However,
according to the objective function, the goal is to discover the optimal state out
of all of them. Unfortunately, the pure optimization issue fails to identify good
solutions for getting from the current condition to the objective state.
In various contexts of optimization issues, an objective function is a function
whose value is either minimised or maximised. An objective function in
search algorithms can be the path cost to the goal node, for example.
Working of a Local search algorithm
Let's look at how a local search algorithm works with the help of an example:
Consider the state-space landscape below, which includes both:
Location: It is defined by the state.
Elevation: The value of the objective function or heuristic cost function
defines it.
Simulated Annealing
The hill climbing algorithm is related to simulated annealing. It is effective in
the current circumstances. Instead of choosing the best move, it chooses a
random move. If the move improves the existing situation, it is always
accepted as a step toward the solution state; otherwise, the move with a
probability smaller than one is accepted. This search method was first utilised
to tackle VLSI layout challenges in 1980. It's also used for plant planning and
other large-scale optimization projects.
Local Beam Search
Random-restart search is not the same as local beam search. Instead of simply
one state, it keeps track of k. It chooses k randomly generated states and
expands them one at a time. The search ends with success if any state is a
desired state. Otherwise, it chooses the top k successors from the entire list
and continues the procedure. While each search process works independently
in random-restart search, the essential information is shared throughout the
parallel search processes in local beam search.
Disadvantages of Local Beam search
The absence of diversity among the k states may make this search difficult.
It's a more expensive version of the hill climbing search.
Parameter: Stochastic Beam Search is a version of Local Beam Search that
chooses k successors at random rather than the best k successors.
there are 28 = 256 possible belief states, but only 12 reachable belief states
Cryptarithmetic Problem
Cryptarithmetic Problem is a form of constraint fulfilment problem where the
game is about digits and their unique substitution either with alphabets or
other symbols. The digits (0-9) are substituted by some conceivable alphabets
or symbols in a cryptarithmetic problem. In a cryptarithmetic problem, the
goal is to replace each digit with an alphabet to achieve an arithmetically
correct solution.
The following are the rules or constraints for a cryptarithmetic problem:
A unique digit should be substituted for a unique alphabet.
The outcome must adhere to the predetermined arithmetic rules, such
as 2+2 = 4, and nothing else.
Only digits from 0 to 9 should be used.
When conducting an addition operation on a problem, there should
only be one carry forward.
The problem can be approached from either the lefthand side (L.H.S)
or the righthand side (R.H.S) (R.H.S)
Let's use an example to better grasp the cryptarithmetic problem and its
constraints:
S E N D + M O R E = M O N E Y is a cryptarithmetic problem.
k-Consistency
Local Search for CSPs
Tree-Structured CSPs
For the map-coloring problem, part of the search tree was constructed using
simple backtracking.
Forward checking
Forward checking is a technique for making better use of constraints during
search. When a variable X is assigned, the forward checking procedure
examines each unassigned variable Y that is linked to X by a constraint and
deletes any value from Y's domain that is incompatible with the value chosen
for X. The progress of a map-coloring search with forward checking is shown
in the diagram below.
Example Explanation:
MAX has 9 possible moves from the start because he is the first player.
Both players alternately place x and o until we reach a leaf node where
one player has three in a row or all squares are filled.
Both players will compute the best possible utility versus an optimum
adversary for each node, called the minimax value.
Assume that both players are well-versed in tic-tac-toe and are playing
their best game. Each player is trying everything he can to keep the
other from winning. In the game, MIN is working against Max.
So, in the game tree, we have a Max layer, a MIN layer, and each layer
is referred to as Ply. The game proceeds to the terminal node, with
Max placing x and MIN placing o to prevent Max from winning.
Either MIN or MAX wins, or the game ends in a tie. This game-tree
represents the entire search universe of possibilities in which MIN and
MAX are tic-tac-toeing taking turns alternatively
As a result, the process for adversarial Search for the Minimax is as follows:
Its goal is to figure out the best way for MAX to win the game.
It employs a depth-first search strategy.
The ideal leaf node in the game tree could appear at any level of the
tree.
Minimax values should be propagated up the tree until the terminal
node is found.
The optimal strategy in a particular game tree can be determined by looking at
the minimax value of each node, which can be expressed as MINIMAX (n). If
MAX prefers to move to a maximum value state and MIN prefers to move to a
minimum value state, then:
Mini-Max Algorithm
In decision-making and game theory, the mini-max algorithm is a
recursive or backtracking method. It suggests the best move for the
player, provided that the opponent is likewise playing well.
The Mini-Max algorithm searches the game tree using recursion.
In AI, the Min-Max algorithm is mostly employed for game play.
Chess, checkers, tic-tac-toe, go, and other two-player games are
examples. This Algorithm calculates the current state's minimax
choice.
The game is played by two players, one named MAX and the other
named MIN, in this algorithm.
Both players are fighting it, since the opponent player receives the
smallest benefit while they receive the greatest profit.
Both players in the game are adversaries, with MAX selecting the
maximum value and MIN selecting the minimum value.
For the investigation of the entire game tree, the minimax method uses
a depth-first search strategy.
The minimax algorithm descends all the way to the tree's terminal
node, then recursively backtracks the tree.
Pseudo-code for MinMax Algorithm
function minimax(node, depth, maximizingPlayer) is
if depth ==0 or node is a terminal node then
return static evaluation of node
if MaximizingPlayer then // for Maximizer Player
maxEva= -infinity
for each child of node do
eva= minimax(child, depth-1, false)
maxEva= max(maxEva,eva) //gives Maximum of the values
return maxEva
else // for Minimizer player
minEva= +infinity
for each child of node do
eva= minimax(child, depth-1, true)
minEva= min(minEva, eva) //gives minimum of the values
return minEva
Initial call:
Minimax(node, 3, true)
Working of Min-Max Algorithm
A simple example can be used to explain how the minimax algorithm
works. We've included an example of a game-tree below, which
represents a two-player game.
There are two players in this scenario, one named Maximizer and the
other named Minimizer.
Maximizer will strive for the highest possible score, while Minimizer
will strive for the lowest possible score.
Because this algorithm uses DFS, we must go all the way through the
leaves to reach the terminal nodes in this game-tree.
The terminal values are given at the terminal node, so we'll compare them and
retrace the tree till we reach the original state. The essential phases in solving
the two-player game tree are as follows:
Step-1: The algorithm constructs the full game-tree in the first phase, then
applies the utility function to obtain the utility values for the terminal states.
Let's assume A is the tree's initial state in the diagram below. Assume that the
maximizer takes the first turn with a worst-case initial value of -infinity, and
the minimizer takes the second turn with a worst-case initial value of +infinity.
Step 2: Now, we'll locate the Maximizer's utilities value, which is -, and
compare each value in the terminal state to the Maximizer's initial value to
determine the upper nodes' values. It will select the best option from all of
them.
For node D max(-1,- -∞) => max(-1,4)= 4
For Node E max(2, -∞) => max(2, 6)= 6
For Node F max(-3, -∞) => max(-3,-5) = -3
For node G max(0, -∞) = max(0, 7) = 7
Step 3: In the next step, it's a turn for minimizer, so it will compare all nodes
value with +∞, and will find the 3rd layer node values.
For node B= min(4,6) = 4
For node C= min (-3, 7) = -3
Step 4: Now it's Maximizer's turn, and it'll choose the maximum value of all
nodes and locate the root node's maximum value. There are only four layers in
this game tree, so we can go to the root node right away, but there will be
more layers in real games.
For node A max(4, -3)= 4
That was the complete workflow of the minimax two player game.
Properties of Mini-Max algorithm
Complete- Min-Max algorithm is Complete. It will definitely find a solution
(if exist), in the finite search tree.
Optimal- Min-Max algorithm is optimal if both opponents are playing
optimally.
Time complexity- As it performs DFS for the game-tree, so the time
complexity of Min-Max algorithm is O(bm), where b is branching factor of the
game-tree, and m is the maximum depth of the tree.
Space Complexity- Space complexity of Mini-max algorithm is also similar to
DFS which is O(bm).
Limitation of the minimax Algorithm
The biggest disadvantage of the minimax algorithm is that it becomes
extremely slow while playing complex games like chess or go. This style of
game contains a lot of branching, and the player has a lot of options to choose
from.
Alpha-Beta Pruning
A modified variant of the minimax method is alpha-beta pruning. It's a way
for improving the minimax algorithm.
The number of game states that the minimax search algorithm must investigate
grows exponentially with the depth of the tree, as we saw with the minimax
search method. We can't get rid of the exponent, but we can reduce it by half.
As a result, there is a technique known as pruning that allows us to compute
the correct minimax choice without having to inspect each node of the game
tree.. It's named alpha-beta pruning because it involves two threshold
parameters, Alpha and beta, for future expansion. Alpha-Beta Algorithm is
another name for it.
Alpha-beta pruning can be done at any depth in a tree, and it can sometimes
prune the entire sub-tree as well as the tree leaves.
The two-parameter can be defined as:
a. Alpha: The best (highest-value) choice we have found so far at
any point along the path of Maximizer. The initial value of
alpha is -∞.
b. Beta: The best (lowest-value) choice we have found so far at
any point along the path of Minimizer. The initial value of beta
is +∞.
The Alpha-beta pruning to a standard minimax algorithm produces the same
result as the regular approach, but it removes those nodes that aren't really
effecting the final decision but are slowing down the procedure. As a result,
reducing these nodes speeds up the process.
Condition for Alpha-beta pruning
The main condition which required for alpha-beta pruning is:
α>=β
Key points about alpha-beta pruning
Only the value of alpha will be updated by the Max player.
Only the beta value will be updated by the Min player.
Instead of alpha and beta values, node values will be sent to upper nodes while
retracing the tree.
Only the alpha and beta values will be passed to the child nodes.
Stage 2: At Node D, the value of α will be calculated as its turn for Max. The
value of α is compared with firstly 2 and then 3, and the max (2, 3) = 3 will be
the value of α at node D and node value will also 3.
Stage 3: Now algorithm backtrack to node B, where the value of β will change
as this is a turn of Min, Now β= +∞, will compare with the available
subsequent nodes value, i.e. min (∞, 3) = 3, hence at node B now α= -∞, and
β= 3.
In the next step, algorithm traverse the next successor of Node B which is
node E, and the values of α= -∞, and β= 3 will also be passed.
Stage 4: At node E, Max will take its turn, and the value of alpha will change.
The current value of alpha will be compared with 5, so max (-∞, 5) = 5, hence
at node E α= 5 and β= 3, where α>=β, so the right successor of E will be
pruned, and algorithm will not traverse it, and the value at node E will be 5.
Stage 5: At next step, algorithm again backtrack the tree, from node B to node
A. At node A, the value of alpha will be changed the maximum available
value is 3 as max (-∞, 3)= 3, and β= +∞, these two values now passes to right
successor of A which is Node C.
At node C, α=3 and β= +∞, and the same values will be passed on to node F.
Stage 6: At node F, again the value of α will be compared with left child
which is 0, and max(3,0)= 3, and then compared with right child which is 1,
and max(3,1)= 3 still α remains 3, but the node value of F will become 1.
Stage 7: Node F returns the node value 1 to node C, at C α= 3 and β= +∞, here
the value of beta will be changed, it will compare with 1 so min (∞, 1) = 1.
Now at C, α=3 and β= 1, and again it satisfies the condition α>=β, so the next
child of C which is G will be pruned, and the algorithm will not compute the
entire sub-tree G.
Stage 8: C now returns the value of 1 to A here the best value for A is max (3,
1) = 3. Following is the final game tree which is the showing the nodes which
are computed and nodes which has never computed. Hence the optimal value
for the maximizer is 3 for this example.
The next step is to learn how to make wise decisions. Naturally, we want to
make the decision that will put us in the best possible situation. The
minimum and maximum values for positions, on the other hand, are not
specified. Instead, we can only calculate the expected value of a position,
which is the average of all possible outcomes of the chance nodes.
As a result, for games with chance nodes, we can generalise the deterministic
minimax value to an expected-minimax value. Terminal nodes, MAX and
MIN nodes (for which the dice roll is known), and MAX and MIN nodes (for
which the dice roll is unknown) all work the same way they did before. The
sum of all outcomes, weighted by the likelihood of each chance action, is the
expected value for chance nodes.
where r is a possible dice roll (or other random events) and RESULT(s,r)
denotes the same state as s, but with the addition that the dice roll’s result is
r.
UNIT III
KNOWLEDGE REPRESENTATION
Variables x, y, z, a, b,....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences
Atomic sentences are the most basic first-order logic sentences. These
sentences are made up of a predicate symbol, a parenthesis, and a series of
terms.
We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
Chinky is a cat: => cat (Chinky).
Complex Sentences
Connectives are used to join atomic sentences to form complex sentences.
The following are two types of first-order logic statements:
Subject: Subject is the main part of the statement.
Predicate: A predicate can be defined as a relation, which binds two atoms
together in a statement.
Consider the following statement: "x is an integer." It has two parts: the first
component, x, is the statement's subject, and the second part, "is an integer," is
the statement's predicate.
Example
We will use this rule for Kings are evil, so we will find some x such that x is
king, and x is greedy so we can infer that x is evil.
Here let say, p1' is king(John) p1 is king(x)
p2' is Greedy(y) p2 is Greedy(x)
θ is {x/John, y/John} q is evil(x)
SUBST(θ,q).
Propositional logic in Artificial intelligence
The simplest kind of logic is propositional logic (PL), in which all statements
are made up of propositions. The term "proposition" refers to a declarative
statement that can be true or false. It's a method of expressing knowledge in
logical and mathematical terms.
Example
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
The following are some fundamental propositional logic facts:
Because it operates with 0 and 1, propositional logic is also known as
Boolean logic.
In propositional logic, symbolic variables are used to express the logic,
and any symbol can be used to represent a proposition, such as A, B,
C, P, Q, R, and so on.
Propositions can be true or untrue, but not both at the same time.
An object, relations or functions, and logical connectives make up
propositional logic.
Logical operators are another name for these connectives.
The basic elements of propositional logic are propositions and
connectives.
Connectives are logical operators that link two sentences together.
Tautology, commonly known as a legitimate sentence, is a proposition
formula that is always true.
Contradiction is a proposition formula that is always false.
Statements that are inquiries, demands, or opinions are not
propositions, such as "Where is Rohini," "How are you," and "What is
your name," are not propositions.
Syntax of propositional logic
The allowed sentences for knowledge representation are defined by the syntax
of propositional logic. Propositions are divided into two categories:
Atomic Propositions
Compound propositions
Atomic Proposition: Simple statements are atomic propositions. It is made up
of only one proposition sign. These are the sentences that must be true or
untrue in order to pass.
Example
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold," as well as being a false fact, is a proposition.
Compound propositions are made up of simpler or atomic propositions joined
together with parenthesis and logical connectives.
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives
Logical connectives are used to link two simpler ideas or to logically represent
a statement. With the use of logical connectives, we can form compound
assertions. There are five primary connectives, which are listed below:
Negation: A sentence such as ¬ P is called negation of P. A literal can be
either Positive literal or negative literal.
Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
Implication: A sentence such as P → Q, is called an implication. Implications
are also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example
If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.Following is
the summarized table for Propositional Logic Connectives:
Truth Table
We need to know the truth values of propositions in all feasible contexts in
propositional logic. With logical connectives, we can combine all possible
combinations, and the representation of these combinations in a tabular
manner is known as a truth table. The truth table for all logical connectives is
as follows:
Truth table with three propositions
A proposition can be constructed by combining three propositions: P, Q, and
R. Because we used three proposition symbols, this truth table is made up of
8n Tuples.
Precedence of connectives
Propositional connectors or logical operators, like arithmetic operators, have a
precedence order. When evaluating a propositional problem, this order should
be followed. The following is a list of the operator precedence order:
Precedence Operators
Logical equivalence
One of the characteristics of propositional logic is logical equivalence. If and
only if the truth table's columns are equal, two assertions are said to be
logically comparable.
Let's take two propositions A and B, so for logical equivalence, we can write it
as A⇔B. In below truth table we can see that column for ¬A∨ B and A→B,
are identical hence A is Equivalent to B
Properties of Operators
Commutativity:
P∧ Q= Q ∧ P, or
P ∨ Q = Q ∨ P.
Associativity:
(P ∧ Q) ∧ R= P ∧ (Q ∧ R),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R)
Identity element:
P ∧ True = P,
P ∨ True= True.
Distributive:
P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
DE Morgan's Law:
¬ (P ∧ Q) = (¬P) ∨ (¬Q)
¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
Double-negation elimination:
¬ (¬P) = P.
Limitations of Propositional logic
With propositional logic, we can't represent relations like ALL, SOME, or
NONE. Example:
All the girls are intelligent.
Some apples are sweet.
The expressive power of propositional logic is restricted.
We can't explain propositions in propositional logic in terms of their qualities
or logical relationships.
Rules of Inference in Artificial intelligence
Inference
We need intelligent computers in artificial intelligence to construct new logic
from old logic or evidence, therefore inference is the process of drawing
conclusions from data and facts.
Inference rules
The templates for creating valid arguments are known as inference rules. In
artificial intelligence, inference rules are used to generate proofs, and a proof
is a series of conclusions that leads to the intended outcome.
The implication among all the connectives is vital in inference rules. Some
terms relating to inference rules are as follows:
Implication: It is one of the logical connectives which can be represented as P
→ Q. It is a Boolean expression.
Converse: The converse of implication, which means the right-hand side
proposition goes to the left-hand side and vice-versa. It can be written as Q →
P.
Contrapositive: The negation of converse is termed as contrapositive, and it
can be represented as ¬ Q → ¬ P.
Inverse: The negation of implication is called inverse. It can be represented as
¬ P → ¬ Q.
Some of the compound claims in the above term are equivalent to each other,
which we can establish using a truth table.
Hence from the above truth table, we can prove that P → Q is equivalent to ¬
Q → ¬ P, and Q→ P is equivalent to ¬ P → ¬ Q.
Types of Inference rules
1. Modus Ponens:
One of the most essential laws of inference is the Modus Ponens rule, which
asserts that if P and P →Q are both true, we can infer that Q will be true as
well. It's written like this:
Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
2.Proof by Truth table:
3. Hypothetical Syllogism
The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is
true, and Q→R is true. It can be represented as the following notation:
Example:
Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R
Proof by truth table:
4. Disjunctive Syllogism:
The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q
will be true. It can be represented as:
Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
Proof by truth-table:
5. Addition:
The Addition rule is one the common inference rule, and it states that If P is
true, then P∨Q will be true.
Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Proof by Truth-Table:
6. Simplification:
The simplification rule state that if P∧ Q is true, then Q or P will also be true.
It can be represented as:
Proof by Truth-Table:
7. Resolution:
The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be
true. It can be represented as
Proof by Truth-Table:
Wumpus world
The Wumpus world is a basic world example that demonstrates the value of a
knowledge-based agent and how knowledge representation is represented. It
was inspired by Gregory Yob's 1973 video game Hunt the Wumpus.
The Wumpus world is a cave with 4x4 rooms and pathways connecting them.
As a result, there are a total of 16 rooms that are interconnected. We now have
a knowledge-based AI capable of progressing in this world. There is an area in
the cave with a beast named Wumpus who eats everybody who enters. The
agent can shoot the Wumpus, but he only has a single arrow. There are some
Pits chambers in the Wumpus universe that are bottomless, and if an agent
falls into one, he will be stuck there indefinitely. The intriguing thing about
this cave is that there is a chance of finding a gold heap in one of the rooms.
So the agent's mission is to find the gold and get out of the cave without
getting eaten by Wumpus or falling into Pits. If the agent returns with gold, he
will be rewarded, but if he is devoured by Wumpus or falls into the pit, he will
be penalised.
A sample diagram for portraying the Wumpus planet is shown below. It
depicts some rooms with Pits, one room with Wumpus, and one agent in the
world's (1, 1) square position.
There are some elements that can assist the agent in navigating the cave. The
following are the components:
The rooms adjacent to the Wumpus room are stinky, thus there is a
stench there.
The room next to PITs has a breeze, so if the agent gets close enough
to PIT, he will feel it.
If and only if the room contains gold, there will be glitter.
If the agent is facing the Wumpus, the agent can kill it, and the
Wumpus will cry horribly, which can be heard throughout the cave.
PEAS description of Wumpus world
To explain the Wumpus world we have given PEAS description as below:
Performance measure:
+1000 reward points if the agent comes out of the cave with the gold.
-1000 points penalty for being eaten by the Wumpus or falling into the
pit.
-1 for each action, and -10 for using an arrow.
The game ends if either agent dies or came out of the cave.
Environment:
A 4*4 grid of rooms.
The agent initially in room square [1, 1], facing toward the right.
Location of Wumpus and gold are chosen randomly except the first
square
Each square of the cave can be a pit with probability 0.2 except the
first square.
Actuators
Left turn,
Right turn
Move forward
Grab
Release
Shoot.
Sensors:
If the agent is in the same room as the Wumpus, he will smell the
stench. (Not on a diagonal.)
If the agent is in the room directly adjacent to the Pit, he will feel a
breeze.
The agent will notice the gleam in the room where the gold is located.
If the agent walks into a wall, he will feel the bump.
When the Wumpus is shot, it lets out a horrifying cry that can be heard
throughout the cave.
These perceptions can be expressed as a five-element list in which
each sensor will have its own set of indicators.
For instance, if an agent detects smell and breeze but no glitter, bump,
or shout, it might be represented as [Stench, Breeze, None, None,
None].
The Wumpus world Properties
Partially observable: The Wumpus world is partially observable
because the agent can only perceive the close environment such as an
adjacent room.
Deterministic: It is deterministic, as the result and outcome of the
world are already known.
Sequential: The order is important, so it is sequential.
Static: It is static as Wumpus and Pits are not moving.
Discrete: The environment is discrete.
One agent: The environment is a single agent as we have one agent
only and Wumpus is not considered as an agent.
Exploring the Wumpus world
Now we'll investigate the Wumpus universe and see how the agent will
achieve its goal through logical reasoning.
The first step for an agent is to:
Initially, the agent is in the first room, or square [1,1], and we already know
that this room is safe for the agent, thus we will add the sign OK to the below
diagram (a) to represent that room is safe. The agent is represented by the
letter A, the breeze by the letter B, the glitter or gold by the letter G, the
visited room by the letter V, the pits by the letter P, and the Wumpus by the
letter W.
At Room [1,1] agent does not feel any breeze or any Stench which means the
adjacent squares are also OK.
Agent's second Step:
Now that the agent must go forward, it will either go to [1, 2] or [2, 1]. Let's
say agent enters room [2, 1], where he detects a breeze, indicating Pit is
present. Because the pit might be in [3, 1] or [2, 2], we'll add the sign P? to
indicate that this is a Pit chamber.
Now the agent will pause and consider his options before doing any
potentially destructive actions. The agent will return to room [1, 1]. The agent
visits the rooms [1,1] and [2,1], thus we'll use the symbol V to symbolise the
squares he's been to.
Agent's third step:
The agent will now proceed to the room [1,2], which is fine. Agent detects a
stink in the room [1,2], indicating the presence of a Wumpus nearby.
However, according to the rules of the game, Wumpus cannot be in the room
[1,1], and he also cannot be in [2,2]. (Agent had not detected any stench when
he was at [2,1]). As a result, the agent infers that Wumpus is in the room [1,3],
and there is no breeze at the moment, implying that there is no Pit and no
Wumpus in [2,2]. So that's safe, and we'll designate it as OK, and the agent
will advance [2,2].
Agent's fourth step:
Because there is no odour and no breeze in room [2,2], let's assume the agent
decides to move to room [2,3]. Agent detects glitter in room [2,3], thus it
should collect the gold and ascend out of the cave.
Unification
Unification is the process of finding a substitute that makes two
separate logical atomic expressions identical. The substitution process
is necessary for unification.
It accepts two literals as input and uses substitution to make them
identical.
Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a unifier such
that, Ψ1𝜎 = Ψ2𝜎, then it can be expressed as UNIFY(Ψ1, Ψ2).
Example: Find the MGU for Unify{King(x), King(John)}
Let Ψ1 = King(x), Ψ2 = King(John),
Substitution θ = {John/x} is a unifier for these atoms and applying this
substitution, and both expressions will be identical.
For unification, the UNIFY algorithm is employed, which takes two
atomic statements and returns a unifier for each of them (If any exist).
All first-order inference techniques rely heavily on unification.
If the expressions do not match, the result is failure.
The replacement variables are referred to as MGU (Most General
Unifier).
E.g. Let's assume P(x, y) and P(a, f(z)) are two different expressions.
In this case, we must make both of the preceding assertions identical. We'll
make the substitution in this case.
P(x, y)......... (i)
P(a, f(z))......... (ii)
In the first statement, replace x with a and y with f(z), and the result
will be a/x and f(z)/y.
The first expression will be equal to the second expression with both
replacements, and the substitution set will be [a/x, f(z)/y].
Conditions for Unification
Following are some basic conditions for unification:
Atoms or expressions with various predicate symbols can never be
united.
Both phrases must have the same number of arguments.
If two comparable variables appear in the same expression, unification
will fail.
Unification Algorithm
Algorithm: Unify(Ψ1, Ψ2)
Step. 1: If Ψ1 or Ψ2 is a variable or constant, then:
a) If Ψ1 or Ψ2 are identical, then return NIL.
b) Else if Ψ1is a variable,
a. then if Ψ1 occurs in Ψ2, then return FAILURE
b. Else return { (Ψ2/ Ψ1)}.
c) Else if Ψ2 is a variable,
a. If Ψ2 occurs in Ψ1 then return FAILURE,
b. Else return {( Ψ1/ Ψ2)}.
d) Else return FAILURE.
Step.2: If the initial Predicate symbol in Ψ1 and Ψ2 are not same, then return
FAILURE.
Step. 3: IF Ψ1 and Ψ2 have a different number of arguments, then return
FAILURE.
Step. 4: Set Substitution set(SUBST) to NIL.
Step. 5: For i=1 to the number of elements in Ψ1.
a) Call Unify function with the ith element of Ψ1 and ith element of
Ψ2, and put the result into S.
b) If S = failure then returns Failure
c) If S ≠ NIL then do,
a. Apply S to the remainder of both L1 and L2.
b. SUBST= APPEND(S, SUBST).
Step.6: Return SUBST.
Implementation of the Algorithm
Step.1: Initialize the substitution set to be empty.
Step.2: Recursively unify atomic sentences:
Check for Identical expression match.
If one expression is a variable vi, and the other is a term ti which does
not contain variable vi, then:
Substitute ti / vi in the existing substitutions
Add ti /vi to the substitution setlist.
If both the expressions are functions, then function name must be
similar, and the number of arguments must be the same in both the
expression.
For each pair of the following atomic sentences find the most general
unifier (If exist).
1. Find the MGU of {p(f(a), g(Y)) and p(X, X)}
Sol: S0 => Here, Ψ1 = p(f(a), g(Y)), and Ψ2 = p(X, X)
SUBST θ= {f(a) / X}
S1 => Ψ1 = p(f(a), g(Y)), and Ψ2 = p(f(a), f(a))
SUBST θ= {f(a) / g(y)}, Unification failed.
Unification is not possible for these expressions.
2. Find the MGU of {p(b, X, f(g(Z))) and p(Z, f(Y), f(Y))}
Here, Ψ1 = p(b, X, f(g(Z))) , and Ψ2 = p(Z, f(Y), f(Y))
S0 => { p(b, X, f(g(Z))); p(Z, f(Y), f(Y))}
SUBST θ={b/Z}
S1 => { p(b, X, f(g(b))); p(b, f(Y), f(Y))}
SUBST θ={f(Y) /X}
S2 => { p(b, f(Y), f(g(b))); p(b, f(Y), f(Y))}
SUBST θ= {g(b) /Y}
S2 => { p(b, f(g(b)), f(g(b)); p(b, f(g(b)), f(g(b))} Unified Successfully.
And Unifier = { b/Z, f(Y) /X , g(b) /Y}.
3. Find the MGU of {p (X, X), and p (Z, f(Z))}
Here, Ψ1 = {p (X, X), and Ψ2 = p (Z, f(Z))
S0 => {p (X, X), p (Z, f(Z))}
SUBST θ= {X/Z}
S1 => {p (Z, Z), p (Z, f(Z))}
SUBST θ= {f(Z) / Z}, Unification Failed.
Hence, unification is not possible for these expressions.
4. Find the MGU of UNIFY(prime (11), prime(y))
Here, Ψ1 = {prime(11) , and Ψ2 = prime(y)}
S0 => {prime(11) , prime(y)}
SUBST θ= {11/y}
S1 => {prime(11) , prime(11)} , Successfully unified.
Unifier: {11/y}.
5. Find the MGU of Q(a, g(x, a), f(y)), Q(a, g(f(b), a), x)}
Here, Ψ1 = Q(a, g(x, a), f(y)), and Ψ2 = Q(a, g(f(b), a), x)
S0 => {Q(a, g(x, a), f(y)); Q(a, g(f(b), a), x)}
SUBST θ= {f(b)/x}
S1 => {Q(a, g(f(b), a), f(y)); Q(a, g(f(b), a), f(b))}
SUBST θ= {b/y}
S1 => {Q(a, g(f(b), a), f(b)); Q(a, g(f(b), a), f(b))}, Successfully Unified.
Unifier: [a/a, f(b)/x, b/y].
6. UNIFY(knows(Richard, x), knows(Richard, John))
Here, Ψ1 = knows(Richard, x), and Ψ2 = knows(Richard, John)
S0 => { knows(Richard, x); knows(Richard, John)}
SUBST θ= {John/x}
S1 => { knows(Richard, John); knows(Richard, John)}, Successfully Unified.
Unifier: {John/x}.
Forward Chaining and backward chaining in AI
Forward and backward chaining is an essential topic in artificial intelligence,
but before we go into forward and backward chaining, let's look at where these
two phrases come from.
Inference engine:
In artificial intelligence, the inference engine is a component of the intelligent
system that applies logical rules to the knowledge base to infer new
information from known facts. The expert system included the first inference
engine. Inference engines often operate in one of two modes:
Forward chaining
Backward chaining
Horn Clause and Definite clause
Horn clause and definite clause are sentence types that allow the knowledge
base to apply a more limited and efficient inference procedure. Forward and
backward chaining techniques are used in logical inference algorithms, and
they both need KB in the form of a first-order definite sentence.
A definite clause, sometimes known as a strict horn clause, is a clause that is a
disjunction of literals with exactly one affirmative literal.
Horn clause: A horn clause is a clause that is a disjunction of literals with at
most one positive literal. As a result, every definite clause is a horn clause.
Example: (¬ p V ¬ q V k). It has only one positive literal k.
It is equivalent to p ∧ q → k.
Forward Chaining
When employing an inference engine, forward chaining is also known as
forward deduction or forward reasoning. Forward chaining is a type of
reasoning that starts with atomic sentences in a knowledge base and uses
inference rules (Modus Ponens) to extract more material in the forward
direction until a goal is attained.
The Forward-chaining algorithm begins with known facts, then activates all
rules with satisfied premises and adds their conclusion to the known facts.
This process continues until the issue is resolved.
Properties of Forward-Chaining
As it moves from bottom to top, it is a down-up method.
It is a method of arriving at a conclusion based on known facts or data
by starting at the beginning and working one's way to the end.
Forward-chaining is also known as data-driven since it allows us to
achieve our goal by utilising existing data.
Expert systems, such as CLIPS, business, and production rule systems,
frequently employ the forward-chaining approach.
Consider the following well-known example, which we'll apply to both ways.
Example
"It is illegal for an American to sell weapons to unfriendly countries,
according to the law. Country A, an American foe, has a few missiles, all of
which were sold to it by Robert, an American citizen."
Demonstrate that "Robert is a thief."
To answer the problem, we'll turn all of the facts above into first-order definite
clauses, then utilise a forward-chaining procedure to get to the goal.
Facts Conversion into FOL
It is a crime for an American to sell weapons to hostile nations. (Let's
say p, q, and r are variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p)
...(1)
Country A has some missiles. ?p Owns(A, p) ∧ Missile(p). It can be
written in two definite clauses by using Existential Instantiation,
introducing new Constant T1.
Owns(A, T1) ......(2)
Missile(T1) .......(3)
All of the missiles were sold to country A by Robert.
?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
Missiles are weapons.
Missile(p) → Weapons (p) .......(5)
Enemy of America is known as hostile.
Enemy(p, America) →Hostile(p) ........(6)
Country A is an enemy of America.
Enemy (A, America) .........(7)
Robert is American
American(Robert). ..........(8)
Forward chaining proof
Step-1:
In the first step we will start with the known facts and will choose the
sentences which do not have implications, such as: American(Robert),
Enemy(A, America), Owns(A, T1), and Missile(T1). All these facts will be
represented as below.
Step-2:
At the second step, we will see those facts which infer from available facts and
with satisfied premises.
Rule-(1) does not satisfy premises, so it will not be added in the first iteration.
Rule-(2) and (3) are already added.
Rule-(4) satisfy with the substitution {p/T1}, so Sells (Robert, T1, A) is
added, which infers from the conjunction of Rule (2) and (3).
Rule-(6) is satisfied with the substitution(p/A), so Hostile(A) is added and
which infers from Rule-(7).
Step-3:
At step-3, as we can check Rule-(1) is satisfied with the
substitution {p/Robert, q/T1, r/A}, so we can add Criminal(Robert) which
infers all the available facts. And hence we reached our goal statement.
Step-2:
At the second step, we will infer other facts form goal fact which satisfies the
rules. So as we can see in Rule-1, the goal predicate Criminal (Robert) is
present with substitution {Robert/P}. So we will add all the conjunctive facts
below the first level and will replace p with Robert.
Here we can see American (Robert) is a fact, so it is proved here.
Step-3:t At step-3, we will extract further fact Missile(q) which infer from
Weapon(q), as it satisfies Rule-(5). Weapon (q) is also true with the
substitution of a constant T1 at q.
Step-4:
At step-4, we can infer facts Missile(T1) and Owns(A, T1) form Sells(Robert,
T1, r) which satisfies the Rule- 4, with the substitution of A in place of r. So
these two statements are proved here.
Step-5:
At step-5, we can infer the fact Enemy(A, America) from Hostile(A) which
satisfies Rule- 6. And hence all the statements are proved true using backward
chaining.
Difference between backward chaining and forward chaining
Resolution in FOL
Resolution is a method of theorem proof that involves constructing refutation
proofs, or proofs by contradictions. It was created in 1965 by a mathematician
named John Alan Robinson.
When several statements are supplied and we need to prove a conclusion from
those claims, we employ resolution. In proofs by resolutions, unification is a
crucial idea. Resolution is a single inference rule that can work on either the
conjunctive normal form or the clausal form efficiently.
Clause: Disjunction of literals (an atomic sentence) is called a clause. It is also
known as a unit clause.
Conjunctive Normal Form: A sentence represented as a conjunction of clauses
is said to be conjunctive normal form or CNF.
Representation
Following are the kind of knowledge which needs to be represented in AI
systems:
Object: All the facts about objects in our world domain. E.g., Guitars
contains strings, trumpets are brass instruments.
Events: Events are the actions which occur in our world.
Performance: It describe behavior which involves knowledge about
how to do things.
Meta-knowledge: It is knowledge about what we know.
Facts: Facts are the truths about the real world and what we represent.
Knowledge-Base: The knowledge base is the most important part of
the knowledge-based agents. It's abbreviated as KB. The Sentences are
grouped together in the Knowledgebase (Here, sentences are used as a
technical term and not identical with the English language).
Knowledge: Knowledge is the awareness or familiarity of facts, data,
and circumstances gained through experiences. The types of
knowledge in artificial intelligence are listed below.
Types of knowledge
Following are the various types of knowledge
1. Declarative Knowledge:
Declarative knowledge is the ability to understand something.
It contains ideas, facts, and objects.
It's also known as descriptive knowledge, and it's communicated using
declarative statements.
It is less complicated than procedural programming.
2. Procedural Knowledge
It's sometimes referred to as "imperative knowledge."
Procedure knowledge is a form of knowledge that entails knowing how to do
something.
It can be used to complete any assignment.
It has rules, plans, procedures, and agendas, among other things.
The use of procedural knowledge is contingent on the job at hand.
3. Meta-knowledge:
Knowledge about the other types of knowledge is called Meta-knowledge.
4. Heuristic knowledge:
Heuristic knowledge is the sum of the knowledge of a group of specialists in a
certain field or subject.
Heuristic knowledge refers to rules of thumb that are based on prior
experiences, awareness of methodologies, and are likely to work but not
guaranteed.
5. Structural knowledge:
Basic problem-solving knowledge is structural knowledge.
It describes the connections between distinct concepts such as kind, part of,
and grouping.
It is a term that describes the relationship between two or more concepts or
objects.
The relation between knowledge and intelligence
Real-world knowledge is essential for intelligence, and artificial intelligence
is no exception. When it comes to exhibiting intelligent behaviour in AI
entities, knowledge is crucial. Only when an agent has some knowledge or
expertise with a given input can he act appropriately on it.
Consider what you would do if you encountered someone who spoke to you in
a language you did not understand. The same can be said for the agents'
intelligent behaviour.
One decision maker, as shown in the diagram below, acts by detecting the
environment and applying knowledge. However, if the knowledge component
is missing, it will be unable to demonstrate intelligent behaviour.
AI knowledge cycle
An Artificial intelligence system has the following components for displaying
intelligent behavior:
Perception
Learning
Knowledge Representation and Reasoning
Planning
Execution
The diagram above depicts how an AI system interacts with the real
environment and what components assist it in displaying intelligence.
Perception is a component of an AI system that allows it to gather information
from its surroundings. It can be in the form of visual, aural, or other sensory
input. The learning component is in charge of gaining knowledge from the
data collected by Perception comportment. The main components of the entire
cycle are knowledge representation and reasoning. These two elements have a
role in demonstrating intelligence in machine-like humans. These two
components are independent of one another, but they are also linked. Analysis
of knowledge representation and reasoning is required for planning and
implementation.
Approaches to knowledge representation:
There are mainly four approaches to knowledge representation, which are
givenbelow:
1. Simple relational knowledge:
It is the most basic technique of storing facts that use the relational method,
with each fact about a group of objects laid out in columns in a logical order.
This method of knowledge representation is often used in database systems to
express the relationships between various things.
This method leaves minimal room for inference.
Example: The following is the simple relational knowledge representation.
Player1 65 23
Player2 58 18
Player3 75 24
2. Inheritable knowledge:
All data must be kept in a hierarchy of classes in the inheritable knowledge
approach.
All classes should be organised in a hierarchical or generic fashion.
We use the inheritance property in this method.
Other members of a class pass on their values to elements.
The instance relation is a type of inheritable knowledge that illustrates a
relationship between an instance and a class.
Each individual frame might indicate a set of traits as well as their value.
Objects and values are represented in Boxed nodes in this technique.
Arrows are used to connect objects to their values.
Example:
3. Inferential knowledge:
Knowledge is represented in the form of formal logics in the inferential
knowledge approach.
More facts can be derived using this method.
It ensured that everything was in order.
Example: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
Small programmes and codes are used in the procedural knowledge approach
to specify how to do specific things and how to proceed.
One significant rule employed in this method is the If-Then rule.
We may employ several coding languages, such as LISP and Prolog, with this
information.
Using this method, we can readily represent heuristic or domain-specific
information.
However, this strategy does not require us to represent all scenarios.
Requirements for knowledge Representation system:
A good knowledge representation system must possess the following
properties.
1. Representational Accuracy:
KR system should have the ability to represent all kind of required knowledge.
2. Inferential Adequacy:
KR system should have ability to manipulate the representational structures to
produce new knowledge corresponding to existing structure.
3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most
productive directions by storing appropriate guides.
4. Acquisitional efficiency- The ability to acquire the new knowledge easily
using automatic methods.
ONTOLOGICAL ENGINEERING
Events, Time, Physical Objects, and Beliefs are examples of concepts that
appear in a variety of disciplines. Ontological engineering is a term used to
describe the process of representing abstract concepts.
Because of the habit of showing graphs with the general concepts at the top
and the more specialised concepts below them, the overall framework of
concepts is called an upper ontology, as seen in Figure.
Categories and Objects
The categorization of objects is an important aspect of knowledge
representation. Although much reasoning takes place at the level of categories,
much engagement with the environment takes place at the level of particular
things.
A shopper's goal, for example, would generally be to purchase a basketball
rather than a specific basketball, such as BB9. In first-order logic, there are
two ways to represent categories: predicates and objects. To put it another
way, we can use the predicate Basketball (b) or reify1 the category as an
object, Basketballs.
To state that b is a member of the category of basketballs, we may say
Member(b, Basketballs), which we would abbreviate as b Basketballs.
Basketballs is a subcategory of Balls, thus we say Subset(Basketballs, Balls),
abbreviated as Basketballs Balls. Through inheritance, categories help to
organise and simplify the information base. We can deduce that every apple is
edible if we state that all instances of the category Food are edible and that
Fruit is a subclass of Food and Apples is a subclass of Fruit. Individual apples
are said to inherit the quality of edibility from their membership in the Food
category. By connecting things to categories or quantifying over their
members, first-order logic makes it simple to state truths about categories.
Here are some instances of different types of facts:
• An object is a member of a category.
BB9 ∈ Basketballs
• A category is a subclass of another category. Basketballs ⊂ Balls
• All members of a category have some properties.
(x∈ Basketballs) ⇒ Spherical (x)
• Members of a category can be recognized by some properties. Orange(x) ∧
Round (x) ∧ Diameter(x)=9.5 ∧ x∈ Balls ⇒ x∈ Basketballs
• A category as a whole has some properties.
Dogs ∈ Domesticated Species
Because Dogs is both a category and a subcategory of Domesticated Species,
the latter must be a category of categories. Categories can also be formed by
establishing membership requirements that are both required and sufficient. A
bachelor, for example, is a single adult male:
x∈ Bachelors ⇔ Unmarried(x) ∧ x∈ Adults ∧ x∈ Males
Physical Composition
To declare that one thing is a part of another, we utilise the general PartOf
connection. Objects can be categorised into hierarchies, similar to the Subset
hierarchy:
PartOf (Bucharest, Romania)
PartOf (Romania, EasternEurope)
PartOf(EasternEurope, Europe)
PartOf (Europe, Earth)
The PartOf relation is transitive and reflexive; that is,
PartOf (x, y) ∧PartOf (y, z) ⇒PartOf (x, z)
PartOf (x, x)
Therefore, we can conclude PartOf (Bucharest, Earth).
For example, if the apples are Apple1, Apple2, and Apple3, then
BunchOf ({Apple1,Apple2,Apple3})
denotes the composite object with the three apples as parts (not elements). We
can define BunchOf in terms of the PartOf relation. Obviously, each element
of s is part of
BunchOf (s): ∀x x∈ s ⇒PartOf (x, BunchOf (s)) Furthermore, BunchOf (s) is
the smallest object satisfying this condition. In other words, BunchOf (s) must
be part of any object that has all the elements of s as parts:
∀y [∀x x∈ s ⇒PartOf (x, y)] ⇒PartOf (BunchOf (s), y)
Measurements
In both scientific and commonsense theories of the world, objects have height,
mass, cost, and so on. The values that we assign for these properties are called
measures. Length(L1)=Inches(1.5)=Centimeters(3.81)
Conversion between units is done by equating multiples of one unit to another:
Centimeters(2.54 ×d)=Inches(d)
Similar axioms can be written for pounds and kilograms, seconds and days,
and dollars and cents. Measures can be used to describe objects as follows:
Diameter (Basketball12)=Inches(9.5)
ListPrice(Basketball12)=$(19)
d∈ Days ⇒ Duration(d)=Hours(24)
Time Intervals
Event calculus opens us up to the possibility of talking about time, and time
intervals. We will consider two kinds of time intervals: moments and extended
intervals. The distinction is that only moments have zero duration:
Partition({Moments,ExtendedIntervals},Intervals)
i∈Moments⇔Duration(i)=Seconds(0)
The functions Begin and End pick out the earliest and latest moments in an
interval, and the function Time delivers the point on the time scale for a
moment.
The function Duration gives the difference between the end time and the start
time. Interval (i) ⇒Duration(i)=(Time(End(i)) − Time(Begin(i)))
Time(Begin(AD1900))=Seconds(0)
Time(Begin(AD2001))=Seconds(3187324800)
Time(End(AD2001))=Seconds(3218860800)
Duration(AD2001)=Seconds(31536000) Two intervals Meet if the end time of
the first equals the start time of the second. The complete set of interval
relations, as proposed by Allen (1983), is shown graphically in Figure 12.2
and logically below: Meet(i,j) ⇔ End(i)=Begin(j)
Before(i,j) ⇔ End(i) < Begin(j)
After (j,i) ⇔ Before(i, j)
During(i,j) ⇔ Begin(j) < Begin(i) < End(i) < End(j)
Overlap(i,j) ⇔ Begin(i) < Begin(j) < End(i) < End(j)
Begins(i,j) ⇔ Begin(i) = Begin(j)
Finishes(i,j) ⇔ End(i) = End(j)
Equals(i,j) ⇔ Begin(i) = Begin(j) ∧ End(i) = End(j)
EVENTS
Fluents and events are reified in event calculus. The ability to communicate
fluently At(Shankar, Berkeley) is an object that alludes to the fact that Shankar
is in Berkeley, but it doesn't say whether it's true or not. The predicate T, as in
T(At(Shankar, Berkeley), t), is used to affirm that a fluent is true at some point
in time. Instances of event categories are used to describe events. The event
E1 of Shankar flying from San Francisco to Washington, D.C. is described as
E1 ∈Flyings∧ Flyer (E1, Shankar ) ∧ Origin(E1, SF) ∧ Destination (E1,DC)
we can define an alternative three-argument version of the category of flying
events and say E1 ∈Flyings(Shankar, SF,DC) We then use Happens(E1, i) to
say that the event E1 took place over the time interval i, and we say the same
thing in functional form with Extent(E1)=i. We represent time intervals by a
(start, end) pair of times; that is, i = (t1, t2) is the time interval that starts at t1
and ends at t2. The complete set of predicates for one version of the event
calculus is T(f, t) Fluent f is true at time t Happens(e, i) Event e happens over
the time interval i Initiates(e, f, t) Event e causes fluent f to start to hold at
time t Terminates(e, f, t) Event e causes fluent f to cease to hold at time t
Clipped(f, i) Fluent f ceases to be true at some point during time interval i
Restored (f, i) Fluent f becomes true sometime during time interval i We
assume a distinguished event, Start, that describes the initial state by saying
which fluents are initiated or terminated at the start time. We define T by
saying that a fluent holds at a point in time if the fluent was initiated by an
event at some time in the past and was not made false (clipped) by an
intervening event. A fluent does not hold if it was terminated by an event and
not made true (restored) by another event. Formally, the axioms are:
Happens(e, (t1, t2)) ∧Initiates(e, f, t1) ∧¬Clipped(f, (t1, t)) ∧ t1 < t ⇒T(f,
t)Happens(e, (t1, t2)) ∧ Terminates(e, f, t1)∧¬Restored (f, (t1, t)) ∧ t1 < t ⇒
¬T(f, t)
where Clipped and Restored are defined by Clipped(f, (t1, t2)) ⇔∃ e, t, t3
Happens(e, (t, t3))∧ t1 ≤ t < t2 ∧ Terminates(e, f, t) Restored (f, (t1, t2)) ⇔∃ e,
t, t3 Happens(e, (t, t3)) ∧ t1 ≤ t < t2 ∧ Initiates(e, f, t)
Take note of the structure: a single "spine" starts with the goal clause and
resolves against knowledge base clauses until the empty clause is formed. This
is typical of Horn clause knowledge bases' resolution. In the backward-
chaining algorithm of Figure, the clauses along the main spine correspond to
the sequential values of the objectives variable. This is because, in backward
chaining, we always opt to resolve with a clause whose positive literal unified
with the left most literal of the "current" clause on the spine. Backward
chaining is thus only a special example of resolution with a specific control
mechanism for determining which resolution should be performed next.
UNIT IV
SOFTWARE AGENTS
DEFINITION
Agent architectures, like software architectures, are a formal description of the
components that make up a system and how they communicate. These items
can also be defined using patterns that have certain constraints.
There are several typical architectures known as pipe-and-filter or
layered architecture.
The interconnections between components are defined by these.
Data is transported through a set of one or more objects that perform a
transformation in a Pipe-and-Filter paradigm.
Layered simply indicates that the system is made up of a series of
layers, each of which provides a distinct set of logical capabilities, and
that connectivity is typically limited to layers that are next to one
another.
TYPES OF ARCHITECTURES
A variety of agent architectures are available to assist, depending on the goals
of the agent application. This section will go through some of the most
common architecture types as well as some of the applications that they can be
utilised for.
1. Reactive architectures
2. Deliberative architectures
3. Blackboard architectures
4. Belief-desire-intention (BDI) architecture
5. Hybrid architectures
6. Mobile architectures
REACTIVE ARCHITECTURES
The simplest architecture for agents is a reactive architecture.
Agent behaviours are just a mapping between stimuli and reaction in
this design.
The agent has no decision-making abilities and can simply react to its
surroundings. 116
The agent merely reads the environment and then assigns one or more
actions to the state of the environment. Given the circumstances, more
than one action may be suitable, and the agent must choose a decision.
Reactive architectures have the advantage of being highly quick.
This type of design is simple to implement in hardware and quick to
look up in software.
Reactive designs have the drawback of being limited to basic
situations.
Sequences of actions require the presence of state, which is not
encoded into the mapping function.
DELIBERATIVE ARCHITECTURES
As the name implies, a deliberative architecture incorporates some
discussion regarding the action to do given the present set of inputs.
Rather than mapping sensors to actuators directly, the deliberative
architecture evaluates the sensors, state, previous consequences of
specific actions, and other data to determine the appropriate action to
do.
The mechanism for selecting actions is unknown. This is due to the
fact that it may be a production system, a neural network, or any other
intelligent algorithm.
The deliberative architecture has the advantage of being able to address
far more complex problems than the reactive architecture.
It is capable of planning and carrying out sequences of activities in
order to reach a goal.
The disadvantage is that it is slower than the reactive architecture due
to the deliberation for the action to select.
ARCHITECTURE DESCRIPTIONS
1. Subsumption Architecture (Reactive Architecture)
2. Behavior Networks (Reactive Architecture)
3. ATLANTIS (Deliberative Architecture)
4. Homer (Deliberative Arch)
5. BB1 (Blackboard)
6. Open Agent Architecture (Blackboard)
7. Procedural Reasoning System (BDI)
8. Aglets (Mobile)
9. Messengers (Mobile)
10. Soar (Hybrid)
SUBSUMPTION ARCHITECTURE (REACTIVE ARCHITECTURE)
Rodney Brooks established the Subsumption architecture in the late
1980s as a result of his research in behavior-based robots.
Subsumption is based on the premise that intelligent behaviour may be
generated from a collection of simple behaviour modules. 121
These modules of behaviour are grouped into layers. The actions that
are reflexive in nature are at the bottom, and the behaviours that are
more sophisticated are at the top. Take a look at the abstract model in
Figure.
The reflexive activities are found at the bottom (level 0). (such as
obstacle avoidance). Level 0 consumes the inputs and offers an action
at the output if these behaviours are necessary. However, because there
are no obstructions, the following layer up is free to take over.
Depending on the condition of the environment, a collection of
behaviours with distinct purposes compete for control at each level.
Levels of capability can be limited to support this (in other words, their
outputs are disabled). Sensor inputs can also be directed to higher
layers by suppressing levels. As depicted in the diagram.
Subsumption is a parallel and distributed sensor and actuator
management framework. The underlying notion is that we start with a
basic set of behaviours and, once we've mastered them, we progress to
higher levels of behaviours.
For instance, we start with obstacle avoidance and work our way up to
object finding. The architecture adopts a more evolutionary design
approach from this perspective.
Subsumption is not without flaws. It is easy, however it does not
appear to be very expandable. As more layers are added, they tend to
conflict with one another, therefore the issue becomes how to layer the
behaviours such that each has the ability to manage when the moment
is right.
Subsumption is also reactive, which means that at the end of the day,
the architecture is still just mapping inputs to behaviours (no planning
occurs, for example). Subsumption does provide a way to pick which
behaviour is appropriate for a given situation.
BB1 (BLACKBOARD)
Barbara Hayes- Roth developed BB1, a domain-independent
blackboard design for AI systems. The architecture facilitates problem-
solving control as well as the explanation of its operations. In addition,
the architecture has the ability to learn new domain knowledge. 126
The domain blackboard, which serves as the global database, and the
control blackboard, which is utilised to generate a solution to the given
control problem, are both included in BB1.
The ability of BB1 to plan progressively is its fundamental feature.
BB1 generates a plan dynamically and adjusts to changes in the
environment, rather than developing a comprehensive plan for a
particular goal and then executing it. This is critical in dynamic
contexts, as unanticipated changes might result in brittle plans that fail.
PROCEDURAL REASONING SYSTEM (BDI)
The Procedural Reasoning System (PRS) is a general-purpose
architecture that's suited for reasoning environments where established
processes can specify actions (action sequences).
PRS is also a BDI architecture, simulating human reasoning theory.
PRS is a distributed architecture that combines reactive and goal-
directed deliberative processing.
Through interaction with ambient sensors, the architecture is able to
construct a world-model of the environment (beliefs).
Intentions can also be used to carry out actions. An interpreter (or
reasoner) sits at the heart of the system, which chooses a goal to pursue
(based on current beliefs) and then retrieves a plan to carry out in order
to attain that objective. During the execution of the plan, PRS
iteratively tests the plan's assumptions. This means it can function in
dynamic contexts where traditional planners would fail.
Plans (also known as knowledge areas) in PRS are predetermined
actions that can be taken in the environment. This simplifies the
architecture because no plans must be generated; instead, they must be
selected based on the environment and the objectives to be reached.
The interpreter guarantees that changes in the environment do not
result in inconsistencies in the plan, even if planning is more about
selection than search or generation. Instead, a new strategy is devised
to meet the objectives.
When all necessary operations can be predefined, PRS is a helpful
design. Due to the lack of plan generation, it is also incredibly
efficient. As a result, PRS is an excellent agent architecture for
creating agents that drive mobile robots.
AGLETS (MOBILE)
Aglets is a mobile agent framework created in the 1990s by IBM
Tokyo. Aglets is built using the Java programming language, which is
ideal for a mobile agent framework. First, the programmes are portable
to any machine that can run a Java Virtual Machine (both
homogeneous and heterogeneous) (JVM). Second, a Java Virtual
Machine is an excellent platform for migration services.
Serialization, or the aggregation of a Java application's programme and
data into a single object that may be restarted, is supported by Java.
The Java application is restarted on a fresh JVM in this situation. A
safe environment (sandbox) is also provided by Java to ensure that a
mobile agent framework does not become a virus distribution system.
The Aglets framework is depicted in the diagram above. The JVM is
located at the very bottom of the framework (the virtual machine that
interprets the Java byte codes). Following that is the agent runtime
environment and the mobility protocol. Aglet Transport Protocol (or
ATP) is a mobility protocol that allows agents to be serialised and then
transported to a host that the agent has previously established.
The agent API is at the top of the stack, and it contains a variety of API
classes focused on agent operation in typical Java fashion. Last but not
least, there are the numerous agents that interact with the framework.
A mobile agent framework relies on a variety of services provided by
the agent API and runtime environment. Agent management,
communication, and security are three of the most crucial functions. To
allow communication with outside agents, agents must be able to
register themselves on a specific host.
Security measures must be implemented to ensure that the agent has
the authority to execute on the framework in order to support
communication.
Aglets provides a mobile agent architecture with a number of essential
features, including mobility, communication, security, and
confidentiality. Aglets enable only rudimentary migration, in that the
agents can only migrate at random locations inside the code (such as
with the dispatch method).
MESSENGERS (MOBILE)
Messengers is a runtime environment that allows you to migrate
processes (mobile agency).
Strong migration, or the ability to migrate at arbitrary locations inside
the mobile application, is a distinguishing strength of the messengers
environment.
The hop statement in the messengers environment specifies when and
where to move to a new destination.
The messengers agent in the application resumes after the migration is
complete, at the point following the previous hop statement. As a
result, rather of employing a message system to send data to the agent,
the application travels to the data. 128
When the data collection is huge and the migration links are slow, this
has clear advantages. The authors dubbed the messengers model
Navigational Programming, as well as Distributed Sequential
Computing (DSC).
These ideas are intriguing because they provide a common
programming paradigm that is equivalent to the typical flow of
sequential programmes. This makes them simpler to create and
comprehend.
Now let's look at a DSC example that uses the messengers
environment. Consider an application in which we operate enormous
matrices that are stored in the memory of a number of hosts.
SOAR (HYBRID)
Soar is a symbolic cognitive architecture that was originally an
abbreviation for State-Operator-And-Result.
Soar is a general-purpose AI system that includes a cognitive model
and an implementation of that model.
Soar is inspired by Newell's unified theories of cognition. Soar is one
of the most extensively utilised designs, with applications ranging from
human behaviour research to gaming agent design in first-person
shooter games.
The Soar architecture aims to create systems that encapsulate general
intelligence. While Soar contains many characteristics that support this
purpose (for example, procedural, episodic, and declarative formats for
representing knowledge), it also lacks some key features. These
comprise episodic memories as well as an emotion model. The
problem-solving technique in Soar is built on a production system
(expert system).
Rules comparable to the if-then form are used to encode behaviour.
Problem solving in Soar is best described as a problem space search (to
a goal node). If this way of issue solving fails, other methods, such as
hill climbing, are employed.
When a solution is found, Soar employs a technique known as
chunking to learn a new rule based on the new information. If the agent
faces the problem again, it can utilise the rule to choose an action
rather than solving the problem again.
AGENT COMMUNICATION
Communication is a crucial feature in multi-agent systems since it allows for
both coordination and information transfer. Agents must also be able to
communicate their actions or plans. However, the manner in which
communication takes place is determined by the aim.
Agents interact in order to better their own or the society/system in
which they live's aims.
Communication allows agents to coordinate their activities and
behaviours, resulting in more coherent systems.
A property of a system of agents doing some activity in a common
environment is coordination.
The extent to which they prevent unnecessary activity by lowering
resource contention, avoiding live lock and deadlock, and maintaining
appropriate safety requirements is the degree of coordination.
Negotiation is coordination among competing or simply self-interested
agents, whereas cooperation is coordination among non-antagonistic
agents.
To collaborate effectively, each agent must typically maintain a model
of the other agents as well as construct a model of future interactions.
This necessitates the presence of sociability. Coherence refers to how
well a system functions as a whole. The ability of a multiagent system
to maintain global coherence without explicit global control is a
challenge. In this situation, the agents must be able to define shared
goals, assign common responsibilities, avoid avoidable disputes, and
pool knowledge and evidence on their own. It is advantageous if the
agents are organised in some way.
Dimensions of Meaning
The formal study of communication has three components: syntax (the
structure of communication symbols), semantics (what the symbols mean),
and pragmatics (how the symbols are used) (how the symbols are interpreted).
The semantics and pragmatics of meaning are intertwined. Because agents
communicate in order to comprehend and be comprehended, it is critical to
analyse the various aspects of meaning related with communication.
Descriptive vs. Prescriptive. Some messages describe events, while
others instruct on how to behave. Human comprehension relies on
descriptions, which are difficult for machines to replicate. Most agent
communication languages, then, are appropriately built for the sharing
of information regarding activities and behaviour.
Personal vs. Conventional Meaning. An agent may have its own
interpretation of a message, which may differ from the interpretation
shared by the other agents with whom the agent interacts. Multiagent
systems should use conventional meanings as much as feasible,
especially since they are often open settings in which new agents can
be deployed at any time.
Subjective vs. Objective: Meaning A message often has an explicit
consequence on the 130 environment, which can be perceived
objectively, similar to traditional meaning, where meaning is
determined externally to an actor. The effect may differ from what the
sender or receiver of the communication perceives internally, i.e.
subjectively.
Speaker's vs. Hearer's vs. Society's Perspective: A message can be
expressed according to the viewpoint of the speaker, hearer, or other
observers, regardless of its conventional or objective meaning.
Semantics vs. Pragmatics: The pragmatics of a message refers to how
communicators use it. This includes considerations of the
communicators' mental states and the environment in which they
reside, as well as issues that are unrelated to the communication's
syntax and semantics.
Contextuality: Messages can't be deciphered in isolation; they need to
be interpreted in light of the agents' mental states, the current condition
of the environment, and the environment's history: how it got to where
it is now. Previous communications and behaviours of the agents have
a direct impact on interpretations.
Coverage Smaller languages are more manageable, but they must be
large enough so that an agent can convey the meanings it intends.
Identity: When agents communicate, the meaning of the
communication is determined by the identities and functions of the
agents engaged, as well as how the agents are specified. A message
could be sent to a specific agent or to all agents who meet a set of
criteria.
Cardinality: A communication transmitted privately to one agent
would be interpreted differently from a message broadcast to the
general public.
MESSAGE TYPES
It is critical for agents with varying skills to be able to communicate
with one another. As a result, communication must be defined at
various levels, with the lowest level being utilised for contact with the
least capable agent.
The agents must be able to communicate with one another in order to
be of interest to one another. They can play either an active, passive, or
both roles in this discourse, allowing them to act as a master, slave, or
peer, respectively.
We suppose that an agent may send and receive messages through a
communication network, in accordance with the previous definition
and assumptions about an agent.
The messages can take a variety of forms, as described below.
Assertions and inquiries are the two most common message types.
Every agent, whether active or passive, needs to be able to accept data.
This information is sent to the agent from an external source via an
assertion in its most basic form. An agent must also be able to answer
inquiries in order to play a passive part in a dialogue, which means it
must be able to 1) accept a query from an external source and 2)
respond to the source by producing an assertion. It's worth noting that
from the perspective of the communication network, there's no
difference between an uninvited assertion and one made in response to
an inquiry.
An agent must be able to ask questions and make statements in order to
take an active role in a conversation. With these capabilities, the agent
may be able to command another agent to answer to the query or
accept the asserted facts. This control method can also be used to
control subagents like neural networks and databases.
In a dialogue, one agent acting as a peer with another agent can play
both active and passive roles. Both assertions and inquiries must be
able to be made and accepted.
SPEECH ACTS
The model for communication among computational agents is spoken human
conversation. Speech act theory is a prominent framework for evaluating
human communication. Human natural language is viewed as acts, such as
requests, proposals, commitments, and responses, according to the speech act
theory. When you request something, for example, you're not just making a
statement; you're actually making the request. When a jury finds a defendant
guilty, something happens: the defendant's social position is altered.
A speech act has three aspects:
1. Locution, the physical utterance by the speaker
2. Illocution, the intended meaning of the utterance by the speaker
3. Perlocution, the action that results from the locution. KQML (Knowledge
Query and Manipulation Language)
From a variety of perspectives, the KQML is an intriguing example of
communication. Communication, for example, necessitates the ability
to locate and converse with a peer (communication layer).
The messages must next be packaged (messaging layer), followed by
an internal format that reflects the messages and is expressive enough
to convey not only information but also requests, responses, and plans
(content layer).
There are programmes to support communication in a network of
KQML-speaking agents. These are facilitators who can act as name
servers for KQML components and assist in the discovery of other
agents who can fulfil a given agent's request.
A KQML router is a front-end to a specific KQML agent that allows
message routing. KQML's message representation follows the LISP
example because it was originally written in Common LISP (balanced
parentheses).
A KQML message has a format that consists of a performative and a
set of arguments for that performative that can be sent to any transport
(such as sockets). The performative is the spoken act that establishes
the message's intent (assertion, command, request, etc.).
The performative-name specifies the sort of message to be conveyed
(evaluate, ask- if, stream-about, reply, tell, deny, standby, advertise,
etc.). The unique names of the agents in the interaction are determined
by the sender and receiver. The information contained in the material is
specific to the performance being done.
This content is described by a language (how to represent it) and an
ontology (the vocabulary (and meaning) of the content). Finally, in
order to correlate the request with the response, the agent can attach a
context to the response (in-reply-to). The KQML message's structure.
(performative-name
: sender X
: receiver Y
: content Z
: language L
: ontology Y
: reply-with R
: in-reply-to Q
)
Let's have a look at a dialogue between two KQML agents as an example. An
agent, in this case, asks for the current value of a temperature sensor in a
system. The temperature of TEMP SENSOR 1A, as sampled by the
temperature-server agent, is requested. The request, as specified in the
prologue language, is the content. Thermal-control-appl is the name of the
agent who is making the request.
(ask-one
:sender thermal-control-appl
:receiver temperature-server
:languageprolog
:ontology CELSIUS-DEGREES
:content “temperature(TEMP_SENSOR_1A ?temperature)”
:reply-with request-102
)
The temperature-server would then respond to our agent, defining the
temperature of the sensor of interest.
(reply
:sender temperature-server
:receiver thermal-control-appl
:languageprolog
:ontology CELSIUS-DEGREES
:content “temperature(TEMP_SENSOR_1A 45.2)”
:in-reply-to request-102
)
Our agent would then receive a response from the temperature-server, defining
the temperature of the sensor of interest,
(reply
:sender temperature-server
:receiver thermal-control-appl
:languageprolog
:ontology CELSIUS-DEGREES
:content “temperature(TEMP_SENSOR_1A 45.2_”
:in-reply-to request1102
)
KQML has a lot of features for communicating information as well as higher-
level requests that deal with the communication layer. A small list of some of
the other KQML per formatives may be seen in the table below.
KQML PERFORMATIVES
Performatives Description
Evaluate Evaluate the content of the message
ask-one Request for the answer to the question
Reply Communicate a reply to a question
stream-about Provide multiple response to a question
Sorry Return an error (can’t respond)
Tell Inform an agent of sentence
Achieve A request of something to achieve by the
receiver
Advertise Advertise the ability to process a performative
Subscribe Subscribe to changes of information
Forward Route a message
There are obvious parallels between XML and KQML. The tags are
present in KQML, however their syntax differs from that of XML.
KQML allows for tag layering, which is a significant difference.
It's worth noting that the tag is the performative's and its arguments'
outer layer. XML is a fairly versatile format that allows for quite
sophisticated data and meta-data structures.
XML is used in a variety of protocols, including XML-RPC (Remote
Procedure Call) and SOAP (Simple Object Access Protocol) (Simple
Object Access Protocol). The Hyper Text Convey Protocol (HTTP) is
used to transport each of these.
TRUST AND REPUTATION
It depends on the level we apply it:
User confidence
• Can we trust the user behind the agent?
– Is he/she a trustworthy source of some kind of knowledge? (e.g. an expert in
a field)
– Does he/she acts in the agent system (through his agents in a trustworthy
way?
Trust of users in agents
• Issues of autonomy: the more autonomy, less trust
• How to create trust?
– Reliability testing for agents
– Formal methods for open MAS
– Security and verifiability
Trust of agents in agents
• Reputation mechanisms
• Contracts
• Norms and Social Structures
Trust - Definition
Cooperation among agents is incorporated into the design process in
closed environments:
The multi-agent system is typically constructed by a single developer
or a single team of developers, and one possibility for reducing
complexity is for the chosen developers to include cooperation among
the agents they build as a key system requirement.
Agent AI seeking information or a specific service from agent aj can
be confident that if AI has the capabilities and resources required, aj
will respond; otherwise, aj will inform AI that it is unable to perform
the action asked.
It may be stated that trust is implicit in closed situations.
Trust can be computed as
A binary value (1=‘I do trust this agent’, 0=‘I don’t trust this agent’)
A set of qualitative values or a discrete set of numerical values (e g
‘trust always’ ‘trust conditional to X’ ‘no trust’) e.g. always, X, trust )
(e.g. ‘2’, ‘1’, ‘0’, ‘-1’, ‘-2’)
A continuous numerical value (e.g. [-300..300])
A probability distribution
Degrees over underlying beliefs and intentions (cognitive approach)
HOW TO COMPUTE TRUST
Trust values can be externally defined
• by the system designer: the trust values are pre-defined
• by the human user: he can introduce his trust values about the humans
behind the other agents
Trust values can be inferred from some existing representation about the
interrelations between the agents
• Communication patterns, cooperation history logs, e-mails, webpage
connectivity mapping...
Trust values can be learnt from current and past experiences
• Increase trust value for agent AI if behaves properly with us
• Decrease trust value for agent AI if it fails/defects us
Trust values can be propagated or shared through a MAS
• Recommender systems, Reputation mechanisms.
TRUST AND REPUTATION
1. In writing, most authors combine trust and reputation.
2. Some authors distinguish between the two.
3. Trust is an individual measure of a given agent's confidence in other agents
(s)
4. Reputation is a social measure of a group of agents' or a society's
confidence in other agents or organisations. One method of calculating
(person) trust is through reputation.
I am more likely to trust a reputable agency.
My reputation has a direct impact on the level of trust that others have in me.
In social groups, reputation can play a sanctioning role: a bad reputation can
be very costly to one's future transactions.
5.Most authors combine (individual) Trust with some form of (social)
Reputation in their models
6. Recommender systems, Reputation mechanisms.
Direct experiences are the most relevant and reliable information source for
individual trust/reputation
1. Type 1: Experience based on direct interaction with the
2. Type 1: Experience with the partner
1. Used by almost all models
2. How to:
• trust value about that partner increases with good experiences,
• it decreases with bad ones
3. Problem: how to compute trust if there is no previous interaction?
3. Type 2: Experience based on observed interaction of other members
1. Used only in scenarios prepared for this.
2. How to: depends on what an agent can observe
• agents can access to the log of past interactions of other agents
• agents can access some feedback from agents about their past interactions
(e.g., in eBay)
3. Problem: one has to introduce some noise handling or
4. confidence level on this information
4. Prior-derived: agents bring with them prior beliefs about strangers Used by
some models to initialize trust/reputation values
How-to:
• designer or human user assigns prior values
• a uniform distribution for reputation priors is set
Assign the lowest possible reputation value to new agents. When an agent's
reputation falls below a certain threshold, there is no motivation to discard a
cyber-identity.
• Assume neither good nor bad reputation for unknown agents.
• Avoid lowest reputation for new, valid agents as an obstacle for other agents
to realize that they are valid.
5. Group-derived:
• Group models can be expanded to yield estimates of prior reputation for
agents in social groupings.
• Establishing a link between a stranger's initial individual reputation and the
group from which he or she originates.
• Issue: extremely domain- and model-dependent.
6.Propagated:
• Based on information gathered from others in the surroundings, the agent can
attempt to evaluate the stranger's reputation. This is known as word of mouth.
• Issue: Combining diverse reputation values is often an ad hoc approach with
no social foundation.
TRUST AND REPUTATION MODELS
1. Not really for MAS, but can be applied to MAS
2. Idea: For serious life / business decisions, you want the
• opinion of a trusted e pert trusted expert
3. If an expert not personally known, then want to find a reference to one via a
chain of friends and colleagues
4. Referral-chain provides:
• Way to judge quality of expert's advice
• Reason for the expert to respond in a trustworthy manner
• Finding good referral-chains is slow, time-consuming, but vital business
gurus on “networking”
• Set of all possible referral-chains = a social network
5.Model integrates information from
• Official organizational charts (online)
• Personal web pages (+ crawling)
• External publication databases
• Internal technical document databases
6. Builds a social network based in referral chains
• Each node is a recommender agent
• Each node provides reputation values for specific areas o E.g. Frieze is good
in mathematics
• Searches in the referral network are
• made by areas
E.g. browsing the network’s “mathematics” recommendation chains
7.Trust Model Overview
• 1-to-1 asymmetric trust relationships.
• Direct trust and recommender trust.
• Trust categories and trust values
• [-1,0,1,2,3,4].
8. Conditional transitivity. Alice trusts Bob.&. Bob trusts Cathy Alice trusts
Cathy Alice trusts.rec Bob.&. Bob says Bob trusts Cathy Alice may trust
Cathy Alice trusts.rec Bob value X. &. Bob says Bob trusts Cathy value Y 140
Alice may trust Cathy value f(X, Y)
9. Recommendation protocol
1. Alice ->Bob: RRQ(Eric)
2. Bob ->Cathy: RRQ(Eric)
3. Cathy -> Bob: Rec(Eric,3)
4. Bob ->Alice: Rec(Eric,3)
Direct Trust
In terms of information reliability, ReGreT assumes that there is no difference
between direct interaction and direct observation. It discusses firsthand
experiences.
The outcome is the most essential component in calculating a direct trust.
A dialogue between two agents can result in one of the following outcomes:
• An initial contract to take a particular course of action and the actual result of
the actions taken, or
• An initial contract to x the terms and conditions of a transaction and the
actual values of the terms of the transaction.
10. This rule states that an agent forms and maintains its commitment to
achieve ø individually iff (1) it has not precommitted itself to another agent to
adopt and achieve ø, (2) it has a goal to achieve ø individually, and (3) it is
willing to achieve ø individually. The chapter on "Formal Methods in DAI"
provides more information on such descriptions.
11. The second strategy is based on the premise that the agents are
economically rational. Furthermore, the number of agents must be limited,
they must speak the same language, have the same problem abstraction, and
arrive at the same conclusion. Rosenschein and Zlotkin created a unified
negotiation protocol based on these assumptions. Agents who follow this
process form a bargain, which is a collaborative plan that satisfies all of the
agents' objectives. For an agent, the utility of a deal is the amount he is willing
to pay less the agreement's cost. Each agent seeks to increase his or her own
utility.
The agents talk about a negotiation set, which is a collection of all deals with a
positive utility for each of them.
In formal terms, a task-oriented domain under this approach becomes a tuple
<T,A,c>
where T is the set of tasks, A is the set of agents, and c(X) is a monotonic
function for the cost of executing the tasks X. A deal is a redistribution of
tasks. The utility of deal d for agent k is Uk(d) = c(Tk) - c(dk)
The conflict deal D occurs when the agents cannot reach a deal. A deal d is
individually rational if d > D. Deal d is pareto optimal if there is no deal d' > d.
The set of all deals that are individually rational and pareto optimal is the
negotiation set, NS. There are three possible situations:
1. conflict: the negotiation set is empty
2. compromise: agents prefer to be alone, but since they are not, they will
agree to a negotiated deal 145
3. cooperative: all deals in the negotiation set are preferred by both agents over
achieving their goals alone. When there is a conflict, then the agents will not
benefit by negotiating—they are better off acting alone. Alternatively, they
can "flip a coin" to decide which agent gets to satisfy its goals.
In the other two circumstances, negotiation is the best option.
Because the agents have some execution autonomy, they can fool or mislead
one another in theory. As a result, developing protocols or societies that can
limit the impacts of deception and misinformation is an attractive study
subject. Another component of the research topic is to create procedures that
make it sensible for agents to be truthful to one another. The links between
economic techniques and human-centered negotiation and argumentation have
yet to be extensively explored.
BARGAINING
A bargaining problem is defined as a pair (S,d). A bargaining solution is a
function f that maps every bargaining problem (S,d) to an outcome in S, i.e.,
f : (S,d) → S
Thus the solution to a bargaining problem is a pair in R2. It gives the values of
the game to the two players and is generated through the function called
bargaining function. Bargaining function maps the set of possible outcomes to
the set of acceptable ones.
Bargaining Solution
A surplus is formed in a transaction when the seller and the buyer value a
product differently. A negotiation solution is a means for buyers and sellers to
agree on how to split the surplus. Consider the case of a house built by builder
A. It cost him Rs. ten lakhs. The house has piqued the curiosity of a potential
buyer, who estimates it to be worth Rs.20 lacs. This deal has the potential to
create a profit of Rs.10 lakhs. Both the builder and the customer must now
agree on a price. The vendor knows the worth is larger than 10 Lacs, and the
buyer knows the cost is less than 20 Lacs. They must come to an agreement on
a price. Both are attempting to maximise their profits. Buyer would want to
buy it for 10 Lacs, while the seller would like to sell it for 20 Lacs. They
bargain on the price, and either trade or dismiss. Trade would result in the
generation of surplus, whereas no surplus is created in case of no-trade.
Bargaining Solution provides an acceptable way to divide the surplus among
the two parties. Formally, a Bargaining Solution is defined as, F : (X,d) → S,
where X R2 and S,dR2. X represents the utilities of the players in the set of
possible bargaining agreements. d represents the point of disagreement. In the
above example, price bargaining set is simply x + y 10, x 0, y 0. A point
(x,y) represents the case, when seller gets a surplus of x, and buyer gets a
surplus of y, i.e. seller sells the house at 10 + x and the buyer pays 20 − y.
1. the set of payoff allocations that are jointly feasible for the two players in
the process of negotiation or arbitration, and
2. the payoffs they would expect if negotiation or arbitration were to fail to
reach a settlement.
Based on these assumptions, Nash generated a list of axioms that a reasonable
solution ought to satisfy. These axioms are as follows:
Axiom 1 (Individual Rationality) This axiom asserts that the bargaining
solution should give neither player less than what it would get from disagree
ment, i.e., f(S,d) ≥ d.
Axiom 2 (Symmetry) The solution should be independent of the players'
names, i.e., who is named a and who is named b, according to this principle.
This indicates that if the utility functions and disagreement utilities of the
participants are equal, they will receive equal shares. As a result, any
asymmetry in the final payout should be related to variations in their utility
functions or the results of their disagreements.
Axiom 3 (Strong Efficiency) This axiom asserts that the bargaining solution
should be feasible and Pareto optimal.
Axiom 4 (Invariance) The solution should not change as a result of linear
changes in either player's utility, according to this principle. As a result, if a
player's utility function is doubled by 2, the solution should remain
unchanged. Only the player will place a higher value on what it receives.
Axiom 5 (Independence of Irrelevant Alternatives) This axiom states that
removing possible options (other than the disagreement point) that would not
have been picked should have no bearing on the solution, i.e. for any closed
convex set.
Nash demonstrated that the bargaining solution that satisfies the five axioms is
OTHER ARCHITECTURES
LAYERED ARCHITECTURES
Given the requirement that an agent be capable of both reactive and proactive
action, a natural decomposition would be to create distinct subsystems to
handle these two sorts of behaviours. This concept easily leads to a type of
design in which the various subsystems are organised into a hierarchy of
interconnected levels. We'll look at some general aspects of layered
architectures in this part, then look at two examples of such designs:
INTERRAP and TOURINGMACHINES
There will usually be at least two levels, one for reactive activity and the other
for proactive conduct. There's no reason why there shouldn't be many more
layers in theory. Regardless of how many levels there are, the information and
control flows within them provide a valuable typology for such designs.
Within layered systems, we may distinguish two forms of control flow (see
Figure):
• Horizontal layering. The software layers in horizontally tiered systems
(Figure (a)) are all directly related to the sensory input and action output. In
effect, each layer functions as an agent, generating recommendations for what
action to take.
• Vertical layering. Sensory input and action output are each handled with by
at most one layer in vertically tiered designs (Figures (b) and (c)).
Horizontally tiered systems provide a significant advantage in terms of
conceptual simplicity: if we need an agent to demonstrate n various forms of
behaviour, we just design n different levels.
However, because the layers are effectively competing with one another for
action ideas, there is a risk that the agent's overall behaviour will be
inconsistent. A mediator function is usually included in horizontally stacked
systems to ensure consistency. It makes judgments regarding which layer has
"control" of the agent at any particular time.
The requirement for central control is troublesome since it implies that the
designer must consider all conceivable interactions between layers. If the
architecture has n layers and each layer is capable of recommending m
possible actions, then there are mn possible interactions to evaluate. In any but
the simplest systems, this is clearly challenging from a design standpoint. The
adoption of a central control system also creates a bottleneck in the decision-
making process of the agent.
ABSTRACT ARCHITECTURE
We can easily formalize the abstract view of agentgs presented so far.
First, we will assume that the state of the agent’s environment can be
characterized as a set S = {s1, s2,…) of environment states.
At any given instant, the environment is assumed to be in one of these
states. The effectoric capability of an agent is assumed to be
represented by a set A = (a1, a2,…) of actions. Then abstractly, an
agent can be viewed as a function Action S* → A
Which converts environmental state sequences into actions. A standard
agent is an agent that is modelled by a function of this type. The
assumption is that an agent selects what action to take based on its
history — its previous experiences. These encounters are represented
as a series of environment states — those that the agent has
encountered thus far.
The (non-determinstic) behaviour of an environment can be modelled
as a function env: S x A → P (S) S and an action (perfrmed by
theWhich takes the current state of the environment s agent), and
maps them to a set of environment state env(s,a) – those that could
result from performing action a in state s. If all the sets in the rnage of
env are all sigletons, (i.e., if the result of performing any action in any
state in a set containing a single member), then the environment is
deterministic, and its behaviour can be accrately predicted.
We can represented the interaction of agent and environment as a
history. A history h is a sequence: h:: ... ... 0 1 2 3 1 s0 ⎯⎯a →s1
⎯⎯a →s2 ⎯⎯a →s3 ⎯⎯a → ⎯a⎯u− →su ⎯⎯au→ where so is
the initial state of the environment (i.e., its state when the agent starts
executing), au is the uth action that the agent chose to perform, and su
is the uth environment state (which is one of the possible results of
executing action au-2 in state su-1). S* → A is an agent, env: S x S →
p(S) is an environment, and so is the initial state of environment.
The characteristic behaviour of an agent action S* → A is an
environment env : is the set of all the histories that satisfy these
properties. If some property holds of all these histories, this property
can be regarded as an invariant property of the agent in the
environment. For example, if our agent is a nuclear reactor controller,
(i.e., the environment is a nuclear reactr), and in all possible histories
of the contrller/reactor, the reactor does not below up, then this can be
regarded as a (desirable) invariant property. We will denote by
hist(agent, environment) the set of all histories of agent in
environment. Two agentws ag1 and ag2 are said to be behaviorally
equivalent with respect to enviroment env iff hist(ag1, env) = hist(ag2,
env) and simply behaviorally equivalent iffr they are behaviorally
equivalent with respect of all environments.
CONCRETE ARCHITECTURES FOR INTELLIGENT AGENTS
1.Agents have only been considered in the abstract. So, while we've looked at
the properties of agents that retain state and those that don't, we haven't
considered what this state would look like. Similarly, we've modelled an
agent's decision-making as an abstract function action that somehow manages
to indicate which action to take—but we haven't talked about how this
function may be implemented. This omission will be addressed in this section.
We'll look at four different types of agents:
• logic based agents—in which decision making is realized through logical
deduction;
• reactive agents—in which decision making is implemented in some form of
direct mapping from situation to action;
• belief-desire-intention agents—in which decision making depends upon the
manipulation of data structures representing the beliefs, desires, and intentions
of the agent; and finally,
• layered architectures—in which decision making is realized via various
software layers, each of which is more-or- less explicitly reasoning about the
environment at different levels of abstraction.
In each of these circumstances, we're moving away from an abstract view of
agents and toward more concrete commitments regarding their underlying
structure and behaviour. Each section describes the nature of these
commitments, the assumptions that the architectures are based on, and the
relative benefits and drawbacks of each.
UNIT V
APPLICATIONS
Applications of AI
Artificial intelligence is used in a variety of ways in today's society. It is
becoming increasingly important in today's world because it can efficiently
handle complicated problems in a variety of areas, including healthcare,
entertainment, banking, and education. Our daily lives are becoming more
comfortable and efficient as a result of artificial intelligence.
The following are some of the areas where Artificial Intelligence is used:
1. AI (Astronomy)
Artificial Intelligence (AI) can be extremely helpful in resolving complicated
challenges in the universe. AI technology can assist in gaining a better
understanding of the cosmos, including how it operates, its origin, and so on.
2. AI (Healthcare)
In the previous five to ten years, AI has become more beneficial to the
healthcare business and is expected to have a big impact.
AI is being used in the healthcare industry to make better and faster diagnoses
than humans. AI can assist doctors with diagnosis and can alert doctors when a
patient's condition is deteriorating so that medical assistance can be provided
before the patient is admitted to the hospital.
3. AI (Gaming)
AI can be employed in video games. AI machines can play strategic games
like chess, in which the system must consider a vast number of different
options.
4. AI (Finance)
The banking and AI businesses are the ideal complements to each other.
Automation, chatbots, adaptive intelligence, algorithm trading, and machine
learning are all being used in financial activities.
5. AI (Data Security)
Data security is critical for every business, and cyber-attacks are on the rise in
the digital age. AI can help you keep your data safe and secure. Some
examples are the AEG bot and the AI2 Platform, which are used to better
determine software bugs and cyber-attacks.
6. AI (Social Media)
Facebook, Twitter, and Snapchat, for example, have billions of user accounts
that must be kept and handled in a very efficient manner. AI has the ability to
organise and manage large volumes of data. AI can go through a large amount
of data to find the most recent trends, hashtags, and user requirements.
7. AI (Travel & Transport)
For the travel industry, AI is becoming increasingly important. AI is capable
of doing a variety of travel-related tasks, including making travel
arrangements and recommending hotels, flights, and the best routes to
customers. The travel industry is utilising AI-powered chatbots that can
engage with clients in a human-like manner to provide better and faster
service.
8. AI (Automotive Industry)
Some automotive companies are utilising artificial intelligence to provide a
virtual assistant to their users in order to improve performance. Tesla, for
example, has released TeslaBot, an intelligent virtual assistant.
Various industries are presently working on self-driving automobiles that will
make your ride safer and more secure.
9. AI (Robotics)
In Robotics, Artificial Intelligence plays a significant role. Typically,
conventional robots are programmed to execute a repetitive task; but, using
AI, we may construct intelligent robots that can perform tasks based on their
own experiences rather than being pre-programmed.
Humanoid Robots are the best instances of AI in robotics; recently, the
intelligent Humanoid Robots Erica and Sophia were built, and they can
converse and behave like people.
10. AI (Entertainment)
We already use AI-based applications in our daily lives with entertainment
providers like Netflix and Amazon. These services display software or show
recommendations using machine learning/artificial intelligence (ML/AI)
algorithms.
11. AI (Agriculture)
Agriculture is a field that necessitates a variety of resources, including effort,
money, and time, in order to get the greatest results. Agriculture is becoming
more computerised these days, and AI is becoming more prevalent in this
industry. AI is being used in agriculture in the form of agriculture robotics,
solid and crop monitoring, and predictive analysis. AI in agriculture has the
potential to be extremely beneficial to farmers.
12. AI (E-commerce)
AI is giving the e-commerce industry a competitive advantage, and it is
becoming increasingly demanded in the market. Shoppers can use AI to find
related products in their preferred size, colour, or brand.
13. AI (Education)
Grading can be automated with AI, giving the instructor more time to educate.
As a teaching assistant, an AI chatbot can communicate with students.
In the future, AI could serve as a personal virtual tutor for pupils, available at
any time and from any location.
Machine Learning
"Machine learning" is defined by Simon. "Learning signifies adaptive
modifications in the system that enable the system to perform the same task or
tasks selected from the same population more successfully the next time".
LANGUAGE MODELS
Language can be defined as a set of strings; “print(2+2)” is a legal program in
the language Python, where “2) + (2 print” is not. Since the are an infinite
number of legal programs, they cannot be enumerated; instead they are
specified by a set of rules called a grammar. Formal languages also have rules
that defined the meaning semantics of a program; for example, the rules say
that the “meaning” of “2 + 2” is 4, and the meaning of “1/0” is that an error is
signated.
1. Natural languages, such as English or Spanish, cannot be described as a set
of predetermined sentences. For example, while everyone agrees that "not
being invited is sad" is an English sentence, opinions differ on the
linguistically correctness of "to be not invited is stated." As a result, rather of
defining a natural language model as a definitive collection, it is more fruitful
to characterise it as a probability distribution over sentences. Instead of asking
whether a string of words is a member of the set defining the language, we
question P(S = word) - what is the chance that a random sentence would
contain words. Natural languages are unclear as well. "He saw her duck" can
refer to either a waterfowl belonging to her or a movement she made to avoid
anything. As a result, rather than a single meaning for a sentence, we must
speak of a probability distribution across all alternative interpretations.
2. Finally, natural language is challenging to deal with due to its huge size and
rapid change. As a result, our language models are only a rough
approximation. We begin with the simplest possible approximation and work
our way up.
Let’s begin with the task of computing P(w|H) — probability of word ‘w’,
given some history ‘H’.
Suppose the ‘H’ is ‘its water is so transparent that’, and we want to know the
probability of next word ‘the’: P(the|its water is so transparent that).
One way to estimate this probability — relative frequency counts. Take a large
corpus, count the number of time ‘its water is so transparent that’ and also
count the number of times it has been followed by ‘the’.
While this method of estimating probabilities straight from counts works well
in many circumstances, it turns out that the web isn't large enough to provide us
with accurate predictions in the vast majority of cases. Why? Because language
is dynamic, and new sentences are introduced on a daily basis that we will
never be able to count.
As a result, we need to incorporate more sophisticated methods for calculating
the likelihood of word w given history H.
To represent the probability of a particular random variable Xi taking on the
value “the”, or P(Xi = “the”), we will use the simplification P(the). We’ll
represent a sequence of N words either as w1 . . . wn or wn (so the
expression wn−1 means the string w1,w2,…,wn−1). For the joint probability of
each word in a sequence having a particular value P(X = w1,Y = w2,Z = w3,
…,W = wn) we’ll use P(w1,w2,…,wn).
How to compute probability of entire sequence? — Using chain rule of
probability
Using Chain rule of probability to calculate joint probability distribution
Bigram Model
What method do we use to calculate bi-gram (or n-gram) probabilities? —
Maximum likelihood estimation, or MLE, is a simple method for estimating
probabilities. By taking counts from a corpus and normalising them so that they
fall between 0 and 1, we may acquire the MLE estimate for the parameters of
an n-gram model.
To compute a specific bigram probability of a word y given a prior word x, for
example, we'll count the bigram C(xy) and normalise by the sum of all the
bigrams that share the same first word x:
Discounting factor
Add-k smoothing
One alternative to add-one smoothing is to move a bit less of the probability
mass from the seen to the unseen events. Instead of adding 1 to each count, we
add a frac- tional count k (.5? .05? .01?). This algorithm is therefore called add-
k smoothing.
Add-k Smoothing Algorithm
Add-k smoothing requires that we have a method for choosing k; this can be
done, for example, by optimizing on a devset. Although add-k is useful for
some tasks (including text classification), it turns out that it still doesn’t work
well for language modeling.
Backoff and Interpolation
If we are trying to compute P(wn|wn−2,wn−1) but we have no examples of a
particular trigram wn−2,wn−1,wn. We can instead estimate its probability by
using the bigram probability P(wn|wn−1). Similarly, if we don’t have counts to
compute P(wn|wn−1), we can look to the unigram P(wn).
Sometimes using less context is a good thing, helping to general- ize more for
contexts that the model hasn’t learned much about.
There are two ways to use this n-gram “hierarchy”.
i. If the evidence is sufficient, we use the trigram; otherwise, we use the
bigram; otherwise, we use the unigram.
We always blend the probability estimates from all the n-gram estimators in
interpolation, weighing and mixing the trigram, bigram, and unigram counts.
We merge different order n-grams by linearly interpolating all the models in
simple linear interpolation. As a result, we estimate the trigram likelihood by
combining the probabilities of the unigram, bigram, and trigram.
INFORMATION RETRIEVAL
The task of retrieving materials that are relevant to a user's desire for
information is known as information retrieval. Search engines on the World
Wide Web are the most well-known instances of information retrieval
systems. When a Web user types (AI book) into a search engine, a list of
relevant pages appears. We'll look at how such systems are put together in this
part. A system for retrieving information (henceforth referred to as IR) can be
defined as follows:
1. A corpus of documents. Each system must decide what it wants to treat as a
document: a paragraph, a page, or a multipage text.
2. Queries posed in a query language. A query is a statement that expresses
what the user wants to know. The query language can be just a list of terms,
like [AI book]; or it can define a phrase of words that must be adjacent, like
["AI book"]; it can include Boolean operators, like [AI AND book]; or it can
include non-Boolean operators, like [AI NEAR book] or [AI book
site:www.aaai.org].
3. A result set: This is the subset of documents deemed relevant to the query
by the IR system. By relevant, we mean material that is likely to be useful to
the individual who asked the question for the specific information requirement
specified in the inquiry.
4. A presentation of the result set: This can be as simple as a ranked list of
document titles or as complicated as a rotating colour map of the result set
projected into a three-dimensional space and displayed in two dimensions. A
Boolean keyword model was used in the first IR systems. Each word in the
document collection is handled as a Boolean feature, which is true if the term
appears in the document and false otherwise.
Advantage
It's easy to explain and put into practise.
Disadvantages
There is no direction on how to organise the relevant materials for
presentation because the degree of relevance of a document is a single
bit.
Users who are not programmers or logicians are unfamiliar with
Boolean expressions. Users find it inconvenient that in order to learn
about farming in Kansas and Nebraska, they must use the query
[farming (Kansas OR Nebraska)].
Even for a seasoned user, formulating a good query might be difficult.
Let's say we try [information AND retrieval AND models AND
optimization] and get nothing. We could try [information OR retrieval
OR models OR optimization], but if it yields too many outcomes, it's
hard to determine where to go next.
IR SCORING FUNCTIONS
1. Most IR systems have abandoned the Boolean paradigm in favour of
models based on word count data.
2. A scoring function takes a document and a query and produces a numerical
score; the papers with the highest scores are the most relevant.
3. The score in the BM25 scoring function is a linear weighted sum of the
scores for each of the terms in the question.
4. A query term's weight is influenced by three factors:
• First, the frequency with which a query term appears in a document (also
known as TF for term frequency). For the query [farming in Kansas],
documents that mention “farming” frequently will have higher scores.
• In result set Not in
result set
Relevant 30 20
Not relevant 10 40
Second, the term's inverse document frequency, or IDF. • Because the term
"in" appears in practically every document, it has a high document frequency
and hence a low inverse document frequency, making it less essential to the
query than "farming" or "Kansas."
• Finally, the document's length. A million-word paper will almost certainly
have all of the query words, although it may not be about the query. A short
document that includes all of the terms is a far better option.
All three of them are taken into account by the BM25 function.
We will see that the recursion bottom out property. We assume page A has
pages T1…Tn which point to it (i.e., are citations). The parameter d is a
damping factor which can be set between 0 and 1. We usually set d to 0.85.
There are more details about d in the next section. Also C(A) is defined as the
number of links going out of page A. The PageRank of a page A is given as
follows:
Machine Translation
The meaning of a text in the original (source) language must be fully restored
in the target language, i.e. the translation, in order to process any translation,
whether human or automated. While it appears simple on the surface, it is
significantly more complicated. Translation is more than just a word-for-word
replacement. A translator must be able to evaluate and analyse all of the text's
aspects, as well as understand how each word influences the others. This
necessitates considerable knowledge of the source and target languages'
grammar, syntax (sentence structure), semantics (meanings), and other
aspects, as well as familiarity with each local region.
Both human and machine translation have their own set of difficulties. For
example, no two translators can create identical translations of the same
content in the same language pair, and customer satisfaction may require
numerous rounds of revisions. The major challenge, though, is determining
how machine translation can produce translations of publishable quality.
Rule-Based Machine Translation Technology
For each language pair, rule-based machine translation relies on a large
number of built-in linguistic rules and millions of bilingual dictionaries.
The software parses text and generates a transitional representation from
which the target language text can be generated. This approach necessitates
enormous sets of rules and extensive lexicons with morphological, syntactic,
and semantic information. These sophisticated rule sets are used by the
programme, which subsequently translates the source language's grammatical
structure to the target language.
Large dictionaries and complex language rules are used to create translations.
By including their terminology into the translation process, users can increase
the quality of the out-of-the-box translation. They generate custom dictionaries
that override the system's default options.
In most circumstances, there are two steps: an initial investment that improves
quality considerably at a low cost, and a continuous investment that improves
quality progressively. While rule-based MT can help firms get to and beyond
the quality threshold, the quality improvement process can be lengthy and
costly.
Statistical Machine Translation Technology
Statistical machine translation makes use of statistical translation models
whose parameters are derived through monolingual and bilingual corpora
analysis. The process of creating statistical translation models is swift, but the
technique is strongly reliant on existing multilingual corpora. For a specific
domain, a minimum of 2 million words is necessary, with considerably more
for general language. Although it is theoretically possible to meet the quality
criterion, most companies lack the appropriate multilingual corpora to create
the necessary translation models. Furthermore, statistical machine translation
uses a lot of CPU power and necessitates a lot of hardware to run translation
models at average performance levels.
Rule-Based MT vs. Statistical MT
Rule-based MT has good out-of-domain quality and is predictable by nature.
Customization based on dictionaries ensures higher quality and adherence to
corporate terminology. However, the fluency that readers expect from a
translation may be lacking. The customising cycle required to attain the
quality criteria might be lengthy and costly in terms of expenditure. Even on
ordinary hardware, the performance is excellent.
When big and qualified corpora are available, statistical MT produces good
results. The translation is fluent, which means it reads smoothly and so
satisfies the needs of the user. The translation, on the other hand, is neither
predictable nor consistent. Good corpora training is automated and less
expensive. However, training on broad language corpora, or text outside of the
defined domain, is ineffective. Statistical machine translation also necessitates
a lot of hardware to construct and manage huge translation models.
Rule-Based MT Statistical MT
+ Out-of-domain translation
– Poor out-of-domain quality
quality
SPEECH RECOGNITION
Given an auditory signal, speech recognition is the challenge of detecting a
series of SPEECH words pronounced by a speaker. It has become one of the
most widely used AI applications.
1. Example: When stated quickly, the word "recognise speech" sounds almost
identical to "wreak a nice beach." Even this brief example demonstrates a few
of the challenges that make communication difficult.
2. First segmentation: written words in English have spaces between them, but
in fast speech there are no pauses in “wreck a nice” that would distinguish it as
a multiword phrase as opposed to the single word “recognize”.
3. Second, coarticulation: when speaking quickly the “s” sound at the end of
“nice” merges with the “b” sound at the beginning of “beach” yielding
something that is close to a “sp”. Another problem that does not show up in
this example is homophones – words like “to”, “too” and “two” that sound the
same but differe in meaning argmax P(word1:t | sound1:t) = argmax
P(sound1:t | word1:t) P(word1:t). word1:t word1:t Heere P (sound1:t |
sound1:t) is the acrostic model. It describes the sound of words – that “ceiling”
begins with a soft “c” and sounds the same as “sealing”. P (word1:t) is known
as the language model. It specifies the prior probability of each utterance – for
example, that “ceiling fan” is about 500 times more likely as a word sequence
than “sealing fan”.
4. Once we define the acoustic and language models, we can solve for the
most likely sequence of words using the Viterbi algorithm.
Acoustic Model
1. The magnitude of the current – which approximates the amplitude of
the sound wave – is measured by an analog-to-digital converter at
discrete intervals called sampling rate.
2. The quantization factor determines the precision of each measurement;
speech recognizers commonly keep 8 to 12 bits. A low-end system
sampling at 8 kHz with 8-bit quantization would require roughly half a
megabyte of speech every minute.
3. A phoneme is the smallest unit of sound that has a specific meaning for
language speakers. The "t" in "stick," for example, sounds similar
enough to the "t" in "tick" that English people assume them to be the
same phoneme. A vector of features summarises each frame. The
phone model is depicted in the image below.
Translating the acoustic signal into a sequence of frames. In this
diagram each frame is described by the discretized values of three
acoustic features; a real system would have dozens of features
ROBOT
1. Robots are physical agents who manipulate the physical world to fulfil
tasks.
2. They are outfitted with effectors like as legs, wheels, joints, and grippers in
order to accomplish this.
3. The sole goal of effectors is to exert physical pressures on the environment.
4. Robots also have sensors that enable them to perceive their surroundings.
5. Modern robotics uses a variety of sensors, such as cameras and lasers to
monitor the environment and gyroscopes and accelerometers to track the
robot's own movements.
6. The majority of today's robots can be classified into one of three groups.
Manipulators, sometimes known as robot arms, are physically attached to their
work environment, such as a factory assembly line or the International Space
Station.
Robot Hardware
1. Sensors serve as a perceptual link between the robot and its surroundings.
2. Passive sensors, such as cameras, are actual environmental observers,
capturing signals created by other sources in the environment.
3.Active sensors, like sonar, emit energy into the surroundings. The fact that
this radiation is reflected back to the sensor is what they rely on. Active
sensors provide more information than passive sensors, but at the cost of
higher power consumption and the risk of interference when numerous active
sensors are employed simultaneously. Sensors can be classified into three sorts
based on whether they sense the environment, the robot's location, or the
robot's internal setup, whether active or passive.
4. Range finders are sensors that measure the distance between things in the
immediate vicinity. Robots were widely equipped with sonar sensors in the
early days of robotics. Sonar sensors produce directed sound waves that are
reflected by objects, with part of the sound making it to the listener.
5. Stereo vision uses many cameras to capture the surroundings from slightly
different perspectives, then analyses the parallax in the images to compute the
range of nearby objects. Sonar and stereo vision are no longer commonly
employed in mobile ground robots due to their inaccuracy.
6. Laser beams and special 1-pixel cameras are used in other range sensors,
which can be guided using sophisticated mirror configurations or spinning
parts. Scanning lidars are the name for these sensors (short for light detection
and ranging).
7. Radar, which is generally the sensor of choice for UAVs, is another
common range sensor. Radar sensors are capable of measuring distances of
several kilometres. Tactile sensors, such as whiskers, bump panels, and touch-
sensitive skin, are on the other end of the range sensing spectrum. These
sensors use physical contact to determine range and can only be used to detect
items that are very close to the robot.
8. Location sensors are a second significant type of sensor. To detect position,
most location sensors use range sensing as a main component. Outside, the
most popular solution to the problem of location is the Global Positioning
System (GPS).
9.Proprioceptive sensors, which notify the robot of its own motion, are the
third major class. Motors are frequently equipped with shaft decoders that
count the revolution of motors in minute increments to measure the exact
configuration of a robotic joint.
10. Inertial sensors, such as gyroscopes, rely on mass resistance to velocity
change. They can aid in the reduction of uncertainty.
11.Force and torque sensors are used to measure other crucial aspects of the
robot's status. When robots handle fragile goods or objects whose exact shape
and placement are unknown, these are essential.
Robotic Perception
1. Perception is the conversion of sensor data into internal representations of
the environment by robots. Sensors are noisy, and the environment is partially
viewable, unexpected, and frequently dynamic, making perception difficult. In
other words, robots face all of the issues associated with state estimation (or
filtering)
2. Good internal representations for robots have three properties as a rule of
thumb: they contain enough information for the robot to make good decisions,
they are structured so that they can be updated efficiently, and they are natural
in the sense that internal variables correspond to natural state variables in the
physical world.
There may be times when no map of the environment is available. The robot
will then need to obtain a map. This is a bit of a chicken-and-egg situation: the
navigating robot will have to figure out where it is in relation to a map it
doesn't know while also generating the map while not knowing where it is.
This subject has been extensively explored under the name simultaneous
localization and mapping, abbreviated as SLAM, and it is vital for many robot
applications.
Many alternative probabilistic approaches, like the extended Kalman filter
outlined above, are used to tackle SLAM difficulties.
Localization using extended Kalman Filter
A repelling potential field pushes the robot away from obstacles, (b) Path
found by simultaneously minimizing path length and the potential
The Voronoi graph is the set of points equidistance to two or more
obstacles in configuration space (b) A probabilistic moodmap, composed
of 100 randomly chosen points in free space.
Robust methods
1. A robust method assumes a bounded level of uncertainty in each component
of a problem, but assigns no probabilities to values inside the allowable
interval.
2. A robust solution is one that works regardless of the actual values as long as
they stay within the assumed ranges.
3.The conformant planning technique is an extreme kind of resilient strategy.