Docsity

good lecture notes and others, Lecture notes of Computer Science

Partial preview of the text

Download good lecture notes and others and more Lecture notes Computer Science in PDF only on Docsity!

Addis Ababa University

College of Natural and Computational Sciences

Department of Computer Science

Intelligent Systems Module

Part I: Introduction to Artificial Intelligence

May 2024

Addis Ababa,

Ethiopia

Table of Contents

6.5 Processing of ANN .................................................................................................................................. 9 6.6 Application of ANN............................................................................................................................... 11 6.7 Sample Questions................................................................................................................................... 12 Chapter Seven: Communicating, Perceiving, and Acting ........................................................................................ 1 7.1 Natural language processing .................................................................................................................... 2 7.2 Applications of NLP ................................................................................................................................ 4 7.3 Introduction to robotics ............................................................................................................................ 5 7.4 Sample Questions..................................................................................................................................... 7

Chapter One: Introduction to artificial intelligence

Objectives After completing this chapter, students will be able to know and understand  Definition of Artificial Intelligence  Typical AI problems  Intelligent behaviour  Practical Impact of AI  Approaches to AI  Limits of AI Today  What can AI systems do?  What can AI systems NOT do yet?  Goals of AI  General AI goal  AI Techniques 1.1 Definition AI is the study of the mental faculties through the use of computational models. Artificial Intelligence is concerned with the design of intelligence in an artificial device. The term was coined by McCarthy in 1956. There are two ideas in the definition. i.e Intelligence, and Artificial device. What is intelligence?  Intelligence relate to tasks involving higher mental process e.g. creativity, solving problems, pattern recognition, classification, classification, learning, induction, deduction, building analogies, optimization language processing, knowledge and many more.  Intelligence is the computational part of the ability to achieve goals.  Is it that which characterize humans? Or is there an absolute standard of judgment?  Accordingly, there are two possibilities:

  • A system with intelligence is expected to behave as intelligently as a human
  • A system with intelligence is expected to behave in the best possible manner  Secondly what type of behaviour are we talking about?
  • Are we looking at the thought process or reasoning ability of the system?
  • Or are we only interested in the final manifestations of the system in terms of its actions? Given this scenario different interpretations have been used by different researchers as defining the scope and view of Artificial Intelligence. 1. One view is that artificial intelligence is about designing systems that are as intelligent as humans. This view involves trying to understand human thought and an effort to build machines that emulate the human thought process. This view is the cognitive science approach to AI. – Think human like
  1. The second approach is best embodied by the concept of the Turing Test. Turing held that in future computers can be programmed to acquire abilities rivaling human intelligence.As part of his argument Turing put forward the idea of an 'imitation game' , in which a human being and a computer would be interrogated under conditions where the interrogator would not know which was which, the communication being entirely by textual messages. Turing argued that if the interrogator could not distinguish them by questioning, then it would be unreasonable not to call the computer intelligent. Turing's 'imitation game' is now usually called 'the Turing test' for intelligence.

Turing Test

3. Logic and laws of thought deals with studies of ideal or rational thought process and inference. The emphasis in this case is on the inference mechanism, and its properties. That is how the system arrives at a conclusion, or the reasoning behind its selection of actions is very important in this point of view. The soundness and completeness of the inference mechanisms are important here. – think rationally

  1. The fourth view of AI is that it is the study of rational agents. This view deals with building

machines are capable of cognitive mental states. Weak AI: deals with the creation of some form of computer-based artificial intelligence that cannot truly reason and solve problems, but can act as if it were intelligent. Weak AI holds that suitably programmed machines can simulate human cognition. Applied AI: aims to produce commercially viable smart system. For example, a security system that is able to recognize the faces of people who are permitted to enter a particular building. Applied AI has already enjoyed considerable success. Cognitive AI: computers are used to test theories about how the human mind works--for example, theories about how we recognize faces and other objects, or about how we solve abstract problems.

1.6 Limits of AI Today

Today‘s successful AI systems operate in well-defined domains and employ narrow, specialized knowledge. Common sense knowledge is needed to function in complex, open-ended worlds. Such a system also needs to understand unconstrained natural language. However these capabilities are not yet fully present in today‘s intelligent systems. 1.7 What can AI systems do? Today‘s AI systems have been able to achieve limited success in some of these tasks.

  • In Computer vision, the systems are capable of face recognition
  • In Robotics, we have been able to make vehicles that are mostly autonomous.
  • In Natural language processing, we have systems that are capable of simple machine translation.
  • Today‘s Expert systems can carry out medical diagnosis in a narrow domain
  • Speech understanding systems are capable of recognizing several thousand words continuous speech
  • Planning and scheduling systems had been employed in scheduling experiments with the Hubble Telescope
  • The Learning systems are capable of doing text categorization into about a 1000 topics
  • In Games, AI systems can play at the Grand Master level in chess (world champion), checkers, etc. 1.8 What can AI systems NOT do yet?
  • Understand natural language robustly (e.g., read and understand articles in a newspaper)
  • Surf the web
  • Interpret an arbitrary visual scene
  • Learn a natural language
  • Construct plans in dynamic real-time domains
  • Exhibit true autonomy and intelligence

1.9 Goals of AI The definition of AI gives four possible goals to pursue  systems that think like human science approach  systems that act like human Test approach  systems that think rationally of thought approach  systems that act rationally agent approach General AI goal  Replicate human intelligent  Solve knowledge intensive task  Make an intelligent connection between perception and action  Enhance human-computer interaction/ communication Engineering based AI goal  Develop concepts, theory and practice of building intelligent machines  Emphasis is on system building Science based AI goal  Develop concepts, mechanisms and vocabulary to understand biological intelligent behaviours  Emphasis is on understanding intelligent behaviours

1.10 AI Techniques

Various techniques that have involved can be applied to a variety of AI tasks. The techniques are concerned with how we represent, manipulate and reason with knowledge in order to solve problem. Example  Techniques, not all ―intelligent‖ but used to behave as intelligent o Describe and match o Constraint satisfaction o Generate and Test  Biology-inspired AI techniques are currently popular o Neural Network o Reinforcement learning 1.11 Sample questions

o Goal reduction o Tree search o Rule based system

o Genetic Algorithms

  1. Which one of the following is correctly matched with the definition and approaches of AI A) Acting humanly - The rational agent approach

Objectives

Chapter Two: Intelligent Agents

After completing this chapter, students will be able to know and understand o Introduction to Intelligent Agents o Agents and the environments o Rationality Vs Omniscience o Structure of Intelligent Agents o Autonomy o Task Environments o Properties of Task environments o PEAS examples o Agent Types 2.1 Introduction to Intelligent Agents

  • Terminology
    • Performance Measure of Agent -It is the criteria, which determines how successful an agent is.
    • Behavior of Agent − It is the action that agent performs after any given sequence of percepts.
    • Percept − It is agent‘s perceptual inputs at a given instance.
    • Percept Sequence − It is the history of all that an agent has perceived till date.
    • Agent Function − It is a map from the precept sequence to an action.
  • An agent is anything that can perceive its environment through sensors and acts upon that environment through effectors. An agent perceives its environment through sensors.
  • The complete set of inputs at a given time is called a percept.
  • The current percept or a sequence of precepts can influence the actions of an agent.
  • The agent can change the environment through actuators or effectors.
  • An operation involving an effector is called an action.
  • Actions can be grouped into action sequences.
  • The agent can have goals which it tries to achieve. Thus, an agent can be looked upon as a system that implements a mapping from percept sequences to actions.
  • A performance measure has to be used in order to evaluate an agent.
  • An autonomous agent decides autonomously which action to take in the current situation to maximize progress towards its goals.
  • An Intelligent Agent must sense, must act, and must be autonomous (to some extent). It also must be rational.
  • AI is about building rational agents.
  • An agent is something that perceives and acts.
  • A rational agent always does the right thing.
    • What are the functionalities (goals)?
    • What are the components?
    • How do we build them?
  • Agent performance
    • An agent function implements a mapping from perception history to action.
    • The behaviour and performance of intelligent agents have to be evaluated in terms of the agent function.
    • The ideal mapping specifies which actions an agent ought to take at any point in time.
  • The performance measure is a subjective measure to characterize how successful an agent is.
  • The success can be measured in various ways.
    • It can be measured in terms of speed or efficiency of the agent.
    • It can be measured by the accuracy or the quality of the solutions achieved by the agent.
    • It can also be measured by power usage, money, etc. 2.2 Agents and the environments
  • An AI system is composed of an agent and its environment.
  • The agents act in their environment. The environment may contain other agents.
  • An agent is anything that can perceive its environment through sensors and acts upon that environment through effectors. 2.3 Rationality Vs Omniscience Rationality
    • Rationality is nothing but status of being reasonable, sensible, and having good sense of judgment.
    • Rationality is concerned with expected actions and results depending upon what the agent has perceived.
    • Performing actions with the aim of obtaining useful information is an important part of rationality.
    • Example of agent:
    • Chess agent o World knowledge is the board state (all the pieces) o Sensory information is the opponents move o It‘s moves also change the board state

2.6 Task Environments

  • An environment in artificial intelligence is the surrounding of the agent.
  • The environment is where agent lives, operate and provide the agent with something to sense and act upon it.
  • The agent takes input from the environment through sensors and delivers the output to the environment through actuators.
  • The most famous artificial environment is the Turing Test environment , in which one real and other artificial agent are tested on equal ground.

2.7 Properties of Task environmentsDiscrete / Continuous − If there are a limited number of distinct, clearly defined, states of the environment, the environment is discrete (For example, chess); otherwise it is continuous (For example, driving).  Observable / Partially Observable − If it is possible to determine the complete state of the environment at each time point from the percepts it is observable; otherwise it is only partially observable.  Static / Dynamic − If the environment does not change while an agent is acting, then it is static; otherwise it is dynamic.  Single agent / Multiple agents − The environment may contain other agents which may be of the same or different kind as that of the agent.  Accessible / Inaccessible − If the agent‘s sensory apparatus can have access to the complete state of the environment, then the environment is accessible to that agent.  Deterministic / Non-deterministic − If the next state of the environment is completely determined by the current state and the actions of the agent, then the environment is deterministic; otherwise it is non-deterministic.  Episodic / Non-episodic − In an episodic environment, each episode consists of the agent perceiving and then acting. The quality of its action depends just on the episode itself. Subsequent episodes do not depend on the actions in the previous episodes. Episodic environments are much simpler because the agent does not need to think ahead. 2.8 PEAS examples

  • The are four elements to take account when designing an agent to solve a particular problem
  • PEAS o P erformance: measure the success of an agents behavior o E nvironment: where an agent operates

o A ctuator: agent acts with in its environment o S ensor: the agent senses its environment

  • Example 1: Agent - Taxi driver o P: safe, fast, legal, maximize profit o E:road, other traffic, customer, pedestrian o A: brake, accelerator, signal, horn, steering wheel o S: camera, sonar, speedometer, GPS, odometer, engine sensor, keyboard. 2.9 Agent Types Agents can be grouped into five classes based on their degree of perceived intelligence and capability. All these agents can improve their performance and generate better action over the time.

2.9.1 Simple reflex agent

  • They are the simplest agents that take decisions on the basis of the current percept and ignore the rest of the percept history. These agents only succeed in the fully observable environment.
  • The Simple reflex agent does not consider any part of percept history during their decision and action process.
  • The Simple reflex agent works on Condition-action rule , which means it maps the current state to action.
  • Such as a Room Cleaner agent, it works only if there is dirt in the room.
  • Problems for the simple reflex agent design approach:
    • They have very limited intelligence
    • They do not have knowledge of non-perceptual parts of the current state
    • Not adaptive to changes in the environment. 2.9.2 Model-based reflex agent
  • The Model-based agent can work in a partially observable environment, and track the situation.
  • A model-based agent has two important factors:
    • Model : It is knowledge about "how things happen in the world," so it is called a Model-based agent.
    • Internal State : It is a representation of the current state based on percept history.
  • These agents have the model, "which is knowledge of the world" and based on the model they perform actions.
  • Updating the agent state requires information about:
    • How the world evolves
    • How the agent's action affects the world.

 Hence, learning agents are able to learn, analyse performance, and look for new ways to improve the performance. 2.10 Summery  AI is to build intelligent agents that act so as to optimize performance.  An agent perceives and acts in an environment, has architecture, and is implemented by an agent program.  An ideal agent always chooses the action which maximizes its expected performance, given its percept sequence so far.  An autonomous agent uses its own experience rather than built-in knowledge of the environment by the designer.  An agent program maps from percept to action and updates its internal state.  Reflex agents respond immediately to precepts.  Goal-based agents act in order to achieve their goal(s).  Utility-based agents maximize their own utility function.  Representing knowledge is important for successful agent design.  The most challenging environments are partially observable, stochastic, sequential, dynamic, and continuous, and contain multiple intelligent agents. 2.11 Questions

1. Which of the following is the meaning of the agent’s percept sequence? A. A complete history of perceived things B. A complete history of the actuator C. Used to perceive the environment D. None of these 2. are very helpful in AI for perceiving and acting upon the environment? A. Perceiver B. Sensors

C. Sensors and Actuators D. None of these

3. Which of the following is the composition for agents in AI? A. Program B. Architecture 4. Artificial Intelligence is unable to do yet? A. Understanding the natural language robustly B. Web mining C. plans Construction in real-time dynamic systems D. All of these

C. Both A and B D. None of these

E. None of these

5. Problem generator is present in which of the following agent? A. Reflex B. Observing

C. Learning D. None of these

6. Which of the following is the rule of a simple reflex agent? A. Simple-action rule B. Simple & Condition-action rule C. Condition-action rule D. None of these 7. We can improve the performance of agents with the help of? A. Learning B. Perceiving

C. Observing D. None of these

8. We can achieve the agent’s goal with the help of ……. action sequences? A. Search B. Plan C. Retrieve

D. Both A and B E. None of these

9. The action of the Simple reflex agent fully depends upon which of the following? A. Perception history B. Current perception C. Learning theory

D. Utility functions E. None of these

Objectives

Chapter Three: Problem Solving (Goal Based) Agents

o Problem Solving by Searching o What is search and terminologies? o Search Strategies o Unformed Search Strategies

  • DFS, BFS, Uniform cost search, DLS, Iterative Deeping DFS, and Bi-directional search. o Informed Search Strategies
  • A star search, Best first search o Local Search Strategies
  • Hill climbing search, Means ends analysis, Simulated annealing

 Note: Backtracking is an algorithm technique for finding all possible solutions using recursion. It traverses a tree from Root node--->Left node ---- > right node.  Advantage:  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.  It takes less time to reach to the goal node than BFS algorithm (if it traverses in the right path).  Disadvantage:  There is the possibility that many states keep re-occurring, and there is no guarantee of finding the solution.  DFS algorithm goes for deep down searching and sometime it may go to the infinite loop. Example

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. T(n)=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.

2. BFS

  • 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.
  • It searches breadthwise in a tree or graph, so it is called breadth-first search.
  • Breadth-first search implemented using FIFO queue data structure.
  • If branching factor (average number of child nodes for a given node) = b and depth = d, then number of nodes at level d = bd.
  • The total no of nodes created in worst case is b + b^2 + b^3 + … + bd. Advantages
    • BFS will provide a solution if any solution exists.
    • If there are more than one solution for a given problem, then BFS will provide the minimal solution which requires the least number of steps. Disadvantages:
    • It requires lots of memory since each level of the tree must be saved into memory to expand the next level.
    • BFS needs lots of time if the solution is far away from the root node. Example

Time Complexity: is obtained by the number of nodes traversed in BFS until the shallowest Node. T (b) =O(bd) where d= depth of shallowest solution and b is a node at every state. 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.

3. Depth limited search A depth-limited search algorithm is similar to depth-first search with a predetermined limit. Depth- limited search can solve the drawback of the infinite path in the Depth-first search. In this algorithm, the node at the depth limit will treat as it has no successor nodes further.