BIT 4202 Artificial Intelligence Module PDF
BIT 4202 Artificial Intelligence Module PDF
BIT 4202 Artificial Intelligence Module PDF
Kenya
Purpose: To explore the idea that computers can be programmed to emulate “human-like”
intelligence in Business Information Technology.
Objectives: By the end of the course unit a learner shall be able to:
Give an overview of0 the main issues of Artificial Intelligence (AI) in Business Information
Technology (BIT)
Define the main sub-disciplines of AI in BIT.
Explain AI techniques
Apply knowledge representations techniques.
Develop simple AI programmes.
Apply methods used in AI programmes to make the programme behave intelligently in
particular heuristic planning.
Course Content
Introduction to artificial Intelligence; Definition of AI, Problems, Problem space and search
Overview of AI application in areas of business
Problem Solving, Searching and Controls Strategies
Problem Representation; Choosing a problem, Space
Search, search problem and closed world assumptions.
Search depth first and breath first techniques with back tracking.
Structures and strategies for state space search, heuristic search.
Introduction to semantic nets, rules, scripts, values and production systems.
Knowledge Representation Network representation, Structured representations, Type
hierarchies, Inheritance
AI languages and prolog; Requirements for AI languages, Introduction to prolog,
Understanding natural languages and speech recognition, AI programming language e.g.
LISP/Prolog
- Advanced representation in prolog.
Machine learning; Definition and concepts, Learning models, Pattern recognition, Intelligence
agents/learning agents
Assessments: A learner is assessed through ; Continuous Assessment Tests (CATs) (30%), End
of semester examination (70%)
CHAPTER 3 ................................................................................................................................................ 35
Problem Solving, Search and Control Strategies ..................................................................................... 35
3.1 Introduction ............................................................................................................................................. 35
3.2. Problem Description .............................................................................................................................. 36
3.3. Steps in Solving a Problem .................................................................................................................... 37
CHAPTER FOUR....................................................................................................................................... 66
Knowledge Representation: Issues ............................................................................................................ 66
4.1. Knowledge and Representation........................................................................................................ 66
4.2. Knowledge ....................................................................................................................................... 66
4.2.1. Knowledge Model (Bellinger 1980) ................................................................................................ 67
Chapter Objectives
By the end of this chapter the learner should be able to;
Define Artificial Intelligence (AI).
Explain the Goals of AI,
Describe the AI Approaches
Explain AI Techniques
Describe the Branches of AI
Explain the Applications of AI.
Artificial intelligence (AI) is a broad field of computing that tries to understand the human
intelligence and using that understanding build agents or entities that can act intelligently.
Artificial Intelligence (AI) could be defined as the ability of computer software and hardware to
do those things that we, as humans, recognize as intelligent behavior. Traditionally those things
include such activities as:
Searching: finding “good” material after having been provided only limited direction,
especially from a large quantity of available data.
Surmounting constraints: finding ways that something will fit into a confined space, taking
apart or building a complex object, or moving through a difficult maze.
Recognizing patterns: finding items with similar characteristics, or identifying an entity when
not all its characteristics are stated or available.
Making logical inferences: drawing conclusions based upon understood reasoning methods
such as deduction and induction.
A sophisticated technology is then a cumulative building of learned and well-refined skills and
processes. In the AI area, these processes have manifested themselves in a number of well-
recognized and maturing areas including Neural Networks, Expert Systems, Automatic Speech
Recognition, Genetic Algorithms, Intelligent Agents, Natural Language Processing, Robotics,
Logic Programming, and Fuzzy Logic.
AI is also defined as getting of computers to do things that seem to be intelligent. The hope is that
more intelligent computers can be more helpful to us-better able to respond to our needs and
wants, and more clever about satisfying them.
However, having said that, there are many tasks which we might reasonably think require
intelligence - such as complex arithmetic - which computers can do very easily. Conversely, there
are many tasks that people do without even thinking - such as recognising a face - which are
extremely complex to automate. AI is concerned with these difficult tasks, which seem to require
complex and sophisticated reasoning processes and knowledge.
People might want to automate human intelligence for a number of different reasons:-
1. To understand human intelligence better. For example, we may be able to test and refine
psychological and linguistic theories by writing programs which attempt to simulate aspects of
human behaviour.
2. Another reason is simply so that we have smarter programs. We may not care if the programs
accurately simulate human reasoning, but by studying human reasoning we may develop
useful techniques for solving difficult problems.
1.3. Goals of AI
AI is a field that overlaps with computer science rather than being a strict subfield. Different areas of AI
are more closely related to psychology, philosophy, logic, linguistics, and even neurophysiology. The goal
of AI is to develop computers that can think, as well as see, hear, walk, talk, and feel. A major thrust of AI
is the development of computer functions normally associated with human intelligence, such as reasoning,
learning, and problem solving. From the definition of AI; there are four possible goals;-
(A) Systems that think like humans (B). Systems that think rationally
The exciting new effort to make computers The study of mental faculties through the use of
think . . . machines with minds, in the full computational models" (Charniak and McDermott,
and literal sense" (Haugeland, 1985) 1985)
"[The automation of] activities that we associate "The study of the computations that make it possible
with human thinking, activities such as to perceive, reason, and act" (Winston, 1992)
decision-making, problem solving, learning
..."(Bellman, 1978)
(C) Systems that act like humans (D). Systems that act rationally
"The art of creating machines that perform "A field of study that seeks to explain and emulate
functions that require intelligence when intelligent behavior in terms of computational
performed by people" (Kurzweil, 1990) processes" (Schalkoff, 1 990)
"The study of how to make computers do things "The branch of computer science that is concerned
at which, at the moment, people are better" with the automation of intelligent behavior" (Luger
(Rich and Knight, 1 991 ) and Stubblefield, 1993)
Table 1. AI Categorization
General AI goals
Replicate human intelligence
Solve knowledge intensive task.
Make an intelligent connection between perception and action.
Enhance human-human, human-computer and computer to computer interaction/ communication
The approaches used in AI are based on the goals of the computational, model, and the basis for evaluating
performance of the system.
Human Being Rationally
Think (1) Cognitive science approach (2) Laws of thought approach
(
Example
3 rooms contain: a person, a computer, and an interrogator.
The interrogator can communicate with the other 2 by teletype (to avoid the machine imitate the
appearance or voice of the person).
The interrogator tries to determine which is the person and which is the machine.
The machine tries to fool the interrogator to believe that it is the human, and the person also tries
to convince the interrogator that it is the human.
If the machine succeeds in fooling the interrogator, then conclude that the machine is intelligent.
2. Biology-Inspired AI Techniques
a) Neural Networks
b) Reinforcement learning
c) Genetic Algorithms
Constraint Satisfaction
Most algorithms for solving CSP search systematically through possible assignment of values.
a) CSP algorithm guarantee to fins solution if one exists or to provide that the problem is
unsolvable.
b) The disadvantage is that they take a very long time to do so
Generate and test method: It first guesses the solution and then test whether this solution is correct,
means solution satisfies the constraint.
This paradigm involves two processes: generate to enumerate possible solutions and test to evaluate
each possible solution
The algorithm is
Goal reduction procedures are special case of the procedural representation of knowledge in AI.
The process involves the Hierarchical sub-division of goals into sub goals, until the sub-goals which
have an immediate solution are reached and are said goal has been satisfied.
Goal- reduction process is illustrated in form a tree drawn upside down
Goal levels: Higher-level goals are higher in the tree and lower-level goals are lower in the tree.
Arcs are directed from a higher-to- lower level of node represent the reduction of the higher-level to
lower level sub goal.
Node at the bottom of the tree represent irreducible action goals
A tree/graph structure can represent relations between goals and sub-goals, alternative sub-goals and
conjoint sub-goals.
Goal-reduction process is illustrated in the form of “AND/OR” tree drawn upside-down as shown
below;
Tree Searching
Many problems can be described in the form of a search tree. A solution to the problem is obtained by
finding a path through this tree. A search through the entire tree, until a satisfactory path is found, is called
exhaustive search.
Tree search strategies
Rule Base
Contains rules; each rule is a step in problem solving.
Rules are domain knowledge and modified only from outside
Rules syntax is
IF condition THEN action
If the condition are matched to the working memory and if fulfilled then the rule may be fired.
Rule based actions are: Add, Remove and Modify
Interpreter
It is the domain independent reasoning mechanism for RBS.
It selects rule from rule base and apply by performing actions.
Operates on a cycle.
1. Retrieval: Finds the rule that matches the current WM.
2. Refinement: Prunes, records and resolves conflicts.
3. Executes the actions of the rules in the Conflict set and then applies the rule by performing actions.
They are part of evolutionary computing and a rapidly growing area of AI.
They are implemented as computer simulation where techniques are inspired by evolutionary biology.
Mechanism of biological evolution.
Every organism has a set of rules.
The genes are connected together into long string called chromosomes.
Each gene represent a specific trait(feature).
The gene and their settings are referred as an organism's, Genotype
When two organism mate they share their genes
A gene can mutate and form a new trait in and organism.
GAs provide a way of solving problems by mimicking processes, the nature uses, Selection, Cross
over, Mutation and accepting to evolve a solution to problem.
(
Logic is a language for reasoning; a collection of rules used while doing logical reasoning.
Types of logic:
Preposition logic- logic of sentences.
Predicative logic- Logic of objects.
Fuzzy logic- dealing with fuzziness
Temporal logic, etc.
Preposition logic and Predicate logic are fundamental to all logic.
Preposition logic.
Prepositions are "sentences"; either true or false but not both. A sentence is smallest unit in propositional
logic. If proposition is true, then truth value is "true"; else "false". Example: Sentence "Grass is green";
Truth value "true"; Proposition is "yes".
Predicate Logic.
Predicate is a function may be true or false for arguments. Predicate logical are rules that govern
quantifiers. Predicative logic is propositional logic added with quantifiers.
Examples:
The car Tom is driving is blue
The sky is blue
The cover of this book is blue.
Predicate: is blue, give a name B;
Sentence: represented as B(x); read B(x) as X is blue
Object: represented as X.
Definition: The science that concerns the description or classification (recognition) of measurement.
Pattern recognition problem
Machine vision-Visual inspection.
Character recognition-mail sorting, processing bank cheques.
Computer aided diagnosis- Medical image.
Speech recognition- Human computer interaction, access.
Knowledge Representation
Knowledge representation is crucial. One of the clearest results of artificial intelligence research so far is
that solving even apparently simple problems requires lots of knowledge. Knowledge is a collection of
facts. To manipulate these facts by program, a suitable representation is required. Different types of
knowledge require different type of representation;
Semantic networks- A graph where the nodes represent concepts and the arcs represent binary
relationships between concepts.
Frames and Scripts: Consists of a data structure which represents a sequence of events for a given
type occurrence.
Production rules: Consist of a set of rule about a behaviour, a production consists two parts: a
Precondition (IF) and an action (THEN), if a production's precondition matches the current state of
the world, then the production is said to be triggered.
Inference
Inference: The act or process of deriving a conclusion based on solely on what one already knows: It is
deduction of new facts from old ones.
Deductive Inference
It is never false; inference is true if premise is true. A traditional logic is based on deduction; it is a method
of exact inference; there is no probability of mistake if rules are followed exactly. The information
required is complete, precise and consistent. A logic is monotonic, if the truth of a proposition does not
change when new information are added to the system.
Inductive Inference
It may be correct or incorrect inference, because in real world the information is incomplete, inexact and
inconsistent. A logic is inductive, also called induction or inductive reasoning, if the process in which the
premises of an argument are believed to support the conclusion but do not ensure it.
A logic is non-monotonic, if the truth of a proposition may change when new information is added to or an
old information is deleted from the system. The reasoner draw conclusions tentatively reserving the right
to retract them in the light of further information. Example: when we hear of a bird, we human infer that
bird can fly, but this conclusion can be reserved when we hear that it is a penguin; the bird penguin cannot
fly.
Planning
A plan is a representation of a course of action. Planning is a problem solving technique. It applies
reasonable series of actions to accomplish a goal. Planning programs: Start with facts about the world,
particularly,
Facts about the effects of actions.
Facts about the particular situation.
Statement of a goal
Benefits of planning
Reducing search
Resolving goal conflicts.
Providing a basis for error recovery
Strategy for planning: It is a sequence of action. From facts the program generate a strategy for achieving
the goal
1.7. Applications of AI
Game playing
Interactive computer games is an emerging area in which the goals of human-level AI are pursued.
Speech Recognition
A process of converting a speech signal to a sequence of words. In the 1990s, computer speech recognition
reached a practical level for limited purposes. Using computers recognizing speech is quite convenient, but
most users find the keyboard and the mouse still more convenient. The typical usages are voice dialing
(Call home), call routing (collect call), simple data entry (credit card number). The Voice verification or
Speaker recognition are a related process. The spoken language interface PEGASUS in the American
Airlines' EAASY SABRE reservation system, allows users to obtain flight information and make
reservations over the telephone.
Computer Vision
It is a combination of concepts, techniques and ideas from Digital Image Processing, Pattern Recognition,
Artificial Intelligence and Computer Graphics. The world is composed of 3-D objects, but the inputs to the
human eye and computers' TV cameras are 2-D. Some useful programs can work solely in 2-D, but full
Expert Systems
Systems in which human expertise is held in the form of rules which enable the system to diagnose
situations without the human expert being present. A Man-machine system with specialized problem-
solving expertise. The "expertise" consists of knowledge about a particular domain, understanding of
problems within that domain, and "skill" at solving some of these problems. A “knowledge engineer''
interviews experts in a certain domain and tries to embody their knowledge in a computer program for
carrying out some task. One of the first expert systems was MYCIN in 1974, which diagnosed
bacterial infections of the blood and suggested treatments. Expert systems rely on knowledge of human
experts, e.g.
Diagnosis and Troubleshooting - deduce faults and suggest corrective actions for a malfunctioning
device or process
Planning and Scheduling – analyzing a set of goals to determine and ordering a set of actions taking
into account the constraints; e.g. airline scheduling of flights
Financial Decision Making - advisory programs assists bankers to make loans, Insurance companies to
assess the risk presented by the customer, etc.
Process Monitoring and Control - analyze real-time data, noticing anomalies, predicting trends, and
controlling optimality and do failure correction.
AI applications are also often written in standard languages like C++ and languages designed for
mathematics, such as MATLAB and Lush.
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Define Business Intelligence
Describe the Application of AI in Business
Explain the Pros and Cons of AI in Business
2.1. Introduction
The potential applications of Artificial Intelligence are abundant. They stretch from the military for
autonomous control and target identification, to the entertainment industry for computer games and robotic
pets, to the big establishments dealing with huge amounts of information such as hospitals, banks and
insurances, we can also use AI to predict customer behavior and detect trends.
AI is a broad discipline that promises to simulate numerous innate human skills such as automatic
programming, case-based reasoning, decision-making, expert systems, natural language processing, pattern
recognition and speech recognition etc. AI technologies bring more complex data-analysis features to
existing applications
Business applications utilize the specific technologies mentioned earlier to try and make better sense of
potentially enormous variability (for example, unknown patterns/relationships in sales data, customer
buying habits, and so on). However, within the corporate world, AI is widely used for complex problem-
solving and decision-support techniques in real-time business applications. The business applicability of
AI techniques is spread across functions ranging from finance management to forecasting and product
Definition:
“Business intelligence (BI) is a broad category of applications and technologies for gathering, storing,
analysing, and providing access to data to help enterprise users make better business decisions. BI
applications include the activities of decision support systems, query and reporting, online analytical
processing (OLAP), statistical analysis, forecasting, and data mining.” (WHATIS?COM, 2001, )
Enterprises that utilize AI-enhanced applications are expected to become more diverse, as the needs for the
ability to analyze data across multiple variables, fraud detection and customer relationship management
emerge as key business drivers to gain competitive advantage.
Optimal scheduling of jobs on equipment, without the use of computer software, is a truly difficult
undertaking. Performing planning using the "Deterministic Simulation Method" will provide you with
schedules that will indicate job loads per equipment. Even in the case limited to a single piece of
equipment, as the number of jobs to schedule on that equipment increases, finding the right solution in the
"Possible Solutions Set" becomes next to impossible. And in the real world, the difficulties arising from
the large size of the solutions set due to the recipes formed by jobs, equipment and products, and shaped by
the technological restrictions, as well as the complexity in finding a close to ideal solution, are readily
apparent.
Advantages
• View your best product runs and the corresponding settings.
• Increase efficiency and quality by using optimal settings from past production.
• Artificial Intelligence can optimize your schedule beyond normal human capabilities.
• Increase productivity by eliminating downtime due to unpredictable changes in the schedule.
In the field of Finance, artificial intelligence has long been used. Some applications of Artificial
Intelligence are
• Credit authorization screening
• Mortgage risk assessment
• Project management and bidding strategy
• Financial and economic forecasting
• Risk rating of exchange-traded, fixed income investments
• Detection of regularities in security price movements
• Prediction of default and bankruptcy
• Security/and or Asset Portfolio Management
Artificial intelligence types used in finance include neural networks, fuzzy logic, genetic algorithms, expert
systems and intelligent agents. They are often used in combination with each other.
High-tech data mining can give companies a precise view of how particular segments of the customer base
react to a product or service and propose changes consistent with those findings. In addition to further
exploring customers" buying patterns, analytics could help companies react much more quickly to the
marketplace. Intelligent agents could let companies make real-time changes to marketing campaigns.
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Explain problem solving in AI
o Explain the AI. Search and Control Strategies
o Describe AI Exhaustive Strategies
o Describe AI Heuristic Search Techniques
(
3.1 Introduction
Researchers in artificial intelligence have segregated the AI problems from the non-AI problems.
Generally, problems, for which straightforward mathematical / logical algorithms are not readily available
and which can be solved by intuitive approach only, are called AI problems.
For solving an AI problem, one may employ both artificial intelligence and non-AI algorithms. An obvious
question is: what is an AI algorithm? Formally speaking, an artificial intelligence algorithm generally
means a non-conventional intuitive approach for problem solving. The key to artificial intelligence
approach is intelligent search and matching. In an intelligent search problem / sub-problem, given a goal
(or starting) state, one has to reach that state from one or more known starting (or goal) states.
Problems dealt with in artificial intelligence generally use a common term called 'state'. A state represents
a status of the solution at a given step of the problem solving procedure. The solution of a problem, thus, is
a collection of the problem states. The problem solving procedure applies an operator to a state to get the
next state. Then it applies another operator to the resulting state to derive a new state. The process of
applying an operator to a state and its subsequent transition to the next state, thus, is continued until the
goal (desired) state is derived.
An important aspect of intelligence is goal-based problem solving. The solution of many problems (e.g.
noughts and crosses, timetabling, chess) can be described by finding a sequence of actions that lead to a
desirable goal. Each action changes the state and the aim is to find the sequence of actions and states that
lead from the initial (start) state to a final (goal) state. Problem solving is fundamental to many AI-based
applications. Problem solving is a process of generating solutions from observe data.
Problem solving, particularly in artificial intelligence, may be characterized as a systematic search through
a range of possible actions in order to reach some predefined goal or solution. Problem-solving methods
divide into special purpose and general purpose. A special-purpose method is tailor-made for a particular
Problem solving relates to analysis of AI. It may be characterized as a Systematic search through a range
of possible actions to reach some predefined goal or solution. Problem solving methods are categorized as
special purpose and general purpose
Special purpose methods is method designed to solve a particular problem (tailor made for a
particular problem). It exploits specific features of the situation in which the problem is embedded
General purpose method applied to a wide range of problems. It is a step-by-step, or incremental,
reduction of the difference between current states and final goal. Example "means-end analysis"
In building a system to solve a particular problem; the steps below are followed.
Define the problem precisely- find input situations as well as final situations for accepting solution
to the problem.
Analyze the problem- find few important features that may have impact on the appropriateness of
various possible techniques for solving the problem.
Isolate and represent task knowledge necessary to solve the problem
Choose the best problem solving techniques and apply to the particular problem
Others includes;
7. Problem Solution: Specify one or more state that would be acceptable solution to the problem called
goals. In the state space, a solution is a path from initial state to a goal state or sometimes just a goal
state.
A solution cost function assigns a numeric cost to each path;
It also gives the cost of applying the operator to the state.
A solution quality is measured by the path cost function; and an optimal solution has the lowest
cost among all solution.
The solution may be any or optimal or all.
The importance of cost depends on the problem and the type of solution asked.
The root of a search tree is a search node which corresponds to the initial state. A node is a data structure
with five components
STATE: the state in the state space to which the node corresponds.
PARENT: the node in the search tree that generated this node.
ACTION: the action that was applied to the parent to generate the node.
PATH-COST: the cost, traditionally denoted by g(n), of the path from the initial state to the node, as
indicated by the parent pointers and;
DEPTH: the number of steps along the path from the initial state.
The first step is to test whether it is goal state. If it is not a goal state, then it’s current state is expanding by
applying the successor function to the current state, thereby generating a new set of states. The choice of
which node to expand during the search is determined by the search strategy.
Complexity is the measure of the performance of the Algorithm, which is measured based on the
internal factor of space and time.
Computational Complexity: This measure the resources in terms of Time and space: Example If A is
an algorithm that solves a decision problem f, then run time of A is the number of steps take on the
input of length n
Time Complexity: T(n) of the decision problem f is the time of best Algorithm A for f
Space complexity S(n) the decision problem f is the amount of memory used by the best
Algorithm A for f
Stacks: A stack maintain the order Last-in first-Out (LIFO) The items are a sequence and piled one on top
of the other.
Queue: An ordered list which work as a First-In First-Out (FIFO).The items are in the sequence but has
restrictions on how items are added to and removed from the list.
A queue has two ends.
All insertions (enqueue ) take place at one end, called Rear or Back
All deletions (dequeue) take place at other end, called Front.
If Queue has a[n] as rear element then a[i+1] is behind a[i] , 1 < i <= n.
All operation take place at one end of queue or the other.
The Dequeue operation removes the item at Front of the queue.
The Enqueue operation adds an item to the Rear of the queue.
Items enter Queue at Rear and
The algorithms that use heuristic functions are called heuristic algorithms.
Heuristic algorithms are not really intelligent; they appear to be intelligent because they achieve better
performance.
A good heuristic will make an informed search dramatically out-perform any uninformed search. For
example, the Traveling Salesman Problem (TSP) where the goal is to find a good solution instead of
finding the best solution. Some prominent intelligent search algorithms are stated below.
1. Generate and Test Approach: This approach concerns the generation of the state-space from a
known starting state (root) of the problem and continues expanding the reasoning space until
the goal node or the terminal state is reached. In fact after generation of each and every state,
the generated node is compared with the known goal state. When the goal is found, the
algorithm terminates. In case there exist multiple paths leading to the goal, then the path
having the smallest distance from the root is preferred. The basic strategy used in this search
is only generation of states and their testing for goals but it does not allow filtering of states.
2. Hill Climbing Approach: Under this approach, one has to first generate a starting state and
measure the total cost for reaching the goal from the given starting state. Let this cost be f.
While f = a predefined utility value and the goal is not reached, new nodes are generated as
children of the current node. However, in case all the neighborhood nodes (states) yield an
identical value of f and the goal is not included in the set of these nodes, the search algorithm
is trapped at a hillock or local extrema. One way to overcome this problem is to select
randomly a new starting state and then continue the above search process. While proving
trigonometric identities, we often use Hill Climbing, perhaps unknowingly.
3. Heuristic Search: Classically heuristics means rule of thumb. In heuristic search, we generally
use one or more heuristic functions to determine the better candidate states among a set of
legal states that could be generated from a known state. The heuristic function, in other words,
measures the fitness of the candidate states. The better the selection of the states, the fewer
will be the number of intermediate states for reaching the goal. However, the most difficult
Example
Find route from Start to Goal state.
Consider the vertices as city and the edges as distances.
Example
1. Initial State: (S)
2. Operator or successor function: for any state x, returns s(x), the set of states reachable from x with
one action.
3. State space: all states reachable from initial by any sequence of actions.
4. Path: sequence through state space.
5. Path cost: function that assigns a cost to a path; cost of a path is the sum of costs of individual
actions along the path.
6. Goal state : (G)
7. Goal test: test to determine if at goal state.
if h(n) _ actual cost of shortest path from node n to goal then h(n) is an under estimate
Some widely used control strategies for search are stated below.
1. Forward search: Here, the control strategies for exploring search proceeds forward from initial state to
wards a solution; the methods are called data- directed.
2. Backward search: Here, the control strategies for exploring search proceeds backward from a goal or
final state towards either a soluble sub problem or the initial state; the methods are called goal directed.
3. Both forward and backward search: Here, the control strategies for exploring search is a mixture of
both forward and backward strategies .
4. Systematic search: Where search space is small, a systematic (but blind) method can be used to explore
the whole search space. One such search method is depth-first search and the other is breath-first
search.
Search Chaining
Chaining refers to sharing conditions between rules, so that the same condition is evaluated once for all
rules. When one or more conditions are shared between rules, they are considered "chained." Chaining are
of two types:
1. Forward chaining is called data-driven and
2. Backward chaining is called query-driven.
Activation rules: Forward and Backward chaining are the two different strategies for activation of rules in
the system. Forward and Backward chaining are techniques for drawing inference from rule based.
The Breadth-first search (BFS) and depth-first search (DFS) are the foundation for all other search
techniques.
Other include; Depth-limited search, uniform-cost search and Bi-directional search
(
3.10.1. Breadth-First Search (BFS) Strategy
The search generates/ expands all nodes at a particular level/depth in the search tree before any node at
the next level is expanded.
The search systematically proceeds tasting each node that is reachable from a parent node before it
expands to any child of those nodes. The control engine guarantees that the space of possible moves is
systematically examined.
The search terminates when a solution is found and the test returns true.
Breadth-First search
The search systematically proceeds to some depth, before another path is considered.
If the maximum depth of the search tree is three, then if this limit is reached and if the solution has not
been found, then the search backtracks to the previous level and explores any remaining alternatives at
this level.
The systematic backtracking procedure ensures that all the possibilities available are explored.
It explores a path all the way to a leaf before backtracking and exploring another path.
This strategy does not guarantee that the optimal solution has been found.
In this strategy, search reaches a satisfactory solution more rapidly than breadth first, an advantage
when the search space is large.
If the tree is very deep and the maximum depth searched is less then the maximum depth of the tree,
then this procedure is "exhaustive modulo of depth” that has been set.
Requires moderate memory space
Examples
Best-first search: an instance of the general TREE-SEACH or GRAPH-SEARCH algorithm in which
a node is selected for expansion based on an evaluation function f (n). The node with the lowest
evaluation is selected for expansion, because the evaluation measures distance to the goal.
Greedy Best-first search: the search tries to expand the node that is closest to the goal, on the grounds
that this is likely to lead to a solution quickly. It evaluates the modes by using the heuristics function:
f(n) = h(n).
A* search: minimizes the total estimated solution cost. It evaluates nodes by combining g(n), the cost
to reach the node, and h(n), the cost to get from the node to the goal.
(Examples: 8-puzzle
Stat space: Configuration of 8-tiles on the board.
Initial state: any Configuration
Goal: tiles in a specific order.
8-puzzle
Constraint is a logical relation among variables.The constraints relate objects without precisely specifying
their positions; moving any one, the relation is still maintained.
For n = 8 queens on a standard chess board (8 × 8), such that no queen can attack any other queen, the
puzzle has 92 distinct solutions. Humans would find it hard to solve N-Queens puzzle while N becomes
more. Example: The possible number of configurations are :
1. For 4-Queens there are 256 different configurations.
2. For 8-Queens there are 16,777,216 configurations.
3. For 16-Queens there are 18,446,744,073,709,551,616 configurations.
4. In general, for N - Queens there are we have N configurations.
5. For N = 16, This would take about 12,000 years on a fast modern machine.
How do we solve such problems? Three computer based approaches or models are stated below. They are:
Generate and Test (GT) ,
Generate and Test (GT) : n = 4 Queens puzzle
One possible solution is to systematically try every placement of queens until we find a solution. The
process is known as "Generate and Test".
Examples of Generate and Test conditions for solutions:
Backtracking (BT)
Backtracking (BT): n = 4 Queens puzzle
Backtracking is similar to a depth-first search but uses even less space, keeping just one current solution
state and updating it.
During search, if an alternative does not work, the search backtracks to the choice point, the place
which presented different alternatives, and tries the next alternative.
When the alternatives are exhausted, the search returns to the previous choice point and tries the
next alternative there.
If there are no more choice points, the search fails.
This is usually achieved in a recursive function where each instance takes one more variable and
alternatively assigns all the available values to it, keeping the one that is consistent with subsequent
recursive calls.
Backtracking is most efficient technique for problems, like n – Queens problem. An example below
illustrates to solve N = 4 Queens problem.
We need to find solution to such problems satisfying all constraints. Like most problems in artificial
intelligence (AI), the constraint Satisfaction problems (CSPs) are solved through search.
The formal definition of a CSP involves variables, their domains, and constraints. A constraint network is
defined by
a set of variables, V1 , V 2, . . . . , Vn,
a domain of values, D1 , D2, . . . . , Dn for each variable; all variables Vi have a value in their
respective domain Di.
a set of constraints, C1 , C2, . . . . , Cm ; a constraint Ci restricts the possible values in the domain of
some subset of the variables.
Problem : Is there a solution of the network, i.e., an assignment of values to the variables such that all
constraints are satisfied ?
A solution to a CSP is an assignment of every variable some value in its domain such that every
constraint is satisfied. Each assignment of a variable to a variable must be consistent i.e must not
violate any of the constraints.
Example :
1. Constraints
A constraint is a relation between a local collection of variables.
The constraints restrict the values that these variable can simultaneously have
Examples : All-diff(X1, X2, X3).
This constraint says that X1, X2, X3 must take on different values.
If {1, 2, 3} is the set of values for each of these variables then:
X1 = 1, X2 = 2, X3 = 3 is ok and X1 = 1, X1 = 1, X1 = 3 not ok
First Representations :
1. We need to know where to place each of the N queens.
2. We could have N variables each of which has as a value 1. . . N2.
3. The values represent where we will place the i th variable.
Second Representation
Here we know, we can not place two queens in the same column.
Assign one queen to each column, and then find out the rows where each of these queens is to placed.
We can have N variables: Q1 , . . . . , QN .
The set of values for each of these variables are {1 , 2 , . . . , N}.
The representation has
Solutions
1. A solution to N - Queens problem is any assignment of values to the variables Q i , . . . , Qn Constraints
can be over any collection of variables.
2. The N – Queens problems, need only binary constraints, ie. Constraints over pair of variables.
Examples of CSPs
Some poplar puzzles like, the Latin Square, the Eight Queens, and Sudoku are stated below.
Latin Square Problem : How can one fill an n × n table with n different symbols such that each each
symbol occurs exactly once in each row and column ?
Solutions : The Latin squares for n = 1, 2, 3 and 4 are :
Sudoku Problem
1. Define the following terms: state, state space, search tree, search node, goal, successor function.
2. Explain why problem formulation must follow goal formulation.
3. Suppose that LEGAL-ACTIONS(s) denotes the set of actions that are legal in a state s, and RESULTS
(a, s) denotes the state that results from performing a legal action a in state s. define SUCCESSOR-FN
in terms of LEGAL-ACTIONS and RESULTS, and vice versa.
4. Does a finite state space always lead to a finite search tree. What types of state spaces always lead to
finite search trees
5. Prove each of the following statements;
a) Breadth-first search is a special case of uniform-cost search
b) Breadth-first search, depth-first search and uniform-cost search are special cases of best-first
search.
c) Uniform-cost search is a special case of A* search.
6. Define the following terms; constraint satisfaction problem, constraints, backtracking search, nin-
conflicts.
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Explain Knowledge Representation.
Describe the Knowledge Representation Models, typology etc
Explain Knowledge representation Issues
Explain Knowledge Representation using Predicate Logic and Rules
Knowledge and Representation are distinct entities that play a central but distinguishable roles in
intelligent system. Knowledge is a description of the world. It determines a system's competence by what it
knows. Representation is the way knowledge is encoded. It defines the performance of a system in doing
something. Different types of knowledge require different kinds of representation. The Knowledge
Representation models/mechanisms are often based on:
Logic
Rules
Frames
Semantic Net
4.2. Knowledge
Knowledge is a progression that starts with data which is of limited utility.
By organizing or analyzing the data, we understand what the data means, and this becomes
information.
The interpretation or evaluation of information yield knowledge.
An understanding of the principles embodied within the knowledge is wisdom
Knowledge Progression
Knowledge model
The model represents transitions and understanding.
the transitions are from data, to information, to knowledge, and finally to wisdom;
the understanding support the transitions from one stage to the next stage.
The distinctions between data, information, knowledge, and wisdom are not very discrete. They are more
like shades of gray rather than black and white (Shedroff, 2001).
Data and information deal with the past; they are based on the gathering of facts and adding
context.
These artifacts are used in the knowledge creation process to create two types of knowledge: declarative
and procedural
All declarative knowledge are explicit knowledge; it is knowledge that can be and has been articulated.
The strategic knowledge is thought as a subset of declarative knowledge.
The Problem solving requires formal knowledge representation, and conversion of informal (implicit)
knowledge to formal (explicit) knowledge.
The Knowledge and the Representation are distinct entities, play a central but distinguishable roles in
intelligent system.
The KR in hierarchical structure, in figure 8, is called semantic network or a collection of frames or slot-
and-filler structure". It shows property inheritance and way for insertion of additional knowledge.
Property inheritance : Objects/elements of specific classes inherit attributes and values from more
general classes.
Classes are organized in a generalized hierarchy.
Inheritable knowledge
Example: a parser in a natural language has the knowledge that a noun phrase may contain articles,
adjectives and nouns. It thus accordingly call routines that know how to process articles, adjectives and
nouns.
4.5. Issues in Knowledge Representation
The fundamental goal of Knowledge Representation is to facilitate inferencing (conclusions) from
knowledge. The issues that arise while using KR techniques are many. Some of these are explained below
1. Important Attributes: Any attribute of objects so basic that they occur in almost every problem
domain?
2. Relationship among attributes: Any important relationship that exists among object attributes ?
3. Choosing Granularity: At what level of detail should the knowledge be represented ?
4. Set of objects: How sets of objects be represented ?
5. Finding Right structure : Given a large amount of knowledge stored, how can relevant parts be
accessed
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Explain Predicate Logic
Describe the Knowledge Representation Using Predicate Logic
Explain Knowledge Representation using Predicate Logic and Rules
. Explain how knowledge may be represented as symbol structures that characterize bits of
knowledge about objects, concepts.
5.1. Logic
Logic is concerned with the truth of statements about the world. It includes: Syntax, Semantics and
Inference Procedure.
1. Syntax: Specifies the symbols in the language about how they can be combined to form sentences. The
facts about the world are represented as sentences in logic
2. Semantic: Specifies how to assign a truth value to a sentence based on its meaning in the world. It
Specifies what facts a sentence refers to. A fact is a claim about the world, and it may be TRUE or
FALSE.
3. Inference Procedure: Specifies methods for computing new sentences from an existing sentences.
Assumptions about KR
Intelligent Behavior can be achieved by manipulation of symbol structures.
KR languages are designed to facilitate operations over symbol structures, have precise syntax and
semantics;
Syntax tells which expression is legal ?, e.g., red1(car1), red1 car1, car1(red1), red1(car1 & car2) ?
Semantic tells what an expression means? e.g., property dark red applies to my car.
Make Inferences, draw new conclusions from existing facts.
Tautologies A proposition that is always true is called a tautology. e.g., (P V ┌: P) is always true
regardless of the truth value of the proposition P.
Contradictions: A proposition that is always false is called a contradiction. e.g., (P _ : P) is always
false regardless of the truth value of the proposition P.
Contingencies: A proposition is called a contingency, if that proposition is neither a tautology nor a
contradiction e.g., (P _ Q) is a contingency.
Antecedent, Consequent: In the conditional statements, p ! q ,the
1st statement or "if - clause" (here p) is called antecedent ,
2nd statement or "then - clause" (here q) is called consequent.
Argument: Any argument can be expressed as a compound statement. Take all the premises, conjoin
them, and make that conjunction the antecedent of a conditional and make the conclusion the
consequent. This implication statement is called the corresponding conditional of the argument.
Note :
Every argument has a corresponding conditional and every implication statement has a corresponding
argument.
An argument is valid "if and only if" its corresponding conditional is a tautology.
Two statements are consistent "if and only if" their conjunction is not a contradiction.
Two statements are logically equivalent "if and only if" their truth table columns are identical; "if and
only if" the statement of their equivalence using " ≡ " is a tautology.
Example:
The assertion "x > 1", where x is a variable, is not a proposition because it is neither true nor false
unless value of x is defined.
Consider example:
o All men are mortal.
o Socrates is a man.
o Then Socrates is mortal
These cannot be expressed in propositional logic as a finite and logically valid argument (formula).
(In Predicate Logic every complete sentence contains two parts: a subject and a predicate.
The subject is what (or whom) the sentence is about and
The predicate tells something about the subject.
A Predicate is a verb phrase template that describes a property of objects, or a relation among objects
represented by the variables. Example: the car Tom is driving is blue. Predicate is blue, describes
property of the car
Predicates are given names; example let B be the name for predicate is blue. The sentence is
represented as B(x) , read as x is blue; x represents an arbitrary Object .
Example
A sentence "Judy {runs}".
The subject is Judy
Predicate is runs
Predicate, always includes verb, which tells something about the subject. Predicate is a verb phrase
template that describes a property of objects, or a relation among objects represented by the variables
How can you express the English language preposition "All cars have wheels" in preposition logic ?
* "All cars have wheels"
∀ x : car • x has wheel
x P(x)
where p (x) is predicate tells : ‘x has wheels’
x is variable for object ‘cars’ that populate universe of discourse
5.9. Existential quantifier (There Exists)
Existential Quantification allows us to state that an object does exist
without naming it.
How can you express the English language preposition "Someone loves you" in preposition logic ?
5.10. Formula
In mathematical logic, a formula is a type of abstract object, a token of which is a symbol or string of
symbols which may be interpreted as any meaningful unit in a formal language.
Terms: Defined recursively as variables, or constants, or functions like f (t1, ……., tn), where f is an n-
array function symbol, and t1, ……., tn are terms. Applying predicates to terms produce atomic
formulas.
Atomic formulas: An atomic formula (or simply atom) is a formula with no deeper propositional
structure, i.e., a formula that contains no logical connectives or a formula that has no strict sub-
formulas.
Atoms are thus the simplest well-formed formulas of the logic.
Compound formulas are formed by combining the atomic formulas using the logical connectives.
Well-formed formula ("wi_") is a symbol or string of symbols (a formula) generated by the formal
grammar of a formal language
Example of atomic formula is t1 = t2.
Example of a compound formula is ((((a ˄ b) ˄c) _ ((¬a ˄b) ˄ c)) _ ((a ˄ ¬:b) ˄c))
5.13. Resolution
Resolution is a procedure used in proving that arguments which are expressible in predicate logic are
correct.
Resolution lead to refute a theorem-proving technique for sentences in propositional logic and first-
order logic
Resolution is a rule of inference.
Resolution is a computerized theorem prover.
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Explain rules used in Rule –based production systems
Explain Logic Programming
Describe logic programming program components
Explain Programming paradigms : Models of Computation
6.1. Introduction
The other most popular approach to Knowledge representation is to use production rules, sometimes called
IF-THEN rules. The production rules are simple but powerful forms of knowledge representation
providing the flexibility of combining declarative and procedural representation for using them in a unified
form.
Examples of production rules
IF condition THEN action
IF premise THEN conclusion
IF proposition p1 and proposition p2 are true THEN proposition p3 is true
The production rules as knowledge representation mechanism are used in the design of many "Rule-based
systems" also called "Production systems" .
Data objects
The data objects of any kind is called a term.
Term : examples
Constants: denote elements such as integers, floating point, atoms.
Variables: denote a single but unspecified element; symbols for variables begin with an uppercase
letter or an underscore.
Compound terms: comprise a function and sequence of one or more compound terms called arguments
Ground and non-ground: Terms are ground if they contain no variables; otherwise they are non-
ground. Goals are atoms or compound terms, and are generally non-ground.
(
Simple data objects: Atoms, Numbers, Variables
Atoms
a lower-case letter, possibly followed by other letters (either case), digits, and underscore character
a string of special characters such as: +;�; _; =; =;&
a string of any characters enclosed within single quotes. e.g. 'ABC'
following are also atoms ! ; [] {} !
Numbers
applications involving heavy numerical calculations are rarely written in Prolog.
Integer representation
a string of any characters enclosed within single quotes. e.g. 'ABC'
real numbers written in standard or scientific notation,
Variables.
begins by a capital letter, possibly followed by other letters (either case), digits, and underscore
character.
Special Structures:
In Prolog this is an ordered collection of terms is called a list . I Lists are structured terms and
Prolog offers a convenient notation to represent them:
Empty list is denoted by the atom [ ].
Non-empty list carries element(s) between square brackets, separating elements by comma. e.g
[bach, bee] [apples, oranges, grapes]
(
6.6.2. Program Components
A Prolog program is a collection of predicates or rules. A predicate establishes a relationships between
objects.
a). Clause, Predicate, Sentence, Subject
Clause is a collection of grammatically-related words.
Predicate is composed of one or more clauses. Clauses are the building blocks of sentences; every
sentence contains one or more clauses.
A Complete Sentence has two parts: subject and predicate. subject is what (or whom) the sentence
is about. predicate tells something about the subject.
Example 1: "cows eat grass". It is a clause, because it contains the subject "cows" and the predicate
"eat grass."
Example 2: "cows eating grass are visible from highway". This is a complete clause. The subject
"cows eating grass" and the predicate "are visible from the highway" makes complete thought.
Structure of a clause
Example
grand parent(X;Y ) : �parent(X; Z); parent(Z;Y ).
parent(X; Y ) : �mother(X; Y ).
parent(X; Y ) : �father (X;Y ).
Interpretation:
A clause specifies the conditional truth of the goal on the LHS; i.e., goal on LHS is assumed to be true if
the sub-goals on RHS are all true.
d). Queries
In Prolog the queries are statements called directive. A special case of directives, are called queries.
Syntactically, directives are clauses with an empty left-hand side.
Example : ? - grandparent(X;W).
In addition to these, there are two programming paradigms (concurrent and object-oriented programming).
While, they are not models of computation, they rank in importance with computational models.
2. Explain the following conflict resolution mechanism as applied to rule based logic programming
a) Refractory
b) Recency
c) Specificity
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Describe Reasoning, Formal Logic and Uncertainty
Explain Symbolic Reasoning
Explain Statistical Reasoning
7.1 Reasoning
Reasoning is the act of deriving a conclusion from certain premises using a given methodology. It is a
process of thinking, and it is about logical arguing and drawing inference. A knowledge system must
reason, if it is requires to do something which has not been told explicitly. For reasoning, the system must
find out what it needs to know from what it already knows.
(
Human Reasoning
A human being can reason in three different areas;
1. Mathematical reasoning
2. Logical reasoning - deduction, inductive and abduction.
3. Non-logical reasoning- linguistic, languages
These areas are in every human being but the ability level depends on education, environment and
genetics
The IQ (Intelligence Quotient) is the summation of mathematical reasoning skills and logical reasoning.
The EQ (Emotional Quotient) depends mostly on non-logical reasoning capability
(
7.2. Logical Reasoning
Logic reasoning is the process of drawing conclusions from facts using rules of inferences.
Logic is divided into formal (symbolic) logic and informal logic.
symbolic logic is the study of symbolic abstraction (construct) that capture the formal features of
logical inference by a formal system
Formal systems has two components, a formal language and a set of inference rule
Formal systems has axioms; An axiom is a sentence which is always true within the system.
Sentences are derived from the system's axioms.
Theorems are rules of derivations
Informal logic: Informal logic is the study of natural language arguments
3. Abduction: Means determining the precondition; It is using the conclusion and the rule to support that
the precondition could explain the conclusion. e.g "When it rains, the grass gets wet. The grass is wet, it
must have rained". It involves;
Guessing that some general principles that relate a given pattern of cases.
Extract hypotheses to form a tentative theory
Usage: Knowledge discovery, Statistical methods, data mining
4. Analogy: Illustration of an idea by means of a more familiar idea that is similar to it in some significant
features.
Finding a common pattern in different cases.
Usage: Matching labels, matching transformations.
Reasoning Approaches
1. Symbolic Reasoning:
2. Statistical reasoning
3. Fuzzy logic reasoning
The idea behind non-monotonic reasoning is to reason with first order logic, and if an inference can
not be obtained then use the set of default rules available within the first order formulation.
Default Theory
The above rule is only accessed if we want to know whether or not Rose owns a house then an answer
can not be deduced from our current beliefs
The default rule is applicable if we can prove that from our beliefs that Rose is an African and an adult,
and the believing that there is some car that is owned by Rose does not lead to and inconsistency.
If these two sets of premises are satisfied, then the rule states that we can conclude that Rose owns a
car.
7.7.3. Circumscription
Circumscription is non-monotonic logic which fomalizes the common sense assumption. Circumscription
is a formalized rule of conjecture (guess) that can be used along with the rules of inference of first order
logic. The idea is to specify particular predicates that are assumed to be “ as false a possible” that is, false
for every object except those for which they are known to be true. Circumscription involves formulating
rules of thumb with "abnormality" predicates and then restricting the extension of these predicates
Circumscribing them, so that they apply to only those things to which they are currently known.
Example: Take the case of a Bird Tweety
The rule of thumb is that "birds typically y" is the condition. The predicate "abnormal" signifies
abnormality with respect to flying ability.
Observe that the rule x(Bird(x)& ¬abnormal(x) →Flies(x)) does not allow us to infer that Tweety
flies, since we do not know that it is abnormal with respect to flying ability.
If we add rules which circumscribe the abnormality predicate to which they are currently known say
"Bird Tweety" then the inference can be drawn.
Recognize inconsistencies
The Inference Engine (IE) may tell the TMS that some sentences are contradictory. Then, TMS may find
that all those sentences are believed true, and reports to the IE which can eliminate the inconsistencies by
determining the assumptions used changing them appropriately
Example: A statement that either Abbott, Babbitt, or Cabot is guilty together with other statements that
Abbott is not guilty, Babbitt is not guilty, and Cabot is not guilty, form a contradiction.
Term Used
Probabilities: Usually, are description of the likelihood of some event occurring (raging from 0 to 1)
Event: One or more outcomes of a probability experiment
Probability Experiment: Process which leads to well-defined results call outcomes
Sample Space: Set of all possible outcomes of a probability experiment
Independent Events: Two events, E1 and E2 are independent if the fact that E1 occurs does not affect
the probability of E2 occurring.
Mutually Exclusive Events: Events E1, E2, …., En are said to be mutually exclusive if the occurrence
of any one of them automatically implies the non-occurrence of the remaining n-1 events
Disjoint Events: Another name for mutually exclusive events.
Classical Probability: Also called a priori theory of probability
The probability of events A = no of possible outcomes f divided by the total no of possible outcomes
n; ie., P(A) = f/n.
Assumption: All possible outcomes are equal likely
Empirical Probability: Determined analytically, using knowledge about the nature of the experiment
rather than through actual experimentation.
Conditional Probability: The probability of some event A, given the occurrence of some other event B.
conditional probability is written P(A/B), and read as “the probability of A, given B”.
Example
Machine learning focuses on the prediction, based on known properties learned from the training data. A
machine learning system usually starts with some knowledge and a corresponding knowledge organization
so that it can interpret, analyze, and test the knowledge acquired. Machine learning Modifies decision
mechanism to improve performance.
1. Some tasks cannot be defined well except by example; that is, we might be able to specify input/output
pairs but not a concise relationship between inputs and desired outputs. We would like machines to be
able to adjust their internal structure to produce correct outputs for a large number of sample inputs
and thus suitably constrain their input/output function to approximate the relationship implicit in the
examples.
2. It is possible that hidden among large piles of data are important relationships and correlations.
Machine learning methods can often be used to extract these relationships (data mining).
3. Human designers often produce machines that do not work as well as desired in the environments in
which they are used. In fact, certain characteristics of the working environment might not be
The figure shown above is a typical learning system model. It consists of the following components.
1. Learning element
2. Knowledge base
3. Performance element
4. Feedback element
5. Standard system.
1. Learning element: It receives and processes the input obtained from a person ( i.e. a teacher), from
reference material like magazines, journals, etc, or from the environment at large.
2. Knowledge base: This is somewhat similar to the database. Initially it may contain some basic
knowledge. Thereafter it receives more knowledge which may be new and so be added as it is or it
may replace the existing knowledge.
3. Performance element: It uses the updated knowledge base to perform some tasks or solves some
problems and produces the corresponding output.
The sequence of operations described above may be repeated until the system gets the desired perfection.
There are several factors affecting the performance. They are,
Types of training provided
The form and extent of any initial background knowledge
The type of feedback provided
The learning algorithms used.
Training is the process of making the system able to learn. It may consist of randomly selected examples
that include a variety of facts and details including irrelevant data. The learning techniques can be
characterized as a search through a space of possible hypotheses or solutions. Background knowledge can
be used to make learning more efficient by reducing the search space. The feedback may be a simple yes or
no type of evaluation or it may contain useful information describing why a particular action was good or
bad. If the feedback is always reliable and carries useful information, the learning process will be faster
and the resultant knowledge will be correct.
The success of machine learning system also depends on the algorithms. These algorithms control the
search to find and build the knowledge structures. The algorithms should extract useful information from
training examples. There are several machine learning techniques available.
Rote Learning
Rote learning, also known as learning by repetition, is a method of learning by memorizing
information. This memorization is usually achieved through the repetition of activities such as reading
or recitation, and the use of flashcards and other learning aids.
Inductive Learning
Inductive reasoning, also known as induction or inductive logic, is a kind of reasoning that constructs or
evaluates propositions that are abstractions of observations of individual instances of members of the same
class. It is commonly construed as a form of reasoning that makes generalizations based on individual
instances. In this sense it is often contrasted with deductive reasoning.
In supervised learning the variables under investigation can be split into two groups: explanatory variables
and one (or more) dependent variables. The target of the analysis is to specify a relationship between the
explanatory variables and the dependent variable as it is done in regression analysis.
Reinforcement learning differs from standard supervised learning in that correct input/output pairs are
never presented, nor sub-optimal actions explicitly corrected. Further, there is a focus on on-line
performance, which involves finding a balance between exploration (of uncharted territory) and
exploitation (of current knowledge). The exploration vs. exploitation trade-off in reinforcement learning
has been most thoroughly studied through the multi-armed bandit problem and in finite MDPs.
The rules are often stochastic. The observation typically involves the scalar immediate reward associated
to the last transition. In many works, the agent is also assumed to observe the current environmental state,
in which case we talk about full observability, whereas in the opposing case we talk about partial
observability. Sometimes the set of actions available to the agent is restricted (e.g., you cannot spend more
money than what you possess).
A reinforcement learning agent interacts with its environment in discrete time steps. At each time t, the
agent receives an observation ot, which typically includes the reward rt. It then chooses an action at from
the set of actions available, which is subsequently sent to the environment. The environment moves to a
new state st + 1 and the reward rt + 1 associated with the transition (st,at,st + 1) is determined. The goal of a
reinforcement learning agent is to collect as much reward as possible. The agent can choose any action as a
function of the history and it can even randomize its action selection.
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Describe and Explain the components, characteristics and features of an Expert
System
Explain knowledge acquisition and techniques
Explain application of Expert Systems
9.1. Introduction
AI programs that achieve expert-level competence in solving problems in task areas by bringing to bear a
body of knowledge about specific tasks are called knowledge-based or expert systems.
Knowledge Base & Knowledge Management: To incorporate these information into the system, it is
necessary to make use of one or more knowledge representation methods. Knowledge representation
formalizes and organizes the knowledge. One widely used representation is the production rule,
or simply rule. A rule consists of an IF part and a THEN part (also called a condition and an
action). The IF part lists a set of conditions in some logical combination. The piece of knowledge
represented by the production rule is relevant to the line of reasoning being developed if the IF
part of the rule is satisfied; consequently, the THEN part can be concluded, or its problem-solving
action taken. Expert systems whose knowledge is represented in rule form are called rule-based
systems.
Another widely used representation, called the unit (also known as frame, schema, or list
structure) is based upon a more passive view of knowledge. The unit is an assemblage of
associated symbolic knowledge about an entity to be represented. Typically, a unit consists of a
list of properties of the entity and associated values for those properties.
IF-THEN Rules
Human experts tend to think along:
Condition action or situation conclusion.
1. Rules "If-then" are predominant form of encoding knowledge in expert systems. These are of the form
If a1, a2, ....... an
Then b1, b2, ....... bn where
each a1 is a condition or situation, and
each a1 is an action or a conclusion
The most common form of semantic networks uses the links between nodes to represent IS-A and HAS
relationship between objects. This kind of relationship establishes an inheritance hierarchy in the network,
with the objects lower down in the network inheriting properties from the object higher up
(
Example of Semantic Networks
The example below shows a car IS-A vehicle; a vehicle HAS wheels
Semantic Network
Frames
In this technique, knowledge is decomposed into highly modular pieces called frames, which are
generalized recode structures. Knowledge consists of concepts, situations, attributes of concepts,
relationships between concepts, and procedures to handle relationships as well as attribute values.
Each concept may be represented as a separate frame.
The attributes, relationships between concepts, and the procedures are allotted to slots in the a
frame.
The contents of a slot may be of any data type- numbers, strings, functions, or procedures.
The frames ay be linked to other frames, providing the same kind of inheritance as that provided
by a semantic network.
A frame- based representation is suitable for object-oriented programming techniques
The forward chaining, backward chaining and the tree searches are the most used techniques for drawing
inference from the knowledge base.
2. Coping with Uncertainty: The ability of the system to reason with rules and data which is incomplete.
Often knowledge is imperfect which causes uncertainty.
To work in the real world, Expert systems must be able to deal with uncertainty
One simple way is to associate a numeric value with each piece of information in the system.
The numeric value represents the certainty with which the information is known.
3. Data Driven Reasoning or Forward Chaining: An inference technique which uses IF-THEN rules to
deduce a problem solution from initial data. The system keeps track of the current state of the problem
solution and looks for rules which will move that state closer to a final solution. The algorithm proceeds
from a given situation to a desired goal, adding new assentations found.
4. Data Representation: The way in which the problem specific data in the system is stored and accessed.
Expert systems are built around knowledge base modules
Knowledge acquisition is transferring knowledge from human expert to computer
Knowledge representation is faithful representation of what the expert knows
The success of the expert system depends on choosing knowledge encoding scheme best for the kind of
knowledge the system is based on.
The IF-Then rules, semantic networks and frames are the most commonly used representation schemes.
5. User Interface: That portion of the code which creates an easy to use system. The acceptability of an
expert system depends largely on the quality of the user interface. Examples;
The questions are answered by referring to the system goals, the rules being used, and the existing problem
solving schemes. The rules typically reflect empirical or ‘compiled’ knowledge
Example: Dialog with an expert system designed to give advice on car problem
System Does the car start?
User No
System Does the engine turn over?
User Yes
System Do you smell gas?
User Yes
System Recommendation- wait 5 minutes and try again
User Why?
System I used the rule:
if not start, and engine-turn-over and smell-gas
Then recommendation is wait 5 minutes and try again
9.8. Application of Expert Systems
Diagnosis and Troubleshooting of Devices and Systems: Medical diagnosis was one of the first
knowledge base areas to which expert system technology was applied
Planning and scheduling: They have been used in airlines scheduling their flights, personnel, and
gates, the manufacturing process planning and job scheduling.
Configuring of Manufactured Objects from sub-assemblies: Used in modular home building and
manufacturing involving complex engineering designs.
Knowledge Publishing: The expert system deliver knowledge that is relevant to the user domain.
Process Monitoring and Control: The expert system performs real-time analysis of data from physical
devices, looking for anomalies, predicting trends, controlling optimality, and failure correction.
Design and Manufacturing: Expert systems assist in the design of physical devices and processes,
ranging from high-level conceptual design to abstract entities all the way to factory floor configuration
of manufacturing processes.
1. ( (
References
1. Winson P.H., Artificial Intelligence 3rd Ed, Addison Wesley
2. Robert S.F, Artificial Intelligence, an Engineering Approach, McGraw Hill
3. Russell S.J & Norvig, Artificial Intelligence; A modern approach, Prentice Hall
4. Rich E & Knight K., Artificial Intelligence, McGraw Hill
Chapter Objectives
By the end of this chapter the learner should be able to;
Describe Natural Language
Explain Syntactic Processing
Explain Knowledge Representation using Predicate Logic and Rules
Explain how knowledge may be represented as symbol structures that characterize bits of
knowledge about objects, concepts.
10.1. Introduction
Natural language Processing (NLP) is a subfield of Artificial Intelligence and linguistic, devoted to make
computers understand statements written in human language.
NLP encompasses anything a computer needs to understand languages (typed or spoken) and also generate
the natural language
Natural Language Understanding (NLU): The task involves understanding and reasoning while the
input is a natural language.
Natural Language Generation(NLG): is a sub-field of natural language processing some time referred
to as text generation.
Levels of Linguistics
Constituents: Assume that a phrase is a construction of some kind. A construction means a syntactic
arrangement that consists of parts usually two called constituent. e.g . The phrase the man is a construction
consists of two constituents the and man.
Constituents
Phrase
A phrase is a group of words that function as a single unit in the syntax sentence.e.g.1 "the house at the end
of the street" is a phrase, acts like noun.
e.g.2 "end of the street" is a phrase, acts like adjective
Phrase formation is governed by a phase structure rule. Most phrases have a head or central word, which
defines the type of phrase. Head is often the first word of the phrase
Some phrase are headless. eg,3 "the rich" is a noun phrase composed of a determiner and an adjective but
noun. Phrase are classified based on type of head they take.
(
Classification of Phrases: Names(abbreviations)
Parser
A parser is a program that accepts as input a sequence of words in a natural language and breaks them up
into parts (nouns, verbs, and their attributes) to be managed by other programming.
Parsing is defined as the act of analyzing the grammaticality of a sentences according to some specific
grammar
It is the process of checking that a particular sequence of words in a sentence correspond to a language
defined its grammar.
Parse tree is a way of representing the out-put of a parser
Example 1: sentence "Liama pickup ball". The parse tree structure is as indicated below
iii) Translate the following into first-order logic (FOL) (12 marks)
1) Some dogs bark
2) All dogs have four legs
3) Everybody likes ice cream
4) All barking dogs are irritating
(b) Answer the following questions by indicating whether the statements are
True (T) or False (F) (8 marks)
(b) What makes Lisp and Prolog the most widely used languages for developing AI programs (3mrk)
c). What is the widely used criterion for determining the success of an AI system? Explain the
working of this criterion (3mrks)
(ii) Use k-Nearest Neighbour technique and square-block distance measure to classify an
object P(10,30,5) given the data below:-
X Y Z Category
30 30 10 A
20 10 20 A
10 20 20 B
15 40 60 A
6 5 10 B
20 10 15 B
13 15 7 B
40 70 70 A
(7 marks)
(a) Discuss any two reasons why psychology may be regarded as a foundation of Artificial
Intelligence. State two other foundations of Artificial Intelligence. (4 marks)
(b) (i) Discuss one advantage and one disadvantage of informed search as a problem solving
technique. (1 marks)
(ii) Show how a search problem may be specified. (5 marks)
(iii) Describe the best-first search heuristic using an example. Explain why you would
recommend such a search method. (8 marks)
(iv) State any two real life applications of the search technique. (2 marks)
a). (i) In problem solving, we have the two main search techniques. State and explain the two main
category of the search technique. (4 marks)
i. Uninformed (Blind) search
ii. Informed (heuristic) search
(ii) Explain the following search conditions in relation to the searching as a problem solving
technique (6 marks)
i. Current state
ii. Goal state
iii. The solution
iv. Where one is
(ii). A knowledge representation language is defined by two aspects. State and explain the two
aspects (4 marks)
1) Syntax
2) Semantics
iii) Translate the following into first-order logic (FOL) (12 marks)
1) Some dogs bark
2) All dogs have four legs
3) Everybody likes ice cream
4) All barking dogs are irritating
x.Dogx ^ Bark x
V x .Dog x }yzwu. Leg y ^legz^leg w ^ leg u
^ has xy ^ has xz ^ has xw ^ has xu ^y
Vx likes (x, icecream)
Vx. Dog x ^ Barking x irritating x
(a) Based on the algorithm of Depth-first search, trace the search of the following path
(12 marks)
(a) Discuss why agents in Artificial Intelligence need not only be software entities. (2 marks)
a). Answer the following questions by indicating whether the statements are True (T) or
False (F) (8 marks)
b) Discuss any three grounds showing why we should have robots. (3 marks)
d) Explain the meaning of the terms supervised learning, hypothesis and example with respect
to Machine Learning in Artificial Intelligence. (3 marks)