PAI Unit -01 Complete.pdf
Document Details
Full Transcript
Subject: Artificial Intelligence Subject Code: AIML/AIDS 207 Class: B.Tech AIML/AIDS 3rd Sem Faculty Name: Mr. Ajay Kumar Unit I– Principles of Artificial Intelligence What is Artificial Intelligence (AI)? Artificial Intelligence is...
Subject: Artificial Intelligence Subject Code: AIML/AIDS 207 Class: B.Tech AIML/AIDS 3rd Sem Faculty Name: Mr. Ajay Kumar Unit I– Principles of Artificial Intelligence What is Artificial Intelligence (AI)? Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made thinking power." So, we can define AI as: "It is a branch of computer science by which we can create intelligent machines which can behave like a human, think like humans, and able to make decisions." Artificial Intelligence exists when a machine can have human based skills such as learning, reasoning, and solving problems With Artificial Intelligence you do not need to preprogram a machine to do some work, despite that you can create a machine with programmed algorithms which can work with own intelligence, and that is the awesomeness of AI. It is believed that AI is not a new technology, and some people says that as per Greek myth, there were Mechanical men in early days which can work and behave like humans. Goals of Artificial Intelligence Following are the main goals of Artificial Intelligence: 1. Replicate human intelligence 2. Solve Knowledge-intensive tasks 3. An intelligent connection of perception and action 4. Building a machine which can perform tasks that requires human intelligence such as: o Proving a theorem o Playing chess o Plan some surgical operation o Driving a car in traffic 5. Creating some system which can exhibit intelligent behavior, learn new things by itself, demonstrate, explain, and can advise to its user. History of Artificial Intelligence Artificial Intelligence is not a new word and not a new technology for researchers. This technology is much older than you would imagine. Even there are the myths of Mechanical men in Ancient Greek and Egyptian Myths. Following are some milestones in the history of AI which defines the journey from the AI generation to till date development. Maturation of Artificial Intelligence (1943-1952) o Year 1943: The first work which is now recognized as AI was done by Warren McCulloch and Walter pits in 1943. They proposed a model of artificial neurons. o Year 1949: Donald Hebb demonstrated an updating rule for modifying the connection strength between neurons. His rule is now called Hebbian learning. o Year 1950: The Alan Turing who was an English mathematician and pioneered Machine learning in 1950. Alan Turing publishes "Computing Machinery and Intelligence" in which he proposed a test. The test can check the machine's ability to exhibit intelligent behavior equivalent to human intelligence, called a Turing test. The birth of Artificial Intelligence (1952-1956) o Year 1955: An Allen Newell and Herbert A. Simon created the "first artificial intelligence program"Which was named as "Logic Theorist". This program had proved 38 of 52 Mathematics theorems, and find new and more elegant proofs for some theorems. o Year 1956: The word "Artificial Intelligence" first adopted by American Computer scientist John McCarthy at the Dartmouth Conference. For the first time, AI coined as an academic field. At that time high-level computer languages such as FORTRAN, LISP, or COBOL were invented. And the enthusiasm for AI was very high at that time. The golden years-Early enthusiasm (1956-1974) o Year 1966: The researchers emphasized developing algorithms which can solve mathematical problems. Joseph Weizenbaum created the first chatbot in 1966, which was named as ELIZA. o Year 1972: The first intelligent humanoid robot was built in Japan which was named as WABOT-1. The first AI winter (1974-1980) o The duration between years 1974 to 1980 was the first AI winter duration. AI winter refers to the time period where computer scientist dealt with a severe shortage of funding from government for AI researches. o During AI winters, an interest of publicity on artificial intelligence was decreased. A boom of AI (1980-1987) o Year 1980: After AI winter duration, AI came back with "Expert System". Expert systems were programmed that emulate the decision-making ability of a human expert. o In the Year 1980, the first national conference of the American Association of Artificial Intelligence was held at Stanford University. The second AI winter (1987-1993) o The duration between the years 1987 to 1993 was the second AI Winter duration. o Again Investors and government stopped in funding for AI research as due to high cost but not efficient result. The expert system such as XCON was very cost effective. The emergence of intelligent agents (1993-2011) o Year 1997: In the year 1997, IBM Deep Blue beats world chess champion, Gary Kasparov, and became the first computer to beat a world chess champion. o Year 2002: for the first time, AI entered the home in the form of Roomba, a vacuum cleaner. o Year 2006: AI came in the Business world till the year 2006. Companies like Facebook, Twitter, and Netflix also started using AI. Deep learning, big data and artificial general intelligence (2011-present) o Year 2011: In the year 2011, IBM's Watson won jeopardy, a quiz show, where it had to solve the complex questions as well as riddles. Watson had proved that it could understand natural language and can solve tricky questions quickly. o Year 2012: Google has launched an Android app feature "Google now", which was able to provide information to the user as a prediction. o Year 2014: In the year 2014, Chatbot "Eugene Goostman" won a competition in the infamous "Turing test." o Year 2018: The "Project Debater" from IBM debated on complex topics with two master debaters and also performed extremely well. o Google has demonstrated an AI program "Duplex" which was a virtual assistant and which had taken hairdresser appointment on call, and lady on other side didn't notice that she was talking with the machine. Now AI has developed to a remarkable level. The concept of Deep learning, big data, and data science are now trending like a boom. Nowadays companies like Google, Facebook, IBM, and Amazon are working with AI and creating amazing devices. The future of Artificial Intelligence is inspiring and will come with high intelligence. Application of AI Artificial Intelligence has various applications in today's society. It is becoming essential for today's time because it can solve complex problems with an efficient way in multiple industries, such as Healthcare, entertainment, finance, education, etc. AI is making our daily life more comfortable and fast. Following are some sectors which have the application of Artificial Intelligence: 1. AI in Astronomy o Artificial Intelligence can be very useful to solve complex universe problems. AI technology can be helpful for understanding the universe such as how it works, origin, etc. 2. AI in Healthcare o In the last, five to ten years, AI becoming more advantageous for the healthcare industry and going to have a significant impact on this industry. o Healthcare Industries are applying AI to make a better and faster diagnosis than humans. AI can help doctors with diagnoses and can inform when patients are worsening so that medical help can reach to the patient before hospitalization. 3. AI in Gaming o AI can be used for gaming purpose. The AI machines can play strategic games like chess, where the machine needs to think of a large number of possible places. 4. AI in Finance o AI and finance industries are the best matches for each other. The finance industry is implementing automation, chatbot, adaptive intelligence, algorithm trading, and machine learning into financial processes. 5. AI in Data Security o The security of data is crucial for every company and cyber-attacks are growing very rapidly in the digital world. AI can be used to make your data more safe and secure. Some examples such as AEG bot, AI2 Platform,are used to determine software bug and cyber-attacks in a better way. 6. AI in Social Media o Social Media sites such as Facebook, Twitter, and Snapchat contain billions of user profiles, which need to be stored and managed in a very efficient way. AI can organize and manage massive amounts of data. AI can analyze lots of data to identify the latest trends, hashtag, and requirement of different users. 7. AI in Travel & Transport o AI is becoming highly demanding for travel industries. AI is capable of doing various travel related works such as from making travel arrangement to suggesting the hotels, flights, and best routes to the customers. Travel industries are using AI-powered chatbots which can make human-like interaction with customers for better and fast response. 8. AI in Automotive Industry o Some Automotive industries are using AI to provide virtual assistant to their user for better performance. Such as Tesla has introduced TeslaBot, an intelligent virtual assistant. o Various Industries are currently working for developing self-driven cars which can make your journey more safe and secure. 9. AI in Robotics: o Artificial Intelligence has a remarkable role in Robotics. Usually, general robots are programmed such that they can perform some repetitive task, but with the help of AI, we can create intelligent robots which can perform tasks with their own experiences without pre-programmed. o Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid robot named as Erica and Sophia has been developed which can talk and behave like humans. 10. AI in Entertainment o We are currently using some AI based applications in our daily life with some entertainment services such as Netflix or Amazon. With the help of ML/AI algorithms, these services show the recommendations for programs or shows. 11. AI in Agriculture o Agriculture is an area which requires various resources, labor, money, and time for best result. Now a day's agriculture is becoming digital, and AI is emerging in this field. Agriculture is applying AI as agriculture robotics, solid and crop monitoring, predictive analysis. AI in agriculture can be very helpful for farmers. 12. AI in E-commerce o AI is providing a competitive edge to the e-commerce industry, and it is becoming more demanding in the e-commerce business. AI is helping shoppers to discover associated products with recommended size, color, or even brand. 13. AI in education: o AI can automate grading so that the tutor can have more time to teach. AI chatbot can communicate with students as a teaching assistant. o AI in the future can be work as a personal virtual tutor for students, which will be accessible easily at any time and any place. Techniques of AI It is a method that exploits knowledge that should be represented in such a way that : i) Knowledge captures generalization. ii) Understandable by people. iii) Easily modifiable to correct. iv) It can be used in many situations. v) It can reduce its volume. Parts of AI Technique: 1. Knowledge Representation: it is used to capture or gather the knowledge about real world. 2. Searching Algorithm : It finds or search solution of the problem. Problem Solving: It is one of the major application of AI.Games like Tic-Tac-Toe, water jug problem , 8 puzzle problem , 8 queens problem etc. , we solve these games through AI agentsor problem solvers. Goal-based agents o The knowledge of the current state environment is not always sufficient to decide for an agent to what to do. o The agent needs to know its goal which describes desirable situations. o Goal-based agents expand the capabilities of the model-based agent by having the "goal" information. o They choose an action, so that they can achieve the goal. o These agents may have to consider a long sequence of possible actions before deciding whether the goal is achieved or not. Such considerations of different scenario are called searching and planning, which makes an agent proactive. Problem-solving agents: In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational agents or Problem-solving agents in AI mostly used these search strategies or algorithms to solve a specific problem and provide the best result. Problem-solving agents are the goal-based agents and use atomic representation. In this topic, we will learn various problem-solving search algorithms. Search Algorithm Terminologies: o Search: Searching is a step by step procedure to solve a search-problem in a given search space. A search problem can have three main factors: a. Search Space: Search space represents a set of possible solutions, which a system may have. b. Start State: It is a state from where agent begins the search. c. Goal test: It is a function which observe the current state and returns whether the goal state is achieved or not. o Search tree: A tree representation of search problem is called Search tree. The root of the search tree is the root node which is corresponding to the initial state. o Actions: It gives the description of all the available actions to the agent. o Transition model: A description of what each action do, can be represented as a transition model. o Path Cost: It is a function which assigns a numeric cost to each path. o Solution: It is an action sequence which leads from the start node to the goal node. o Optimal Solution: If a solution has the lowest cost among all solutions. Properties of Search Algorithms: Following are the four essential properties of search algorithms to compare the efficiency of these algorithms: Completeness: A search algorithm is said to be complete if it guarantees to return a solution if at least any solution exists for any random input. Optimality: If a solution found for an algorithm is guaranteed to be the best solution (lowest path cost) among all other solutions, then such a solution for is said to be an optimal solution. Time Complexity: Time complexity is a measure of time for an algorithm to complete its task. Space Complexity: It is the maximum storage space required at any point during the search, as the complexity of the problem. Types of search algorithms Based on the search problems we can classify the search algorithms into uninformed (Blind search) search and informed search (Heuristic search) algorithms. Uninformed/Blind Search: The uninformed search does not contain any domain knowledge such as closeness, the location of the goal. It operates in a brute-force way as it only includes information about how to traverse the tree and how to identify leaf and goal nodes. Uninformed search applies a way in which search tree is searched without any information about the search space like initial state operators and test for the goal, so it is also called blind search.It examines each node of the tree until it achieves the goal node. It can be divided into five main types: o Breadth-first search o Uniform cost search o Depth-first search o Iterative deepening depth-first search o Bidirectional Search Informed Search Informed search algorithms use domain knowledge. In an informed search, problem information is available which can guide the search. Informed search strategies can find a solution more efficiently than an uninformed search strategy. Informed search is also called a Heuristic search. A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in reasonable time. Informed search can solve much complex problem which could not be solved in another way. An example of informed search algorithms is a traveling salesman problem. 1. Greedy Search 2. A* Search Uninformed Search Algorithms Uninformed search is a class of general-purpose search algorithms which operates in brute force-way. Uninformed search algorithms do not have additional information about state or search space other than how to traverse the tree, so it is also called blind search. Following are the various types of uninformed search algorithms: 1. Breadth-first Search 2. Depth-first Search 3. Depth-limited Search 4. Iterative deepening depth-first search 5. Uniform cost search 6. Bidirectional Search 1. Breadth-first Search: o Breadth-first search is the most common search strategy for traversing a tree or graph. This algorithm searches breadthwise in a tree or graph, so it is called breadth-first search. o BFS algorithm starts searching from the root node of the tree and expands all successor node at the current level before moving to nodes of next level. o The breadth-first search algorithm is an example of a general-graph search algorithm. o Breadth-first search implemented using FIFO queue data structure. Advantages: o BFS will provide a solution if any solution exists. o If there are more than one solutions for a given problem, then BFS will provide the minimal solution which requires the least number of steps. Disadvantages: o It requires lots of memory since each level of the tree must be saved into memory to expand the next level. o BFS needs lots of time if the solution is far away from the root node. Example: In the below tree structure, we have shown the traversing of the tree using BFS algorithm from the root node S to goal node K. BFS search algorithm traverse in layers, so it will follow the path which is shown by the dotted arrow, and the traversed path will be: 1. S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K Time Complexity: Time Complexity of BFS algorithm can be obtained by the number of nodes traversed in BFS until the shallowest Node. Where the d= depth of shallowest solution and b is a node at every state. T (b) = 1+b2+b3+.......+ bd= O (bd) Space Complexity: Space complexity of BFS algorithm is given by the Memory size of frontier which is O(bd). Completeness: BFS is complete, which means if the shallowest goal node is at some finite depth, then BFS will find a solution. Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the node. 2. Depth-first Search Depth-first search isa recursive algorithm for traversing a tree or graph data structure. It is called the depth-first search because it starts from the root node and follows each path to its greatest depth node before moving to the next path. DFS uses a stack data structure for its implementation. The process of the DFS algorithm is similar to the BFS algorithm. Advantage: o DFS requires very less memory as it only needs to store a stack of the nodes on the path from root node to the current node. o It takes less time to reach to the goal node than BFS algorithm (if it traverses in the right path). Disadvantage: o There is the possibility that many states keep re-occurring, and there is no guarantee of finding the solution. o DFS algorithm goes for deep down searching and sometime it may go to the infinite loop. Example: In the below search tree, we have shown the flow of depth-first search, and it will follow the order as: Root node--->Left node ----> right node. It will start searching from root node S, and traverse A, then B, then D and E, after traversing E, it will backtrack the tree as E has no other successor and still goal node is not found. After backtracking it will traverse node C and then G, and here it will terminate as it found goal node. Completeness: DFS search algorithm is complete within finite state space as it will expand every node within a limited search tree. Time Complexity: Time complexity of DFS will be equivalent to the node traversed by the algorithm. It is given by: T(n)= 1+ n2+ n3 +.........+ nm=O(nm) Where, m= maximum depth of any node and this can be much larger than d (Shallowest solution depth) Space Complexity: DFS algorithm needs to store only single path from the root node, hence space complexity of DFS is equivalent to the size of the fringe set, which is O(bm). Optimal: DFS search algorithm is non-optimal, as it may generate a large number of steps or high cost to reach to the goal node. Informed Search Algorithms So far we have talked about the uninformed search algorithms which looked through search space for all possible solutions of the problem without having any additional knowledge about search space. But informed search algorithm contains an array of knowledge such as how far we are from the goal, path cost, how to reach to goal node, etc. This knowledge help agents to explore less to the search space and find more efficiently the goal node. The informed search algorithm is more useful for large search space. Informed search algorithm uses the idea of heuristic, so it is also called Heuristic search. Heuristics function: Heuristic is a function which is used in Informed Search, and it finds the most promising path. It takes the current state of the agent as its input and produces the estimation of how close agent is from the goal. The heuristic method, however, might not always give the best solution, but it guaranteed to find a good solution in reasonable time. Heuristic function estimates how close a state is to the goal. It is represented by h(n), and it calculates the cost of an optimal path between the pair of states. The value of the heuristic function is always positive. h(n) B----->F----> G Time Complexity: The worst case time complexity of Greedy best first search is O(b m). Space Complexity: The worst case space complexity of Greedy best first search is O(bm). Where, m is the maximum depth of the search space. Complete: Greedy best-first search is also incomplete, even if the given state space is finite. Optimal: Greedy best first search algorithm is not optimal. 2.) A* Search Algorithm: A* search is the most commonly known form of best-first search. It uses heuristic function h(n), and cost to reach the node n from the start state g(n). It has combined features of UCS and greedy best-first search, by which it solve the problem efficiently. A* search algorithm finds the shortest path through the search space using the heuristic function. This search algorithm expands less search tree and provides optimal result faster. A* algorithm is similar to UCS except that it uses g(n)+h(n) instead of g(n). In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we can combine both costs as following, and this sum is called as a fitness number. At each point in the search space, only those node is expanded which have the lowest value of f(n), and the algorithm terminates when the goal node is found. Algorithm of A* search: Step1: Place the starting node in the OPEN list. Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and stops. Step 3: Select the node from the OPEN list which has the smallest value of evaluation function (g+h), if node n is goal node then return success and stop, otherwise Step 4: Expand node n and generate all of its successors, and put n into the closed list. For each successor n', check whether n' is already in the OPEN or CLOSED list, if not then compute evaluation function for n' and place into Open list. Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the back pointer which reflects the lowest g(n') value. Step 6: Return to Step 2. Advantages: o A* search algorithm is the best algorithm than other search algorithms. o A* search algorithm is optimal and complete. o This algorithm can solve very complex problems. Disadvantages: o It does not always produce the shortest path as it mostly based on heuristics and approximation. o A* search algorithm has some complexity issues. o The main drawback of A* is memory requirement as it keeps all generated nodes in the memory, so it is not practical for various large-scale problems. Example: In this example, we will traverse the given graph using the A* algorithm. The heuristic value of all states is given in the below table so we will calculate the f(n) of each state using the formula f(n)= g(n) + h(n), where g(n) is the cost to reach any node from start state. Here we will use OPEN and CLOSED list. Solution: Initialization: {(S, 5)} Iteration1: {(S--> A, 4), (S-->G, 10)} Iteration2: {(S--> A-->C, 4), (S--> A-->B, 7), (S-->G, 10)} Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7), (S-->G, 10)} Iteration 4 will give the final result, as S--->A--->C--->G it provides the optimal path with cost 6. Points to remember: o A* algorithm returns the path which occurred first, and it does not search for all remaining paths. o The efficiency of A* algorithm depends on the quality of heuristic. o A* algorithm expands all nodes which satisfy the condition f(n) Complete: A* algorithm is complete as long as: o Branching factor is finite. o Cost at every action is fixed. Optimal: A* search algorithm is optimal if it follows below two conditions: o Admissible: the first condition requires for optimality is that h(n) should be an admissible heuristic for A* tree search. An admissible heuristic is optimistic in nature. o Consistency: Second required condition is consistency for only A* graph-search. If the heuristic function is admissible, then A* tree search will always find the least cost path. Time Complexity: The time complexity of A* search algorithm depends on heuristic function, and the number of nodes expanded is exponential to the depth of solution d. So the time complexity is O(b^d), where b is the branching factor. Space Complexity: The space complexity of A* search algorithm is O(b^d). Hill Climbing Algorithm in Artificial Intelligence o Hill climbing algorithm is a local search algorithm which continuously moves in the direction of increasing elevation/value to find the peak of the mountain or best solution to the problem. It terminates when it reaches a peak value where no neighbor has a higher value. o Hill climbing algorithm is a technique which is used for optimizing the mathematical problems. One of the widely discussed examples of Hill climbing algorithm is Traveling- salesman Problem in which we need to minimize the distance traveled by the salesman. o It is also called greedy local search as it only looks to its good immediate neighbor state and not beyond that. o A node of hill climbing algorithm has two components which are state and value. o Hill Climbing is mostly used when a good heuristic is available. o In this algorithm, we don't need to maintain and handle the search tree or graph as it only keeps a single current state. Features of Hill Climbing: Following are some main features of Hill Climbing Algorithm: o Generate and Test variant: Hill Climbing is the variant of Generate and Test method. The Generate and Test method produce feedback which helps to decide which direction to move in the search space. o Greedy approach: Hill-climbing algorithm search moves in the direction which optimizes the cost. o No backtracking: It does not backtrack the search space, as it does not remember the previous states. State-space Diagram for Hill Climbing: The state-space landscape is a graphical representation of the hill-climbing algorithm which is showing a graph between various states of algorithm and Objective function/Cost. On Y-axis we have taken the function which can be an objective function or cost function, and state-space on the x-axis. If the function on Y-axis is cost then, the goal of search is to find the global minimum and local minimum. If the function of Y-axis is Objective function, then the goal of the search is to find the global maximum and local maximum. Different regions in the state space landscape: Local Maximum: Local maximum is a state which is better than its neighbor states, but there is also another state which is higher than it. Global Maximum: Global maximum is the best possible state of state space landscape. It has the highest value of objective function. Current state: It is a state in a landscape diagram where an agent is currently present. Flat local maximum: It is a flat space in the landscape where all the neighbor states of current states have the same value. Shoulder: It is a plateau region which has an uphill edge. Types of Hill Climbing Algorithm: o Simple hill Climbing: o Steepest-Ascent hill-climbing: o Stochastic hill Climbing: 1. Simple Hill Climbing: Simple hill climbing is the simplest way to implement a hill climbing algorithm. It only evaluates the neighbor node state at a time and selects the first one which optimizes current cost and set it as a current state. It only checks it's one successor state, and if it finds better than the current state, then move else be in the same state. This algorithm has the following features: o Less time consuming o Less optimal solution and the solution is not guaranteed Algorithm for Simple Hill Climbing: o Step 1: Evaluate the initial state, if it is goal state then return success and Stop. o Step 2: Loop Until a solution is found or there is no new operator left to apply. o Step 3: Select and apply an operator to the current state. o Step 4: Check new state: a. If it is goal state, then return success and quit. b. Else if it is better than the current state then assign new state as a current state. c. Else if not better than the current state, then return to step2. o Step 5: Exit. 2. Steepest-Ascent hill climbing: The steepest-Ascent algorithm is a variation of simple hill climbing algorithm. This algorithm examines all the neighboring nodes of the current state and selects one neighbor node which is closest to the goal state. This algorithm consumes more time as it searches for multiple neighbors Algorithm for Steepest-Ascent hill climbing: o Step 1: Evaluate the initial state, if it is goal state then return success and stop, else make current state as initial state. o Step 2: Loop until a solution is found or the current state does not change. a. Let SUCC be a state such that any successor of the current state will be better than it. b. For each operator that applies to the current state: a. Apply the new operator and generate a new state. b. Evaluate the new state. c. If it is goal state, then return it and quit, else compare it to the SUCC. d. If it is better than SUCC, then set new state as SUCC. e. If the SUCC is better than the current state, then set current state to SUCC. o Step 5: Exit. Means-Ends Analysis in Artificial Intelligence o Means-Ends Analysis is problem-solving techniques used in Artificial intelligence for limiting search in AI programs. o It is a mixture of Backward and forward search technique. o The MEA technique was first introduced in 1961 by Allen Newell, and Herbert A. Simon in their problem-solving computer program, which was named as General Problem Solver (GPS). o The MEA analysis process centered on the evaluation of the difference between the current state and goal state. How means-ends analysis Works: The means-ends analysis process can be applied recursively for a problem. It is a strategy to control search in problem-solving. Following are the main Steps which describes the working of MEA technique for solving a problem. a. First, evaluate the difference between Initial State and final State. b. Select the various operators which can be applied for each difference. c. Apply the operator at each difference, which reduces the difference between the current state and goal state. Operator Subgoaling In the MEA process, we detect the differences between the current state and goal state. Once these differences occur, then we can apply an operator to reduce the differences. But sometimes it is possible that an operator cannot be applied to the current state. So we create the subproblem of the current state, in which operator can be applied, such type of backward chaining in which operators are selected, and then sub goals are set up to establish the preconditions of the operator is called Operator Subgoaling. Algorithm for Means-Ends Analysis: Let's we take Current state as CURRENT and Goal State as GOAL, then following are the steps for the MEA algorithm. o Step 1: Compare CURRENT to GOAL, if there are no differences between both then return Success and Exit. o Step 2: Else, select the most significant difference and reduce it by doing the following steps until the success or failure occurs. a. Select a new operator O which is applicable for the current difference, and if there is no such operator, then signal failure. b. Attempt to apply operator O to CURRENT. Make a description of two states. i) O-Start, a state in which O?s preconditions are satisfied. ii) O-Result, the state that would result if O were applied In O-start. c. If (First-Part