AI DBU Best of Best PDF
AI DBU Best of Best PDF
AI DBU Best of Best PDF
College of Computing
March 2023
Debre Berhan,
Ethiopia
Table of Contents
Chapter One: Introduction to artificial intelligence ................................................................................................ 4
1.1 Definition................................................................................................................................................ 4
1.2 Typical AI problems............................................................................................................................... 6
1.3 Intelligent behaviour............................................................................................................................... 6
1.4 Practical Impact of AI ............................................................................................................................ 6
1.5 Approaches to AI ................................................................................................................................... 6
1.6 Limits of AI Today................................................................................................................................. 7
1.7 What can AI systems do? ....................................................................................................................... 7
1.8 What can AI systems NOT do yet?........................................................................................................ 7
1.9 Goals of AI ............................................................................................................................................. 8
1.10 AI Techniques ........................................................................................................................................ 8
1.11 Sample questions .................................................................................................................................... 8
Chapter Two: Intelligent Agents ............................................................................................................................ 3
2.1 Introduction to Intelligent Agents........................................................................................................... 3
2.2 Agents and the environments ................................................................................................................. 4
2.3 Rationality Vs Omniscience ................................................................................................................... 4
2.4 Structure of Intelligent Agents ............................................................................................................... 5
2.5 Autonomy ............................................................................................................................................... 5
2.6 Task Environments ................................................................................................................................. 6
2.7 Properties of Task environments ............................................................................................................ 6
2.8 PEAS examples ...................................................................................................................................... 6
2.9 Agent Types............................................................................................................................................ 7
2.10 Summery................................................................................................................................................. 9
2.11 Questions ................................................................................................................................................ 9
Chapter Three: Problem Solving (Goal Based) Agents .......................................................................................... 2
3.1 Problem Solving by Searching ............................................................................................................... 2
3.2 What is search and terminologies? ............................................................................................................... 2
3.5 Search Strategies .................................................................................................................................... 2
3.5.1 Unformed Search Strategies ........................................................................................................... 2
3.5.2 Informed Search Strategies ............................................................................................................. 8
3.5.3 Local Search Strategies ................................................................................................................ 12
3.5.4 Adversarial Search Strategies ....................................................................................................... 16
3.6 Avoiding Repeated States ..................................................................................................................... 19
3.7 Constraint Satisfaction Search .............................................................................................................. 20
3.8 Sample Questions ................................................................................................................................. 22
Chapter Four: Knowledge Representation and Reasoning ................................................................................... 23
4.1 Knowledge based agent ........................................................................................................................ 24
4.2 Architecture of Knowledge based agents ............................................................................................. 24
4.3 Levels of knowledge............................................................................................................................. 25
4.4 Approaches to design KB agents .......................................................................................................... 26
4.5 Knowledge Representation ................................................................................................................... 26
4.6 Techniques of Knowledge Representation ........................................................................................... 26
4.7 Propositional Logic .............................................................................................................................. 29
4.7.1 Logical connectives in PL ............................................................................................................ 30
4.7.2 Inference in Propositional Logic .................................................................................................... 1
4.8 Predicate (First-Order) Logic ................................................................................................................. 2
4.8.1 Quantifiers in FOL.......................................................................................................................... 3
4.8.2 Inference in First-Order Logic ........................................................................................................ 4
4.8.3 Unification in FOL ......................................................................................................................... 6
4.8.4 Resolution in FOL .......................................................................................................................... 7
4.9 Reasoning ............................................................................................................................................... 7
4.10 Reasoning under uncertainty .................................................................................................................. 9
4.11 Summery............................................................................................................................................... 12
4.12 Sample Questions ................................................................................................................................. 12
Chapter Five: Expert System .................................................................................................................................. 2
5.1 Introduction ............................................................................................................................................ 2
5.2 Applications of Expert Systems ............................................................................................................. 2
5.3 Expert Systems Technologies ................................................................................................................. 2
5.4 Benefits of Expert Systems..................................................................................................................... 2
5.5 Expert System Limitations ..................................................................................................................... 3
5.6 The Architecture of Expert Systems ....................................................................................................... 3
5.7 Components of Expert Systems .............................................................................................................. 3
5.7.1 The Knowledge bases ..................................................................................................................... 3
5.7.2 The Inference Engine...................................................................................................................... 4
5.7.3 The User Interface .......................................................................................................................... 5
5.8 Development of Expert System .............................................................................................................. 6
5.7 Questions ................................................................................................................................................ 6
Chapter Six: Learning Agents ................................................................................................................................ 2
6.1 Introduction ............................................................................................................................................ 2
6.2 Types of learning (machine learning) ..................................................................................................... 3
A. Decision tree algorithm .......................................................................................................................... 4
B. Regression algorithm .............................................................................................................................. 5
6.2 Neural Networks ..................................................................................................................................... 6
6.3 Biological neurons .................................................................................................................................. 7
6.4 ANN for linear equations ....................................................................................................................... 8
6.5 Processing of ANN ................................................................................................................................. 9
6.6 Application of ANN ............................................................................................................................. 11
6.7 Sample Questions ................................................................................................................................. 12
Chapter Seven: Communicating, Perceiving, and Acting ...................................................................................... 1
7.1 Natural language processing ................................................................................................................... 2
7.2 Applications of NLP ............................................................................................................................... 4
7.3 Introduction to robotics .......................................................................................................................... 5
7.4 Sample Questions ................................................................................................................................... 7
Turing Test
3. Logic and laws of thought deals with studies of ideal or rational thought process and inference.
The emphasis in this case is on the inference mechanism, and its properties. That is how the system
arrives at a conclusion, or the reasoning behind its selection of actions is very important in this
point of view. The soundness and completeness of the inference mechanisms are important here. –
think rationally
4. The fourth view of AI is that it is the study of rational agents. This view deals with building
machines that act rationally. The focus is on how the system acts and performs, and not so much
on the reasoning process. A rational agent is one that acts rationally, that is, is in the best possible
manner.
1.2 Typical AI problems
While studying the typical range of tasks that we might expect an “intelligent entity” to perform, we
need to consider both “common-place” tasks as well as expert tasks.
Examples of common-place tasks include
– Recognizing people, objects.
– Communicating (through natural language).
– Navigating around obstacles on the streets
1.5 Approaches to AI
Strong AI aims to build machines that can truly reason and solve problems. These machines should
be self-aware and their overall intellectual ability needs to be indistinguishable from that of a human
being. Excessive optimism in the 1950s and 1960s concerning strong AI has given way to an
appreciation of the extreme difficulty of the problem. Strong AI maintains that suitably programmed
machines are capable of cognitive mental states.
Weak AI: deals with the creation of some form of computer-based artificial intelligence that cannot
truly reason and solve problems, but can act as if it were intelligent. Weak AI holds that suitably
programmed machines can simulate human cognition.
Applied AI: aims to produce commercially viable smart system. For example, a security system that
is able to recognize the faces of people who are permitted to enter a particular building. Applied AI
has already enjoyed considerable success.
Cognitive AI: computers are used to test theories about how the human mind works--for example,
theories about how we recognize faces and other objects, or about how we solve abstract problems.
1.9 Goals of AI
The definition of AI gives four possible goals to pursue
systems that think like human science approach
systems that act like human Test approach
systems that think rationally of thought approach
systems that act rationally agent approach
General AI goal
Replicate human intelligent
Solve knowledge intensive task
Make an intelligent connection between perception and action
Enhance human-computer interaction/ communication
Engineering based AI goal
Develop concepts, theory and practice of building intelligent machines
Emphasis is on system building
Science based AI goal
Develop concepts, mechanisms and vocabulary to understand biological intelligent
behaviours
Emphasis is on understanding intelligent behaviours
1.10 AI Techniques
Various techniques that have involved can be applied to a variety of AI tasks. The techniques are
concerned with how we represent, manipulate and reason with knowledge in order to solve problem.
Example
Techniques, not all “intelligent” but used to behave as intelligent
o Describe and match o Goal reduction
o Constraint satisfaction o Tree search
o Generate and Test o Rule based system
Biology-inspired AI techniques are currently popular
o Neural Network o Genetic Algorithms
o Reinforcement learning
1.11 Sample questions
1. Which one of the following is correctly matched with the definition and approaches of AI
A) Acting humanly - The rational agent approach
B) Thinking humanly - The social constructive modelling approach
C) Thinking rationally - The “laws of thought” approach
D) Acting rationally - The Turing test approach
2. Artificial Intelligence is about
A) Making a machine Intelligent
B) Playing a game on Computer
C) Programming on Machine with your Own Intelligence
D) Putting your intelligence in Machine
3. One of the following is/are false about human vs. machine intelligence
A) Machines perceive by set of rules rather than patterns
B) Machines can label/figure out a missing part of a given object more effectively than humans
C) Humans recall and store information by patterns rather than algorithms
D) Machines can’t think out of the box but humans do
4. One of the following is/are true about the benefits of Artificial intelligence except
A) Useful for risky areas
B) High speed and accuracy
C) Increase dependency on machines
D) Reliability
E) All of them
5. Which of the following is not a goal of AI?
A) Thinking humanly
B) Adapting to the environment and situations
C) Real Life Problem Solving
D) To rule over humans
6. One of the following is/are true about dataset in machine learning systems except?
A) Qualified/Clear dataset is enough even if its amount is small
B) Invalid dataset gives invalid results
C) Quality of dataset is better than quality of algorithms that you select
D) Handling missing data is preferable because it has its own meanings
7. "Artificial Intelligence means to mimic a human. Hence, if a robot can move from one place to
another like a human, then it comes under Artificial Intelligence."
A) True B) False C) May be true or false
Chapter Two: Intelligent Agents
Objectives
After completing this chapter, students will be able to know and understand
o Introduction to Intelligent Agents
o Agents and the environments
o Rationality Vs Omniscience
o Structure of Intelligent Agents
o Autonomy
o Task Environments
o Properties of Task environments
o PEAS examples
o Agent Types
2.1 Introduction to Intelligent Agents
• Terminology
• Performance Measure of Agent -It is the criteria, which determines how successful an agent is.
• Behavior of Agent − It is the action that agent performs after any given sequence of percepts.
• Percept − It is agent’s perceptual inputs at a given instance.
• Percept Sequence − It is the history of all that an agent has perceived till date.
• Agent Function − It is a map from the precept sequence to an action.
• An agent is anything that can perceive its environment through sensors and acts upon that
environment through effectors. An agent perceives its environment through sensors.
• The complete set of inputs at a given time is called a percept.
• The current percept or a sequence of precepts can influence the actions of an agent.
• The agent can change the environment through actuators or effectors.
• An operation involving an effector is called an action.
• Actions can be grouped into action sequences.
• The agent can have goals which it tries to achieve. Thus, an agent can be looked upon as a system
that implements a mapping from percept sequences to actions.
• A performance measure has to be used in order to evaluate an agent.
• An autonomous agent decides autonomously which action to take in the current situation to
maximize progress towards its goals.
• An Intelligent Agent must sense, must act, and must be autonomous (to some extent). It also must
be rational.
• AI is about building rational agents.
• An agent is something that perceives and acts.
• A rational agent always does the right thing.
• What are the functionalities (goals)?
• What are the components?
• How do we build them?
• Agent performance
• An agent function implements a mapping from perception history to action.
• The behaviour and performance of intelligent agents have to be evaluated in terms of the agent
function.
• The ideal mapping specifies which actions an agent ought to take at any point in time.
• The performance measure is a subjective measure to characterize how successful an agent is.
• The success can be measured in various ways.
• It can be measured in terms of speed or efficiency of the agent.
• It can be measured by the accuracy or the quality of the solutions achieved by the agent.
• It can also be measured by power usage, money, etc.
2.2 Agents and the environments
• An AI system is composed of an agent and its environment.
• The agents act in their environment. The environment may contain other agents.
• An agent is anything that can perceive its environment through sensors and acts upon that
environment through effectors.
2.3 Rationality Vs Omniscience
Rationality
• Rationality is nothing but status of being reasonable, sensible, and having good sense of judgment.
• Rationality is concerned with expected actions and results depending upon what the agent has
perceived.
• Performing actions with the aim of obtaining useful information is an important part of rationality.
• Example of agent:
• Chess agent
o World knowledge is the board state (all the pieces)
o Sensory information is the opponents move
o It’s moves also change the board state
• Human: sensor (eye, ears, skins, taste). effectors (Hand, fingers, legs, mouth)
• Robot: sensor (camera, infrared,..), effectors (gripper, wheel, speaker,.)
• Software agent: function as sensor and actuator
Ideal Rational Agent
• An ideal rational agent is the one, which is capable of doing expected actions to maximize its
performance measure, on the basis of −
o Its percept sequences
o Its built-in knowledge bases
• Rationality of an agent depends on the following −
o The performance measures, which determine the degree of success.
o Agent’s Percept Sequence till now.
o The agent’s posterior knowledge about the environment.
o The actions that the agent can carry out.
• A rational agent always performs right action, where the right action means the action that causes
the agent to be most successful in the given percept sequence.
• Omniscience
o It is the state of possessing unlimited knowledge about all things possible.
o It is the capacity of knowing unlimited knowledge of all things that can be known.
o It knows the actual effects of its actions and it is impossible in real world.
A rational agent behaves according to its precepts and knowledge and attempts to maximize the
expected performance.
2.4 Structure of Intelligent Agents
The Structure of Intelligent Agents - Agent’s structure can be viewed as −
• Agent = Architecture + Agent Program
• Architecture = the machinery that an agent executes on.
• Agent Program = an implementation of an agent function.
2.5 Autonomy
The autonomy of an agent is the extent to which its behaviour is determined by its own experience,
rather than knowledge of designer.
• Extremes
• No autonomy – ignores environment/data
• Complete autonomy – must act randomly/no program
• Ideal: design agents to have some autonomy
• Possibly become more autonomous with experience
2.6 Task Environments
• An environment in artificial intelligence is the surrounding of the agent.
• The environment is where agent lives, operate and provide the agent with something to sense and
act upon it.
• The agent takes input from the environment through sensors and delivers the output to the
environment through actuators.
• The most famous artificial environment is the Turing Test environment, in which one real and
other artificial agent are tested on equal ground.
Completeness: DFS search algorithm is complete within finite state space as it will expand every
node within a limited search tree.
Time Complexity: Time complexity of DFS will be equivalent to the node traversed by the
algorithm. T(n)=O(nm), where m= maximum depth of any node and this can be much larger than d
(Shallowest solution depth)
Space Complexity: DFS algorithm needs to store only single path from the root node, hence space
complexity of DFS is equivalent to the size of the fringe set, which is O(bm).
Optimal: DFS search algorithm is non-optimal, as it may generate a large number of steps or high
cost to reach to the goal node.
2. BFS
• BFS algorithm starts searching from the root node of the tree and expands all successor node at the
current level before moving to nodes of next level.
• It searches breadthwise in a tree or graph, so it is called breadth-first search.
• Breadth-first search implemented using FIFO queue data structure.
• If branching factor (average number of child nodes for a given node) = b and depth = d, then number
of nodes at level d = bd.
• The total no of nodes created in worst case is b + b2 + b3 + … + bd.
Advantages
• BFS will provide a solution if any solution exists.
• If there are more than one solution for a given problem, then BFS will provide the minimal
solution which requires the least number of steps.
Disadvantages:
• It requires lots of memory since each level of the tree must be saved into memory to expand the
next level.
• BFS needs lots of time if the solution is far away from the root node.
Example
Time Complexity: is obtained by the number of nodes traversed in BFS until the shallowest Node. T
(b) =O(bd) where d= depth of shallowest solution and b is a node at every state.
Space Complexity: Space complexity of BFS algorithm is given by the Memory size of frontier which
is O(bd)
Completeness: BFS is complete, which means if the shallowest goal node is at some finite depth, then
BFS will find a solution.
Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the node.
3. Depth limited search
A depth-limited search algorithm is similar to depth-first search with a predetermined limit. Depth-
limited search can solve the drawback of the infinite path in the Depth-first search. In this algorithm, the
node at the depth limit will treat as it has no successor nodes further.
Depth-limited search can be terminated with two Conditions of failure:
a. Standard failure value: It indicates that problem does not have any solution.
b. Cutoff failure value: It defines no solution for the problem within a given depth limit.
• Advantages:
– Depth-limited search is Memory efficient.
• Disadvantages:
– Depth-limited search also has a disadvantage of incompleteness.
– It may not be optimal if the problem has more than one solution.
Example: Find the path to get the goal ‘J’ if depth limit is 2
• Completeness: DLS search algorithm is complete if the solution is above the depth-limit.
• Time Complexity: Time complexity of DLS algorithm is O(bℓ).
• Space Complexity: Space complexity of DLS algorithm is O(b×ℓ).
• Optimal: Depth-limited search can be viewed as a special case of DFS, and it is also not optimal
even if ℓ>d.
4. Uniform cost search
• Uniform-cost search is a searching algorithm used for traversing a weighted tree or graph.
• This algorithm comes into play when a different cost is available for each edge.
• The primary goal of the uniform-cost search is to find a path to the goal node which has the lowest
cumulative cost.
• Uniform-cost search expands nodes according to their path costs form the root node.
• It can be used to solve any graph/tree where the optimal cost is in demand. A uniform-cost search
algorithm is implemented by the priority queue.
• It gives maximum priority to the lowest cumulative cost.
• Uniform cost search is equivalent to BFS algorithm if the path cost of all edges is the same.
• Advantages:
• Uniform cost search is optimal because at every state the path with the least cost is chosen.
• Disadvantages:
• It does not care about the number of steps involve in searching and only concerned about path
cost. Due to which this algorithm may be stuck in an infinite loop.
• Example : Find the goal node ‘G’ for the following search tree
• Completeness - Uniform-cost search is complete, such as if there is a solution, UCS will find 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 is O(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 optimal as it only selects a path with the lowest path cost.
5. Iterative Deeping DFS
• It is a combination of DFS and BFS algorithms. This search algorithm finds out the best depth limit
and does it by gradually increasing the limit until a goal is found.
• This algorithm performs depth-first search up to a certain "depth limit", and it keeps increasing the
depth limit after each iteration until the goal node is found.
• This Search algorithm combines the benefits of Breadth-first search's fast search and depth-first
search's memory efficiency.
• The iterative search algorithm is useful uninformed search when search space is large, and depth of
goal node is unknown.
• Advantages:
• It combines the benefits of BFS and DFS search algorithm in terms of fast search and memory
efficiency.
• Disadvantages:
• The main drawback of IDDFS is that it repeats all the work of the previous phase.
• Example : find the goal node G
Solution
1'st Iteration-----> A
2'nd Iteration----> A, B, C
3'rd Iteration------>A, B, D, E, C, F, G
In the third iteration, the algorithm will find the goal node.
• Completeness - This algorithm is complete if the branching factor is finite.
• 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 - IDDFS algorithm is optimal if path cost is a non- decreasing function of the depth of
the node.
6. Bidirectional search
• Bidirectional search algorithm runs two simultaneous searches, one form initial state called as
forward-search and other from goal node called as backward-search, to find the goal node.
• Bidirectional search replaces one single search graph with two small sub-graphs in which one starts
the search from an initial vertex and other starts from goal vertex.
• The search stops when these two graphs intersect each other.
• Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.
• Advantages:
• Bidirectional search is fast.
• Bidirectional search requires less memory
• Disadvantages:
• Implementation of the bidirectional search tree is difficult.
• In bidirectional search, one should know the goal state in advance.
• Example - In the below search tree, bidirectional search algorithm is applied. This algorithm divides
one graph/tree into two sub-graphs. It starts traversing from node 1 in the forward direction and starts
from goal node 16 in the backward direction.
• The algorithm terminates at node 9 where two searches meet.
• Find the path to get the goal node ‘16’
• The heuristic value of all states is given in the table so we will calculate the f(n) of each state using
the formula f(n)= g(n) + h(n), where g(n) is the cost to reach any node from start state.
• Here we will use OPEN and CLOSED list.
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 gives the final result, as S--->A--->C--->G it provides the optimal path with cost 6.
• Complete: A* algorithm is complete as long as:
o Branching factor is finite.
o Cost at every action is fixed.
• Optimal: A* search algorithm is optimal if it follows below two conditions:
o Admissible: the first condition requires for optimality is that h(n) should be an admissible
heuristic for A* tree search. An admissible heuristic is optimistic in nature.
o Consistency: Second required condition is consistency for only A* graph-search.
• If the heuristic function is admissible, then A* tree search will always find the least cost path.
• Time Complexity: The time complexity of A* search algorithm depends on heuristic function, and
the number of nodes expanded is exponential to the depth of solution d. So the time complexity is
O(bd), where b is the branching factor.
• Space Complexity: The space complexity of A* search algorithm is O(bd).
3.5.3 Local Search Strategies
In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution.
- Local search: widely used for very big problems
- Returns good but not optimal solutions
State space = set of "complete" configurations
- Find configuration satisfying constraints
- Examples: n-Queens, VLSI layout, airline flight schedules
Local search algorithms
- Keep a single "current" state, or small set of states
- Iteratively try to improve it / them
- Very memory efficient
o keeps only one or a few states
o You control how much memory you use
1. Hill climbing algorithm
Hill climbing algorithm is a local search algorithm which continuously moves in the direction of
increasing elevation/value to find the peak of the mountain or best solution to the problem. It terminates
when it reaches a peak value where no neighbor has a higher value.
It is also called greedy local search as it only looks to its good immediate neighbor state and not beyond
that. A node of hill climbing algorithm has two components which are state and value. Hill Climbing is
mostly used when a good heuristic is available. In this algorithm, we don't need to maintain and handle
the search tree or graph as it only keeps a single current state.
• Features of hill climbing algorithm
• Generate and Test variant: The Generate and Test method produce feedback which helps
to decide which direction to move in the search space.
• Greedy approach: Hill-climbing algorithm search moves in the direction which optimizes
the cost.
• No backtracking: It does not backtrack the search space, as it does not remember the
previous states.
• The state-space landscape is a graphical representation of the hill-climbing algorithm which is
showing a graph between various states of algorithm and Objective function/Cost.
• Local Maximum - is a state which is better than its neighbor states, but there is also another state
which is higher than it.
• Global Maximum - is the best possible state of state space landscape. It has the highest value of
objective function.
• Current state - It is a state in a landscape diagram where an agent is currently present.
• Flat local maximum - It is a flat space in the landscape where all the neighbor states of current
states have the same value.
• Shoulder - It is a plateau region which has an uphill edge.
Types of hill climbing algorithms
1. Simple hill climbing algorithm
• Simple hill climbing is the simplest way in which it only evaluates the neighbor node state at a
time and selects the first one which optimizes current cost and set it as a current state.
• It only checks it's one successor state, and if it finds better than the current state, then move else
be in the same state.
• features
• Less time consuming
• Less optimal solution and the solution is not guaranteed
• Algorithmic steps
• Create a CURRENT node, NEIGHBOUR node, and a GOAL node.
• If the CURRENT node=GOAL node, return GOAL and terminate the search.
• Else CURRENT node<= NEIGHBOUR node, move ahead.
• Loop until the goal is not reached or a point is not found.
2. Steepest-Ascent algorithm
• The steepest-Ascent algorithm is a variation of simple hill climbing algorithm.
• It examines all the neighboring nodes of the current state and selects one neighbor node which
is closest to the goal state.
• It consumes more time as it searches for multiple neighbours
• Both simple and steepest-ascent hill climbing search, fails when there is no closer node.
• Algorithmic steps
1. Create a CURRENT node and a GOAL node.
2. If the CURRENT node=GOAL node, return GOAL and terminate the search.
3. Loop until a better node is not found to reach the solution.
4. If there is any better successor node present, expand it.
5. When the GOAL is attained, return GOAL and terminate.
3. Stochastic hill climbing:
• Stochastic hill climbing does not examine for all its neighbor before moving.
• Rather, this search algorithm selects one neighbor node at random and decides whether to choose
it as a current state or examine another state.
• It does not focus on all the nodes.
• It selects one node at random and decides whether it should be expanded or search for a better
one.
Algorithmic steps
• Evaluate the initial state. If it is a goal state then stop and return success. Otherwise, make the
initial state the current state.
• Repeat these steps until a solution is found or the current state does not change.
• Select a state that has not been yet applied to the current state.
• Apply the successor function to the current state and generate all the neighbor states.
• Among the generated neighbor states which are better than the current state choose a state
randomly
• If the chosen state is the goal state, then return success, else make it the current state and
repeat step 2.
• Exit from the function.
Problems of hill climbing algorithm
1. Local Maximum: A local maximum is a peak state in the landscape which is better than each of its
neighboring states, but there is another state also present which is higher than the local maximum.
• Solution: Backtracking technique can be a solution of the local maximum in state space
landscape. Create a list of the promising path so that the algorithm can backtrack the search space
and explore other paths as well.
2. Plateau: A plateau is the flat area of the search space in which all the neighbor states of the current
state contains the same value, because of this algorithm does not find any best direction to move. A hill-
climbing search might be lost in the plateau area.
• Solution: The solution for the plateau is to take big steps or very little steps while searching, to
solve the problem. Randomly select a state which is far away from the current state so it is
possible that the algorithm could find non-plateau region.
3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher than its
surrounding areas, but itself has a slope, and cannot be reached in a single move.
• Solution: With the use of bidirectional search, or by moving in different directions, we can
improve this problem.
2. Means ends analysis
Means-Ends Analysis is mixed strategy, it makes possible that first to solve the major part of a problem
and then go back and solve the small problems arise during combining the big parts of the problem. It is
a mixture of Backward and forward search technique. The MEA analysis computes by evaluating the
difference between the current state and goal state. The means-ends analysis process can be applied
recursively for a problem.
• Steps.
• First, evaluate the difference between Initial State and final State.
• Select the various operators which can be applied for each difference.
• Apply the operator at each difference, which reduces the difference between the current state
and goal state.
Algorithms
• Step 1: Compare CURRENT to GOAL, if there are no differences between both then return
Success and Exit.
• Step 2: Else, select the most significant difference and reduce it by doing the following steps
until the success or failure occurs.
• Select a new operator O which is applicable for the current difference, and if there is no
such operator, then signal failure.
• Attempt to apply operator O to CURRENT. Make a description of two states.
i) O-Start, a state in which O?s preconditions are satisfied.
ii) O-Result, the state that would result if O were applied In O-start.
• If
(First-PartMEA(CURRENT,O-START)
And
(LAST-Part MEA (O-Result, GOAL), are successful, then signal Success and return
the result of combining FIRST-PART, O, and LAST-PART.
• For example, in the above figure, the two players MAX and MIN are there. MAX starts the game
by choosing one path and propagating all the nodes of that path.
• Now, MAX will backtrack to the initial node and choose the best path where his utility value will
be the maximum.
• After this, its MIN chance. MIN will also propagate through a path and again will backtrack,
but MIN will choose the path which could minimize MAX winning chances or the utility value.
• So, if the level is minimizing, the node will accept the minimum value from the successor nodes.
• If the level is maximizing, the node will accept the maximum value from the successor.
• Minimax value of a node (backed up value):
• If N is terminal, use the utility value
• If N is a Max move, take max of successors
• If N is a Min move, take min of successors
• Choose the move with the highest minimax value
• best achievable payoff against best play
• Choose moves that will lead to a win, even though min is trying to block
2. Alpha Beta Pruning
Alpha-beta pruning is a modified version of the minimax algorithm. It is an optimization technique for
the minimax algorithm. In the minimax search algorithm that the number of game states it has to examine
are exponential in depth of the tree. Since we cannot eliminate the exponent, but we can cut it to half.
Hence there is a technique by which without checking each node of the game tree we can compute the
correct minimax decision, and this technique is called pruning or Alpha beta algorithm.
• Alpha-beta pruning can be applied at any depth of a tree, and sometimes it not only prune the tree
leaves but also entire sub-tree.
• 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 -∞.
• 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 +∞.
• It removes all the nodes which are not really affecting the final decision but making algorithm slow.
Hence by pruning these nodes, it makes the algorithm fast.
• The main condition which required for alpha-beta pruning is α>=β
• The Max player will only update the value of alpha.
• The Min player will only update the value of beta.
• While backtracking the tree, the node values will be passed to upper nodes instead of values of alpha
and beta.
• We will only pass the alpha, beta values to the child nodes.
• The effectiveness of alpha-beta pruning is highly dependent on the order in which each node is
examined.
• Worst ordering: In some cases, alpha-beta pruning algorithm does not prune any of the leaves of
the tree, and works exactly as minimax algorithm.
• consumes more time
• the best move occurs on the right side of the tree.
• The time complexity for such an order is O(bm).
• Ideal ordering: occurs when lots of pruning happens in the tree, and best moves occur at the left
side of the tree.
• go deep twice as minimax algorithm in the same amount of time.
• Complexity in ideal ordering is O(bm/2).
• Rules to find good ordering:
• Occur the best move from the shallowest node.
• Order the nodes in the tree such that the best nodes are checked first.
• Use domain knowledge while finding the best move.
• We can bookkeep the states, as there is a possibility that states may repeat.
3.6 Avoiding Repeated States
Do not return to the parent state (e.g., in 8 puzzle problem, do not allow the Up move right after a
Down move)
Do not create solution paths with cycles.
Do not generate any repeated states (need to store and check a potentially large number of states)
This is done by keeping a list of "expanded states" i.e., states whose daughters have already been
put on the enqueued list. This entails removing states from the "enqueued list" and placing them on
an "expanded list" (In the standard algorithm literature, the list of expanded states is called the
"closed list ", thus, we would move states from the open list to the closed list)
3.7 Constraint Satisfaction Search
Constraint satisfaction is a technique where a problem is solved when its values satisfy certain
constraints or rules of the problem. Such type of technique leads to a deeper understanding of the
problem structure as well as its complexity.
Constraint satisfaction depends on three components, namely:
X: It is a set of variables.
D: It is a set of domains where the variables reside. There is a specific domain for each
variable.
C: It is a set of constraints which are followed by the set of variables.
In constraint satisfaction, domains are the spaces where the variables reside, following the problem
specific constraints. These are the three main elements of a constraint satisfaction technique. The
constraint value consists of a pair of {scope, rel}. The scope is a tuple of variables which participate in
the constraint and rel is a relation which includes a list of values which the variables can take to satisfy
the constraints of the problem.
Solving Constraint Satisfaction Problems
The requirements to solve a constraint satisfaction problem (CSP) is:
A state-space
The notion of the solution.
A state in state-space is defined by assigning values to some or all variables such as
{X1=v1, X2=v2, and so on…}.
An assignment of values to a variable can be done in three ways:
Consistent or Legal Assignment: An assignment which does not violate any constraint or rule
is called Consistent or legal assignment.
Complete Assignment: An assignment where every variable is assigned with a value, and the
solution to the CSP remains consistent. Such assignment is known as Complete assignment.
Partial Assignment: An assignment which assigns values to some of the variables only. Such
type of assignments are called Partial assignments.
Types of Domains in CSP
There are following two types of domains which are used by the variables :
Discrete Domain: It is an infinite domain which can have one state for multiple variables. For
example, a start state can be allocated infinite times for each variable.
Finite Domain: It is a finite domain which can have continuous states describing one domain
for one specific variable. It is also called a continuous domain.
Constraint Types in CSP
With respect to the variables, basically there are following types of constraints:
Unary Constraints: It is the simplest type of constraints that restricts the value of a single
variable.
Binary Constraints: It is the constraint type which relates two variables. A value x2 will
contain a value which lies between x1 and x3.
Global Constraints: It is the constraint type which involves an arbitrary number of variables.
Some special types of solution algorithms are used to solve the following types of constraints:
Linear Constraints: These type of constraints are commonly used in linear programming
where each variable containing an integer value exists in linear form only.
Non-linear Constraints: These type of constraints are used in non-linear programming where
each variable (an integer value) exists in a non-linear form.
Note: A special constraint which works in real-world is known as Preference constraint.
Constraint Propagation
In local state-spaces, the choice is only one, i.e., to search for a solution. But in CSP, we have two
choices either:
We can search for a solution or
We can perform a special type of inference called constraint propagation.
Constraint propagation is a special type of inference which helps in reducing the legal number of
values for the variables. The idea behind constraint propagation is local consistency.
In local consistency, variables are treated as nodes, and each binary constraint is treated as an arc in
the given problem. There are following local consistencies which are discussed below:
Node Consistency: A single variable is said to be node consistent if all the values in the
variable’s domain satisfy the unary constraints on the variables.
Arc Consistency: A variable is arc consistent if every value in its domain satisfies the binary
constraints of the variables.
Path Consistency: When the evaluation of a set of two variable with respect to a third variable
can be extended over another variable, satisfying all the binary constraints. It is similar to arc
consistency.
k-consistency: This type of consistency is used to define the notion of stronger forms of
propagation. Here, we examine the k-consistency of the variables.
3.8 Sample Questions
1. Which of the following is identical to the closed list in Graph search?
(A). Transposition table
(B). Depth-first search
(C). Hill climbing search algorithm
(D). None of the above
2. According to the minimax search algorithm, which of the following values are independent?
(A). Root is independent
(B). Every state is dependent
(C). Pruned leaves x and y
(D). None of the above
3. How we can increase the effectiveness of the alpha-beta pruning?
(A). Depends on the order in which of the following they are executed
(B). Depends on the nodes
(C). All of these
(D). None of the above
4. Which of the following function is used to find the feasibility of a complete game tree?
(A). Transposition
(B). Evaluation function
(C). Alpha-beta pruning
(D). All of these
5. Which of the following search removes the branches that can’t influence the final decision,
and it’s equal to minimax search?
(A). Depth-first
(B). Alpha-beta pruning
(C). Breadth-first
(D). None of the above
6. Which of the following search is identical to minimax search?
(A). Depth-first
(B). Hill-climbing
(C). Breadth-first
(D). All of these
7. Where do the values of alpha-beta search can be modified?
(A). Initial state itself
(B). Along the path of search
(C). At the end
(D). None of the above
8. According to the alpha-beta pruning, select the value assigned to alpha and beta?
(A). Alpha = max
(B). Beta = min
(C). Beta = max
(D). Both A and B
(E). None of the above
9. One of the following is/are correctly matched except
A) Informed search – Best first search
B) A * search depends on heuristic value
C) Brute force strategies – Uniformed algorithms
D) Blind search – A star search
10. One of the evaluations of AI searching algorithm is ‘its optimality’, so what is optimality
means
A) It always finds a least cost solution for a problem
B) It always finds a solution of a problem if it exist
C) It always takes a small amount of time and space
D) It always finds a solution of a problem even if it does not exist
3. Frame Representation
• A frame is a record like structure which consists of a collection of attributes and its values to describe
an entity in the world. Frames are the AI data structure which divides knowledge into substructures
by representing stereotypes situations. It consists of a collection of slots and slot values. These slots
may be of any type and sizes.
• Slots have names and values which are called facets.
• Facets: The various aspects of a slot is known as Facets. Facets are features of frames which
enable us to put constraints on the frames.
• A frame may consist of any number of slots, and a slot may include any number of facets and facets
may have any number of values.
• A frame is also known as slot-filler knowledge representation in artificial intelligence.
Advantages of frame representation:
It makes the programming easier by grouping the related data.
It is comparably flexible and used by many applications in AI.
It is very easy to add slots for new attribute and relations.
It is easy to include default data and to search for missing values.
Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
In frame system inference mechanism is not be easily processed.
Inference mechanism cannot be smoothly proceeded by frame representation.
4. Production Rules
– In production rules agent checks for the condition and if the condition exists then production rule
fires and corresponding action is carried out.
o The condition part of the rule determines which rule may be applied to a problem.
o And the action part carries out the associated problem-solving steps. This complete process
is called a recognize-act cycle.
– The working memory contains the description of the current state of problems-solving and rule can
write knowledge to the working memory. This knowledge match and may fire other rules.
– If there is a new situation (state) generates, then multiple production rules will be fired together, this
is called conflict set. In this situation, the agent needs to select a rule from these sets, and it is called
a conflict resolution.
– Advantages of Production rule:
o The production rules are expressed in natural language.
o The production rules are highly modular, so we can easily remove, add or modify an
individual rule.
– Disadvantages of Production rule:
o Production rule system does not exhibit any learning capabilities, as it does not store the
result of the problem for the future uses.
o During the execution of the program, many rules may be active hence rule-based production
systems are inefficient.
4.7 Propositional Logic
Propositional logic (PL) is the simplest form of logic where all the statements are made by propositions.
A proposition is a declarative statement which is either true or false. It is a technique of knowledge
representation in logical and mathematical form.
Following are some basic facts about PL:
Propositional/Boolean logic as it works on 0 and 1.
In PL, we use symbolic variables to represent the logic, and we can use any symbol for a representing
a proposition, such A, B, C, P, Q, R, etc.
Propositions can be either true or false, but it cannot be both.
Propositional logic consists of an object, relations or function, and logical connectives.
These connectives are also called logical operators.
The propositions and connectives are the basic elements of the propositional logic.
Connectives can be said as a logical operator which connects two sentences.
A proposition formula which is always true is called tautology, and it is also called a valid sentence.
A proposition formula which is always false is called Contradiction.
A proposition formula which has both true and false values is called Contingency.
Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.
Syntax of propositional logic:
The syntax of propositional logic defines the allowable sentences for the knowledge representation.
There are two types of Propositions:
Atomic Proposition - are the simple propositions consists of a single proposition symbol.
These are the sentences which must be either true or false.
2+2 is 4, it is an atomic proposition as it is a true fact.
"The Sun is cold" is also a proposition as it is a false fact.
Compound proposition - are constructed by combining simpler or atomic propositions, using
parenthesis and logical connectives.
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
• It shows the simple relationship between joint and conditional probabilities. Here,
• P(A|B) is known as posterior, which we need to calculate, and it will be read as Probability of
hypothesis A when we have occurred an evidence B.
• P(B|A) is called the likelihood, in which we consider that hypothesis is true, then we calculate
the probability of evidence.
• P(A) is called the prior probability, probability of hypothesis before considering the evidence
• P(B) is called marginal probability, pure probability of an evidence.
• In the equation (a), in general, we can write P (B) = P(A)*P(B|Ai), hence the Bayes' rule can be
𝐏(𝐁|𝐀𝐢)𝐏(𝐀𝐢)
written as: P(Ai|B) = ∑ 𝐏(𝐀𝐢)𝐏(𝐁|𝐀𝐢) , Where A1, A2, A3,........, An is a set of mutually exclusive and
exhaustive events.
• Example-1:
• Question: what is the probability that a patient has diseases meningitis with a stiff neck? Assume
• A doctor is aware that disease meningitis causes a patient to have a stiff neck, and it occurs 80%
of the time. He is also aware of some more facts, which are given as follows:
• The Known probability that a patient has meningitis disease is 1/30,000.
• The Known probability that a patient has a stiff neck is 2%.
• Let a be the proposition that patient has stiff neck and b be the proposition that patient has
meningitis. , so we can calculate the following as:
• P(a|b) = 0.8 , P(b) = 1/30000 , P(a)= .02
• P(b/a) = (p(a/b)*p(b))/p(a) = (0.8*1/3000)/0.02 = 0.001333333.
• Hence, we can assume that 1 patient out of 750 patients has meningitis disease with
a stiff neck.
• Example-2:
• Question: From a standard deck of playing cards, a single card is drawn. The probability that the
card is king is 4/52, then calculate posterior probability P(King|Face), which means the drawn face
card is a king card.
• Solution:
face
P( )∗P(king)
king
• P(king/face)= …………. i
P(face)
4.11 Summery
4.12 Sample Questions
1. The process of capturing the inference process as Single Inference Rule is known as______
A) Generalized Modus Ponens C) Variables
B) Ponens D) Clause
2. Which algorithm takes two sentences as input and returns a Unifier?
A) Inference C) Hill-Climbing
B) Unify algorithm D) Depth-first search
3. First order logic Statements contains______
A) Predicate and Subject C) Predicate and Subject
B) Predicate and Preposition D) Subject and an Object
4. The Bayesian Network gives________
A) A complete description of the domain
B) Partial Description of the domain
C) A complete description of the domain
D) None of these
5. The probabilistic reasoning depends upon____________
A) Observations C) Likelihood
B) Estimation D) All of these
6. Hybrid Bayesian Network consist_____.
A) both discrete and continuous variable C) Continuous Variable only
B) Discrete variables only D) Discontinuous Variable
7. How do you represent “All dogs have tails”?
A) ۷x: dog(x) àhastail(x) C) ۷x: dog(y) àhastail(x)
B) ۷x: dog(x) àhastail(y) D) ۷x: dog(x) àhasàtail(x)
8. A production rule consists of
A) A set of Rule
B) A sequence of steps
C) Set of Rule & sequence of steps
D) Arbitrary representation to problem
9. _________ is used to demonstrate, on a purely syntactic basis, that one formula is a logical
consequence of another formula.
A) Deductive Systems
B) Inductive Systems
C) Reasoning with Knowledge Based Systems
D) Search Based Systems
10. What is the condition of variables in first-order literals?
A) Existentially quantified
B) Universally quantified
C) Both Existentially & Universally quantified
D) None of the mentioned
Chapter Five: Expert System
Objectives
o Introduction
o Applications of Expert Systems
o Expert Systems Technologies
o Benefits of Expert Systems
o Expert System Limitations
o The Architecture of Expert Systems
o Components of Expert Systems
o The Knowledge bases
o The Inference Engine
o The User Interface
o Development of Expert System
5.1 Introduction
The expert systems are the computer applications developed to solve complex problems in a particular
domain, at the level of extra-ordinary human intelligence and expertise. Some ccharacteristics of
expert system are High performance, Understandable, Reliable, and Highly responsive.
Capabilities of Expert Systems include
• Advising • Interpreting input
• Instructing and assisting human in decision • Predicting results
making • Justifying the conclusion
• Demonstrating • Suggesting alternative options to a
• Deriving a solution problem
• Diagnosing and Explaining
Expert Systems are incapable of
• Substituting human decision makers
• Possessing human capabilities
• Producing accurate output for inadequate knowledge base
• Refining their own knowledge
5.7 Questions
1. Which of the following is not a Characteristics of Expert Systems?
A. Understandable C. Unreliable
B. Highly responsive D. High performance
2. Which of the following is not a Capabilities of Expert Systems?
A. Advising C. Explaining
B. Demonstrating D. Expanding
3. Which of the following is Capabilities of Expert Systems?
A. Possessing human capabilities
B. Suggesting alternative options to a problem
C. Refining their own knowledge
D. Substituting human decision makers
4. Which of the following are Components of Expert Systems?
A. Knowledge Base C. User Interface
B. Inference Engine D. All of the above
5. Which of the following is incorrect application of Expert System?
A. Design Domain C. Knowledge Domain
B. Monitoring Systems D. Systems domain
6. Which of the following is incorrect Expert Systems Limitations?
A. Limitations of the technology C. Easy to maintain
B. Difficult knowledge acquisition D. High development costs
7. A ______ is nothing but an expert system without knowledge base?
A. Tools C. Expert System
B. shell D. knowledge
8. Which of the following strategies used by Inference Engine?
A. Forward Chaining C. Stable Chaining
B. Block Chaining D. Both A and B
9. In Expert System, Knowledge Acquisition means,
A. How to get required domain knowledge by the expert system
B. System maintenance
C. System implementation
D. None of the mentioned above
10. In expert system Forward Chaining, is a strategy to answer the question, "___".
A. What can happen previously? C. Both A and B
B. What can happen next? D. All of the mentioned above
Chapter Six: Learning Agents
Objectives
o Introduction
o Define learning agents, machine learning
o Discuss components of learning system.
o Types of machine learning and describe the algorithms for each learning types.
o Discuss about application of machine learning, pros and cons of machine learning.
o Define neural networks and compare with biological neurons
o ANN for linear equations
o Discuss about processing of ANN (Network Topology, Adjustments of Weights or Learning,
and Activation Functions)
o Compare and contrast feedforward network and feedbackward network and discuss its type.
o Define activation function, and its type (linear, bi-polar sigmoid, binary sigmoid).
o Application of ANN, Advantages and disadvantages of ANN
6.1 Introduction
Learning denotes changes in a system that enables the system more efficient next time. Learning is an
important feature of “intelligent”. Machine learning is the subfield of AI concerned with intelligent
systems that learn from experience and examples. It is the computational study of algorithms that
improve performance based on experience
Machine learning is particularly attractive in several real- l i f e problems because ofthe following
reasons:
• Some tasks cannot be defined well except by example
• Working environment of machines may not be known at design time
• Explicit knowledge encoding may be difficult and not available
• Environments change over time
• Biological systems learn
Recently, learning is widely used in a number of application areas including,
• Data mining and knowledge discovery
• Speech/image/video (pattern) recognition
• Adaptive control
• Autonomous vehicles/robots
• Decision support systems
• Bioinformatics
• WWW
Formally, a computer program is said to learn from experience E with respect to some class of
tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves
with experience E.
Thus a learning system is characterized by:
• task T
• experience E, and
• performance measure P
Components of learning system
• Learning Element makes changes to the system based on how it's doing
• Performance Element is the agent itself that acts in the world
• Critic tells the Learning Element how it is doing (e.g., success or failure) by comparing with a
fixed standard of performance
• Problem Generator suggests "problems" or actions that will generate new examples or
experiences that will aid in training the system further
6.2 Types of learning (machine learning)
• Machine learning enables a machine to automatically learn from data, improve performance from
experiences, and predict things without being explicitly programmed.
• Want to learn an unknown function f(x) = y, where x is an input example and y is the desired
output.
• Machine learning constructs or uses the algorithms that learn from historical data.
• Supervised
• Unsupervised
• Reinforcement
Supervised learning implies we are given a set of (x, y) pairs by a "teacher." The system is supplied
with a set of training examples consisting of inputs and corresponding outputs, and is required to
discover the relation or mapping between then, e.g. as a series of rules, or a neural network. Agent
learns a function from observing example input-output pairs
o Classification
o Regression
Unsupervised learning means we are only given the x’s. In either case, the goal is to estimate f.
The system is supplied with a set of training examples consisting only of inputs and is required to
discover for itself what appropriate outputs should be,
o Most common task is clustering – e.g. taxi agent notices “bad traffic days”
o Association rule learning
o If someone buys pen and book then he/she has the probability of buying bag
Clustering
Association
Reinforcement learning is a feedback-based learning method, in which a learning agent gets a
reward for each right action and gets a penalty for each wrong action.
The agent learns automatically with these feedbacks and improves its performance. In reinforcement
learning, the agent interacts with the environment and explores it. The goal of an agent is to get the
most reward points, and hence, it improves its performance. The robotic dog, which automatically
learns the movement of his arms, is an example of Reinforcement learning.
A. Decision tree algorithm
It is a classification and prediction tool having a tree like structure, where each internal node denotes
a test on an attribute, each branch represents an outcome of the test, and each leaf node (terminal
node) holds a class label. In Business Intelligence, entropy is a measure of the randomness in the
information being processed. The higher the entropy, the harder it is to draw any conclusions from
that information.
Information gain can be defined as the amount of information gained about a random variable or
signal from observing another random variable. It can be considered as the difference between the
entropy of parent node and weighted average entropy of child nodes.
Gini impurity is a measure of how often a randomly chosen element from the set would be
incorrectly labeled if it was randomly labeled according to the distribution of labels in the subset.
Gini impurity is lower bounded by 0, with 0 occurring if the data set contains only one class.
There are many algorithms there to build a decision tree. They are
CART (Classification and Regression Trees) — This makes use of Gini impurity as metric.
ID3 (Iterative Dichotomiser 3) — This uses entropy and information gain as metric.
B. Regression algorithm
Regression analysis is one of the most commonly used BI techniques in social and behavioural
sciences as well as in physical sciences which involves identifying and evaluating the relationship
between a dependent variable and one or more independent variables, which are also called predictor
or explanatory variables.
- Independent variables are characteristics that can be measured directly; these variables are also called
predictor or explanatory variables used to predict or to explain the behavior of the dependent
variable.
- Dependent variable is a characteristic whose value depends on the values of independent variables.
6.2 Neural Networks
Artificial neural networks are among the most powerful learning models. They have the versatility to
approximate a wide range of complex functions representing multi-dimensional input-output maps.
Neural networks also have inherent adaptability, and can perform robustly even in noisy environments.
An Artificial Neural Network (ANN) is an information processing paradigm that is inspired by the way
biological nervous systems, such as the brain, process information. The key element of this paradigm
is the novel structure of the information processing system.
It is composed of large number of highly interconnected simple processing elements (neurons)
working in unison to solve specific problems. ANNs, like people, learn by example. An ANN is
configured for a specific application, such as pattern recognition or data classification, through a learning
process. Learning in biological systems involves adjustments to the synaptic connections that exist
between the neurons. This is true of ANNs as well. ANNs can process information at a great speed
owing to their highly massive parallelism.
Neural networks, with their remarkable ability to derive meaning from complicated or imprecise data,
can be used to extract patterns and detect trends that are too complex to be noticed by either humans or
other computer techniques. A trained neural network can be thought of as an "expert" in the category
of information it has been given to analyse. This expert can then be used to provide projections given
new situations of interest and answer "what if" questions. Other advantages include:
o Adaptive learning: An ability to learn how to do tasks based on the data given for training or initial
experience.
o Self-Organisation: An ANN can create its own organisation or representation of the information it
receives during learning time.
o Real Time Operation: ANN computations may be carried out in parallel, and special hardware
devices are being designed and manufactured which take advantage of this capability.
o Fault Tolerance via Redundant Information Coding: Partial destruction of a network leads to the
corresponding degradation of performance. However, some network capabilities may be retained
even with major network damage.
6.3 Biological neurons
A nerve cell neuron is a special biological cell that processes information. According to an estimation,
there are huge number of neurons, approximately 1011 with numerous interconnections, approximately
1015. A typical neuron consists of the following four parts
• Dendrites − They are tree-like branches, responsible for receiving the information from other
neurons it is connected to. In other sense, we can say that they are like the ears of neuron.
• Soma − It is the cell body of the neuron and is responsible for processing of information, they
have received from dendrites.
• Axon − It is just like a cable through which neurons send the information.
• Synapses − It is the connection between the axon and other neuron dendrites.
6.4 ANN for linear equations
• To depict the basic operation of a neural net, ·consider a set of neurons, say X1 and X2,
transmitting signals to another neuron, Y. Here X1, and X2 are input neurons, which transmit
signals, and Y is the output neuron, which receives signals. Input neurons X1, and X2 are
connected to the output neuron Y, over a weighted
• Interconnection links (W1, and W2) as shown in the figure. For the above simple neuron net
architecture, the net input has to be calculated in the following way:
• Yin=X1W1+X2W2
where x1 and x2 are the activation of the input neurons X1, and X2, i.e., the output of input signals.
The output y of the output neuron Y can be obtained applying activation over net input, i.e., the
function of the net input:
• Y=F (yin)
• The function robe applied over the net input is called as activation function.
6.5 Processing of ANN
Processing of ANN depends on the following
- Network Topology
- Adjustments of Weights or Learning
- Activation Functions
11. A network topology
It is the arrangement of a network along with its nodes and connecting lines.
- Feedforward Network - It is a non-recurrent network having processing units/nodes in layers
and all the nodes in a layer are connected with the nodes of the previous layers. The connection
has different weights upon them. There is no feedback loop means the signal can only flow in
one direction, from input to output. It may be divided into the following two types −
A. Single layer feedforward network − The concept is of feedforward ANN aving only one
weighted layer. In other words, we can say the input layer is fully connected to the output layer.
B. Multilayer feedforward network − The concept is of eedforward ANN having more than one
weighted layer. As this network has one or more layers between the input and the output layer, it
is called hidden layers.
- feedback network has feedback paths, which means the signal can flow in both directions
using loops. This makes it a non-linear dynamic system, which changes continuously until it
reaches a state of equilibrium. It may be divided into the following types : Recurrent networks
− They are feedback networks with closed loops. Following are the two types of recurrent
networks.
A. Fully recurrent network − It is the simplest neural network architecture because all nodes are
connected to all other nodes and each node works as both input and output.
B. Jordan network − It is a closed loop network in which the output will go to the input again as
feedback as shown in the following diagram.
– Bi-ploar sigmoid
o Define NLP
o NLP components and its implication
o Pros and Cons of NLP
o Phases of NLP
o Difficulty of NLP
o Application of NLP
o Define Robotics and its application in details
o Define locomotion in robotics and discuss each types
7.1 Natural language processing
NLP stands for Natural Language Processing, which is a part of Computer Science, Human language,
and Artificial Intelligence. It is the technology that is used by machines to understand, analyze,
manipulate, and interpret human's languages. It helps developers to organize knowledge for
performing tasks such as translation, automatic summarization, Named Entity Recognition (NER),
speech recognition, relationship extraction, and topic segmentation.
Advantages of NLP
Helps users to ask questions about any subject and get a direct response within seconds.
Helps computers to communicate with humans in their languages.
It is very time efficient.
Most of the companies use NLP to improve the efficiency of documentation processes,
accuracy of documentation, and identify the information from large databases.
Disadvantages of NLP
NLP may not show context.
NLP is unpredictable
NLP may require more keystrokes.
NLP is unable to adapt to the new domain, and it has a limited function that's why NLP is
built for a single and specific task only.
Components of NLP
1. Natural Language Understanding (NLU)
Natural Language Understanding (NLU) helps the machine to understand and analyses
human language by extracting the metadata from content such as concepts, entities,
keywords, emotion, relations, and semantic roles.
NLU mainly used in Business applications to understand the customer's problem in
both spoken and written language.
Tasks -
• It is used to map the given input into useful representation.
• It is used to analyze different aspects of the language.
2. Natural Language Generation (NLG)
Natural Language Generation (NLG) acts as a translator that converts the computerized
data into natural language representation. It mainly involves Text planning, Sentence
planning, and Text Realization.
The NLU is difficult than NLG.
Difference between NLU and NLG
NLU is the process of reading and interpreting language.
NLG is the process of writing or generating language.
NLG - It produces non-linguistic outputs from natural language inputs.
NLG - It produces constructing natural language outputs from non-linguistic inputs.
Phases of NLP