Download Test-1 Solution Thinking humanly Thinking rationally Acting

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Intelligence explosion wikipedia , lookup

Ecological interface design wikipedia , lookup

Unification (computer science) wikipedia , lookup

Genetic algorithm wikipedia , lookup

Agent (The Matrix) wikipedia , lookup

Enactivism wikipedia , lookup

Soar (cognitive architecture) wikipedia , lookup

Multi-armed bandit wikipedia , lookup

Existential risk from artificial general intelligence wikipedia , lookup

Knowledge representation and reasoning wikipedia , lookup

Philosophy of artificial intelligence wikipedia , lookup

Computer Go wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Cognitive model wikipedia , lookup

Embodied cognitive science wikipedia , lookup

Transcript
 Test-1 Solution
Date: 25-02-2015
Marks: 50
Subject & Code: Artificial Intelligence and Agent technology (14SCS24)
Sec: II Sem M.Tech
Name of faculty: Dr.Srikanta Murthy. K
Time: 8.30 to 10.00AM
Q1). What is AI? Explain the term rationality with respect to AI
Ans. AI is the study of how to make computers do things which, at the moment, people
do better. But it provides a good outline of what constitutes artificial intelligence and it
avoids the philosophical issues that dominate attempts to define the meaning of either
artificial or intelligence.
A System is rational if it performs “Right Things” based on the information
provided to it.
Thought processes & reasoning
Human
performance
Thinking
humanly
Thinking
rationally
Acting
humanly
Acting
rationally
Ideal
concept of
intelligence
Behavior
Thinking Humanly: (The cognitive modeling approach)
• Most of the time it is a black box where we are not clear about our thought process.
• One has to know functioning of brain and its mechanism for possessing information.
• It is an area of cognitive science.
– The stimuli are converted into mental representation.
– Cognitive processes manipulate representation to build new representations that
are used to generate actions.
Acting Humanly: (The Turing test approach)
• The overall behavior of the system should be human like.
• It could be achieved by observation.
• The Turing test proposed by Alan Turing was designed to provide a satisfactory
optimal or operational definition of intelligence.
– Natural language processing.
– Knowledge representation.
– Automated reasoning.
– Machine learning.
Thinking Rationally: (The laws of thought approach)
• Such systems rely on logic rather than human to measure correctness.
• For thinking rationally or logically, logic formulas and theories are used for
synthesizing outcomes.
• For example,
– given John is a human and all humans are mortal then one can conclude
logically that John is mortal
• Not all intelligent behaviors are mediated by logical deliberation.
Acting Humanly: (The rational agent approach)
• An agent is just something that acts.
• Computer agents are not just programs.
• Computer agents acts(or)operates under autonomous control, perceive from their
environment, adapts to change etc.,
• Rational agents that acts to achive the best outcome.
• Making correct inferences is a part of being a rational agent.
• A way to act rationally is to reason logically.
Q2). Describe a well-defined problem? Explain the same for 8 queen
problem
Ans.
A well-defined problem can be described by:
• Initial state: that the agent starts in.
• Operator or successor function: for any state x returns s(x), the set of states
reachable from x with one action.
• State space: all states reachable from initial by any sequence of actions.
• Path: sequence through state space.
• Path cost: function that assigns a cost to a path. Cost of a path is the sum of costs
of individual actions along the path.
• Goal test: test to determine if at goal state.
• The step cost: of taking action a to go from state x to state y is denoted by c(x,a,y).
• Solution to the problem is a path from the initial state to a goal state.
• Optimal solution has the lowest path cost among all solutions.
The goal of 8-queens problem is to place 8-queens on the chessboard such that no queen
attacks any other. (Queen moves Row or Column or Diagonal)
Fig.1
In the above Fig.1 8-Queens are on the board and none attacked. We can say this as a
Goal State or Final State.
There are many possible ways of arranging 8-Queens, Fig.1 is one among them.
• An Incremental formulation involves for 8-queens problem, each action adds a
queen to the state.
• A 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.
• States: Any arrangement of 0 to 8 queens on board is a state.
• Initial state: No queen on the board.
• Successor function: Add a queen to any empty square.
• Goal Test: 8 queens are on the board, none attacked.
Q3). What are problem characteristics? Explain the DFS and BFS
Ans. The problem characteristics are:
1. Is the problem decomposable into a set of nearly independent smaller or easier sub
problems?
2. Can the solution steps be ignored or at least undone if they prove unwise?
3. Is the problem's universe predictable?
4. Is a good solution to the problem obvious without comparison to all other possible
solutions?
5. Is the desired solution a state of the world or a path to a state?
6. Is a large amount of knowledge absolutely required to solve this problem or is
knowledge important only to constrain the search?
7. Can a computer that is simply given the problem return the solution or will the
solution of the problem require interaction between the computer and a person?
ALGORITHM: BREADTH-FIRST SEARCH
1. Create a variable called NODE-LIST and set it to the initial state.
2. Loop until the goal state is found or NODE-LIST is empty.
a. Remove the first element, say E, from the NODE-LIST. If NODELIST was empty then quit.
b. For each way that each rule can match the state described in E do:
i) Apply the rule to generate a new state.
ii) If the new state is the goal state, quit and return this state.
iii) Otherwise add this state to the end of NODE-LIST
ADVANTAGES OF BREADTH-FIRST SEARCH
1. Breadth first search will never get trapped exploring the useless path forever.
2. If there is a solution, BFS will definitely find it out.
3. If there is more than one solution then BFS can find the minimal one that requires
less number of steps.
DISADVANTAGES OF BREADTH-FIRST SEARCH
1. The main drawback of Breadth first search is its memory requirement. Since each
level of the tree must be saved in order to generate the next level, and the amount
of memory is proportional to the number of nodes stored, the space complexity of
BFS is O(bd). As a result, BFS is severely space-bound in practice so will exhaust
the memory available on typical computers in a matter of minutes.
2. If the solution is farther away from the root, breath first search will consume lot of
time.
ALGORITHM: DEPTH FIRST SEARCH
1. If the initial state is a goal state, quit and return success.
2. Otherwise, loop until success or failure is signaled.
a. Generate a state, say E, and let it be the successor of the initial state. If there
is no successor, signal failure.
b. Call Depth-First Search with E as the initial state.
c. If success is returned, signal success. Otherwise continue in this loop.
ADVANTAGES OF DEPTH-FIRST SEARCH

The advantage of depth-first Search is that memory requirement is only linear with
respect to the search graph. This is in contrast with breadth-first search which
requires more space. The reason is that the algorithm only needs to store a stack of
nodes on the path from the root to the current node.

The time complexity of a depth-first Search to depth d is O(b^d) since it generates the
same set of nodes as breadth-first search, but simply in a different order. Thus
practically depth-first search is time-limited rather than space-limited.

If depth-first search finds solution without exploring much in a path then the time and
space it takes will be very less.
DISADVANTAGES OF DEPTH-FIRST SEARCH

The disadvantage of Depth-First Search is that there is a possibility that it may go
down the left-most path forever. Even a finite graph can generate an infinite tree.

Depth-First Search is not guaranteed to find the solution.

And there is no guarantee to find a minimal solution, if more than one solution
exists.
Q4). Explain production systems. Write the production rules for water-jug
problem
Ans.
Knowledge representation formalism consists of collections of condition-action rules
(Production Rules or Operators), a database which is modified in accordance with the
rules, and a Production System Interpreter which controls the operation of the rules i.e.,
the 'control mechanism' of a Production System, determining the order in which
Production Rules are fired.
A system that uses this form of knowledge representation is called a production
system.
Components of an AI production system are:
1. A set of production rules each consisting of a left side the applicability of the rule
and the right side the operations to be performed;
2. One or more knowledge bases containing the required information for each task;
3. A control strategy that specifies the order in which the rules will be compared to the
database and ways of resolving conflict;
4. Rule applier Control Strategy or Control Structure.
Production Rules for water-jug:
S.No
Condition
Action
Explanation
1
(x, y)
If x<4
(x, y)
If y<3
(x, y)
If x>0
(x, y)
If y>0
(x, y)
If x>0
→ (4, y)
Fill the 4-gallon jug.
→ (x, 3)
Fill the 3-gallon jug.
→ (x-d, y)
Pour some water out of the 4-gallon jug
→ (x, y-d)
Pour some water out of the 3-gallon jug
→ (0, y)
Empty the 4-gallon jug on the ground
2
3
4
5
6
7
(x, y)
If y>0
(x, y)
If x+y≥4 & y>0
→ (x, 0)
Empty the 3-gallon jug on the ground
→ (4, y-(4-x))
Pour water from the 3-gallon jug into
the 4-gallon jug until the 4-gallon jug is
full
Pour water from the 4-gallon jug into
the 3-gallon jug until the 3-gallon jug is
full
Pour all the water from the 3-gallon jug
into the 4-gallon jug
Pour all the water from the 4-gallon jug
into the 3-gallon jug
Pour the 2-gallons from the 3-gallon jug
into the 4-gallon jug
Empty the 2-gallons in the 4-gallon jug
on the ground
8
(x, y)
If x+y≥3 & x>0
→ (x-(3-y), 3)
9
→ (x+y, 0)
→ (0, x+y)
11
(x, y)
If x+y≤4 & y>0
(x, y)
If x+y≤3 & x>0
(0, 2)
12
(2, y)
→ (0, y)
10
→ (2, 0)
Q5). What is an Agent? What does Task Environment means? Give PEAS
description for an automated taxi.
Ans.
"An agent is anything that can be viewed as perceiving its environment through sensors
and acting upon that environment through effectors."
Agent
Sensors
Environment
?
Actuators
Example:
• A human agent has eyes, ears, and other organs for sensors and hands, legs, mouth,
and other body parts for actuators.
• A robotic agent might have cameras and infrared range finders for sensors and various
motors for actuators.
• A software agent receives keystrokes, file contents, and network packets as sensory
inputs and acts on the environment by displaying on the screen, writing files, and
sending network packets.
• Vacuum-Cleaner World
• This world has two locations only A & B.
• The vacuum agent perceives where it is( in A or B) and whether there is dirt or
not.
• Percepts: location and contents, e.g., [A,Dirty]
• Actions: Left, Right, Suck, NoOp.
• Simplest agent function:
• if current location( say A) is dirty then
• suck else move to location B
In the simple vacuum-cleaner agent, we had to specify the performance measure, the
environment, and the agent’s actuators and sensors. By grouping these we can call as
Task Environment.
Task Environments are the “problems” and rational agents are “solution” to it.
Properties of task environment:
• Fully observable vs. partially observable
• Deterministic vs. stochastic
• Episodic vs. sequential
• Static vs. dynamic
• Discrete vs. continuous
• Single agent vs. multi-agent
PEAS description for automated taxi:
Agent
Type
Taxi
driver
Performance
Measure
Safe, fast, legal,
comfortable
trip, maximize
profits
Environment
Actuators
Sensors
Roads, other
traffic,
pedestrians,
customers
Steering,
accelerator,
break,
signal, horn,
display
Cameras, sonar,
speedometer, GPS,
odometer,
accelerometer, engine,
sensors, keyboard