Module 1-1
Module 1-1
Syllabus: Basics of AI, Applications of AI, Artificial Intelligence Problems and Techniques, Problem
Spaces and Search: Defining the problem as a state space search, Production systems and its
characteristics, Problem characteristics, Issues in the design of search programs. Good behaviour: the
concept of rationality, the nature of environments, simple reflex programs.
Artificial Intelligence (AI), a term coined by John McCarthy in 1956, refers to the intelligence
demonstrated by machines, aiming to replicate and enhance human-like problem-solving
capabilities. AI systems use heuristic algorithms and production systems to efficiently solve
problems within given time and space constraints. It finds applications in areas like natural
language processing, robotics, vision, speech processing, gaming, and expert systems, including
banking operations. Natural language processing involves both understanding and generating
human language from computer data. Rule-based systems, also known as expert systems, use ‘if–
then’ rules to encode domain knowledge, making them a widely adopted and easily maintainable
form of AI in industry.
Definition
Artificial Intelligence is a branch of computer science focused on creating systems that can
perform tasks requiring human-like intelligence. It involves developing computational
techniques, representations, and procedures to automate intellectual activities such as problem-
solving, reasoning, and learning. AI draws upon data structures, algorithms, and programming
methods to simulate and explain intelligent behavior through computational processes.
These capabilities enable machines to work autonomously and adapt to changing environments,
making them suitable for a wide range of applications.
There are various definitions of AI according to different authors. Most of these definitions take
a very technical direction and avoid philosophical problems connected with the idea that AI’s
purpose is to construct an artificial human. These definitions are categorized into the following
four categories:
1. Systems that think like humans (focus on reasoning and human framework).
2. Systems that think rationally (focus on reasoning and a general concept of intelligence).
3. Systems that act like humans (focus on behavior and human framework).
4. Systems that act rationally (focus on behavior and a general concept of intelligence).
These four categories represent different approaches to Artificial Intelligence (AI), each focusing
on how to define and achieve intelligent behavior in machines. The classification is often
attributed to Stuart Russell and Peter Norvig in their influential AI textbook. Here's a detailed
explanation of each:
Mimic human cognitive processes (reasoning, memory, learning). These systems aim to simulate
the way humans think by modeling mental processes such as perception, reasoning, problem-
solving, and learning. The goal is to understand how the human brain functions and replicate
these processes in machines.
Examples:
Simulating human decision-making processes
Modeling learning patterns (e.g., ACT-R, SOAR cognitive architectures)
Logical reasoning and formal methods to make correct inferences. These systems aim to emulate
rational thought, where reasoning follows clear, logical rules. The system doesn't necessarily
replicate how humans think, but rather how an ideal rational agent should think to achieve
correct results.
Examples:
Logic-based AI systems
Automated theorem provers (e.g., Prolog)
Rule-based expert systems
Mimic human behavior externally (regardless of internal thought).These systems aim to behave
like a human would, especially in observable tasks, such as speaking, moving, recognizing
speech or images, and interacting with the environment. It doesn’t matter how the system arrives
at its decisions, only that the behavior resembles that of humans
Examples:
FAct in a way that maximizes goal achievement logically and efficiently. This is the most
practical and widely used approach in modern AI. It defines an intelligent agent as one that acts
to achieve the best outcome, or the best expected outcome, given available knowledge. It doesn’t
need to mimic human behavior or thought — only needs to make rational decisions.
Examples:
AI Vocabulary
Intelligence
Intelligence means using mental abilities like thinking, learning, solving problems, recognizing
patterns, understanding language, and making decisions to achieve goals.
Intelligent Behavior
This is when a system can understand its surroundings, learn from experience, solve problems,
think creatively, apply knowledge in new situations, and communicate with others.
Science-Based Goals of AI
These goals focus on understanding how natural (human or animal) intelligence works and
learning from it.
Engineering-Based Goals of AI
These aim to build machines or systems that can act intelligently, using practical tools, theories,
and techniques.
AI Techniques
These are the methods used to represent knowledge (facts), reason with it, and solve problems.
Good techniques make it easier for the system to think and make decisions.
Learning
Learning in AI means that a program gets better at tasks over time based on past experience,
allowing it to work faster or more accurately next time.
Applications of AI
AI is used in many areas, like solving problems, searching for information, recognizing speech,
understanding languages, seeing through cameras (vision), and expert systems that give advice.
AI has several fundamental goals that drive research and development in the field:
One of AI’s key goals is to create systems that can learn from data, identify patterns, and make
informed decisions without explicit programming. This is achieved through various machine
learning techniques such as supervised, unsupervised, and reinforcement learning.
Human-like Interaction
Creating systems that can understand and interact with humans naturally through speech, text,
facial expressions, and gestures is a key goal in AI, known as Human-Computer Interaction
(HCI).
Artificial Intelligence (AI) can be categorized into three primary types based on their capability
to perform tasks: Narrow AI, General AI, and Super AI. These categories represent a
progression of AI development, from systems that can perform a single task to hypothetical
systems that can surpass human intelligence in every domain. Understanding these distinctions is
crucial to grasp the current state, limitations, and future prospects of AI.
Narrow AI, also known as Weak AI, is the most common form of artificial intelligence in use
today. These systems are developed and trained to carry out specific tasks or solve narrowly
defined problems. They operate under a limited set of constraints and rules, and while they may
outperform humans in certain tasks, they lack generalization capabilities. This means they cannot
transfer knowledge from one domain to another or perform any task outside their programmed
scope.
Examples of Narrow AI are widely visible in daily life and industry. Voice assistants like
Apple’s Siri, Amazon Alexa, or Google Assistant use speech recognition and natural language
processing to carry out commands such as playing music, sending texts, or setting reminders.
Facial recognition software in smartphones and surveillance systems can accurately identify
and verify individuals. Spam filters in email platforms automatically detect and redirect
unwanted messages, while recommendation engines used by platforms like Netflix and
Amazon suggest content or products based on user preferences and behaviors.
Despite their usefulness, narrow AI systems have significant limitations. They cannot operate
beyond their predefined functionalities, lack self-awareness, and cannot perform reasoning or
adapt to tasks they weren’t specifically trained for. For instance, a spam filter cannot perform
voice recognition, and a chess-playing AI cannot drive a car. These systems are entirely
dependent on human-created data and rules, making them inflexible when faced with novel
situations.
General AI, also referred to as Strong AI or Artificial General Intelligence (AGI), represents the
next stage in AI evolution. A General AI system would possess the ability to understand, learn,
and apply knowledge across a broad range of tasks, much like a human being. It would have the
cognitive flexibility to reason, solve problems, plan, learn from experience, and adapt to
unfamiliar environments or challenges without requiring reprogramming.
The fundamental difference between Narrow AI and General AI lies in versatility and autonomy.
While Narrow AI excels in performing individual tasks, General AI aims to mimic human
intelligence comprehensively. This would include not just technical or logical reasoning but also
common-sense understanding, language fluency, emotional intelligence, and the ability to draw
from experience to make informed decisions.
Currently, General AI remains a theoretical concept. No existing AI system possesses the full
range of cognitive abilities required to qualify as AGI. Researchers around the world are working
toward this goal, developing systems that can integrate multiple forms of intelligence—such as
perception, language, and motor skills—but we are still many years away from achieving true
General AI. Achieving AGI would require breakthroughs in machine learning, cognitive science,
ethics, and computing infrastructure. The ultimate goal is to create machines that can
autonomously reason, self-learn, and adapt just as effectively as humans across all domains.
3. Super AI
Super AI is a speculative and highly advanced form of artificial intelligence that would surpass
human intelligence in every conceivable way. A Super AI system would not only be capable of
performing all cognitive tasks better than humans but also exhibit qualities like emotional
intelligence, creativity, strategic thinking, and self-awareness far beyond current capabilities.
Super AI, if ever realized, could potentially solve problems humans find intractable—such as
curing complex diseases, managing global climate systems, or optimizing worldwide economic
structures.
At present, Super AI is purely theoretical. No system even remotely approaches this level of
capability, and it remains a topic of philosophical debate and futuristic speculation. Nevertheless,
discussions about Super AI are gaining traction, prompting calls for regulation, ethical
guidelines, and international cooperation to ensure that future developments in AI remain
aligned with human interests and safety.
1. Search Problems
Search problems in AI involve navigating through a set of possible states to reach a desired goal
state. These problems require algorithms to explore potential paths and choose the most optimal
one, often based on heuristics or cost functions. Common examples include solving mazes,
pathfinding in maps, or selecting the best move in a game. The Travelling Salesman Problem and
chess algorithms are classic examples, where the AI must efficiently search for a solution among
numerous possibilities.
2. Knowledge-Based Problems
Knowledge-based problems rely heavily on domain-specific information and rules to derive
conclusions or make decisions. These problems are addressed using systems like expert systems,
which emulate human reasoning by applying encoded knowledge to specific scenarios. For
instance, MYCIN was designed to diagnose bacterial infections using medical knowledge, while
other systems provide financial or legal advice by interpreting structured rules and data.
4. Learning Problems
Learning problems require AI systems to improve performance over time by analyzing data or
experiences. Machine learning techniques are employed to identify patterns, make predictions, or
classify data. These systems adapt based on new information, becoming more accurate with
increased exposure. Applications span across spam detection, recommendation systems, and
predictive analytics in various industries.
AI TECHNIQUES
1. Search Algorithms
2. Knowledge Representation
Knowledge representation is the method by which AI stores and organizes information so that it
can be used to make decisions and inferences. Structures such as semantic networks, frames,
rule-based systems (IF-THEN logic), and ontologies allow machines to model relationships,
objects, and events within a given domain. Effective knowledge representation makes it easier
for AI systems to simulate human reasoning and understand context, enabling applications in
expert systems, diagnostics, and intelligent assistants.
3. Inference Engines
Inference engines are the reasoning components of AI systems that apply logical rules to
knowledge bases to derive conclusions or make decisions. They typically operate using forward
chaining (starting from known facts to infer new information) or backward chaining (working
from a goal to identify supporting facts). These mechanisms are central to expert systems and
rule-based problem-solving, enabling automated decision-making and deduction in areas such as
medical diagnosis and troubleshooting systems.
4. Machine Learning
Machine learning enables AI systems to learn from data and improve their performance over
time without being explicitly programmed. Supervised learning trains models using labeled
datasets for tasks like classification and regression, while unsupervised learning uncovers
patterns or groupings in unlabeled data, such as clustering. Reinforcement learning, on the other
hand, involves agents learning optimal behaviors through trial-and-error interactions with their
environment, receiving rewards or penalties as feedback, and is used in robotics, gaming, and
autonomous control systems.
8. Genetic Algorithms
Genetic algorithms are search and optimization techniques inspired by the process of natural
evolution. They operate on a population of possible solutions using operators like selection,
crossover, and mutation to evolve better solutions over generations. These algorithms are
particularly useful for solving problems with large, complex, or poorly understood search spaces,
such as scheduling, engineering design, and neural network optimization.
1. Games
NLP enables communication between humans and computers in natural (human) language. It
comprises two main tasks: Natural Language Generation and Understanding. Natural Language
Processing (NLP) systems are essential for enabling effective communication between humans
and computers using natural (human) language. One key function is speech recognition and
synthesis, where NLP converts spoken language into text and vice versa, allowing for voice-
based interactions with digital assistants or applications. Another important role is interpreting
user inputs, which involves understanding the intent and meaning behind what a user types or
says, even when the input is ambiguous or unstructured. Lastly, NLP systems help in generating
appropriate responses, enabling machines to reply in a way that is contextually relevant and
human-like. Together, these capabilities allow NLP systems to facilitate seamless, intelligent
dialogue between users and machines.
Challenges in NLP:
Natural Language Processing (NLP) faces several significant challenges that make accurate
language interpretation complex. One major issue is ambiguity in words and sentences, where a
single word like "input", "income", or "intake" can have multiple meanings depending on the
context, making it difficult for machines to determine the correct interpretation. Another
challenge is understanding context, syntax, grammar, and semantics, as human language often
involves nuanced structures, idiomatic expressions, and grammatical variations that are hard for
machines to decode. Additionally, NLP systems often struggle due to their dependency on world
knowledge—the ability to interpret language accurately frequently requires background
knowledge about how the world works, which machines typically lack or cannot apply
effectively. These challenges highlight the complexity of replicating human-like language
understanding in AI systems.
Keyword Analysis
Keyword analysis is the checking of keywords that a visitor is using or will be using while
searching for a specific web site. Natural language processors can serve as powerful AI tools for
keyword analysis. These processors are nothing but algorithms that help in understanding
keywords used by the visitors. Some important aspects involved in keyword analysis are
morphology, synonyms, grammar and syntax. Morphology considers the different shapes a word
can take, as seen in verb tense. At times, it is easy to use changes in verbs, such as come, came
and coming. However, there are irregular changes, such as tell, told, bring and brought, where
analyzing the keywords becomes very difficult. Synonyms are words that have similar meaning
in a given context. Many natural language processors have the capability to identify synonyms
and know how to use them. The concept of syntax and grammar is also important in keyword
analysis. The syntax of a keyword helps in determining the pattern of the word, while its
grammar determines when the keyword is used or the context in which it is used.
The main goal of NLP is to design and build a computer system that can be used to understand,
analyze and generate natural languages, which is understood by human beings. The various
processes included in NLP are as follows
: Text-To-Speech (TTS)
Text Simplification
Automatic Summarization
Text-To-Speech (TTS)
Text-To-Speech is the process of converting written text into spoken words. A TTS system
reads the input text and generates synthetic human-like speech using a speech synthesizer.
This is widely used in voice assistants, screen readers for the visually impaired, and
navigation systems. TTS systems also handle language rules like pronunciation, intonation,
and stress to make the output natural and understandable.
Natural Language Generation is the process where a machine converts structured data into
natural language text. It enables machines to write reports, summaries, or explanations
automatically. NLG is used in applications like weather forecasting reports, financial
summaries, and chatbots that respond in human-like language.
Machine Translation involves automatically translating text or speech from one language to
another. Systems like Google Translate use complex NLP models to handle grammar,
context, and idioms. Modern machine translation uses deep learning models like neural
machine translation (NMT) to improve fluency and accuracy.
Text Simplification
Text Simplification aims to reduce the complexity of text while preserving its original
meaning. It is particularly useful for readers with cognitive disabilities, language learners, or
children. This process involves rewriting sentences with simpler vocabulary and structure to
enhance readability and comprehension.
Automatic Summarization
Question Answering systems are designed to automatically answer questions posed in natural
language. These systems extract answers either from structured data or large text corpora.
QA is used in virtual assistants, customer support bots, and search engines. Advanced QA
systems combine IR, IE, and NLG.
3. Vision Processing
Challenges:
4. Speech Processing
AI systems process spoken language and convert it into machine-understandable formats. This
allows verbal communication with computers.
Limitations:
5. Robotics
Robotics involves the creation of intelligent machines that can perform tasks traditionally carried
out by humans, often in industrial or service settings. Artificial Intelligence (AI) plays a crucial
role in robotics by enabling machines to sense the environment through sensors and cameras,
allowing them to detect obstacles, recognize objects, or monitor surroundings. AI also supports
decision-making based on environmental input, helping robots analyze data from their
surroundings and choose appropriate actions in real-time. Finally, AI allows robots to perform
mechanical actions, such as picking, placing, assembling, or moving objects with precision and
adaptability. This integration of AI makes robots more autonomous, efficient, and capable of
operating in dynamic or complex environments.
Components of a robot:
A robot is an automatic machine, which can be programmed to perform various complex tasks.
A machine must satisfy certain features to qualify as a robot. These features are as follows: It
must have the ability to sense the environment. It must be capable of taking some decisions
depending upon the changes in the environment. It must be able to move in one or more
directions. It must obtain energy from some source to remain charged for doing work. The
source of energy can either be solar or electrical.
Research is ongoing to develop robots capable of multitasking, beyond repetitive single-task
automation.
6. Expert Systems
The need for expert systems arises from their ability to perform complex problem-solving tasks
with high accuracy, reliability, and efficiency. Unlike human experts who may become fatigued,
forget details, or be influenced by emotions, expert systems offer consistent performance without
variation. They can operate continuously 24/7, ensuring round-the-clock availability without the
need for breaks or rest. These systems are designed to retain and recall every piece of relevant
information, avoiding the limitations of human memory. Additionally, expert systems provide
uniform and unbiased decision-making, which is crucial in critical domains like healthcare,
finance, and engineering. Importantly, they are also capable of processing incomplete or
uncertain data, making them valuable in real-world situations where perfect information is rarely
available. These features justify their growing adoption across various industries.
Advantages
Disseminate expert knowledge widely at a lower cost.
Ensure consistent performance and reasoning.
Preserve institutional expertise.
Handle uncertainty in data effectively.
Applications
1. Diagnosis & Troubleshooting – Detect and fix faults (e.g., in machinery or medical
diagnosis).
2. Planning & Scheduling – Used in logistics, job-shop planning, airline schedules.
3. Configuration – Assemble complex systems using predefined components (e.g., modular
housing).
4. Financial Decision Making – Used in loans, insurance, and forex.
5. Knowledge Publishing – Provides expert advice (e.g., grammar checkers, tax advisors).
6. Process Monitoring & Control – Real-time industrial data monitoring and optimization.
7. Design & Manufacturing – Aids in designing systems and optimizing manufacturing
processes.
In Artificial Intelligence, solving problems often requires a large amount of knowledge. If the
available knowledge is not enough, the system needs to search for more information within a
knowledge base. This knowledge is usually stored in the form of facts and must be organized
properly to make searching faster and easier. A method called search control knowledge helps
guide the system by identifying different possible paths to reach a goal. The system then
compares these paths and chooses the best one to solve the problem.
8. Abstraction
Artificial Intelligence (AI) is about creating systems that behave intelligently, even though no
system (not even humans) has perfect memory, perception, or decision-making. AI tries to
understand and replicate intelligent behavior like seeing, learning, planning, reasoning, and using
language.
These problems often involve limited information, complex logic, and many possible outcomes.
1. Clearly define the problem and what a good solution looks like.
2. Understand the problem deeply — some details can affect how you solve it.
3. Gather and represent the knowledge needed to solve it.
4. Choose the right technique to find the best solution.
An AI problem includes:
A problem space is like a map of all possible situations or steps you can take to solve a
problem.
A solution is one path through that space that achieves your goal.
AI uses search techniques to find the right path:
o Depth-first search: go as far as possible down one path.
o Breadth-first search: explore all possible first steps before going deeper.
Problem solving is one of the most important goals of Artificial Intelligence. It involves finding
solutions based on given information or observations. Often, the solution cannot be found
directly, so AI uses models and step-by-step methods to solve problems.
GPS was a computer program created in 1957 by Simon and Newell to act as a universal
problem solver.
It was designed to solve symbolic problems, like proving theorems, solving puzzles (e.g.,
Towers of Hanoi), or playing chess.
It worked well for simple, clearly defined problems, but struggled with real-world,
complex problems.
To build an AI system that can solve a specific problem, you follow these steps:
1. Define the problem clearly — know what the input and desired output should be.
2. Analyze the problem — identify key parts that affect how you solve it.
3. Collect knowledge — gather facts or rules needed to solve the problem.
4. Choose and apply techniques — use the best available method to find the solution.
Problem Definition in AI
A problem includes:
To solve the problem, the system searches through the state space using these rules until it finds
a path from the start to the goal.
Search in AI
Search is the key to AI problem solving. It’s used when no direct solution is available. Many AI
problems are solved by searching through a problem space.
The problem space is often shown as a graph (where each point is a possible situation). To
simplify things, AI often turns this graph into a tree, which is easier to search but might repeat
some paths. A tree connects all points (nodes) without creating any loops or cycles.
Types of Problem-Solving Methods
1. Special-purpose methods:
o Designed for one specific problem.
o Uses features that are unique to that problem.
2. General-purpose methods: Can solve many different types of problems. One common
method is Means-End Analysis: Breaks the problem into smaller steps. Reduces the
difference between where you are now and where you want to be.
In AI, many problems — like playing a game — are solved by thinking in terms of states and
moves. This is called a state space search.
Games like chess have too many possible moves — more than the number of atoms in the
universe!
This makes it impossible to list out every possible move or rule.
To solve this, we use:
o Simplified rules written in general form
o Hashing to store and search efficiently
o Systematic searching instead of brute force
Use
Goal
You have:
Your goal is to end up with exactly 2 gallons of water in the 4-gallon jug.
State Space
(0, 0): Both the 4-gallon and 3-gallon jugs are empty.
No rule applied yet – this is the starting point.
(0, 3): Fill the 3-gallon jug completely from the tap.
Now, the 3-gallon jug has 3 gallons, and the 4-gallon jug is still empty.
(3, 0): Pour the 3 gallons from the 3-gallon jug into the 4-gallon jug.
The 3-gallon jug becomes empty, and the 4-gallon jug now has 3 gallons.
(3, 3): Again, fill the 3-gallon jug fully from the tap.
Now both jugs are full (4-gallon has 3 gallons, 3-gallon has 3 gallons).
(4, 2): Pour water from the 3-gallon jug into the 4-gallon jug until the 4-gallon is full.
Since the 4-gallon jug only needed 1 more gallon, it becomes full (3+1 = 4), and the 3-
gallon jug is left with 2 gallons.
(0, 2): Empty the 4-gallon jug completely into the drain.
The 4-gallon jug now has 0 gallons, and the 3-gallon jug still has 2 gallons.
(2, 0): Pour water from the 3-gallon jug into the 4-gallon jug.
Since the 3-gallon jug had 2 gallons, and the 4-gallon jug was empty, all 2 gallons are
now in the 4-gallon jug.
The goal was to get 2 gallons in the 4-gallon jug, and by carefully applying a series of pouring,
filling, and emptying rules, this solution successfully achieved the target in 6 steps after the
initial state.
The 8-puzzle is a popular sliding puzzle that involves a 3×3 grid where eight numbered tiles and
one blank space are arranged. The objective is to rearrange the tiles from an initial configuration
to a target configuration using a sequence of valid moves. Here’s a step-by-step explanation of
the 8-puzzle:
The 8-puzzle starts with an initial configuration where eight numbered tiles (usually from 1 to 8)
and one empty space are arranged randomly within a 3×3 grid. For example, an initial state could
look like this:
Here, the empty space is represented by a blank square.
The goal is to reach a predefined target state, which typically has the tiles arranged in numerical
order. The empty space is usually in the bottom-right corner. The goal state looks like this:
Tiles can only be moved into the empty space if they are adjacent to it (either horizontally or
vertically, not diagonally). This means that at any given state, you can slide a neighboring tile
into the empty space.
Step 4: Objective
The objective is to find a sequence of moves that transforms the initial configuration into the
goal configuration. Each move represents a state transition.
Step 6: Solution
The solution is a series of moves (states) that, when applied to the initial configuration, lead to
the goal configuration. For instance, a sequence of moves might look like this:
This sequence of moves transforms the initial configuration into the goal configuration.
DESIGNING SEARCH PROGRAMS IN AI
Solutions can be good in different ways. They can be good in terms of time or storage or in
difficulty of the algorithm.
A good solution in AI can:Take less time ,Use less memory ,Be simple and efficient
For example, in the Travelling Salesman Problem (TSP), there may be many different paths:
Think of searching as moving through a tree from the start point to the goal. Each node is a
possible state, and branches are possible actions. But generating every node is wasteful — many
won’t help. So, a smart search only creates useful nodes when needed.
1. Direction of Search:
o You can search forward (start → goal) or backward (goal → start).
2. Rule Matching:
o You need an efficient way to check which rules apply to each situation.
3. Node Representation:
o You must choose a way to represent each step or state.
o For games, a simple array may work.
o For complex problems, you need advanced data structures (this is called the frame
problem).
Tree or Graph
Production systems provide appropriate structures for performing and describing search
processes. A production system has the following four basic components:
A set of rules each consisting of a left side that determines the applicability of the rule and a
right side that describes the operation to be performed if the rule is applied.
A control strategy that specifies the order in which the rules will be compared with facts in the
database and also specifies how to resolve conflicts in selection of several rules or selection of
more facts.
The production rules operate on the knowledge database. Each rule has a precondition—that is,
either satisfied or not by the knowledge database. If the precondition is satisfied, the rule can be
applied. Application of the rule changes the knowledge database. The control system chooses
which applicable rule should be applied and ceases computation when a termination condition on
the knowledge database is satisfied.
The Missionaries and Cannibals problem illustrates the use of state space search for planning
under constraints: Three missionaries and three cannibals wish to cross a river using a two
person boat. If at any time the cannibals outnumber the missionaries on either side of the river,
they will eat the missionaries. How can a sequence of boat trips be performed that will get
everyone to the other side of the river without any missionaries being eaten?
3 missionaries and 3 cannibals need to cross a river using a boat that holds 2 people max.
Constraint: On either side of the river, cannibals must never outnumber missionaries, or
the missionaries will be eaten!
State representation:
(M, C, B) where:
M = missionaries on the left side
C = cannibals on the left side
B = boat position (1 = left, 0 = right)
State Representation:
Initial State: (3, 3, 1) → 3 missionaries, 3 cannibals on the left bank, and the boat is on
the left (1)
Goal State: (0, 0, 0) → Everyone is on the right bank, and the boat is also on the right (0)
Never more cannibals than missionaries on either bank unless there are no missionaries.
Only 1 or 2 people in the boat at any time.
Boat travels back and forth accordingly.
Production systems are used in Artificial Intelligence to describe how problems can be solved
using a series of rules (called productions). These rules guide the system from an initial state to
a goal state.
1. Monotonic System: Once a rule is applied, it does not block other rules from being applied
[Link]: Adding facts to memory — nothing is removed, so all earlier rules still work.
1. Nonmonotonic System: Applying a rule may prevent other rules from being used later.
o Example: Making a decision that changes the situation so earlier choices are no
longer valid.
2. Partially Commutative System:If several rules can be applied in different orders and still
lead to the same result, it’s partially commutative.
3. Commutative System: Combines both monotonic and partially commutative properties.
o All rule combinations that lead from one state to another work the same way.
Theoretically:
Any solvable problem can be solved using any type of production system, even if it's
inefficient.
Practically:
Some types of production systems work better for certain problems.
o For example, monotonic and partially commutative systems are good for
problems where backtracking isn’t needed (called ignorable problems).
o However, they might cause duplication of states during search, so efficiency is
still a concern.
PROBLEM CHARACTERISTICS
In Artificial Intelligence (AI), solving problems often involves using smart shortcuts called
heuristics. These are rules based on experience that help make faster decisions—but they work
best in specific types of problems (they are domain-specific).
AI uses these heuristics in the form of IF–THEN rules, especially in systems called production
systems, to solve complex problems without having to try every possible solution.
Problem Decomposition
Breaking a big problem into smaller, easier parts helps solve it more efficiently. This is an
intelligent behavior in AI.
Problem:
Illustrated Breakdown:
Each part can be solved individually:
Ignorable Problems:
You can skip wrong steps and try another path.
Example: Proving a theorem.
Recoverable Problems:
You can undo previous steps and try again.
Example: 8-puzzle game.
Irrecoverable Problems:
Once a move is made, it can’t be undone.
Example: Playing chess.
Predictable:
You always know what will happen (e.g., 8-puzzle).
Unpredictable:
The outcome is uncertain (e.g., playing Bridge).
These need planning with feedback—but this can be time-consuming.
Consider the problem of answering questions based on a database of simple facts such as the
following: Siva was a man.
No mortal lives longer than 100 years. Suppose we ask a question; ‘Is Siva alive?’ By
representing these facts in a formal language, such as predicate logic, and then using formal
inference methods we can derive an answer to this question easily. There are two ways to answer
the question shown below: Method I
Method II
Answer: So Siva is not alive. It is the answer from the above methods. We are interested to
answer the question; it does not matter which path we follow. If we follow one path successfully
to the correct answer, then there is no reason to go back and check another path to lead the
solution.
Solutions can be good in different ways. They can be good in terms of time or storage or in
difficulty of the algorithm. In case of the travelling salesman problem, finding the best path can
lead to a significant amount of computation. The solution of such problems is only possible by
using heuristics. In this type of problem, a path is found of a distance of 8850 miles and another
one of 7750. It is clear that the second is better than the first but is it the best? Infinite time may
be needed and usually heuristics are used to find a very good path in finite time.
Each search process can be considered to be a tree traversal. The object of the search is to find a
path from the initial state to a goal state using a tree. The number of nodes generated might be
huge; and in practice many of the nodes would not be needed. The secret of a good search
routine is to generate only those nodes that are likely to be useful, rather than having a precise
tree. The rules are used to represent the tree implicitly and only to create nodes explicitly if they
are actually to be of use. The following issues arise while searching:
The tree can be searched forward from the initial node to the goal state or backwards from the
goal state to the initial state.
To select applicable rules, it is critical to have an efficient procedure for matching rules against
states.
This is the knowledge representation problem or the frame problem. In games, an array suffices;
in other problems, more complex data structures are needed.
Finally, in terms of data structures, considering the water jug as a typical problem do we use a
graph or tree? The breadth-first structure does take note of all nodes generated but the depth-first
one can be modified. For checking duplicate nodes follow these steps: 1. Observe all nodes that
are already generated, if a new node is present. 2. If it exists add it to the graph. 3. If it already
exists, then a. Set the node that is being expanded to the point to the already existing node
corresponding to its successor rather than to the new one. The new one can be thrown away. b. If
the best or shortest path is being determined, check to see if this path is better or worse than the
old one. If worse, do nothing. Better save the new path and work the change in length through
the chain of successor nodes if necessary.
Example: Tic-Tac-Toe State spaces are good representations for board games such as Tic-Tac-
Toe. The position of a game can be explained by the contents of the board and the player whose
turn is next. The board can be represented as an array of 9 cells, each of which may contain an X
or O or be empty.
Solving Problems using Search
Given an informal description of the problem, construct a formal description as a state space:
Define a data structure to represent the state.
Make a representation for the initial state from the given data.
Write programs to represent operators that change a given state representation to a
new state representation.
Write a program to detect terminal states.
1. Direction of Search
One of the first and most important decisions in designing a search program is choosing the
direction in which the search will proceed. In general, searches can be either forward—starting
from the initial state and progressing toward the goal—or backward—beginning from the goal
and tracing steps back to the initial state. This directional choice has a significant impact on both
the efficiency and feasibility of the search. Forward search is intuitive and often easier to
implement, especially when the initial conditions are well known and clearly defined. However,
in scenarios where the goal is known but the path to it is ambiguous (as in puzzle-solving or
reverse planning), backward search may be more effective.
Moreover, some problems lend themselves naturally to one direction over the other. For
example, in route planning with known maps, forward search is suitable; but in goal-driven
systems like theorem proving, backward search is more practical as it helps determine what
conditions need to be satisfied. In some advanced systems, bidirectional search is employed—
searching forward from the start and backward from the goal simultaneously—to significantly
reduce the search space. However, implementing this requires careful synchronization and
memory management. Ultimately, the selection of search direction must be guided by the
problem structure and the available computational resources.
2. Rule Matching
Rule matching refers to the process of identifying applicable rules that can be used to transition
from the current state to the next possible states. In AI systems, particularly those based on
production rules or state-transition models, efficient rule matching is critical to performance.
Poorly optimized rule matching can cause the system to slow down, especially when dealing
with a vast number of rules or a large state space. The core challenge is to ensure that the
program can quickly and accurately determine which rules are relevant to the current state and
should be applied next.
To address this, various techniques have been developed. For instance, pattern matching
algorithms and indexing methods can significantly accelerate the rule selection process. In more
complex environments, discrimination networks like Rete or TREAT algorithms are used to
compile and match rules efficiently against working memory. The ability to filter and prioritize
applicable rules ensures that only promising branches of the search tree are explored. This
improves both time complexity and computational cost, making rule matching a cornerstone of
efficient AI problem-solving.
3. Node Representation
Another vital concern in search program design is the way in which nodes (or states) are
represented. Each node in a search tree or graph encapsulates the current state of the problem,
along with information such as the path taken to reach it, the cost incurred, and sometimes
additional metadata like parent or child nodes. Choosing the right data structure to represent
nodes has a direct impact on the speed and scalability of the search. For simple problems such as
tic-tac-toe, a two-dimensional array might suffice to represent the board state. But for complex
problems like robotic path planning or language translation, more elaborate data models such as
linked lists, graphs, trees, or object-oriented representations are required.
This design issue is closely related to the knowledge representation problem, often referred to as
the frame problem. The frame problem deals with how to represent what changes and what stays
the same in a given state after an action is taken. For instance, in a chess game, moving a piece
changes only a part of the board; efficiently representing this without recomputing the entire
state is key. Additionally, node representation must support easy comparison (for detecting
duplicates), easy expansion (for generating successors), and efficient memory use. Therefore,
selecting an appropriate representation strategy is essential to balancing accuracy, performance,
and memory efficiency.
The decision to represent the search space as a tree or a graph is a fundamental design choice in
search algorithms. A tree structure is straightforward and suitable when each state leads to
entirely new and distinct subsequent states. This is common in educational or conceptual
problems where duplication is minimal. In such cases, each node has one unique parent, and
breadth-first or depth-first traversal is relatively simple to implement. However, in practical,
real-world problems such as pathfinding or game trees, states often recur or overlap, leading to
duplicate nodes if a tree structure is used.
To handle this, a graph structure is often more appropriate. Graphs allow for nodes to have
multiple parent states, enabling efficient handling of state reuse and cycles. This is particularly
important in search problems like the water jug problem or route optimization, where different
paths can lead to the same outcome. Although graphs require more overhead in terms of
bookkeeping and memory—as they need to store lists of visited nodes and maintain references—
they are far more effective at avoiding redundant computations. Using graphs also enables more
advanced search algorithms like A*, which benefit from cost evaluation and path updating. Thus,
the tree-versus-graph decision should be guided by the nature of the problem and the likelihood
of state duplication.
5. Node Duplication
The typical procedure involves three steps: First, the system checks whether a newly generated
node exists in the list of previously explored nodes. If it is new, it is added to the search graph. If
it already exists, the system must decide whether to link to the existing node or update it. When
the objective is to find the best path, the program compares the cost of the newly generated path
with the one already stored. If the new path is shorter or more efficient, the existing node is
updated, and the improved cost is propagated through its successors, if necessary. This ensures
that the best-known solutions are retained, and inefficient paths are discarded. Advanced
algorithms like A* and Dijkstra's algorithm incorporate such mechanisms inherently, making
them robust for real-world applications. Efficient handling of node duplication not only
optimizes performance but also ensures accuracy and completeness in pathfinding tasks.
In many AI problems, the search space is too vast to explore exhaustively. This is where
heuristics play a critical role. A heuristic is an informed guess or strategy that helps guide the
search process toward the most promising areas of the search space. Heuristics aim to improve
efficiency by avoiding unlikely or irrelevant paths and focusing computational efforts where the
solution is more probable. The effectiveness of a heuristic can significantly impact the speed and
quality of the solution.
Heuristics are used in informed search algorithms such as A*, Greedy Best-First Search, and Hill
Climbing. These algorithms rely on heuristic functions—often called cost functions or evaluation
functions—to estimate how close a given state is to the goal. For example, in the 8-puzzle
problem, a common heuristic is the number of misplaced tiles or the Manhattan distance. Good
heuristics are admissible (never overestimate the true cost to reach the goal) and consistent
(satisfy the triangle inequality). Designing heuristics requires domain knowledge and a deep
understanding of the problem structure.
However, poorly chosen heuristics can mislead the search, resulting in longer runtimes or missed
solutions. Therefore, a balance must be struck between heuristic accuracy and computational
overhead. Heuristic design is both an art and a science and remains one of the most active areas
in AI research.
Question Bank
Search
Reasoning
Learning