You are on page 1of 18

RIFT VALLY UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE


Group ASSIGNMENT AI

Group Name ID

1.Amanuel Alemayehu CIR/0015/16

2.Kedir Surur CIR/0028/16

3.Yohanies Wale CIR/0036/16

4.Tegist Alemayehu CIR/0012/16

SUBMITED TO: INST. Wondante


Question

 The foundations of AI systems - why is search required to solve the problem;


 the problem and its environment - what features do they have;
 knowledge that would help guide search - what are the features of the
knowledge, and how your system might acquire the knowledge;
 a production system algorithm that is appropriate for your system, including
how your system would choose which states and transformations to apply at
each step.
1.The foundations of AI systems - why is search required to solve the problem;

What is Search?

Search is the systematic examination of states to find path from the start/root state to the goal
state.

The set of possible states, together with operators defining their connectivity constitute the search
space.

The output of a search algorithm is a solution, that is, a path from the initial state to a state that
satisfies the goal test.

In real life search usually results from a lack of knowledge. In AI too search is merely a offensive
instrument with which to attack problems that we can't seem to solve any better way.

Search techniques fall into three groups:

 Methods which find any start - goal path,

 Methods which find the best path, and finally

 Search methods in the face of adversaries.

Problem Solving by Search

An important aspect of intelligence is goal-based problem solving.

The solution of many problems (e.g. noughts and crosses, timetabling, chess) can be described by
finding a sequence of actions that lead to a desirable goal. Each action changes the state and the aim
is to find the sequence of actions and states that lead from the initial (start) state to a final (goal)
state.

A well-defined problem can be described by:

 Initial state

 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

Problem Solving as Search

In the simplest case of an agent deciding what it should do, the agent has a state-based model of the
world, with a goal to achieve and no uncertainty. This is either a flat (non-hierarchical)
representation or a single level of a hierarchy. The agent is able to determine how to achieve its
goal by searching in its representation of the world state space for a way to get from its current
state to a state that satisfies its goal. Given a complete model, it tries to find a sequence of actions
that will achieve its goal before it has to act in the world.

This problem can be abstracted to the mathematical problem of finding a path from the start node
to a goal node in a directed graph. Many other problems can also be mapped to this abstraction, so
it is worthwhile to consider this level of abstraction. Most of this chapter explores various
algorithms for finding such paths.

Example:Computer maps provide path-finding: showing how to drive (or ride, walk or take transit)
from one location to another. Finding the best route from a current location to a destination is a
search problem. The state includes the location, and possibly the driving direction and speed. A
legal route will include the roads (going the correct way down one-way streets) and intersections
the traveler will traverse.

The best route could mean

•the shortest (least distance) route

•the quickest route

•the lowest-cost route that takes into account time, money (e.g, fuel and tolls) and the route’s
attractiveness.

Finding the shortest route is usually easiest to implement as computing distances from a map is
usually straightforward.
2. problem and its environment - what features do they have;

AI is developing with such an incredible speed, sometimes it seems magical. There is an opinion
among researchers and developers that AI could grow so immensely strong that it would be
difficult for humans to control.

Humans developed AI systems by introducing into them every possible intelligence they could, for
which the humans themselves now seem threatened.

Threat to Privacy

An AI program that recognizes speech and understands natural language is theoretically capable of
understanding each conversation on e-mails and telephones.

Threat to Human Dignity

AI systems have already started replacing the human beings in few industries. It should not replace
people in the sectors where they are holding dignified positions which are pertaining to ethics such
as nursing, surgeon, judge, police officer, etc.

Threat to Safety

The self-improving AI systems can become so mighty than humans that could be very difficult to
stop from achieving their goals, which may lead to unintended consequences.

Features of Artificial Intelligence

These are the features of AI that make it unique:

 Eliminate dull and boring tasks

 Data ingestion

 Imitates human cognition

 Futuristic

 Prevent natural disasters

 Facial Recognition and Chatbots

1. Eliminate Dull and Boring Tasks

All of us have, at some point, accomplished a certain task just because we had to do it, not because
we enjoyed doing it. We found that task to be boring, or dull. However, with a machine, you never
have to experience similar boredness. An artificially intelligent system will do and continue doing
the task as commanded to it, no matter how many times it has to do it. Also, such systems only
make tedious, vast tasks easier for the users.

Dialog flow which is a subsidiary company of Google, that takes credit for creating the Google
assistant. We give so many commands to this assistant in a single day! From asking Ok Google, call
mom, to Ok Google, order sandwiches – the assistant has it all covered.

At the same time, we have the facility of being able to send numerous calendar invitations to people
using this assistant. All we’ve got to do is choose the time of a certain event, and type in the list of
guests. The assistant does the rest of the work. An invite will be sent to all those on the guest list.
This is so much easier when compared to calling, texting, or visiting people to invite them in your
event.

Wait!! Before reading further you must know the basics of AI with AI tutorial

2. Data Ingestion

Data ingestion is one of the most important features of artificial intelligence. Artificially intelligent
systems deal with huge amounts of data. Even a small company of about 50 employees has huge
chunks of data to analyze, we can’t even imagine the quantity of data that organizations like
Facebook handle.

Also, an artificially intelligent system stores multiple information about multiple entities from
multiple sources. All of this appears on the system in a synchronous, or a simultaneous manner.

The data that we are all producing is growing exponentially, which is where AI steps in. Such data is
dynamically updated and it becomes difficult for regular database systems to ingest it all. So, AI-
enabled systems have gone beyond and gathered and analyzed data that can prove to be useful for
all.

One such example of artificial intelligence would be Elucify, which is basically a database of
multiple business contacts. Elucify works on a basic principle – give, to receive. The user has to
create an account here and sign in, after which the information of the user’s contacts is accessible
and shareable by the system. In return, the user gets relevant business contacts, which might be
potential customers. In other words, Elucify is crowdsourcing this data. This explains so much
about the coaching centers that first call your friend, then you, and then other friends of yours
belonging to the same batch.

3. Imitates Human Cognition

We call it an artificially intelligent system because it essentially imitates or mimics the way the
human mind thinks and solves problems. This is what makes AI unique. Like the humans study
their environment, draw inferences, and then interact with it accordingly, an AI also successfully
attempts to interpret the environment and act suitably.

However it is not entirely possible, as of today, but developers and scientists are working on
systems that cater to the theory of mind and self-awareness of the artificially intelligent systems.

This further makes us think of the day when an AI system will be able to fully mimic the human
mind and behave exactly like a human. To be honest, I am so looking forward to the day when only
my personal AI system will interact with people in my stead, and an asocial me would binge watch
some web series in the comfort of my home.

For example, Baidu, a Chinese tech giant, which is actually a search engine that works in the Chinese
language, primarily for the citizens of China. Baidu also has a voice cloning tool, which can now
clone human voice with the help of just 3-4 seconds of audio, as opposed to the previously taken 30
minutes. Well, it is equally terrifying as is awesome!

4. FuturisticAI-enabled systems are designed to observe and react to their surroundings. They not
only perceive the environment and take actions accordingly but also keep in mind (isn’t it ironic
that I just used ‘mind’ for artificial intelligence?) the situations that might come up in the near
future.

The classic example of this characteristic would be a self-driven car. It notes the speed of the cars
that are driving around and tries implementing similar speed patterns in the traffic, also known as
neural networks .

Simultaneously, it feeds data into the

machine learning algorithms and observes when and how a car is changing lanes. It tries reaching a
certain target or goal by considering multiple scenarios.

One must keep in mind that such decisions rely heavily on the Automated Driving System (ADS)
that is integral to the working of a self-driven car. ADS, in simple words, is basically a system that
uses a combination of various systems that a driver uses to drive the car. With the help of ADS, a car
can navigate without the actual presence of a driver inside.

BMW is an example of AI – self-driven cars, a leading German multinational automobile


manufacturer is developing self-driven cars that have fully automated driving, however, the driver
can still request control from the vehicle at times. This car will be able to handle most driving
situations on its own, giving the driver a break.

5. Prevent Natural Disasters

We are all friendly with using AI for our businesses, for our gaming profiles, and more such
purposes. Now it is our turn to take AI one step ahead and hone it, so that governments can use it in
disaster management. Artificially intelligent systems, when fed with data about thousands of
previous disasters, AI can accurately predict the future relating to the disasters that might occur.

Today, with the help of features of artificial intelligence like these scientists are studying more than
a lac of previously occurred earthquakes and similar disasters like tremors and volcanic eruptions,
to create a neural network . The mechanism of this network was tested on about 30,000 events, and
the predictions of the system came out to be more precise as compared to the traditional
techniques.

Similarly, AI systems are studying

seismic information, which is information regarding movements in the tectonic plates that reside
beneath the earth’s surface. Scientists are also observing ash particles that arise from lava that
generates in a volcanic eruption, and other geological information to predict sudden eruptions.

Likewise, we are working on accurately predicting other natural disasters like cyclones, floods, etc.

Cyclone Fani hit Bangladesh and the south eastern state of India- Odisha in May 2019. The Indian
Meteorological Department predicted and tracked this storm beforehand and evacuated about 1.2
million residents of Odisha on time, and moved them to cyclone shelters built on higher altitudes.
This helped save numerous lives, and the death toll due to the cyclone was reduced to mere 72
people.

One can only imagine the amount of people whose lives AI can save if these predictions are true and
have proper execution.

6. Facial Recognition and Chatbots

Facial recognition system enables a machine to unlock or provide authorized access to an


individual, by verifying or identifying a person’s face. A camera fit into the machine senses the face,
and it is compared to a previously stored face in its memory. Most smartphones these days provide
facial recognition to unlock the phone.

My friends are notorious and don’t stop pulling pranks on me. One day, I accidentally revealed my
phone’s password to them. Afraid that they would mess up, I simply changed the security setting
from password to facial recognition. Now, only I am able to unlock my phone and this has saved me
from any kind of embarrassment.

Chatbots are software that enables a conversation with the user to solve any issues that they are
facing, via auditory methods or texting. These software simulate human behavior while talking to a
human over an application. Many companies have started using chatbots as a means of customer
service, like Swiggy and Nykaa.

Swiggy chatbots offer services revolving around issues that the customers face when their food is
stuck in traffic, or the items they ordered are unavailable. The Nykaa chatbot exists to provide
product suggestions to the users. Yesterday I was looking for a conditioner for my curly, frizzy hair,
and this chatbot provided me really good options- that too in my budget!

Summary

AI is no more a technology of the future. It is now something that we are living alongside. It is as
vast as a child’s imagination. There are so many things that make AI unique and humans are busy
enhancing these technologies. Today, with the advancement of technology, we are living and
breathing artificial intelligence.
3. knowledge that would help guide search - what are the features of the knowledge, and
how your system might acquire the knowledge;

To solve many problems requires much knowledge, and this knowledge must be
represented in the computer. As part of designing a program to solve problems, we must
define how the knowledge will be represented. A representation scheme is the form of
the knowledge that is used in an agent. A representation of some piece of knowledge is
the internal representation of the knowledge. A representation scheme specifies the form
of the knowledge. A knowledge base is the representation of all of the knowledge that is
stored by an agent.
A good representation scheme is a compromise among many competing objectives. A
representation should be
 Rich enough to express the knowledge needed to solve the problem.
 As close to the problem as possible; it should be compact, natural, and
maintainable. It should be easy to see the relationship between the representation
and the domain being represented, so that it is easy to determine whether the
knowledge represented is correct. A small change in the problem should result in a
small change in the representation of the problem.
 Amenable to efficient computation, which usually means that it is able to express
features of the problem that can be exploited for computational gain and able to
trade off accuracy and computation time?
 Able to be acquired from people, data and past experiences.
Many different representation schemes have been designed. Many of these start with some
of these objectives and are then expanded to include the other objectives. For example,
some are designed for learning and then expanded to allow richer problem solving and
inference abilities. Some representation schemes are designed with expressiveness in
mind, and then inference and learning are added on. Some schemes start from tractable
inference and then are made more natural, and more able to be acquired.

Different Types of Knowledge

There are 5 types of Knowledge such as:

 
 

 Declarative Knowledge – It includes concepts, facts, and objects and expressed in a


declarative sentence.
 Structural Knowledge – It is a basic problem-solving knowledge that describes the
relationship between concepts and objects.
 Procedural Knowledge – This is responsible for knowing how to do something and
includes rules, strategies, procedures, etc.
 Meta Knowledge – Meta Knowledge defines knowledge about other types of
Knowledge.
 Heuristic Knowledge – This represents some expert knowledge in the field or
subject.

Various levels of knowledge-based agent:

A knowledge-based agent can be viewed at different levels which are given below:

1. Knowledge level

Knowledge level is the first level of knowledge-based agent, and in this level, we need to
specify what the agent knows, and what the agent goals are. With these specifications, we
can fix its behavior. For example, suppose an automated taxi agent needs to go from a
station A to station B, and he knows the way from A to B, so this comes at the knowledge
level.
2. Logical level:

At this level, we understand that how the knowledge representation of knowledge is


stored. At this level, sentences are encoded into different logics. At the logical level, an
encoding of knowledge into logical sentences occurs. At the logical level we can expect to
the automated taxi agent to reach to the destination B.

3. Implementation level:

This is the physical representation of logic and knowledge. At the implementation level
agent perform actions as per logical and knowledge level. At this level, an automated taxi
agent actually implements his knowledge and logic so that he can reach to the destination.

Approaches to designing a knowledge-based agent:

There are mainly two approaches to build a knowledge-based agent:

1. Declarative approach: We can create a knowledge-based agent by initializing


with an empty knowledge base and telling the agent all the sentences with which we
want to start with. This approach is called Declarative approach.

2. Procedural approach: In the procedural approach, we directly encode desired


behavior as a program code. This means we just need to write a program that
already encodes the desired behavior or agent.

However, in the real world, a successful agent can be built by combining both declarative
and procedural approaches, and declarative knowledge can often be compiled into more
efficient procedural code.
4. a production system algorithm that is appropriate for your system, including how your
system would choose which states and transformations to apply at each step.

A production system has 6 modules spread over the 3 parts of the central intelligence ...

 Problem representation

1. Problem (and maybe some environment) information in states, in a growing space of achieved
states. Includes the initial state.

Other state lists and data structures as required.

 Knowledge base

2. Knowledge that can help the search control.

Static information that forms part of every state (and thus need not be duplicated) can be moved
here.

Environment information

Semantic information for the static and dynamic information

 Search control

3. State transformation rules

4. A strategy, with access to the problem representation (the three types of information) and
knowledge base.

5. A function that tests for a solution state

6. The engine drives the system, and in conjunction with the control strategy and transformations
forms the solution generator of a classical problem description.

In general terms, the production system algorithm ...

 Tests whether or not a solution state has been achieved

 It may be necessary to generate several goal states before halting however, as a "best"
solution may be required.

 Finds possible achieved-state + transformation pairs


 Selects achieved-state+transformation pairs

 Implements the selected transformations

 Inserts the new states in the achieved space of states.

 The dynamic space is all known states

 The frontier space is states from which transformations can still be done. Sometimes
separated from the dynamic space.

 The new space is states just discovered. Sometimes separated from the dynamic space.

 Must produce motion through the state space.

Algorithms handout

Production system engine algorithm, for

 No environment

 Deterministic, non-decomposable, recoverable, any solution problem

 Choose state, expand all ways

Suitable for, e.g., a theorem prover

Problem = SenseProblem(); KB += StaticPartOf(Problem); CurrentState = DynamicPartOf(Problem);


NewStates = {CurrentState}; DynamicStateSpace = {}; FrontierStates = {}; while (!
SolutionFound(NewStates)) { FrontierStates += NewStates; StateToTransform =
ExtractStateToTransform(FrontierStates,KB,DynamicStateSpace); NewStates =
ApplyAllTransformations(StateToTransform); NewStates =
RemoveLoops(NewStates,DynamicStateSpace,FrontierStates,StateToTransform);
DynamicStateSpace += StateToTransform;

Implementation notes

 Static part of problem added to any a priori knowledge in KB

 FrontierStates += NewStates moves the frontier forward.

 ExtractStateToTransform removes theStateToTransform from theFrontierStates .

To extend the basic algorithm to a best solution (e.g., a journey planner in a perfect world), call ...

SolutionFound(NewStates,FrontierStates)
and install ...

SolutionFound(NewStates,FrontierStates) {

static BestSolutionSoFar = NULL;

//----Update best state so far foreach (State in NewStates) { if (IsSolution(State) && State >
BestSolutionSoFar) { BestSolutionSoFar = State; } } //----Check if there is hope for
improvement foreach (State in NewStates + FrontierStates) { if (State could get better than
BestSolutionSoFar) { return(FALSE); } } return(TRUE); }

Influence of environment characteristics

Accessibility

Greater accessibility gives a greater possible role for knowledge acquired from the environment.

Explorable environment requires one sensing.

Contingent environment requires resensing.

Dynamism

Environment changes during process, and thus requires resensing.

Can plan ahead only if static.

Semi-dynamic plays time off against performance.

Continuity

Data structures change

Agents

Multi-agent means a dynamic environment and/or a strategic problem

Influence of problem characteristics

Determinism

Deterministic: Can choose transformation by predicting new states. Can plan ahead (if environment
allows)

Searchable: Can search ahead.


Non-deterministic: Cannot predict new states. Cannot plan or search ahead. Requires repeated
sensing.

Decomposability

If episodic, each episode can be treated separately. No relative state information between episodes.

Recoverability

Recoverable: Can do any number of transformations from any number of states. No need to plan
ahead - good for non-deterministic problems.

Backtrackable: Must do one transformation from "current" state, but can always transform back.
Must take cost of backtracking into account.

Non-recoverable: Must do one transformation from the current state.

Solution quality

Best solution possible if recoverable or backtrackable

The role of knowledge - how much is there, and how useful is it?

 Ignorance - no knowledge available, e.g., first time activities

 Known a priori - can be used consistently

 Explorable - can be acquired through one-time use of sensors.

 Contingent - explorable as you progress into the state space, and you learn as you go. A
similar effect to non-determinism.

Production system engine algorithm, for

 No environment

 Deterministic, non-decomposable, backtrackable, any solution problem

 Use option to expand only one way (backtrackable)

Suitable for, e.g., simple maze solving. The frontier is the single current state.

Problem = SenseProblem(); KB += StaticPartOf(Problem); CurrentState = DynamicPartOf(Problem);


DynamicStateSpace = {}; while (! SolutionFound(CurrentState)) { Transformation =
ChooseTransformationFromCurrentState(CurrentState,KB,DynamicStateSpace); if
(Transformation == "backtrack") { CurrentState =
PreviousState(CurrentState,DynamicStateSpace); } else { DynamicStateSpace +=
CurrentState; CurrentState = ApplyTransformation(CurrentState,Transformation); if
(Loop(CurrentState,DynamicStateSpace)) { CurrentState =
PreviousState(CurrentState,DynamicStateSpace); } }}

Production system engine algorithm, for

 Accessible-explorable, static, discrete, single agent environment

 Non-deterministic, non-decomposable, non-recoverable, any solution problem (bad


combination!)

 Can expand only one way (non-deterministic, non-recoverable)

The non-determinism requires resensing. In combination with the non-recoverability, this sucks.
Suitable for a roulette wheel player (where a transformation is a bet and spin).

Environment = SenseEnvironment(); Problem = SenseProblem(); KB += StaticPartOf(Problem) +


Environment; CurrentState = DynamicPartOf(Problem); DynamicStateSpace = {}; while (!
SolutionFound(CurrentState)) { Transformation =
ChooseTransformationFromCurrentState(CurrentState,KB,DynamicStateSpace);
DynamicStateSpace += CurrentState; ApplyTransformation(CurrentState,Transformation);
CurrentState = DynamicPartOf(SenseProblem()); if (Loop(CurrentState,DynamicPartOf))
{ NoteToAvoidSameChoiceAgain(CurrentState,Transformation); } }

Production system engine algorithm, for

 Accessible-contingent, dynamic, discrete, single agent environment

 Deterministic, non-decomposable, recoverable, any solution problem

 Expand one way (can also do expand all ways)

Suitable for real-time web search.

Problem = SenseProblem(); KB += StaticPartOf(Problem); CurrentState = DynamicPartOf(Problem);


DynamicStateSpace = {}; while (! SolutionFound(CurrentState)) { DynamicStateSpace +=
CurrentState; Environment = SenseEnvironment(); (FromState,Transformation) =
ChooseStateAndTransformation(Environment,KB,DynamicStateSpace); CurrentState =
ApplyTransformation(FromState,Transformation); if (Loop(CurrentState,DynamicStateSpace)) {
NoteToAvoidSameChoiceAgain(CurrentState,Transformation); } }

Selecting applicable transformations


Matching

Involves search through the pre-conditions and finding all that match.

Slow if there are a lot of rules.

Indexing

Use the current state as an index into the rules to find appropriate rules.

Could use a partial index then search - the usual hashing techniques.

Matching with variables (unification)

Must keep bindings and apply them to the post-condition of the rule to get the new state.

More variables means more general rules but more matches with the problem state.

Approximate matching.

Arises from imprecise states and imprecise rules.

Ability to add new information to the static knowledge base can change system behaviour. Can add
new transformation rules that are consistent with old without disrupting the system.

You might also like