0% found this document useful (0 votes)
139 views

Aiml Assignment

Artificial intelligence can be classified into four main categories based on capabilities and functionality. The categories based on capabilities are weak/narrow AI, general AI, and super AI. Weak AI can perform dedicated tasks but not beyond its limitations, while general and super AI do not yet exist. The categories based on functionality are reactive machines, limited memory machines, theory of mind machines, and self-aware machines. A production system provides solutions to problems using a set of rules and mechanisms to follow the rules. A knowledge-based system aims to capture human expertise through a knowledge base and inference engine to support decision making.

Uploaded by

ruhi thakur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

Aiml Assignment

Artificial intelligence can be classified into four main categories based on capabilities and functionality. The categories based on capabilities are weak/narrow AI, general AI, and super AI. Weak AI can perform dedicated tasks but not beyond its limitations, while general and super AI do not yet exist. The categories based on functionality are reactive machines, limited memory machines, theory of mind machines, and self-aware machines. A production system provides solutions to problems using a set of rules and mechanisms to follow the rules. A knowledge-based system aims to capture human expertise through a knowledge base and inference engine to support decision making.

Uploaded by

ruhi thakur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

SHRI VAISHNAV VIDYAPEETH

VISHWAVIDALAYA
ARTIFICIAL INTELLIGENCE AND MACHIENE LEARNING
Question:-1. Describe the four categories under which AI
is classified with examples.
Answer:- Artificial Intelligence can be divided in various types, there are mainly two types
of main categorization which are based on capabilities and based on functionally of AI.
Following is flow diagram which explain the types of AI.

AI type-1: Based on Capabilities


1. Weak AI or Narrow AI:
o Narrow AI is a type of AI which is able to perform a dedicated task with intelligence.The most
common and currently available AI is Narrow AI in the world of Artificial Intelligence.
o Narrow AI cannot perform beyond its field or limitations, as it is only trained for one specific
task. Hence it is also termed as weak AI. Narrow AI can fail in unpredictable ways if it goes
beyond its limits.
o Apple Siriis a good example of Narrow AI, but it operates with a limited pre-defined range of
functions.
o IBM's Watson supercomputer also comes under Narrow AI, as it uses an Expert system
approach combined with Machine learning and natural language processing.
o Some Examples of Narrow AI are playing chess, purchasing suggestions on e-commerce site,
self-driving cars, speech recognition, and image recognition.

2. General AI:
o General AI is a type of intelligence which could perform any intellectual task with efficiency
like a human.
o The idea behind the general AI to make such a system which could be smarter and think like
a human by its own.
o Currently, there is no such system exist which could come under general AI and can perform
any task as perfect as a human.
o The worldwide researchers are now focused on developing machines with General AI.
o As systems with general AI are still under research, and it will take lots of efforts and time to
develop such systems.

3. Super AI:
o Super AI is a level of Intelligence of Systems at which machines could surpass human
intelligence, and can perform any task better than human with cognitive properties. It is an
outcome of general AI.
o Some key characteristics of strong AI include capability include the ability to think, to
reason,solve the puzzle, make judgments, plan, learn, and communicate by its own.
o Super AI is still a hypothetical concept of Artificial Intelligence. Development of such systems
in real is still world changing task.

Artificial Intelligence type-2: Based on functionality


1. Reactive Machines
o Purely reactive machines are the most basic types of Artificial Intelligence.
o Such AI systems do not store memories or past experiences for future actions.
o These machines only focus on current scenarios and react on it as per possible best action.
o IBM's Deep Blue system is an example of reactive machines.
o Google's AlphaGo is also an example of reactive machines.

2. Limited Memory
o Limited memory machines can store past experiences or some data for a short period of
time.
o These machines can use stored data for a limited time period only.
o Self-driving cars are one of the best examples of Limited Memory systems. These cars can
store recent speed of nearby cars, the distance of other cars, speed limit, and other
information to navigate the road.

3. Theory of Mind
o Theory of Mind AI should understand the human emotions, people, beliefs, and be able to
interact socially like humans.
o This type of AI machines are still not developed, but researchers are making lots of efforts
and improvement for developing such AI machines.

4. Self-Awareness
o Self-awareness AI is the future of Artificial Intelligence. These machines will be super
intelligent, and will have their own consciousness, sentiments, and self-awareness.
o These machines will be smarter than human mind.
o Self-Awareness AI does not exist in reality still and it is a hypothetical concept.

Question:-2. Define artificial intelligence.


Answer:- Artificial intelligence (AI), the ability of a digital  computer  or computer-
controlled  robot  to perform tasks commonly associated with intelligent beings. The term is
frequently applied to the project of developing systems endowed with the  intellectual  processes
characteristic of humans, such as the ability to reason, discover meaning, generalize, or learn from
past experience. Since the development of the  digital computer  in the 1940s, it has been
demonstrated that computers can be programmed to carry out very complex tasks—as, for example,
discovering proofs for mathematical theorems or playing  chess—with great proficiency. Still, despite
continuing advances in computer processing speed and memory capacity, there are as yet no
programs that can match human flexibility over wider domains or in tasks requiring much everyday
knowledge. On the other hand, some programs have attained the performance levels of human
experts and professionals in performing certain specific tasks, so that artificial intelligence in this
limited sense is found in applications as  diverse  as medical  diagnosis, computer  search engines, and

voice or handwriting recognition .

Question:-3. What is a production system?


Answer:- Production System is a computer program which is used to provide a solution for a
problem using a set of rules about behavior. Along with the rules, it consists of the mechanism
required to follow these rules.
It is sometimes also called a  production rule system.

Components of a production system

1. A Global Database

2. Set of Production rules

3. A control System

The  Global Database  is the central data structure used by the production system. The rules in the

production system operate on this database.

 Each rule has a pre-condition. The rules for which database satisfies the pre-condition

can be applied to it.

 Out of all the applicable rules, the Control system  chooses which rule to apply.

 Application of a rule on database transforms it.

 Once the termination condition is satisfied the computation ceases.

Features of a Production System

1. Simplicity: Each sentence in a production system has a if-then architecture that provides

simplicity in knowledge representation.

2. Modularity: In a production system code the knowledge is available in discrete pieces,

each of which can be treated independently.

3. Modifiability: This feature allows us to form production rule in skeleton form first and

then add on according to the need of the specific application.


4. Knowledge Intensive: The knowledge base of a production system does not contain any code or

programming. It is written in pure English. The problem of semantics is solved by their structure of

representation.

Advantages of Production System

 Provides an excellent base for structuring AI Problems

 Each rule can be added, removed or modified independently, which makes the system

highly modular.

 Helpful in designing real-time applications.

 Provides opportunities for heuristic control of the search.

 A good way to model the state-driven nature of intelligent machines.

 More flexible than algorithmic control.

 Language independent

Question:-4 . what is knowledge based system ? explain.

Answer:- A knowledge-based system (KBS) is a form of artificial intelligence (AI)  that


aims to capture the knowledge of human experts to support decision-making. Examples of
knowledge-based systems include expert systems, which are so called because of their
reliance on human expertise.

The typical architecture of a knowledge-based system, which informs its problem-solving


method, includes a knowledge base and an inference engine. The knowledge base contains a
collection of information in a given field -- medical diagnosis, for example. The inference
engine deduces insights from the information housed in the knowledge base. Knowledge-
based systems also include an interface through which users query the system and interact
with it.
A knowledge-based system may vary with respect to its problem-solving method or approach.
Some systems encode expert knowledge as rules and are therefore referred to as rule-based
systems. Another approach, case-based reasoning, substitutes cases for rules. Cases are
essentially solutions to existing problems that a case-based system will attempt to apply to a
new problem.

Knowledge-based systems represent a rules-based or case-based approach to AI

Where knowledge-based systems are used


 Over the years, knowledge-based systems have been developed for a number of
applications. MYCIN, for example, was an early knowledge-based system created to
help doctors diagnose diseases. Healthcare has remained an important market for
knowledge-based systems, which are now referred to as clinical decision-support
systems in the health sciences context.

 Knowledge-based systems have also been employed in applications as diverse as


avalanche path analysis, industrial equipment fault diagnosis and cash management.

Knowledge-based systems and artificial intelligence


 While a subset of artificial intelligence, classical knowledge-based systems differ in
approach to some of the newer developments in AI.

 Daniel Dennett, a philosopher and cognitive scientist, in his 2017 book, From


Bacteria to Bach and Back, cited a strategy shift from early AI, characterized by
"top-down-organized, bureaucratically efficient know-it-all" systems to systems that
harness Big Data and "statistical pattern-finding techniques" such as data-mining
and  deep learning in a more bottom-up approach.

 Examples of AI following the latter approach include neural network systems, a type


of deep-learning technology that concentrates on signal processing and pattern
recognition problems such as facial recognition.

Question:- 5. What is heuristic search?


Answer:- Heuristic search  is defined as a procedure of search that endeavors to upgrade an
issue by iteratively improving the arrangement dependent on a given heuristic capacity or a cost
measure.

This technique doesn’t generally ensure to locate an ideal or the best arrangement, however,
it may rather locate a decent or worthy arrangement inside a sensible measure of time and
memory space. This is a sort of an alternate route as we regularly exchange one of
optimality, culmination, exactness, or accuracy for speed.

It may be a function which is employed in Informed Search, and it finds the


foremost  promising path. It takes the present  state of the agent as its input and produces the
estimation of how close agent is from the goal
A Heuristic (or a heuristic capacity) investigates search calculations. At each stretching step,
it assesses the accessible data and settles on a choice on which branch to follow. It does as
such by positioning other options. The Heuristic is any gadget that is frequently successful
yet won’t ensure work for each situation.

We need heuristics in order to create, in a sensible measure of time, an answer that is


sufficient for the issue being referred to. It doesn’t need to be the best-an estimated
arrangement will do since this is sufficiently quick. Most issues are exponential.

Heuristic Search let us decrease this to a somewhat polynomial number. We utilize this in AI
since we can place it to use in circumstances where we can’t discover known calculations.

Techniques in Heuristic Search


1. Direct Heuristic Search(Informed Search)

Informed Search Algorithms have information on the target state which helps in logically
capable-looking. This information gathered as a limit that measures how close a state is to
the goal state.

Its significant bit of leeway is that it is proficiency is high and is equipped for discovering
arrangements in a shorter span than ignorant Search.
It contains an array of knowledge  like how far we are from the goal, path cost, how to reach
the goal node, etc. This data help agents to explore less to the search space and find more
efficiently the goal node.
It is likewise nearly more affordable than an educated pursuit. It’s models incorporate-

a. A*Search

A* search is the most consistently known kind of best-first interest. It uses heuristic limit
h(n), and cost to show up at the center point n from the earliest starting point state g(n). It
has solidified features of UCS  and insatiable best-first request, by which it deal with the
issue capably.
A* search computation finds the briefest path through the chase space using the heuristic
limit. This chase count expands less interest trees and gives a perfect result snappier.
A* count resembles UCS beside that it uses g(n)+h(n) instead of g(n). It is formulated with
weighted graphs, which suggests  it can find the simplest path involving the littlest cost in
terms of distance and time.
This makes A* algorithm in AI an informed search algorithm for best-first search.
b. Greedy Best First Search

Greedy best-first search algorithm always selects the trail which appears best at that
moment.  Within the best first search algorithm, we expand the node which is closest to the
goal node and therefore the closest cost is estimated by heuristic function.
This sort of search reliably picks the way which appears best by then. It is the blend
of BFS and DFS. It uses heuristic limit and searches. The BFS grants us to take the
advantages of the two estimations.
2. Weak Heuristic Search (Uninformed Search)

Uninformed Search Algorithms have no additional information on the target center point
other than the one gave in the troublesome definition, so it’s also called blind search.

The plans to show up at the target state from the earliest starting point state differentiate just
by the solicitation and length of exercises.

The uninformed search may be a class of general-purpose search algorithms which operates
in brute force-way. It is more unpredictable to actualize than an educated pursuit as there is
no usage of information in the ignorant inquiry. Instances of Uninformed Search are-
a. Breadth-First Search

BFS is an approach in Heuristic Search that is used to diagram data or glancing through the
tree or intersection structures. The estimation profitably visits and means all the key centers
in a graph in an exact breadthwise structure.

This count picks a singular center point (beginning or source point) in a diagram and a while
later visits all the centers neighboring the picked center.

Remember, BFS gets to these centers separately.

At the point when the computation visits and means the starting center point, by then it moves
towards the nearest unvisited  center points and assessments them. Once visited, all center
points are stepped. These accentuations continue until all the center points of the graph have
been viably visited and checked.
Some of the cons of Breadth-First Search include :

 It eats up a lot of memory space. As every level of center points is saved for making the
following one.
 Its  flightiness  depends upon the number of center points. It can check duplicate center
points.
b. Uniform Cost Search

Basically, it performs masterminding in growing the expense of the path to a center point.
Furthermore, it reliably develops the least cost center point.

Uniform-cost search expands nodes consistent with their path costs form the basis node. It is
often used to solve any graph/tree where the optimal cost is in demand.
In spite of the way that it is vague from Breadth-First chase if each progress has
a  comparative cost. It researches courses in the extending solicitation of cost.
c. Depth First Search

It relies upon the possibility of LIFO. As it speaks to Last In First Out. In like manner,
completed in recursion with LIFO stack data structure. Along these lines, It used to make a
vague course of action of centers from the Breadth-First procedure, just in the differing
demand.
As the way is been taken care of in each accentuation from root to leaf center point.
Subsequently, store centers are immediate with space requirements. With extending factor b
and significance as m, the additional room is bm.

Drawbacks of Depth First Search


 As the estimation may not end and go on unimaginably in one manner. From now on, a
response to this issue is to take a cut-out significance.
 In the unlikely event that the ideal cut-off is d, and in case the took cut-out is lesser than
d, by then this estimation may crash and burn.
 If regardless, d is lesser than the fixed cut-off., by then execution time increases.
 Its multifaceted nature depends upon various ways. It can’t check duplicate center
points.
d. Iterative Deepening Depth First Search

Iterative Deepening Depth First Search (IDDFS) is a strategy wherein cycles of DFS are
run persistently with growing cutoff points until we locate the target. IDDFS is perfect like
BFS, yet uses generously less memory.
At each accentuation, it visits the centers in the request tree in a comparable solicitation as
significance first chase, be that as it may, the total solicitation wherein center points are first
visited is enough breadth first.

e. Bidirectional Search

This as the name recommends, runs two different ways. It works with two who glance
through that run at the same time, beginning one from source excessively objective and the
other one from goal to source a retrogressive way.
The two inquiries should bargain the data structure. It depends on a guided outline to find
the most restricted route between the source(initial center) to the goal center point.

The two missions will start from their individual spots and the estimation stops when the two
requests meet at a center. It is a speedier method and improves the proportion of time
required for exploring the graph.

This strategy is capable in the circumstance when the starting center point and target center
are stand-out and portrayed. Spreading factor is the equivalent for the two.
Hill Climbing in AI

Hill Climbing is a kind of heuristic quest for logical progression issues in the field of
Artificial Intelligence. Given a set of data sources and a better than average heuristic limit, it
endeavors to find an adequate enough response for the issue. This course of action may not
be the overall perfect most noteworthy.

In the above definition, logical headway issues surmise that incline climbing handles the
issues where we need to grow or confine a given authentic limit by picking regards from the
given information sources.

For example, Model Travelling salesman issue where we need to constrain the division
passed by the salesperson.

‘Heuristic search‘ infers that this interest estimation may not find the perfect response to the
issue. In any case, it will give a not too bad game plan in a reasonable time.
A heuristic limit is a limit that will rank all the potential decisions at any growing advance in
search of figuring subject to the available information. It makes the estimation pick the best
course out of courses.

Features of Hill Climbing

 Produce and Test variation: Hill Climbing is the variation of the Generate and Test
strategy. The Generate and Test technique produce input which assists with choosing
which bearing to move in the inquiry space.
 Use of Greedy Approach: Hill-climbing calculation search moves toward the path which
improves the expense.
 No backtracking: It doesn’t backtrack the pursuit space, as it doesn’t recall the past
states.
Types of Hill Climbing in AI

a. Simple Hill Climbing

Simple Hill climbing is the least difficult approach to execute a slope climbing calculation. It
just assesses the neighbor hub state at once and chooses the first which enhances current
expense and sets it as a present state.

It just checks it’s one replacement state, and on the off chance that it discovers superior to
the present state, at that point move else be in a similar state.
Its features include:
 Less tedious
 Less ideal arrangement that isn’t ensured
b. Steepest Ascent Hill Climbing

The steepest-Ascent calculation is a variety of basic slope climbing calculations. It first


examines all the neighboring nodes then selects the node closest to the answer state as of
next node.
This calculation looks at all the neighboring hubs of the present state and chooses one
neighbor hub which is nearest to the objective state.

This calculation expends additional time as it looks for different neighbors

c. Stochastic Hill Climbing

Stochastic slope climbing doesn’t analyze for all its neighbors before moving. It makes use of
randomness as a part of the search process. It is also an area search algorithm, meaning that
it modifies one solution and searches the relatively local area of the search space until the
local optima is found .

This suggests that it’s appropriate on unimodal optimization problems or to be used after the
appliance of a worldwide optimization algorithm.
This calculation chooses one neighbor hub aimlessly and concludes whether to pick it as a
present state or analyze another state.

Problems associated with Hill Climbing


 Local Maximum –  All the surrounding states have values lower than the current. With
the implementation of the Greedy Approach, implies we won’t be moving to a lower
state. This ends the procedure despite the fact that there may have been a superior
arrangement. As a workaround, we use backtracking.
 Plateau:  All neighbors to it have a similar worth. This makes it difficult to pick a course.
To dodge this, we haphazardly make a major jump.
 Ridge:  At an edge, development in every conceivable course is descending. This makes
it resemble a pinnacle and ends the procedure. To stay away from this, we may utilize
at least two guidelines before testing.
Constraint Satisfaction Problem

CSP or Constraint Satisfaction Problem is a set of questions that requires its answer inside
certain confinements/conditions otherwise called limitations. It comprises of :
 Limited arrangement of factors which stores the arrangement. (V = {V1, V2, V3,…..,
Vn} )
 Lot of discrete qualities from which the arrangement is picked. (D = {D1, D2, D3,…..,Dn} )
 Limited arrangement of limitations. (C = {C1, C2, C3,……, Cn} )
In the case of AI, we most of the time, deal with discrete quantities.

The common problems which can be solved using a CSP are Sudoku problems,
Cryptarithmetic, Crossword, etc.

Simulated Annealing Heuristic Search

Simulated Annealing is an algorithm that never makes a move towards lower esteem destined
to be incomplete that it can stall out on a nearby extreme.
Also, on the off chance that calculation applies an irregular stroll, by moving a replacement,
at that point, it might finish yet not proficient.

Mimicked Annealing is a calculation that yields both proficiency and culmination.


In terms of metallurgy, Annealing is a procedure of solidifying a metal or glass to a high
temperature at that point cooling bit by bit, so this permits the metal to arrive at a low-
vitality crystalline state.

A similar procedure is utilized in reenacted toughening in which the calculation picks an


arbitrary move, rather than picking the best move.

In the event that the irregular move improves the state, at that point, it follows a similar way.

Something else, the calculation follows the way which has a likelihood of under 1 or it moves
downhill and picks another way.

Question:-6. List few of the task domains of AI.


Artificial intelligence (or AI) is basically the capability of a machine or a computer program
to think and learn like a human, in short, mimicking human intelligence processes.
Algorithms are created and applied into a dynamic computing environment, enabling
machines to learn and make decisions with the data.

As there are many different types of AI, it can be classified into 3 main categories.

Narrow Artificial Intelligence

Also known as Weak AI, it is developed and designated for a particular task. The single task
it performs is within a limited context, being excellent at routine jobs, be it physical or
cognitive.

Artificial General Intelligence

Also known as AGI, it has generalized cognitive ability to analyse and decide, in which the
AI provides solutions for an unfamiliar task it encounters. It can applies understanding and
reasoning like how a normal human would in the specific environment.

Artificial Super Intelligence

Also known as ASI, it exceed human abilities, being be able to mimic human thoughts and
achieve an accuracy higher than normal humans. ASI proves superior to humans in terms
cognitive ability.

Now, AI is dependent on the tasks they carry out. It can range from simple task, to complex
analytics. There are a few domains on how AI carry out their functions.

Formal Tasks- Tasks which requires logic and constraints to function.


(For eg. Mathematics, Games, verification)

Mundane tasks- Routine everyday tasks that requires common sense reasoning

(For eg. Perception, robotics, natural language, Vision, Speech)

Expert tasks- Tasks which requires high analytical and thinking skills, a job only a
professionals can do

(For eg. Financial analysis, medical diagnostics, engineering, scientific analysis, consulting)

So having these types of domains, there are different types of works and information AI can
interpret. Usually an AI can approach them in the following ways.

Symbolic approach is how an AI application interprets human intelligence through symbol


manipulation and interpretation. Basic concepts are broken down into symbols and the AI
processes them into something understandable to solve the problem. These symbols are
arranged in such a way that the structures pertaining them can relate to each other. It can be
through lists, hierarchies, or even networks to determine it.

Sub-symbolic approach is how an AI recognizes things or patterns without any specific


knowledge. Using a connectionist system method, the AI processes a cluster of high-
dimensional quantitative sensory data to determine the relevancy of each node of data and
determine the output of it. It functions on limited information, gradually adjusting to finally
to best fit a solution.

Statistical approach is how AI solve specific problems using mathematics as tools. The AI
will gather, organize, analyze, synthesize and interpret numerical information from data and
deliver measurable forumlative results. This helps retrieve important data and trends which
are vital and necessary.

QUESTION:-7. Expand LISP and PROLOG.


Answer:- LISP, in full  list processing, a  computer programming language  developed about
1960 by  John McCarthy  at the  Massachusetts Institute of Technology  (MIT). LISP was founded on
the mathematical theory of  recursive functions  (in which a function appears in its own definition). A
LISP program is a function applied to data, rather than being a sequence of procedural steps as
in  FORTRAN  and  ALGOL. LISP uses a very simple notation in which operations and their operands are
given in a parenthesized list. For example, (+  a  (*  b  c)) stands for  a  +  b*c. Although this appears
awkward, the notation works well for computers. LISP also uses the list structure to represent data,
and, because programs and data use the same structure, it is easy for a LISP program to operate on
other programs as data.

LISP became a common language for  artificial intelligence  (AI) programming, partly owing to
the  confluence  of LISP and AI work at MIT and partly because AI programs capable of “learning”
could be written in LISP as self-modifying programs. LISP has evolved through numerous  dialects,
such as Scheme and Common LISP.

What is Prolog?

 Prolog stands for  Programming in logic.  It is used in artificial intelligence programming.


 Prolog is a  declarative  programming language.
For example:  While implementing the solution for a given problem, instead of specifying the
ways to achieve a certain goal in a specific situation, user needs to specify about the
situation (rules and facts) and the goal (query). After these stages, Prolog interpreter
derives the solution.
 Prolog is useful in AI, NLP, databases but useless in other areas such as graphics or
numerical algorithms.
Prolog facts
 A fact is something that seems to be true.
For example:  It's raining.
 In Prolog, facts are used to form the statements. Facts consist of a specific item or relation
between two or more items.
How to convert English to prolog facts using facts and rules?
It is very simple to convert English sentence into Prolog facts. Some examples are explained in the
following table.

English Statements Prolog Facts

Dog is barking barking(dog)

Jaya likes food if it is delicious. likes( Jaya, Food):-delicious(Food)

In the above table, the statement  'Dog is barking'  is a  fact,  while the statement  'Jaya likes food if it
is delicious'  is called  rule.  In this statement, variable like 'Food' has a first letter in capital, because
its value came from previous fact. The symbol  ':-'  is used to denote that “Jaya likes delicious food”.

Arithmetic Operations in Prolog


 Prolog provides the facility for arithmetic operations.
 As per the requirement of the user, arithmetic operations can be divided into some special
purpose integer predicates and a series of general predicates for integer, floating point and
rational arithmetic.
 The general arithmetic predicates are handled by the expressions.
Sr. No Operator Explanation

1 X+Y The sum of 'X' and 'Y'

2 X-Y the difference of 'X' and 'Y'

3 X*Y The product of 'X' and 'Y'

4 X/Y The quotient of 'X' and 'Y'

5 X^Y 'X' to the power of 'Y'

6 -X Negation of 'X'

7 abs(X) Absolute value of 'X'

8 sqrt(X) The square root of X

9 sin(X) The sine of X

10 cos(X) The cos of X

 An expression is either a function or a simple number.


 Prolog arithmetic is slightly different than other programming languages.
For example:
?- X is    2 + 1.
X=3?
yes
In the above example,  'is'  is used as a special predefined operator.

The basic arithmetic operators are given in the following table:

Operator precedence
 If there is more than one operator in the arithmetic expression such as A-B*C+D, then the
prolog decides an order in which the operator should be applied.
 Prolog gives numerical value for each operator, operators with high precedence
like  '*'  and  '/'  are applied before operators with relatively low precedence values
like  '+'  and  '-'.
 Operator with same precedence value ('*' or '/') and ('+' or '-') should be applied from left to
right.
 So, the expression A-B*C+D can be written as  A-(B*C)+D
Matching and Unification in Prolog
Definition:  The two terms are said to be matched, if they are equal or if they consist of variables
representing the resulting equal terms.
Prolog matches expressions in structural way. So,
?- 3 + 2= 5
no
Note:  In prolog '=' means matches with.

Consider the following example,?- X + 3 =    2 * Y

But the following expressions will match because they have same structure.

Expression 1:
?- X + Y = 2 + 3
X=2
Y=3

Expression 2:
?- 2 + Y = X + 3
X=2
Y=3

Prolog Lists:
 Lists are the finite sequence of elements.
 Prolog uses […] to build a list.
 The notation [X|Y] represents that the first element is X and second element is Y (X is head
and Y is tail).
 Prolog has some special notation for lists:
I) [a]                    [honda, maruti, renault]
ii) [a,b,c)        [pen, pencil, notebook]
iii) []    represents the empty list.
Example 1:  Pattern Matching in Lists
?- [a,b] = [a,X]
X=b
but:
?- [a,b] = [X]
no
Question:-8. Differentiate informed and uniformed search.
Give example.
Answer:- Informed Search
 They contain information on goal state.
 It helps search efficiently.
 The information is obtained by a function that helps estimate how close a current
state is, to the goal state.
 Examples of informed search include greedy search and graph search.
 It uses the knowledge in the process of searching.
 It helps find the solution quickly.
 It may or may not be complete.
 It is inexpensive.
 It consumes less time.
 It gives the direction about the solution.
 It is less lengthy to implement.
Uninformed Search
 They don’t have any additional information.
 The information is only provided in the problem definition.
 The goal state can be reached using different order and length of actions.
 Examples of uninformed search include depth first search (DFS) and breadth first
search (BFS).
 It doesn’t use the knowledge in the process of searching.
 It takes more time to show the solution.
 It is always complete.
 It is expensive.
 It consumes moderate time.
 There is no suggestion regarding finding the solution.
 It is lengthy to implement.

Question:-9. Define state-space search technique.


Answer:- State space search  is a process used in the field of  computer science,
including  artificial intelligence  (AI), in which successive  configurations  or  states  of an instance are
considered, with the intention of finding a  goal state  with a desired property.

Problems are often modelled as a  state space, a  set  of  states  that a problem can be in. The set of
states forms a  graph  where two states are connected if there is an  operation  that can be performed
to transform the first state into the second.
State space search often differs from traditional  computer science  search  methods because the state
space is  implicit: the typical state space graph is much too large to generate and store in  memory.
Instead, nodes are generated as they are explored, and typically discarded thereafter. A solution to
a  combinatorial search  instance may consist of the goal state itself, or of a path from some  initial
state  to the goal state.

Question:-10. List the fields that form the basis for AI.
Answer:-Artificial intelligence is applied in fields such as
· Intelligent Robots

· Remote sensing

· Law-enforcement

· Scientific discovery

· Gaming

· Toys

· Handwriting Recognition

· Natural language Processing

· Natural language generation

· Machine Vision

· Computer Vision

· Expert Systems

· Medical diagnosis

· Stock trading

You might also like