Clande Gemini: With $
Clande Gemini: With $
with
Made is
clande $ Gemini
unit 1
Al
ML
What is AI?
DL
Importance of AI:
• Solve real-world problems accurately (health, marketing, traffic etc.)
• Create virtual personal assistants (Siri, Alexa etc.)
• Build robots for high-risk environments
• Enable new technologies and opportunities
Goals of AI:
• Replicate human intelligence.
• Solve knowledge-intensive tasks.
• Intelligently connect perception and action.
• Perform tasks requiring human intelligence (e.g., proving theorems, playing
chess, surgical planning, driving in traffic).
• Exhibit intelligent behavior, learn autonomously, demonstrate, explain, and
advise.
Advantages of AI:
• High accuracy with fewer errors.
• High-speed decision-making.
• High reliability in performing tasks.
• Useful in risky situations.
• Provides digital assistance.
• Enhances public utilities like self-driving cars, facial recognition, natural
language processing.
Disadvantages of AI:
• High cost of hardware and software.
• Limited ability to think creatively or outside programmed parameters.
• Lacks emotions and feelings, leading to potential harm if not carefully
managed.
• Increases dependency on machines, potentially diminishing human mental
capabilities.
• Lacks original creativity compared to human intelligence.
AI Problems:
Artificial Intelligence (AI) aims to create computer systems that exhibit intelligent
behavior similar to human intelligence. However, intelligence itself has inherent
limitations in areas like perception, memory, and computational capabilities. AI
research seeks to understand the underlying computations required for intelligent
behavior across various aspects:
1) What are the core assumptions about the nature of intelligence and the
cognitive processes that define it?
The initial assumption was computers could excel by brute-force, exploring all
solutions leveraging raw speed. However, it was realized these problems require
significant knowledge representation.
2 Knowledge Representation:
• Knowledge must be represented in a form that is understandable to both
humans and machines.
• Techniques like rules, frames, semantic networks, and logic facilitate this
representation.
• They capture generalizations, group similar concepts, and enable reasoning
and inference.
3 Abstraction:
• Abstraction is the process of identifying and representing essential features
while ignoring irrelevant details.
• It helps manage complexity by focusing on high-level concepts and patterns.
• Techniques like hierarchical abstraction, problem decomposition, and
constraint propagation are employed.
• Algorithm:
1 Represent the current board state as a vector.
2 Convert the vector to a decimal number.
3 Use the decimal number as an index to look up the optimal move in a
massive pre-computed table called "MOVETABLE". This table contains
entries for every possible board configuration.
4 Update the board state based on the recommended move from the table.
• Comments:
◦ This approach is fast but incredibly inefficient in terms of space. The
"MOVETABLE" requires immense storage space to hold optimal moves for all
possible board configurations.
◦ Creating and maintaining such a table is labor-intensive and prone to
errors.
◦ It lacks generalizability - this technique wouldn't scale well to larger or
more complex games due to the exponential explosion in possible board
configurations.
• Data Structures:
◦ Board: A nine-element vector representing the board state (0: blank, 1: X,
2: O).
◦ Turn: An integer indicating the current move number (1-9).
• Algorithm:
1 Utilize three subroutines:
▪ Make2: Returns the center square if blank, otherwise, a random non-corner
blank square.
▪ Posswin(p): Checks rows/columns/diagonals, returns 0 if player p can't win
next move, else returns the winning square number
▪ Go(n): Makes a move to square n, updating the board and turn.
• Algorithm:
1 Evaluate all possible next moves and the opponent's potential replies.
2 For each move, simulate the game forward for several steps, estimating the
likelihood of winning from each possible future state.
3 Choose the move that leads to the most promising future outcome for the AI
player.
• Comments:
◦ This approach offers better decision-making compared to the previous two
but requires significant computational resources and sophisticated algorithms.
◦ Requires knowledge of overall game strategy beyond basic tactics.
Levels of AI Models:
- Level 1: Programs that solve trivial problems easily, that are solvable by
computers without AI techniques
- Examples: EPAM (memorizing syllables) - It is of interest only to
psychologists
- Level 2: Programs that solve non-trivial problems using AI techniques, with the
goal of modeling human performance
- Reasons for modeling human performance:
- Testing psychological theories of human performance (e.g., PARRY -
simulating paranoid behavior)
- Enabling computers to understand human reasoning (e.g., answering questions
based on human behavior)
- Allowing humans to understand computer reasoning (transparency and
acceptance)
- Exploiting knowledge from experts (e.g., GPS - General Problem Solver)
Key Characteristics:
- Level 1 programs use direct methods without AI techniques
- Level 2 programs use AI techniques, including:
- Search (when no direct method is available)
- Knowledge representation (about problem domain objects)
- Abstraction (for pruning and real-time solutions)
In summary, AI models can either solve trivial problems directly or tackle non-
trivial problems using AI techniques like search, knowledge representation, and
abstraction. The goal for the latter is to model human performance, either by
replicating human reasoning or finding the most efficient solution, while
accounting for factors like transparency, acceptance, and expert knowledge.
Criteria for success:
Defining success criteria is critical for AI projects. A key question is "How do we
determine if a machine is truly intelligent?" Turing proposed the "Turing Test" in
1950 to evaluate this, involving an interrogator interacting with a human and
machine to determine which is which. However, concerns exist about the vast
knowledge required for machines to pass.
For AI programs, specifying criteria for success within their intended restricted
domains is crucial, as this currently provides the best measure of progress in the
field.
Problem, Problem space and Search:
To build a system capable of solving a particular problem, four key steps are
required:
• Defining the Problem: Precise definition including initial and final
situations.
• Problem Analysis: Identifying crucial features for selecting appropriate
problem-solving techniques.
• Task Knowledge Representation: Isolating and representing essential task
knowledge.
• Selecting Problem-Solving Techniques: Choosing the most suitable
techniques for the problem at hand.
State space search is a common approach in Artificial Intelligence, particularly
for games. It represents a problem as a series of states and actions (operators)
that transition between them. Key components of a state space include:
• States: All possible configurations of the problem (e.g., board positions in
a game).
• Operators: Actions that change the state (e.g., legal moves in a game).
• Initial State: The starting point of the problem.
• Goal States: The desired end states (often identified by a program).
You have two jugs, one with a 4-gallon capacity and another with a 3-gallon
capacity. Neither jug has any measuring markers. There is a pump to fill the jugs
with water. The task is to get exactly 2 gallons of water into the 4-gallon jug.
↳ Production Rules :-
(x y)
,
>
-
(4y)
,
Ifa > y
(x y) ,
>
-
(x 3) ,
If y > 3
(x %) ,
>
- (x d y)
-
If x >0
(2 , %) >
-
(x y d) ,
-
If y > 0
12 .
% >
-
(0 y) ,
If n > 0
(214) >
-
(x, 0)
If y>
(4 y) ,
>
- (4 y (4 ,
-
-
x)
Ifx +y = 4 andy > 0
(2 %) ,
>
- (x -
(3 -
y) 3) ,
If n +y = 3 and >
(4 %) ,
>
-
(2 +y 0) ,
If 4 and
y> 0
U+
y =
18 %) .
>
- (0 ,
x +
y)
If n + 3 and 20
y
=
10 ,
2) >
- /2 0) ,
(2 ,
y) >
- (0 , y)
whichone O 0 10 0
checking
, ,
- =
14 0 (0 3)
gallon
, ,
.
-
0
, 0
13 , 0
(4 3)
,
10 , 03
0
, 3
3, 3 10 3)
, 10 0) ,
Y
13, 3)
,2
same water level 3, 3
4, 2
(4 2)
,
(0 3), (3 01,
0. 2
10 , 2)
(2 01,
(42) (0 2) ,
Production Systems:
1) Global Database: This is the primary database containing all the necessary
information to complete a task. It is divided into temporary and permanent parts.
2) Production Rule Set: A set of rules that operate on the global database, each
consisting of a precondition and a postcondition.
3) Control System: The decision-maker that determines which production rule to
apply and when to stop the computation based on termination conditions.
Working Principle:
The production rules operate on the global knowledge database. Each rule has a
precondition that is either satisfied or not by the current state of the database. If
the precondition is satisfied, the rule can be applied, and its corresponding action
is executed, changing the global database. The control system determines which
applicable rule should be fired and stops the computation when a termination
condition is met.
Monotonicity:
• A monotonic production system is one where applying a rule never prevents
another rule from being applied later. Allows simultaneous application of rules
without interference.
• A non-monotonic production system is one where applying a rule can
prevent other rules from being applied later. Efficiently solves problems without
backtracking.
Commutativity:
• A partially commutative production system has the property that if a
sequence of rules transforms one state to another, any permutation (reordering) of
those rules that satisfies all preconditions will also transform the initial state to
the final state
• A non-partially commutative system is one in which the order of rule
application matters.
While all problem types can theoretically be solved by any production system,
practical considerations guide the selection of the most suitable system for a given
problem.
Partially commutative, monotonic production systems are effective for solving
ignorable problems, where backtracking to previous states is unnecessary.
Non-partially commutative systems are useful for problems involving permanent
changes, where backtracking is essential to correct mistakes.
Problem Characteristics:
This problem can be solved by breaking it into smaller problems, each of which
we can solve by using a small collection of specific rules.
2) Reversibility: Is it possible to undo solution steps if they are found to be unwise
or leading to a dead-end?
This gives rise to three problem categories:
a) Ignorable (e.g., theorem proving): Solution steps can be simply ignored without
consequences.
b) Recoverable (e.g., 8-puzzle): Solution steps can be undone, and the solver can
backtrack to previous states.
c) Irrecoverable (e.g., chess): Once a move is made, it cannot be undone, and the
solver must proceed from the current state.
7) User Interaction: Does the solution process require interaction with a user, or
can it be fully automated?
The nature of solution steps (reversible or not) impacts the search strategy. In
recoverable cases, backtracking and undoing steps is possible, while in
irrecoverable cases, the solver must commit to each move.
For some problems, like querying a knowledge base, there may be multiple valid
paths to the solution. If one path successfully leads to the correct answer, there is
no need to explore alternative paths, as the goal is to find a solution rather than the
specific solution process.
Issues in the Design of Search Programs:
1) Tree Traversal:
• The search process involves traversing a tree from the initial state to a goal
state.
• Generating nodes in the tree can lead to a large number of unnecessary
nodes.
• Effective search algorithms generate only nodes likely to be useful.
• Search can proceed forward from the initial node to the goal state or
backward from the goal state to the initial state.
4) Node Representation:
Search Tree:
Pathfinding is the process of finding the most efficient route between two nodes
in a graph. It's a fundamental problem in computer science and is essential in
various applications, including route planning in GPS systems, navigation in
video games, and network routing in telecommunications.
Both BFS and DFS are fundamental algorithms in pathfinding and are often used
as building blocks for more advanced pathfinding algorithms, such as A* (A-
star), Dijkstra's algorithm, and various heuristic-based approaches.
und ↳
-S :
Predicate Logic:
In the last statement, ∀x (read as "for all x") is a universal quantifier, and → (read
as "implies") is a logical connective. This statement represents the relationship
between being a man and being mortal, allowing the inference that "Marcus is
mortal" and "Plato is mortal" from the given statements.
Predicate logic also includes other logical connectives like "and" (∧), "or" (∨), and
"not" (¬), which help in constructing more complex logical expressions.
1. Simple relationships like greater-than (gt) and less-than (lt) can be expressed as
computable predicates:
- gt(1,0) means "1 is greater than 0"
- lt(0,1) means "0 is less than 1"
4. Using quantifiers like "for all" (∀), general rules can be expressed:
- ∀x: man(x) → mortal(x) means "All men are mortal"
Resolution Steps:
The resolution rule is a single inference rule that operates efficiently on clauses in
conjunctive normal form. It works by combining two clauses that contain
complementary literals (a literal and its negation) and resolving them to produce a
new clause.
Example :-
war dayyouwillegya
If it is
hnay and
If it is rainin
8
It is a warm
day.
It is
gaining .
It is
sunny
Goal :3 You will
enjoy
.
enjoy
(1 means AND ,
>
- means
implies)
2) It is a warm
day
.
FOL : - Warm
9) Itishai
to
2) It is
sunny
FOLie O
Sunny a
# negate
-
We have eliminate their
to
- A
~
b can be written
as
2 .
/Sunny 1 Wase)
a)
Want
+
Oh
Sunny 1
enjoy
b) <
raining V Wet
3
Negate the statement to be .
proved
Ihe statement to be
proved is is
enjoy
and its will be
negate is
enjoy
Fl· contradition
Now in our
-enjoywherever
statements the contradiction will consider that
of Tenjoy occurs we
statement -
-Enjoy >
Sunny 1 Twarm
Venjoy
Now these two
we will
apply unification method
& on
,
-Enjoy >
Sunny 1 Twarm
Venjoy
1 Warm
Samay
+
Now in our statements wherever the contradiction Warm will consider that
of occurs we
statement .
flow statement
17 warm =
+
Sunny warm
>
Stung
Now in our statements wherever the contradiction will consider that
Isunny
of occurs we
statement
S from e
statement
.
sury
>
Sunny ->
E1 -
contradiction
#
We
got an
y
emy statement which is a contradiction
Conditions of Unification:
1- Both the predicates to be unified should have an equal number of terms.
2- Neither ti nor si can be a negation operator, or predicate or functions of different
variables, or if ti = term belonging to si or if si = term belonging to ti then
unification is not possible.
21
and the negated goal = ¬ r. Set S thus includes all these 5 clauses. Now by resolution
algorithm, we construct the solution by a tree. Since it terminates with a null clause,
the goal is proved.
22
Example I2:
"All people who are not poor and are smart are hippy. Those people who' read are not
stupid. John can read are is wealthy. Happy people have exciting lives. Can anyone be
found with an exciting life?"
Sol.:
a) First change the sentences to predicate form:
b) These predicate calculus expressions for the happy life problem are
transformed into the following clauses:
23
Figure (2): Resolution prove for the "exciting life" problem.
24
Natural Deductions :- It is
of proof calculus
a kind in which
logical reasonin
is
expressed by inference sales closely
related to the natural
way of reasoning
Inference
sules be stated as below
may
is
Introducing (1) (1 1) :
If A
,
, , . .. .
to them A, MA nAu If A As
....
is
,,
also
....
thre
An ale true then
,
conjuction A 1Az
,
....
An
A ,
1A ... An are the then Ai is also
then Ai (li < n)
Convert to clause form: FOL->CNF
Convert the following statement to clause form:
∀x[B(x)→ ( ∃y [ Q(x,y) ∧ ⎤ P(y) ]
∧ ⎤ ∃y [ Q(x,y) ∧ Q(y,x) ]
∧ ∀y [ ⎤ B(y) → ⎤ E(x,y)] ) ]
2- Move the negation down to the atomic formulas (by using the following rules)
• ⎤ (P∧Q) ≡ ⎤P ∨ ⎤Q
• ⎤ (P∨Q) ≡ ⎤P ∧ ⎤Q
• ⎤(⎤(P)) ≡ P
• ⎤ ∀x ( P (x) ) ≡ ∃x (⎤ P (x) )
• ⎤ ∃x ( P (x) ) ≡ ∀x (⎤ P (x) )
17
3- Purge existential quantifiers
The function that is eliminate the existential are called “ Skolem function”
∀x[⎤ B(x) ∨ ( [ Q(x , f (x)) ∧ ⎤ P(f (x)) ]
∧ ∀y [ ⎤ Q(x,y) ∨ ⎤ Q(y,x) ]
∧ ∀y [ B(y) ∨ ⎤ E(x,y)] ) ]
18
7- Eliminate the conjunctions
∀x [ ⎤ B(x) ∨ ( Q(x , f (x) ]
∀x [⎤ B(x) ∨ ⎤ P(f (x) ) ]
∀x ∀y [ ⎤ B(x) ∨ ⎤ Q(x,y) ∨ ⎤ Q(y,x) ]
∀x ∀z [⎤ B(x) ∨ B(z) ∨ ⎤ E(x,z) ]
8- Rename all the variables, as necessary, so that no two variables are the same.
∀x [ ⎤ B(x) ∨ ( Q(x , f (x) ]
∀w [⎤ B(w) ∨ ⎤ P(f (w) ) ]
∀u ∀y [⎤ B(u) ∨ ⎤ Q(u,y) ∨ ⎤ Q(y,u) ]
∀a ∀z [⎤ B(a) ∨ B(z) ∨ ⎤ E(a,z) ]
19
Representations and Mappings
Types of Knowledge:
1) Tacit Knowledge
1. Relational Knowledge:
2. Inheritable Knowledge:
3. Inferential Knowledge:
4. Procedural Knowledge:
1. Important Attributes:
• Two attributes that are generally significant are "instance" and "isa" as they
support property inheritance.
3. Choosing Granularity:
4. Set of Objects:
• Certain properties may be true for objects as members of a set but not as
individuals.
• Representing sets of objects is more efficient than associating properties
with each individual element.
• Sets can be represented using the universal quantifier in logical
representations or as nodes in hierarchical structures with inheritance.
Solutions Proposed:
3) Frames & Scripts Approach (Minsky & Schank): Categorizes and segments the
world into frames or scripts to develop routines for specific scenarios.
Components:
Relations:
Example:
1) Computational time: Traversing the entire network to answer queries can be time-
consuming, and the solution may not exist in the network.
2) Limited scale: Modeling human-like memory with vast numbers of neurons and
connections is not practical.
3) Lack of quantifiers: Semantic networks do not have equivalent quantifiers (e.g.,
for all, for some, none).
4) No standard link names: There is no standard definition for the names of links
(arcs).
5) Lack of intelligence: Semantic networks depend on the creator of the system and
are not inherently intelligent.
2
unit
Non-monotonic reasoning:
We have to retract our initial conclusion that Tweety can fly, since penguins are a
type of bird that cannot fly. The addition of new information caused us to revise
our beliefs.
Advantages:
Disadvantages:
Metaclasses:
Relating Classes:
Slots as Frames:
Slots as Relations:
Algorithm:
Example:
Advantages:
• Uses limited memory as it only needs to store the current path being
explored
• Easy to implement and can be recursive
• Can quickly find a solution path, if one exists close to the root
Disadvantages:
BFS is a search strategy used in AI and computer science to explore all nodes at
the current depth level before moving on to nodes at the next depth level. It
searches horizontally outward from the starting node, ensuring all possibilities at
each level are explored before going deeper.
Algorithm:
1) Initialization: Start with the starting node, enqueue it into a queue, and mark it
as visited.
2) Exploration: While the queue is not empty:
• Dequeue a node and visit it.
• Enqueue all unvisited neighbors of the dequeued node and mark them as
visited.
3) Termination: Repeat until the queue is empty.
Example:
Step: 1
We pick A as the starting point and add A to the Queue. To prevent cycles, we
also mark A as visited(by adding it to the visited set).
Step: 2
We remove the head of the Queue (i.e. A now). The Node was First In (inserted
first) in the Queue.
We process A and pick all its neighbours that have not been visited yet(i.e., not
in the visited set). Those are D, C, and E.
We add D, C, and E to the Queue and these to the visited set.
Step :3
Next, we pull the head of the Queue, , i.e. D.
We process D and consider all neighbours of D, which are A and E, but since
both A and E are in the visited set, we ignore them and move forward.
Step :4
Next, we pull the head of the Queue, i.e. E.
We process E.
Then we need to consider all neighbours of E, which are A and D, but since both
A and D are in the visited set, we ignore them and move forward.
So we see that the Breadth-First Search relies on 2 other data structures i.e. A
queue and a Visited Set (or Arrays).
Advantages:
Disadvantages:
Where:
Special Considerations:
Common approaches:
• Certainty factor models have been largely replaced by Bayesian Belief Networks
(BBNs).
• BBNs provide a more expressive and principled way to represent and reason
with uncertainties.
• Build global probabilistic models instead of isolated certainty propagation in
rules.
Rule-based Systems:
Key Characteristics:
Examples:
Advantages:
Limitations:
Bayesian Network can be used for building models from data and experts
opinions, and it consists of two parts:
◦ Each node has a CPT specifying its probability given its parent nodes
◦ Quantifies the strengths of the dependencies
Directeda
Applications:
Advantages:
Disadvantages:
Need:
Characteristics:
Imagine there is a murder that has taken place in a room with 4 people present -
Alice (A), Bob (B), Charlie (C), and Dana (D). The victim is Bob, who was
stabbed in the back with a knife.
Using Dempster-Shafer theory, we can assign belief masses (m) to each of these
scenarios based on the evidence available. For example, if there is strong
evidence implicating Alice, we may assign a high belief mass to the scenario
{A}.
As more evidence comes in, we update the belief masses accordingly using
Dempster's rule. The belief and plausibility in different scenarios guide our
conclusion.
Disadvantages:
Fuzzy Logic is a form of multi-valued logic that allows for partial truths, not
just true/false.
Based on the idea that many situations cannot be defined as completely true or
false.
In the boolean system truth value, 1.0 represents the absolute truth value and
0.0 represents the absolute false value. But in the fuzzy system, there is no
logic for the absolute truth and absolute false value. But in fuzzy logic, there is
an intermediate value too present which is partially true and partially false.
• Fuzzy Sets: Represent the output as a set of membership degrees for each
possible value.
Fuzzy Logic Systems Architecture:
Applications:
Purpose:
Key Components:
1) Knowledge Base:
• Contains domain-specific knowledge from human experts.
• Includes facts, rules, procedures, and case data.
2) Inference Engine:
• Applies logical rules to known facts to derive new facts or conclusions.
• Uses techniques like forward chaining and backward chaining.
4) User Interface:
• Enables users to interact with the system and provide input.
• Presents recommendations, solutions, and explanations.
5) Explanation Module:
• Provides justifications and reasoning for the system's conclusions.
• Increases transparency and trust in the system.
Examples:
• MYCIN: Early expert system for diagnosing and treating bacterial infections.
• DENDRAL: System for analyzing molecular structures from spectrographic
data.
• XCON: Configured computer systems based on user requirements.
Development Process:
Advantages:
Disadvantages:
Applications:
Example:
Output: [1, 2, 3, 4, 5]
Example:
Output: [1, 2, 3, 4, 5]
In this example, the declarative knowledge is represented by the use of the map
function, which operates on each element of the array a and applies the provided
function (number * 1, which simply returns the number itself). The declarative
knowledge here is the concept of mapping a function over an array to create a new
array.
Both examples produce the same output, but they differ in their approach and the
type of knowledge used. Procedural knowledge focuses on the step-by-step
instructions, while declarative knowledge focuses on describing the facts and
relationships.
S
Logic programming:
These rules take the form of Horn clauses, which are clauses with at most one
positive literal. Examples are: P, P⋁Q, P→Q
In logic programming languages like Prolog, programs are actually sets of Horn
clauses transformed as:
The key difference between logical and Prolog representations is that Prolog
has a fixed control strategy determining how to search for answers, while pure
logical assertions only define the set of answers without specifying how to find
them.
In forward reasoning, the AI system is first provided with one or more constraints
or facts. It then searches its knowledge base to find rules that match these given
constraints. Any rule whose conditions are satisfied by the provided facts is
triggered. The conclusions derived from these triggered rules generate new facts.
These new facts are then added to the initial set of facts, and the process repeats
with the AI continuing to apply more rules that match the incremented set of facts
and constraints. This cycle continues until no new facts can be derived.
The AI system first selects a goal state that it wants to prove or establish. It then
looks for rules in its knowledge base whose conclusions match this goal. For each
such rule, it treats the rule's conditions as sub-goals that need to be satisfied for
the main goal to be derived. The system then tries to find facts in its initial data
that satisfy these sub-goals.
If the system can find a set of initial facts that satisfies all the sub-goals of a rule,
then that rule's conclusion (the original goal) is considered proven based on those
facts. However, if no set of initial facts can satisfy all the sub-goals
simultaneously, then the goal is rejected.
Heuristic algorithms are not truly intelligent themselves, but they appear
intelligent because they achieve better performance compared to blind search
methods. They work by taking advantage of feedback from the data to direct the
search path towards more promising areas of the solution space.
Such techniques allow finding satisfactory solutions within reasonable time and
memory constraints. Some prominent informed search algorithms are:
1) Generate and Test - Generate candidate solutions and test if they satisfy the
problem.
2) Best-first Search - Explore the most promising node first based on an evaluation
function.
3) Greedy Search - Make the locally optimal choice at each step with the hope of
finding a global optimum.
4) A* Search - An optimal best-first search that uses a heuristic to focus on paths
likely to lead to the solution.
The key idea behind heuristic search is to use domain-specific knowledge encoded
as heuristic functions to intelligently prune the search space and focus effort on
fruitful regions, trading off completeness for efficiency when finding an optimal
solution is impractical.
Generate and Test
To make it more efficient, a heuristic function can guide and prune the generate phase
by ranking/prioritizing more promising candidates. This avoids wasted effort on
unpromising paths.
For complex problems, generate and test alone may be inefficient. It can be combined
with other techniques like constraint satisfaction to first reduce the search space before
applying systematic generation and testing on the reduced space (like in the
DENDRAL AI program).
For the generate phase to be effective, the candidate solution generators should have
some key properties:
Hill Climbing is a local search optimization algorithm that tries to find the best
solution to a problem by continually moving in the direction of increasing value
or elevation. It starts from an initial state and keeps climbing by transitioning to
neighboring states that have better objective function values, until it reaches a
peak where no further improvement is possible among the neighbors.
1. Simple Hill Climbing: Evaluates only one successor state and moves there if it
is better than the current state.
Algorithm for Simple Hill Climbing:
◦ Step 1: Evaluate the initial state, if it is goal state then return success and Stop.
◦ Step 2: Loop Until a solution is found or there is no new operator left to apply.
◦ Step 3: Select and apply an operator to the current state.
◦ Step 4: Check new state:
1) If it is goal state, then return success and quit.
2) Else if it is better than the current state then assign new state as a current state.
3) Else if not better than the current state, then return to step2.
◦ Step 5: Exit.
2. Steepest Ascent: Evaluates all successor states and moves to the best neighbor,
even if not strictly better than the current state.
• Local Maxima: Peaks that are suboptimal compared to other higher peaks in
the landscape.
• Plateaus: Flat regions where all neighbors have equal value, providing no
sense of direction.
• Ridges: Elongated areas that are better than neighbors, but not peaks.
The main strengths of Hill Climbing are its simplicity and efficiency when good
heuristics are available. However, it is not complete and can get trapped in
suboptimal regions. It works best for landscapes with small numbers of peaks.
Best First Search
Best First Search is an informed search algorithm that tries to find the optimal
solution by exploring the most promising paths first. Unlike breadth-first and
depth-first searches which explore blindly, Best First Search uses an evaluation
function to estimate which neighboring nodes are most likely to lead to the goal,
and expands those nodes first.
So at each step, the most promising path based on the evaluation function is
expanded, in an attempt to quickly reach the goal without exploring unpromising
paths.
The time complexity is O(n log n) in the worst case of exploring all nodes, due to
the log n cost of priority queue operations.
In some AI problems, the overall problem can be broken down into a set of
sub-problems. Solving each sub-problem separately and combining their
solutions yields the solution to the original larger problem. Such
decomposable problems are represented using AND-OR graphs or trees.
1) Start with G containing just the initial state node INIT. Compute h'(INIT).
3) If INIT was solved, the marked path from INIT is the solution tree
This allows AO* to find the minimum cost solution in AND-OR graphs
effectively, unlike A* which can get stuck at AND nodes by underestimating
costs.
However, AO* has higher memory overhead from storing the entire explored
graph G. Its time complexity also remains exponential in the worst case for
solving intractable problems.
Constraint Satisfaction Problems
1) Variables: These are the unknowns that need to be determined. For example,
in a Sudoku puzzle, the variables represent the cells that need to be filled with
numbers.
2) Domains: Each variable has a domain, which is the set of possible values that
can be assigned to it. Domains can be finite (e.g., numbers 1-9 for Sudoku cells)
or infinite.
3) Constraints: These are the rules or restrictions that govern how variables are
related and what value combinations are valid or invalid. Constraints limit the
values variables can take based on the values of other variables.
The goal is to find an assignment of values to all variables that satisfies all the
given constraints simultaneously.
CSPs provide a powerful general framework for modeling and solving a wide
variety of real-world constraint-based problems like scheduling, resource
planning, configuration, and design tasks.
• Modeling the problem variables, value choices, and constraints linking them
• Using smart search algorithms to explore the constrained solution space
efficiently
• Propagating constraints to prune inconsistent possibilities early
• Finding one or all possible assignments satisfying all constraints
Means-Ends Analysis (MEA)
1) Identify the key differences between the current state and goal state
4) Recursively repeat this process on the new states until the goal is reached
MEA works by continuously evaluating the differences with the goal, and taking
operators that make progress in reducing those differences, rather than exploring
blindly. It interleaves forward and backward reasoning in a goal-directed
manner.
The Means-Ends Analysis approach was first used in the General Problem Solver
(GPS) program and has been applied to various domains like planning, robotics,
theorem proving and games. It exemplifies the general idea of refining a problem
representation until the solution becomes transparent.