The document discusses problem-solving agents and their approach to solving problems. Problem-solving agents (1) formulate a goal based on the current situation, (2) formulate the problem by defining relevant states and actions, and (3) search for a solution by exploring sequences of actions that lead to the goal state. Several examples of problems are provided, including the 8-puzzle, robotic assembly, the 8 queens problem, and the missionaries and cannibals problem. For each problem, the relevant states, actions, goal tests, and path costs are defined.
The document discusses problem solving by searching. It describes problem solving agents and how they formulate goals and problems, search for solutions, and execute solutions. Tree search algorithms like breadth-first search, uniform-cost search, and depth-first search are described. Example problems discussed include the 8-puzzle, 8-queens, and route finding problems. The strategies of different uninformed search algorithms are explained.
The document discusses problem-solving agents and search algorithms. It provides examples of toy problems like the 8-puzzle and real-world problems like touring in Romania. Problem-solving agents work by formulating a goal, formulating the problem as a set of states and actions, and then using a search algorithm to find a solution. Real-world problems are more complex to define than toy problems and people care about the solutions. The document also provides examples of defining the state space, actions, goal tests, and path costs for various problems.
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
The document discusses informed search techniques that use heuristic information to guide the search for a solution more efficiently. It describes how heuristic information about the problem domain can help constrain the search space. Hill climbing and best-first search are two informed search strategies discussed. Hill climbing iteratively moves to successor states with improved heuristic values until a local optimum is reached. Best-first search maintains an open list of promising nodes to explore and prioritizes expanding nodes with the best heuristic values to avoid getting stuck in local optima.
This document summarizes key topics from a session on problem solving by search algorithms in artificial intelligence. It discusses uninformed search strategies like breadth-first search and depth-first search. It also covers informed, heuristic search strategies such as greedy best-first search and A* search which use heuristic functions to estimate distance to the goal. Examples are provided to illustrate best first search, and it describes how this algorithm expands nodes and uses priority queues to order nodes by estimated cost. The next session is slated to cover the A* search algorithm in more detail.
This document discusses various problems that can be solved using backtracking, including graph coloring, the Hamiltonian cycle problem, the subset sum problem, the n-queen problem, and map coloring. It provides examples of how backtracking works by constructing partial solutions and evaluating them to find valid solutions or determine dead ends. Key terms like state-space trees and promising vs non-promising states are introduced. Specific examples are given for problems like placing 4 queens on a chessboard and coloring a map of Australia.
This document discusses propositional logic and knowledge representation. It introduces propositional logic as the simplest form of logic that uses symbols to represent facts that can then be joined by logical connectives like AND and OR. Truth tables are presented as a way to determine the truth value of propositions connected by these logical operators. The document also discusses concepts like models of formulas, satisfiable and valid formulas, and rules of inference like modus ponens and disjunctive syllogism that allow deducing new facts from initial propositions. Examples are provided to illustrate each concept.
The document discusses search strategies in artificial intelligence. It defines key terms like search space, start state, goal test, and search tree. It describes properties of search algorithms like completeness, optimality, time complexity, and space complexity. It differentiates between uninformed searches, which do not use domain knowledge, like breadth-first search and depth-first search, and informed searches, which use heuristics to guide the search more efficiently, like greedy search and A* search. The document outlines the differences between informed and uninformed searches.
The document discusses problem solving by searching. It describes problem solving agents and how they formulate goals and problems, search for solutions, and execute solutions. Tree search algorithms like breadth-first search, uniform-cost search, and depth-first search are described. Example problems discussed include the 8-puzzle, 8-queens, and route finding problems. The strategies of different uninformed search algorithms are explained.
The document discusses problem-solving agents and search algorithms. It provides examples of toy problems like the 8-puzzle and real-world problems like touring in Romania. Problem-solving agents work by formulating a goal, formulating the problem as a set of states and actions, and then using a search algorithm to find a solution. Real-world problems are more complex to define than toy problems and people care about the solutions. The document also provides examples of defining the state space, actions, goal tests, and path costs for various problems.
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
The document discusses informed search techniques that use heuristic information to guide the search for a solution more efficiently. It describes how heuristic information about the problem domain can help constrain the search space. Hill climbing and best-first search are two informed search strategies discussed. Hill climbing iteratively moves to successor states with improved heuristic values until a local optimum is reached. Best-first search maintains an open list of promising nodes to explore and prioritizes expanding nodes with the best heuristic values to avoid getting stuck in local optima.
This document summarizes key topics from a session on problem solving by search algorithms in artificial intelligence. It discusses uninformed search strategies like breadth-first search and depth-first search. It also covers informed, heuristic search strategies such as greedy best-first search and A* search which use heuristic functions to estimate distance to the goal. Examples are provided to illustrate best first search, and it describes how this algorithm expands nodes and uses priority queues to order nodes by estimated cost. The next session is slated to cover the A* search algorithm in more detail.
This document discusses various problems that can be solved using backtracking, including graph coloring, the Hamiltonian cycle problem, the subset sum problem, the n-queen problem, and map coloring. It provides examples of how backtracking works by constructing partial solutions and evaluating them to find valid solutions or determine dead ends. Key terms like state-space trees and promising vs non-promising states are introduced. Specific examples are given for problems like placing 4 queens on a chessboard and coloring a map of Australia.
This document discusses propositional logic and knowledge representation. It introduces propositional logic as the simplest form of logic that uses symbols to represent facts that can then be joined by logical connectives like AND and OR. Truth tables are presented as a way to determine the truth value of propositions connected by these logical operators. The document also discusses concepts like models of formulas, satisfiable and valid formulas, and rules of inference like modus ponens and disjunctive syllogism that allow deducing new facts from initial propositions. Examples are provided to illustrate each concept.
The document discusses search strategies in artificial intelligence. It defines key terms like search space, start state, goal test, and search tree. It describes properties of search algorithms like completeness, optimality, time complexity, and space complexity. It differentiates between uninformed searches, which do not use domain knowledge, like breadth-first search and depth-first search, and informed searches, which use heuristics to guide the search more efficiently, like greedy search and A* search. The document outlines the differences between informed and uninformed searches.
L03 ai - knowledge representation using logicManjula V
The document discusses knowledge representation using predicate logic. It begins by reviewing propositional logic and its semantics using truth tables. It then introduces predicate logic, which can represent properties and relations using predicates with arguments. It discusses representing knowledge in predicate logic using quantifiers, predicates, and variables. It also covers inferencing in predicate logic using techniques like forward chaining, backward chaining, and resolution. An example problem is presented to illustrate representing a problem and solving it using resolution refutation in predicate logic.
The document discusses knowledge-based agents and how they use inference to derive new representations of the world from their knowledge base in order to determine what actions to take. It provides the example of an agent exploring a cave, or "Wumpus world", where the goal is to locate gold and exit without being killed by the Wumpus monster or falling into pits. The agent uses its percepts and knowledge base along with inference rules to deduce its next action at each step.
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
Artificial Intelligence involves representing problems as state spaces and using algorithms to search the state space to solve the problem. The document discusses key concepts in problem solving using search including representing the problem as states, defining state transitions with successor functions, and exploring the resulting state space to find a solution. It provides examples of representing common problems like the 8-puzzle and n-queens as state spaces. The document also summarizes uninformed search strategies like breadth-first, depth-first, and iterative deepening search that use the problem definition to search the state space without using heuristics.
Greedy algorithms make locally optimal choices at each step in the hope of finding a globally optimal solution. The activity selection problem involves choosing a maximum set of activities that do not overlap in time. The greedy algorithm for this problem sorts activities by finish time and selects the earliest finishing activity at each step. This algorithm is optimal because the activity selection problem exhibits the optimal substructure property and the greedy algorithm satisfies the greedy-choice property at each step.
This document discusses problem solving agents in artificial intelligence. It explains that problem solving agents focus on satisfying goals by formulating the goal based on the current situation, then formulating the problem by determining the actions needed to achieve the goal. Key components of problem formulation include the initial state, possible actions, transition model describing how actions change the state, a goal test, and path cost function. Two examples of well-defined problems are given: the 8-puzzle problem and the 8-queens problem.
This slides contains assymptotic notations, recurrence relation like subtitution method, iteration method, master method and recursion tree method and sorting algorithms like merge sort, quick sort, heap sort, counting sort, radix sort and bucket sort.
The Foundations of Artificial Intelligence, The History of
Artificial Intelligence, and the State of the Art. Intelligent Agents: Introduction, How Agents
should Act, Structure of Intelligent Agents, Environments. Solving Problems by Searching:
problem-solving Agents, Formulating problems, Example problems, and searching for Solutions,
Search Strategies, Avoiding Repeated States, and Constraint Satisfaction Search. Informed
Search Methods: Best-First Search, Heuristic Functions, Memory Bounded Search, and Iterative
Improvement Algorithms.
Knowledge representation In Artificial IntelligenceRamla Sheikh
facts, information, and skills acquired through experience or education; the theoretical or practical understanding of a subject.
Knowledge = information + rules
EXAMPLE
Doctors, managers.
This document discusses greedy algorithms and dynamic programming techniques for solving optimization problems. It covers the activity selection problem, which can be solved greedily by always selecting the shortest remaining activity. It also discusses the knapsack problem and how the fractional version can be solved greedily while the 0-1 version requires dynamic programming due to its optimal substructure but non-greedy nature. Dynamic programming builds up solutions by combining optimal solutions to overlapping subproblems.
This document provides an overview of representing graphs and Dijkstra's algorithm in Prolog. It discusses different ways to represent graphs in Prolog, including using edge clauses, a graph term, and an adjacency list. It then explains Dijkstra's algorithm for finding the shortest path between nodes in a graph and provides pseudocode for implementing it in Prolog using rules for operations like finding the minimum value and merging lists.
The document discusses local search algorithms as an alternative to classical search algorithms when the path to the goal state is irrelevant. It describes hill-climbing search, which iteratively moves to a neighboring state with improved value. Hill-climbing can get stuck at local optima. Variations like simulated annealing and stochastic hill-climbing incorporate randomness to avoid local optima. Genetic algorithms use techniques inspired by evolution like selection, crossover and mutation to search the state space. The document uses examples like the 8-queens and 8-puzzle problems to illustrate local search concepts.
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEKhushboo Pal
n artificial intelligence, an intelligent agent (IA) is an autonomous entity which acts, directing its activity towards achieving goals (i.e. it is an agent), upon an environment using observation through sensors and consequent actuators (i.e. it is intelligent).An intelligent agent is a program that can make decisions or perform a service based on its environment, user input and experiences. These programs can be used to autonomously gather information on a regular, programmed schedule or when prompted by the user in real time. Intelligent agents may also be referred to as a bot, which is short for robot.Examples of intelligent agents
AI assistants, like Alexa and Siri, are examples of intelligent agents as they use sensors to perceive a request made by the user and the automatically collect data from the internet without the user's help. They can be used to gather information about its perceived environment such as weather and time.
Infogate is another example of an intelligent agent, which alerts users about news based on specified topics of interest.
Autonomous vehicles could also be considered intelligent agents as they use sensors, GPS and cameras to make reactive decisions based on the environment to maneuver through traffic.
Examples of intelligent agents
AI assistants, like Alexa and Siri, are examples of intelligent agents as they use sensors to perceive a request made by the user and the automatically collect data from the internet without the user's help. They can be used to gather information about its perceived environment such as weather and time.
Infogate is another example of an intelligent agent, which alerts users about news based on specified topics of interest.
Autonomous vehicles could also be considered intelligent agents as they use sensors, GPS and cameras to make reactive decisions based on the environment to maneuver through traffic.
The document provides an introduction to automata theory and finite state automata (FSA). It defines an automaton as an abstract computing device or mathematical model used in computer science and computational linguistics. The reading discusses pioneers in automata theory like Alan Turing and his development of Turing machines. It then gives an overview of finite state automata, explaining concepts like states, transitions, alphabets, and using a example of building an FSA for a "sheeptalk" language to demonstrate these components.
This document discusses algorithms and their analysis. It defines an algorithm as a step-by-step procedure to solve a problem or calculate a quantity. Algorithm analysis involves evaluating memory usage and time complexity. Asymptotics, such as Big-O notation, are used to formalize the growth rates of algorithms. Common sorting algorithms like insertion sort and quicksort are analyzed using recurrence relations to determine their time complexities as O(n^2) and O(nlogn), respectively.
This document discusses randomized algorithms. It begins by listing different categories of algorithms, including randomized algorithms. Randomized algorithms introduce randomness into the algorithm to avoid worst-case behavior and find efficient approximate solutions. Quicksort is presented as an example randomized algorithm, where randomness improves its average runtime from quadratic to linear. The document also discusses the randomized closest pair algorithm and a randomized algorithm for primality testing. Both introduce randomness to improve efficiency compared to deterministic algorithms for the same problems.
A Heuristic is a technique to solve a problem faster than classic methods, or to find an approximate solution when classic methods cannot. This is a kind of a shortcut as we often trade one of optimality, completeness, accuracy, or precision for speed. A Heuristic (or a heuristic function) takes a look at search algorithms. At each branching step, it evaluates the available information and makes a decision on which branch to follow.
This document summarizes various search algorithms and toy problems that are used to illustrate problem solving by searching. It begins by introducing problem solving as finding a sequence of actions to achieve a goal from an initial state. It then discusses uninformed search strategies like breadth-first, depth-first, and uniform cost search. Several toy problems are presented, including the 8-puzzle, vacuum world, missionaries and cannibals problem. Real-world problems involving route finding, VLSI layout, and robot navigation are also briefly described. Evaluation criteria for search algorithms like space/time complexity and optimality/completeness are covered. Finally, iterative deepening search is introduced as a way to overcome depth limitations.
This document discusses greedy algorithms and divide and conquer algorithms. It provides examples of problems that can be solved using each approach and outlines the general solutions. For greedy algorithms, it explains that they make locally optimal choices at each step without considering future possibilities. For divide and conquer, it explains the three main steps of dividing the problem into subproblems, solving the subproblems recursively, and merging the solutions. It also provides an example problem of finding the number of inversions in an array by modifying the merge sort algorithm.
L03 ai - knowledge representation using logicManjula V
The document discusses knowledge representation using predicate logic. It begins by reviewing propositional logic and its semantics using truth tables. It then introduces predicate logic, which can represent properties and relations using predicates with arguments. It discusses representing knowledge in predicate logic using quantifiers, predicates, and variables. It also covers inferencing in predicate logic using techniques like forward chaining, backward chaining, and resolution. An example problem is presented to illustrate representing a problem and solving it using resolution refutation in predicate logic.
The document discusses knowledge-based agents and how they use inference to derive new representations of the world from their knowledge base in order to determine what actions to take. It provides the example of an agent exploring a cave, or "Wumpus world", where the goal is to locate gold and exit without being killed by the Wumpus monster or falling into pits. The agent uses its percepts and knowledge base along with inference rules to deduce its next action at each step.
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
Artificial Intelligence involves representing problems as state spaces and using algorithms to search the state space to solve the problem. The document discusses key concepts in problem solving using search including representing the problem as states, defining state transitions with successor functions, and exploring the resulting state space to find a solution. It provides examples of representing common problems like the 8-puzzle and n-queens as state spaces. The document also summarizes uninformed search strategies like breadth-first, depth-first, and iterative deepening search that use the problem definition to search the state space without using heuristics.
Greedy algorithms make locally optimal choices at each step in the hope of finding a globally optimal solution. The activity selection problem involves choosing a maximum set of activities that do not overlap in time. The greedy algorithm for this problem sorts activities by finish time and selects the earliest finishing activity at each step. This algorithm is optimal because the activity selection problem exhibits the optimal substructure property and the greedy algorithm satisfies the greedy-choice property at each step.
This document discusses problem solving agents in artificial intelligence. It explains that problem solving agents focus on satisfying goals by formulating the goal based on the current situation, then formulating the problem by determining the actions needed to achieve the goal. Key components of problem formulation include the initial state, possible actions, transition model describing how actions change the state, a goal test, and path cost function. Two examples of well-defined problems are given: the 8-puzzle problem and the 8-queens problem.
This slides contains assymptotic notations, recurrence relation like subtitution method, iteration method, master method and recursion tree method and sorting algorithms like merge sort, quick sort, heap sort, counting sort, radix sort and bucket sort.
The Foundations of Artificial Intelligence, The History of
Artificial Intelligence, and the State of the Art. Intelligent Agents: Introduction, How Agents
should Act, Structure of Intelligent Agents, Environments. Solving Problems by Searching:
problem-solving Agents, Formulating problems, Example problems, and searching for Solutions,
Search Strategies, Avoiding Repeated States, and Constraint Satisfaction Search. Informed
Search Methods: Best-First Search, Heuristic Functions, Memory Bounded Search, and Iterative
Improvement Algorithms.
Knowledge representation In Artificial IntelligenceRamla Sheikh
facts, information, and skills acquired through experience or education; the theoretical or practical understanding of a subject.
Knowledge = information + rules
EXAMPLE
Doctors, managers.
This document discusses greedy algorithms and dynamic programming techniques for solving optimization problems. It covers the activity selection problem, which can be solved greedily by always selecting the shortest remaining activity. It also discusses the knapsack problem and how the fractional version can be solved greedily while the 0-1 version requires dynamic programming due to its optimal substructure but non-greedy nature. Dynamic programming builds up solutions by combining optimal solutions to overlapping subproblems.
This document provides an overview of representing graphs and Dijkstra's algorithm in Prolog. It discusses different ways to represent graphs in Prolog, including using edge clauses, a graph term, and an adjacency list. It then explains Dijkstra's algorithm for finding the shortest path between nodes in a graph and provides pseudocode for implementing it in Prolog using rules for operations like finding the minimum value and merging lists.
The document discusses local search algorithms as an alternative to classical search algorithms when the path to the goal state is irrelevant. It describes hill-climbing search, which iteratively moves to a neighboring state with improved value. Hill-climbing can get stuck at local optima. Variations like simulated annealing and stochastic hill-climbing incorporate randomness to avoid local optima. Genetic algorithms use techniques inspired by evolution like selection, crossover and mutation to search the state space. The document uses examples like the 8-queens and 8-puzzle problems to illustrate local search concepts.
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEKhushboo Pal
n artificial intelligence, an intelligent agent (IA) is an autonomous entity which acts, directing its activity towards achieving goals (i.e. it is an agent), upon an environment using observation through sensors and consequent actuators (i.e. it is intelligent).An intelligent agent is a program that can make decisions or perform a service based on its environment, user input and experiences. These programs can be used to autonomously gather information on a regular, programmed schedule or when prompted by the user in real time. Intelligent agents may also be referred to as a bot, which is short for robot.Examples of intelligent agents
AI assistants, like Alexa and Siri, are examples of intelligent agents as they use sensors to perceive a request made by the user and the automatically collect data from the internet without the user's help. They can be used to gather information about its perceived environment such as weather and time.
Infogate is another example of an intelligent agent, which alerts users about news based on specified topics of interest.
Autonomous vehicles could also be considered intelligent agents as they use sensors, GPS and cameras to make reactive decisions based on the environment to maneuver through traffic.
Examples of intelligent agents
AI assistants, like Alexa and Siri, are examples of intelligent agents as they use sensors to perceive a request made by the user and the automatically collect data from the internet without the user's help. They can be used to gather information about its perceived environment such as weather and time.
Infogate is another example of an intelligent agent, which alerts users about news based on specified topics of interest.
Autonomous vehicles could also be considered intelligent agents as they use sensors, GPS and cameras to make reactive decisions based on the environment to maneuver through traffic.
The document provides an introduction to automata theory and finite state automata (FSA). It defines an automaton as an abstract computing device or mathematical model used in computer science and computational linguistics. The reading discusses pioneers in automata theory like Alan Turing and his development of Turing machines. It then gives an overview of finite state automata, explaining concepts like states, transitions, alphabets, and using a example of building an FSA for a "sheeptalk" language to demonstrate these components.
This document discusses algorithms and their analysis. It defines an algorithm as a step-by-step procedure to solve a problem or calculate a quantity. Algorithm analysis involves evaluating memory usage and time complexity. Asymptotics, such as Big-O notation, are used to formalize the growth rates of algorithms. Common sorting algorithms like insertion sort and quicksort are analyzed using recurrence relations to determine their time complexities as O(n^2) and O(nlogn), respectively.
This document discusses randomized algorithms. It begins by listing different categories of algorithms, including randomized algorithms. Randomized algorithms introduce randomness into the algorithm to avoid worst-case behavior and find efficient approximate solutions. Quicksort is presented as an example randomized algorithm, where randomness improves its average runtime from quadratic to linear. The document also discusses the randomized closest pair algorithm and a randomized algorithm for primality testing. Both introduce randomness to improve efficiency compared to deterministic algorithms for the same problems.
A Heuristic is a technique to solve a problem faster than classic methods, or to find an approximate solution when classic methods cannot. This is a kind of a shortcut as we often trade one of optimality, completeness, accuracy, or precision for speed. A Heuristic (or a heuristic function) takes a look at search algorithms. At each branching step, it evaluates the available information and makes a decision on which branch to follow.
This document summarizes various search algorithms and toy problems that are used to illustrate problem solving by searching. It begins by introducing problem solving as finding a sequence of actions to achieve a goal from an initial state. It then discusses uninformed search strategies like breadth-first, depth-first, and uniform cost search. Several toy problems are presented, including the 8-puzzle, vacuum world, missionaries and cannibals problem. Real-world problems involving route finding, VLSI layout, and robot navigation are also briefly described. Evaluation criteria for search algorithms like space/time complexity and optimality/completeness are covered. Finally, iterative deepening search is introduced as a way to overcome depth limitations.
This document discusses greedy algorithms and divide and conquer algorithms. It provides examples of problems that can be solved using each approach and outlines the general solutions. For greedy algorithms, it explains that they make locally optimal choices at each step without considering future possibilities. For divide and conquer, it explains the three main steps of dividing the problem into subproblems, solving the subproblems recursively, and merging the solutions. It also provides an example problem of finding the number of inversions in an array by modifying the merge sort algorithm.
This document discusses state-space representations for general problem solving. It provides examples of state-space models for various problems including the 8-queens puzzle, traveling salesman problem, sliding tile puzzle, cryptarithmetic, Boolean satisfiability, crossword puzzles, and finding common misspelled words in strings. The key components of a state-space model are the initial state, operators that change the state, and a goal test to determine when the problem is solved.
This document discusses search algorithms and problem solving through searching. It begins by defining search problems and representing them using graphs with states as nodes and actions as edges. It then covers uninformed search strategies like breadth-first and depth-first search. Informed search strategies use heuristics to guide the search toward more promising areas of the problem space. Examples of single agent pathfinding problems are given like the traveling salesman problem and Rubik's cube.
The document discusses uninformed search techniques. It provides examples of representing problems as states and operators that transform states. This includes problems like the water jug problem, 8-puzzle, and 8-queens. It then describes common uninformed search algorithms like breadth-first search, depth-first search, iterative deepening, and uniform cost search. It analyzes the properties of these algorithms like completeness, time complexity, space complexity, and optimality.
The document discusses the characteristics of algorithms and the concept of mathematical expectation in average case analysis. It then provides the pseudocode for the MaxMin algorithm and discusses the greedy knapsack algorithm and the travelling salesman problem. Finally, it explains the sum of subsets problem, describing two formulations and how the solution space can be organized into trees.
Lecture is related to the topic of Artificial intelligencemohsinwaseer1
The document discusses different types of problem-solving agents, including reflex agents which directly map states to actions, and goal-based agents which solve problems by searching for sequences of actions that lead to desirable goal states. It provides examples of well-defined problems like the vacuum world and 8-puzzle that involve specifying an initial state, possible actions, transition models, a goal test, and a path cost function. The document also discusses how real-world problems like route planning and airline travel can be modeled as search problems by defining states, actions, transitions between states, and optimal solutions.
The document provides information about topics to be covered in class today including warm-ups, make-up tests, reviews of radical equations, Pythagorean theorem, distance and midpoint formulas, and STAR testing. It then reviews solving radical equations, using the Pythagorean theorem, and applying the distance and midpoint formulas to different types of problems. Examples are provided for using the distance and midpoint formulas to find missing coordinates given certain known values.
Constraint satisfaction problems (CSPs) involve assigning values to variables from given domains so that all constraints are satisfied. CSPs provide a general framework that can model many combinatorial problems. A CSP is defined by variables that take values from domains, and constraints specifying allowed value combinations. Real-world CSPs include scheduling, assignment problems, timetabling, mapping coloring and puzzles. Examples provided include cryptarithmetic, Sudoku, 4-queens, and graph coloring.
This document describes sets and operations on sets related to numbers on a roulette wheel. It defines six sets - A (red numbers), B (black numbers), C (green numbers), D (even numbers), E (odd numbers), and F (numbers 1-12). It provides the elements of each set based on a standard American roulette wheel. It then calculates the unions and intersections of these sets according to the given operations. Tables and diagrams are provided to represent the set operations and relationships.
This document discusses algorithms for clipping circles and curves to a bounding region. It describes a fast circle clipping algorithm that uses an accept/reject test to determine whether points are inside or outside the clipping region. It also discusses a midpoint circle algorithm that uses incremental steps to scan convert circles. Finally, it explains that curved objects can be clipped by first testing if their bounding rectangles overlap the clipping region before solving nonlinear equations to find curve-window intersection points.
The document discusses various search algorithms used in artificial intelligence problem solving. It defines key search terminology like problem space, states, actions, and goals. It then explains different types of search problems and provides examples like the 8-puzzle and vacuuming world problems. Finally, it summarizes uninformed search strategies like breadth-first search, depth-first search, and iterative deepening search as well as informed strategies like greedy best-first search and A* search which use heuristics to guide the search.
Reinforcement learning is a computational approach for learning through interaction without an explicit teacher. An agent takes actions in various states and receives rewards, allowing it to learn relationships between situations and optimal actions. The goal is to learn a policy that maximizes long-term rewards by balancing exploitation of current knowledge with exploration of new actions. Methods like Q-learning use value function approximation and experience replay in deep neural networks to scale to complex problems with large state spaces like video games. Temporal difference learning combines the advantages of Monte Carlo and dynamic programming by bootstrapping values from current estimates rather than waiting for full episodes.
The document discusses various backtracking algorithms and problems. It begins with an overview of backtracking as a general algorithm design technique for problems that involve traversing decision trees and exploring partial solutions. It then provides examples of specific problems that can be solved using backtracking, including the N-Queens problem, map coloring problem, and Hamiltonian circuits problem. It also discusses common terminology and concepts in backtracking algorithms like state space trees, pruning nonpromising nodes, and backtracking when partial solutions are determined to not lead to complete solutions.
Unit-1 Basic Concept of Algorithm.pptxssuser01e301
The document discusses various topics related to algorithms including algorithm design, real-life applications, analysis, and implementation. It specifically covers four algorithms - the taxi algorithm, rent-a-car algorithm, call-me algorithm, and bus algorithm - for getting from an airport to a house. It also provides examples of simple multiplication methods like the American, English, and Russian approaches as well as the divide and conquer method.
This presentation is the full application of discrete mathematics throughout a course and includes Set Theory, Functions nd Sequences, Automata Theory, Grammars and algorithm building.
This document discusses dynamic programming and algorithms for solving all-pair shortest path problems. It begins by defining dynamic programming as avoiding recalculating solutions by storing results in a table. It then describes Floyd's algorithm for finding shortest paths between all pairs of nodes in a graph. The algorithm iterates through nodes, calculating shortest paths that pass through each intermediate node. It takes O(n3) time for a graph with n nodes. Finally, it discusses the multistage graph problem and provides forward and backward algorithms to find the minimum cost path from source to destination in a multistage graph in O(V+E) time, where V and E are the numbers of vertices and edges.
This document provides instructions for calculating and interpreting Spearman's rank correlation coefficient. It begins with an example comparing pedestrian counts and convenience shops in 12 town zones. Tables are constructed to rank the data and calculate differences between ranks. The equation for Spearman's rank is shown and applied to the example data, yielding a value of 0.888. This indicates a fairly positive relationship between pedestrian counts and shops. Critical values tables are presented to determine statistical significance based on the sample size. In this case, the value exceeds thresholds for 95% and 99% confidence, showing a highly significant relationship.
The document discusses problem solving through search. It defines intelligent agents, search problems, and search graphs. Search problems are formulated using states, operators, start states, and goal states. Several search algorithms are introduced, including depth-first search and breadth-first search. Examples of search problems discussed include finding a route from Arad to Bucharest in Romania, the vacuum world problem, the 8-queens problem, and the 8-puzzle problem. The document outlines how to represent these problems as state spaces and formulates them in terms of states, actions, initial states, and goal tests. It also introduces tree search algorithms and strategies for searching state spaces, such as uninformed blind search and informed heuristic search.
The document provides an introduction to unsupervised learning and reinforcement learning. It then discusses eigen values and eigen vectors, showing how to calculate them from a matrix. It provides examples of covariance matrices and using Gaussian elimination to solve for eigen vectors. Finally, it discusses principal component analysis and different clustering algorithms like K-means clustering.
Cross validation is a technique for evaluating machine learning models by splitting the dataset into training and validation sets and training the model multiple times on different splits, to reduce variance. K-fold cross validation splits the data into k equally sized folds, where each fold is used once for validation while the remaining k-1 folds are used for training. Leave-one-out cross validation uses a single observation from the dataset as the validation set. Stratified k-fold cross validation ensures each fold has the same class proportions as the full dataset. Grid search evaluates all combinations of hyperparameters specified as a grid, while randomized search samples hyperparameters randomly within specified ranges. Learning curves show training and validation performance as a function of training set size and can diagnose underfitting
This document provides an overview of supervised machine learning algorithms for classification, including logistic regression, k-nearest neighbors (KNN), support vector machines (SVM), and decision trees. It discusses key concepts like evaluation metrics, performance measures, and use cases. For logistic regression, it covers the mathematics behind maximum likelihood estimation and gradient descent. For KNN, it explains the algorithm and discusses distance metrics and a numerical example. For SVM, it outlines the concept of finding the optimal hyperplane that maximizes the margin between classes.
The document provides information on solving the sum of subsets problem using backtracking. It discusses two formulations - one where solutions are represented by tuples indicating which numbers are included, and another where each position indicates if the corresponding number is included or not. It shows the state space tree that represents all possible solutions for each formulation. The tree is traversed depth-first to find all solutions where the sum of the included numbers equals the target sum. Pruning techniques are used to avoid exploring non-promising paths.
The document discusses the greedy method and its applications. It begins by defining the greedy approach for optimization problems, noting that greedy algorithms make locally optimal choices at each step in hopes of finding a global optimum. Some applications of the greedy method include the knapsack problem, minimum spanning trees using Kruskal's and Prim's algorithms, job sequencing with deadlines, and finding the shortest path using Dijkstra's algorithm. The document then focuses on explaining the fractional knapsack problem and providing a step-by-step example of solving it using a greedy approach. It also provides examples and explanations of Kruskal's algorithm for finding minimum spanning trees.
The document describes various divide and conquer algorithms including binary search, merge sort, quicksort, and finding maximum and minimum elements. It begins by explaining the general divide and conquer approach of dividing a problem into smaller subproblems, solving the subproblems independently, and combining the solutions. Several examples are then provided with pseudocode and analysis of their divide and conquer implementations. Key algorithms covered in the document include binary search (log n time), merge sort (n log n time), and quicksort (n log n time on average).
What is an Algorithm
Time Complexity
Space Complexity
Asymptotic Notations
Recursive Analysis
Selection Sort
Insertion Sort
Recurrences
Substitution Method
Master Tree Method
Recursion Tree Method
This document provides an outline for a machine learning syllabus. It includes 14 modules covering topics like machine learning terminology, supervised and unsupervised learning algorithms, optimization techniques, and projects. It lists software and hardware requirements for the course. It also discusses machine learning applications, issues, and the steps to build a machine learning model.
The simplex method is a linear programming algorithm that can solve problems with more than two decision variables. It works by generating a series of solutions, called tableaus, where each tableau corresponds to a corner point of the feasible solution space. The algorithm starts at the initial tableau, which corresponds to the origin. It then shifts to adjacent corner points, moving in the direction that optimizes the objective function. This process of generating new tableaus continues until an optimal solution is found.
The document discusses functions and the pigeonhole principle. It defines what a function is, how functions can be represented graphically and with tables and ordered pairs. It covers one-to-one, onto, and bijective functions. It also discusses function composition, inverse functions, and the identity function. The pigeonhole principle states that if n objects are put into m containers where n > m, then at least one container must hold more than one object. Examples are given to illustrate how to apply the principle to problems involving months, socks, and selecting numbers.
The document discusses relations and their representations. It defines a binary relation as a subset of A×B where A and B are nonempty sets. Relations can be represented using arrow diagrams, directed graphs, and zero-one matrices. A directed graph represents the elements of A as vertices and draws an edge from vertex a to b if aRb. The zero-one matrix representation assigns 1 to the entry in row a and column b if (a,b) is in the relation, and 0 otherwise. The document also discusses indegrees, outdegrees, composite relations, and properties of relations like reflexivity.
This document discusses logic and propositional logic. It covers the following topics:
- The history and applications of logic.
- Different types of statements and their grammar.
- Propositional logic including symbols, connectives, truth tables, and semantics.
- Quantifiers, universal and existential quantification, and properties of quantifiers.
- Normal forms such as disjunctive normal form and conjunctive normal form.
- Inference rules and the principle of mathematical induction, illustrated with examples.
1. Set theory is an important mathematical concept and tool that is used in many areas including programming, real-world applications, and computer science problems.
2. The document introduces some basic concepts of set theory including sets, members, operations on sets like union and intersection, and relationships between sets like subsets and complements.
3. Infinite sets are discussed as well as different types of infinite sets including countably infinite and uncountably infinite sets. Special sets like the empty set and power sets are also covered.
The document discusses uncertainty and probabilistic reasoning. It describes sources of uncertainty like partial information, unreliable information, and conflicting information from multiple sources. It then discusses representing and reasoning with uncertainty using techniques like default logic, rules with probabilities, and probability theory. The key approaches covered are conditional probability, independence, conditional independence, and using Bayes' rule to update probabilities based on new evidence.
The document outlines the objectives, outcomes, and learning outcomes of a course on artificial intelligence. The objectives include conceptualizing ideas and techniques for intelligent systems, understanding mechanisms of intelligent thought and action, and understanding advanced representation and search techniques. Outcomes include developing an understanding of AI building blocks, choosing appropriate problem solving methods, analyzing strengths and weaknesses of AI approaches, and designing models for reasoning with uncertainty. Learning outcomes include knowledge, intellectual skills, practical skills, and transferable skills in artificial intelligence.
Planning involves representing an initial state, possible actions, and a goal state. A planning agent uses a knowledge base to select action sequences that transform the initial state into a goal state. STRIPS is a common planning representation that uses predicates to describe states and logical operators to represent actions and their effects. A STRIPS planning problem specifies the initial state, goal conditions, and set of operators. A solution is a sequence of ground operator instances that produces the goal state from the initial state.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
3. shiwani gupta 3
Agents
• An agent is an entity that can be viewed as perceiving its environment
through sensors and acting upon that environment through
effectors/actuators to achieve goals
• Ideal, rational, human, robotic, software, autonomous
• Simple reflex, Model Based, Goal based, Utility based
• The Simple Reflex Agent will work only if the correct decision can
be made on the basis of the current percept.
4. SHIWANI GUPTA 4
Drawback of Simple reflex agents (Module2)
• unable to plan ahead
• limited in what they can do because their actions are determined only
by the current percept
• have no knowledge of what their actions do nor of what they are
trying to achieve.
Solution:
one kind of goal-based agent… problem-solving agent.
(Problem-solving agents decide what to do by finding sequences of
actions that lead to desirable states)
• Goal formulation based on current situation
• Problem Formulation is the process of deciding what actions and
states to consider
• Search is the process of looking for different possible sequences of
actions leading to goal state
• Execution is carrying out actions recommended as solution by search
algorithm
A goal and a set of means for achieving the goal is called a problem, and
the process of exploring what the means can do is called search
8. 8
Toy Problems vs.
Real-World Problems
Toy Problems
– concise and exact
description
– used for illustration
purposes
– used for performance
comparisons
• Simple to describe
• Trivial to solve
Real-World Problems
– no single, agreed-upon
description
– people care about the
solutions
• Hours to define
9. SHIWANI GUPTA 9
Toy problems
– Touring in Romania
– 8-Puzzle/Sliding Block Puzzle
– Robotic Assembly
– 8 Queen
– Missionaries and Cannibals
– Cryptarithmetic
– Water Jug Problem
10. 10
Real-World Problem:
Touring in Romania
Oradea
Bucharest
Fagaras
Pitesti
Neamt
Iasi
Vaslui
Urziceni
Hirsova
Eforie
Giurgiu
Craiova
Rimnicu Vilcea
Sibiu
Dobreta
Mehadia
Lugoj
Timisoara
Arad
Zerind
120
140
151
75
70
111
118
75
71
85
90
211
101
97
138
146
80
99
87
92
142
98
86
Aim: find a course of action that satisfies a number of specified conditions
11. 13
Touring in Romania:
Search Problem Definition
• initial state:
– In(Arad)
• possible Actions:
– DriveTo(Zerind), DriveTo(Sibiu), DriveTo(Timisoara), etc.
• goal state:
– In(Bucharest)
• step cost:
– distances between cities
15. SHIWANI GUPTA 17
Example: robotic assembly
• states?: real-valued coordinates of robot joint angles; parts of the
object to be assembled
• actions?: continuous motions of robot joints
• goal test?: complete assembly
• path cost?: time to execute
16. SHIWANI GUPTA 18
Example: 8 queens problem
The incremental formulation involves placing queens one by one,
whereas
the complete-state formulation starts with all 8 queens on the board and
moves them around.
In either case, the path cost is of no interest because only the final state
counts; algorithms are thus compared only on search cost.
Goal test: 8 queens on board, none attacked.
Path cost: zero.
States: any arrangement of 0 to 8 queens on board.
Operators: add a queen to any square.
17. SHIWANI GUPTA 19
Incremental formulation
The fact that placing a queen where it is already attacked cannot work,
because subsequent placing of other queens will not undo the attack.
So we might try the following:
States: arrangements of 0 to 8 queens with none attacked
Operators: place a queen in the left-most empty column such that it is not
attacked by any other queen
It is easy to see that the actions given
can generate only states with no attacks;
but sometimes no actions will be possible.
For example, after making the first seven
choices (left-to-right)
A quick calculation shows that there are only
Much fewer sequences to investigate.
The right formulation makes a big
difference to the size of the search space.
18. SHIWANI GUPTA 20
Complete formulation
• States: arrangements of 8 queens, one in each column.
• Operators: move any attacked queen to another square in the
same column.
19. SHIWANI GUPTA 21
Example: Missionaries and cannibals problem
(Three missionaries and three cannibals are on one side of a river, along with a boat that can hold
max two people. Find a way to get everyone to the other side, without ever leaving a group of
missionaries in one place outnumbered by the cannibals in that place)
States: a state consists of an ordered sequence of three numbers representing
the number of missionaries, cannibals, and boats on the bank of the river
from which they started. Thus, the start state is (3,3,1)
Operators: from each state the possible operators are to take either one
missionary, one cannibal, two missionaries, two cannibals, or one of each
across in the boat. Thus, there are at most five operators, although most
states have fewer because it is necessary to avoid illegal states. Note that if
we had chosen to distinguish between individual people then there would be
27 operators instead of just 5
Goal test: reached state (0,0,1)
Path cost: number of crossings
20. 22
Missionaries and Cannibals:
Successor Function
state set of <action, state>
(L:3m,3c,b-R:0m,0c) → {<2c, (L:3m,1c-R:0m,2c,b)>,
<1m1c, (L:2m,2c-R:1m,1c,b)>,
<1c, (L:3m,2c-R:0m,1c,b)>}
(L:3m,1c-R:0m,2c,b) → {<2c, (L:3m,3c,b-R:0m,0c) >,
<1c, (L:3m,2c,b-R:0m,1c)>}
(L:2m,2c-R:1m,1c,b) → {<1m1c, (L:3m,3c,b-R:0m,0c) >,
<1m, (L:3m,2c,b-R:0m,1c)>}
22. SHIWANI GUPTA 24
LEFT BANK RIGHT BANK
0 Initial setup: MMMCCC B -
1 Two cannibals cross over: MMMC B CC
2 One comes back: MMMCC B C
3 Two cannibals go over again: MMM B CCC
4 One comes back: MMMC B CC
5 Two missionaries cross: MC B MMCC
6 A missionary & cannibal return: MMCC B MC
7 Two missionaries cross again: CC B MMMC
8 A cannibal returns: CCC B MMM
9 Two cannibals cross: C B MMMCC
10 One returns: CC B MMMC
11 And brings over the third: - B MMMCCC
23. 25
Missionaries and Cannibals: Goal
State and Path Cost
• goal state:
– all missionaries, all
cannibals, and the
boat are on the right
bank.
• path cost
– step cost: 1 for each
crossing
– path cost: number of
crossings = length of path
• solution path:
– 4 optimal solutions
– cost: 11
24. SHIWANI GUPTA 30
Example: Cryptarithmetic
States: a cryptarithmetic puzzle with some letters replaced by digits.
Operators: replace all occurrences of a letter with a digit not already
appearing in the puzzle.
Goal test: puzzle contains only digits, and represents a correct sum.
Path cost: zero. All solutions equally valid.
One way to do this is to adopt a fixed order, e.g., alphabetical order.
A better choice is to do whichever is the most constrained substitution,
that is, the letter that has the fewest legal possibilities given the
constraints of the puzzle.
25. Crypt-Arithmetic puzzle
• Problem Statement:
– Solve the following puzzle by assigning numeral (0-9) in such a way that
each letter is assigned unique digit which satisfy the following addition.
– Constraints : No two letters have the same value. (The constraints of
arithmetic).
• Initial Problem State
– S = ? ; E = ? ;N = ? ; D = ? ; M = ? ;O = ? ; R = ? ;Y = ?
S E N D
+ M O R E
_________________________________
M O N E Y
_________________________________
26. Carries:
C4 = ? ;C3 = ? ;C2 = ? ;C1 = ?
Constraint equations:
Y = D + E C1
E = N + R + C1 C2
N = E + O + C2 C3
O = S + M + C3 C4
M = C4
C4 C3 C2 C1 Carry
S E N D
+ M O R E
_________________________________
M O N E Y
_________________________________
27. • We can easily see that M has to be non zero
digit, so the value of C4 =1
1. M = C4 M = 1
2. O = S + M + C3 → C4
For C4 =1, S + M + C3 > 9
S + 1 + C3 > 9 S+C3 > 8.
If C3 = 0, then S = 9 else if C3 = 1,
then S = 8 or 9.
• We see that for S = 9
– C3 = 0 or 1
– It can be easily seen that C3 = 1 is not
possible as O = S + M + C3 O = 11
O has to be assigned digit 1 but 1 is
already assigned to M, so not possible.
– Therefore, only choice for C3 = 0, and
thus O = 10. This implies that O is
assigned 0 (zero) digit.
• Therefore, O = 0
M = 1, O = 0
C4 C3 C2 C1 Carry
S E N D
+ M O R E
_________________________________
M O N E Y
_________________________________
Y = D + E → C1
E = N + R + C1 → C2
N = E + O + C2 → C3
O = S + M + C3 → C4
M = C4
28. 3. Since C3 = 0; N = E + O + C2 produces
no carry.
• As O = 0, N = E + C2 .
• Since N E, therefore, C2 = 1.
Hence N = E + 1
• Now E can take value from 2 to 8 {0,1,9
already assigned so far }
– If E = 2, then N = 3.
– Since C2 = 1, from E = N + R + C1 ,
we get 12 = N + R + C1
• If C1 = 0 then R = 9, which is not
possible as we are on the path with S
= 9
• If C1 = 1 then R = 8, then
» From Y = D + E , we get 10
+ Y= D + 2 .
» For no value of D, we can get
Y.
– Try similarly for E = 3, 4. We fail in
each case.
C4 C3 C2 C1 Carry
S E N D
+ M O R E
_________________________________
M O N E Y
_________________________________
Y = D + E → C1
E = N + R + C1 → C2
N = E + O + C2 → C3
O = S + M + C3 → C4
M = C4
29. • If E = 5, then N = 6
– Since C2 = 1, from E = N + R + C1 ,
we get 15 = N + R + C1 ,
– If C1 = 0 then R = 9, which is not
possible as we are on the path with
S = 9.
– If C1 = 1 then R = 8, then
• From Y = D + E , we get 10 +
Y= D + 5 i.e., 5 + Y = D.
• If Y = 2 then D = 7. These
values are possible.
• Hence we get the final solution as
given below and on backtracking, we
may find more solutions.
S = 9 ; E = 5 ; N = 6 ; D = 7 ;
M = 1 ; O = 0 ; R = 8 ;Y = 2
C4 C3 C2 C1 Carry
S E N D
+ M O R E
_________________________________
M O N E Y
_________________________________
Y = D + E → C1
E = N + R + C1 → C2
N = E + O + C2 → C3
O = S + M + C3 → C4
M = C4
30. Constraints:
Y = D + E C1
E = N + R + C1 C2
N = E + O + C2 C3
O = S + M + C3 C4
M = C4
Initial State
M = 1 → C4 = 1
O = 1 + S + C3
O
S = 9 S = 8
O
C3 = 0 C3 = 1
O = 0 O = 1
Fixed
M = 1
O = 0
N = E + O + C2 = E + C2 → C2 = 1 (must) → N = E + 1
E = 2 E = 3 ….. E = 5
N = 3 N = 6
E = N + R + C1 E = N + R + C1
10 + 2 = 3 + R + C1 10 + 5 = 6 + R + C1
O O
R = 9 R = 8 R = 9 R = 8
C1 =0 C1 = 1 C1 = 0 C1 = 1
O O
10 + Y = D + E = D + 2 10 + Y = D + E = D + 5
O O
D = 8 D = 9 D = 7
Y = 0 Y = 1 Y = 2
The first solution obtained is:
M = 1, O = 0, S = 9, E = 5, N = 6, R = 8, D = 7, Y = 2
31. C4 C3 C2 C1 Carries
B A S E
+ B A L L
_________________________________
G A M E S
_________________________________
Constraints equations are:
E + L = S → C1
S + L + C1= E → C2
2A + C2 = M → C3
2B + C3 = A → C4
G = C4
Initial Problem State
G = ?; A = ?;M = ?; E = ?; S = ?; B = ?; L = ?
32. 1. G = C4 G = 1
2. 2B+ C3 = A → C4
2.1 Since C4 = 1, therefore, 2B+ C3 > 9 B can take values from 5 to 9.
2.2 Try the following steps for each value of B from 5 to 9 till we get a
possible value of B.
if C3 = 0 A = 0 M = 0 for C2 = 0 or M = 1 for C2 = 1
• If B = 5
if C3 = 1 A = 1 (as G = 1 already)
• For B = 6 we get similar contradiction while generating the search tree.
• If B = 7 , then for C3 = 0, we get A = 4 M = 8 if C2 = 0 that leads to
contradiction, so this path is pruned. If C2 = 1, then M = 9 .
3. Let us solve S + L + C1 = E and E + L = S
• Using both equations, we get 2L + C1 = 0 L = 5 and C1 = 0
• Using L = 5, we get S + 5 = E that should generate carry C2 = 1 as shown
above
• So S+5 > 9 Possible values for E are {2, 3, 6, 8} (with carry bit C2 = 1 )
• If E = 2 then S + 5 = 12 S = 7 (as B = 7 already)
• If E = 3 then S + 5 = 13 S = 8.
• Therefore E = 3 and S = 8 are fixed up.
4. Hence we get the final solution as given below and on backtracking, we may find
more solutions. In this case we get only one solution.
G = 1; A = 4; M = 9; E = 3; S = 8;B = 7; L = 5
33. SHIWANI GUPTA 39
MARS Each of the ten letters (m, a, r, s, v, e,
+ VENUS n, u, t, and p) represents a unique number
+ URANUS in the range 0 .. 9.
+ SATURN
------------
NEPTUNE Solution: NEPTUNE = 1078610
M=4, A=5, R=9, etc.
34. Water Jug Problem
• Problem Statement: "You are given two jugs, a
4-gallon one and a 3-gallon one. Neither has
any measuring markers on it. There is a tap
that can be used to fill the jugs with water.
How can you get exactly 2 gallons of water
into the 4-gallon jug?"
SHIWANI GUPTA 40
35. Production Rules
Rules Conclusions
R1:(X, Y | X < 4) → (4, Y) {Fill 4-gallon jug}
R2:(X, Y | Y < 3) →(X, 3) {Fill 3-gallon jug}
R3:(X, Y | X > 0) →(0, Y) {Empty 4-gallon jug}
R4:(X, Y | Y > 0) →(X, 0) {Empty 3-gallon jug}
R5:(X, Y | X+Y >= 4 ΛY > 0) →(4, Y –(4 –X)) {Pour water from 3-gallon jug into 4-
gallon jug until 4-gallon jug is full}
R6:(X, Y | X+Y >= 3 ΛX > 0) →(X –(3 –Y), 3)) {Pour water from 4-gallon jug into 3-
gallon jug until 3-gallon jug is full}
R7:(X, Y | X+Y <= 4 ΛY > 0) → (X+Y, 0) {Pour all water from 3-gallon jug into 4- gallon jug }
R8:(X, Y | X+Y <= 3 ΛX > 0) →(0, X+Y) {Pour all water from 4-gallon jug into 3- gallon jug }
R9:(X, Y | X > 0) → (X –D, Y) {Pour some water D out from 4- gallon jug}
R10:(X, Y | Y > 0) →(X, Y -D) {Pour some water D out from 3- gallon jug}
SHIWANI GUPTA 41
36. SHIWANI GUPTA 42
2 0
Number Rules applied 4-g jug 3-g jug
of steps
1 Initial State 0 0
2 R1 {Fill 4-gallon jug} 4 0
3 R6 {Pour from 4 to 3-g jug until it is full } 1 3
4 R4 {Empty 3-gallon jug} 1 0
5 R8 {Pour all water from 4 to 3-gallon jug} 0 1
6 R1 {Fill 4-gallon jug} 4 1
7 R6 {Pour from 4 to 3-g jug until it is full} 2 3
8 R4 {Empty 3-gallon jug}
Goal State
Solution
37. Water Jug Problem
Given a full 5-gallon jug and a full 2-gallon jug, fill the 2-gallon jug with
exactly one gallon of water.
• State: ?
• Initial State: ?
• Operators: ?
• Goal State: ?
5
2
38. SHIWANI GUPTA 45
Real World problems
• Route Finding applications, such as routing in computer networks,
automated travel advisory systems, and airline travel planning systems.
• Touring and traveling salesperson problem is a famous touring
problem in which each city must be visited exactly once. The aim is to find
the shortest tour.
• VLSI layout with cell layout and channel routing.
• Robot navigation is a generalization of the route-finding problem
described earlier. Rather than a discrete set of routes, a robot can move in a
continuous space with (in principle) an infinite set of possible actions and
states.
• Assembly sequencing of complex objects by a robot, the problem is to
find an order in which to assemble the parts of some object. If the wrong
order is chosen, there will be no way to add some part later in the sequence
without undoing some of the work already done.
• Monkey Banana Problem
39. General Route Finding Problem
• Problem Statement
• States: Locations
• Initial State: Starting Point
• Successor Function(Operators): Move from one location
to other
• Goal Test: Arrive at certain location
• Path Cost: Money, time, travel, comfort, scenery,…
SHIWANI GUPTA 46
40. Travelling Salesman Problem
• Problem Statement
• States: Locations/cities
• Initial State: Starting Point
• Successor Function(Operators): Move from one location
to other
• Goal Test:All locations visited, Agent at initial location
• Path Cost: Distance between locations
SHIWANI GUPTA 47
41. VLSI layout problem
• Problem Statement
• States: Positions of components, wires on chip
• Initial State:
– Incremental
– Complete State
• Successor Function(Operators)
– Incremental
– Complete State
• Goal Test: All components placed and connected as specified
• Path Cost: distance, capacity, no. of connections per component
SHIWANI GUPTA 48
42. Robot Navigation
• Problem Statement
• States: Locations, Position of actuator
• Initial State: Start pos
• Successor Function(Operators): Movement, actions of
actuators
• Goal Test: Task Dependent
• Path Cost: Distance, Energy consumption
SHIWANI GUPTA 49
43. Assembly Sequencing
• Problem Statement
• States: Location of components
• Initial State: No components assembled
• Successor Function(Operators): Place component
• Goal Test: System fully assembled
• Path Cost: Number of moves
SHIWANI GUPTA 50
44. Monkey Banana Problem
• Problem Statement
• States:
• Initial State: Monkey on the floor without bananas
• Successor Function(Operators)
• Goal Test
• Path Cost: The number of moves by monkey to get bananas
SHIWANI GUPTA 51
45. Search Problem
• State space
– each state is an abstract representation of the
environment
– the state space is discrete
• Initial state
• Successor function
• Goal test
• Path cost
46. Search Problem
• State space
• Initial state:
– usually the current state
– sometimes one or several hypothetical states
(“what if …”)
• Successor function
• Goal test
• Path cost
47. Search Problem
• State space
• Initial state
• Successor function:
– [state → subset of states]
– an abstract representation of the possible actions
• Goal test
• Path cost
48. Search Problem
• State space
• Initial state
• Successor function
• Goal test:
– usually a condition
– sometimes the description of a state
• Path cost
49. Search Problem
• State space
• Initial state
• Successor function
• Goal test
• Path cost:
– [path → positive number]
– usually, path cost = sum of step costs
– e.g., number of moves of the empty tile
50. Assumptions in Basic Search
• The environment is static
• The environment is discretizable
• The environment is observable
• The actions are deterministic
51. University Questions
• Solve the following Crypt arithmetic problem:
FORTY
CROSS SEND BASE TEN EAT
ROADS MORE BALL TEN THAT
DANGER MONEY GAMES SIXTY
APPLE
• You are given 2 jugs of cap 4l and 3l each. Neither of the jugs have
any measuring markers on them. There is a pump that can be used to
fill jugs with water. How can u get exactly 2l of water in 4l jug?
Formulate the problem in state space and draw complete diagram
• Consider jugs of volumes 3 and 7 units are available. Show the trace
to measure 2 and 5 units.
• Solve Wolf Goat Cabbage problem.