Assignment No-2: Submitted To

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

ASSIGNMENT NO-2

OF

ARTIFICIAL INTELLIGENCE

SUBMITTED TO
RUCHI MAM
SUBMITTED BY
RAJINDER KUMAR
RA1810A04

PART: A

Q1:- Mention the between BFS and DFS using examples. Can we
use these searching techniques in Search engine.

Solution:
Q1:- Mention the between BFS and DFS using examples. Can we
use these searching techniques in Search engine.

ANS:-BFS:

Breadth First Search (also known as BFS) is a


search method used to broaden all the nodes of a particular
graph. It accomplishes this task by searching every single solution
in order to examine and expand these nodes (or a combination of
sequences therein). As such, a BFS does not use a heuristic
algorithm (or an algorithm that searches for a solution through
multiple scenarios). After all the nodes are obtained, they are
added to a queue known as the First In, First Out queue. Those
nodes that have no been explored are ‘stored’ in a container
marked ‘open’; once explored they are transported to a container
marked ‘closed’.

Depth First Search (also known as DFS) is a search method that


burrows deeper into a child node of a search until a goal is
reached (or until there is a node without any other permutations or
‘children’). After one goal is found, the search backtracks to a
previous node that has gone with a solution, repeating the process
until all the nodes have been successfully searched. As such,
nodes continue to be put aside for further exploration – this is
called non-recursive implementation.

Example:-

what a BFS would look like. The numbers represent the order in
which the nodes are accessed in a BFS:
In a depth first search, you start at the root, and follow one of the
branches of the tree as far as possible until either the node you are
looking for is found or you hit a leaf node ( a node with no children). If
you hit a leaf node, then you continue the search at the nearest
ancestor with unexplored children.

Here’s an example of what a DFS would look like. The numbers


represent the order in which the nodes are accessed in a DFS:

Comparing BFS and DFS, the big advantage of DFS is that it has
much lower memory requirements than BFS, because it’s not
necessary to store all of the child pointers at each level. Depending
on the data and what you are looking for, either DFS or BFS could be
advantageous. For example, given a family tree if one were looking
for someone on the tree who’s still alive, then it would be safe to
assume that person would be on the bottom of the tree. This means
that a BFS would take a very long time to reach that last level. A
DFS, however, would find the goal faster. But, if one were looking for
a family member who died a very long time ago, then that person
would be closer to the top of the tree. Then, a BFS would usually be
faster than a DFS. So, the advantages of either vary depending on
the data and what you’re looking for.

Yes we can use these searching techniques in search engines.


Progressive deepening actually emulates BFS using DFS. The idea
is to simply apply DFS to a specific level. If you find the goal, exit,
other wise repeat DFS to the next lower level. Go on doing this until
you either reach the goal node or the full height of the tree is
explored. For example, apply a DFS to level 2 in the tree, if it reaches
the goal state, exit, otherwise increase the level of DFS and apply it
again until you reach level 4. You can increase the level of DFS by
any factor.

Q2:- What are the heuristic search techniques? Explain with the help
of an example .

Heuristic search technique is the best suited useful, for a variety of


combinational and combinational problems is nearest neighbor
heuristic, applying it to famous traveling salesman problem. Heuristic
search technique improves the efficiency of search process. Many
problems are solved by using this technique. Example finding
shortest distance with minimal cost.

Heuristic Search Techniques


• Direct techniques (blind search) are not
always possible (they require too much time
or memory).
• Weak techniques can be effective if applied
correctly on the right kinds of tasks.
– Typically require domain specific information.

Q3 :- How constrain satisfaction is important with respect to Artificial


Intelligence?

Solution:-

constrain satisfaction is important with respect to Artificial


Intelligence because In artificial intelligence and operations
research, constraint satisfaction is the process of finding a solution
to a set of constraints that impose conditions that the variables must
satisfy.

Constraint satisfaction problems or CSPs


are mathematical problems defined as a set of objects whose state
must satisfy a number of constraints or limitations. CSPs represent
the entities in a problem as a homogeneous collection of finite
constraints over variables, which is solved by constraint satisfaction
methods. CSPs are the subject of intense research in both artificial
intelligence and operations research, since the regularity in their
formulation provides a common basis to analyze and solve problems
of many unrelated families

The techniques used in constraint satisfaction depend on the kind of


constraints being considered. Often used are constraints on a finite
domain, to the point that constraint satisfaction problems are typically
identified with problems based on constraints on a finite domain.
Such problems are usually solved via search, in particular a form of
backtracking or local search. Constraint propagation are other
methods used on such problems; most of them are incomplete in
general, that is, they may solve the problem or prove it unsatisfiable,
but not always. Constraint propagation methods are also used in
conjunction with search to make a given problem simpler to solve.
Other considered kinds of constraints are on real or rational numbers;
solving problems on these constraints is done via variable elimination
or the simplex algorithm. As soon as the procedure finds the goal
state it will quit. Notice that it guarantees to find the solution at a
minimum depth like BFS. Imagine that there are a number of
solutions below level 4 in the tree. The procedure would only travel a
small portion of the search space and without large memory
requirements, will find out the solution.

PART:B

Q4:- What are the issues faced in knowledge representation?

Solution:-

Issues of Knowledge Representation:

To solve complex problems in Artificial Intelligence, we need both the


“large amount of knowledge” and “mechanism or some sort of
formalism for manipulating that the knowledge to create solutions to
new problems” A variety of ways of representing the knowledge
(facts) exploited in AI programs

• Is there any attributes/entities of objects so that they occur in


problem domain.
• Is there any important relationships that exist among entities of
objects.
• At what level should knowledge be represented? Is there any good
set of primitives
• How should sets of objects be represented?
• Given an immense data stored in a database (db), how can relevant
parts be accessed when they are needed?
Q5:- What is predicate logic? Illustrate with example.

Solution:- The first of these, predicate logic, involves using standard


forms of logical symbolism which have been familiar to philosophers
and mathematicians for many decades. Most simple sentences, for
example, ``Peter is generous'' or ``Jane gives a painting to Sam,'' can
be represented in terms of logical formulae in which a predicate is
applied to one or more arguments:

PREDICATE ARGUMENTS

generous (peter)

gives (jane, painting, sam)

Examples
• Predicates: Brother, Sister, Mother , Father
• Objects: som, Hillary, harry, Roger
• Facts expressed as atomic sentences a.k.a.
literals:

Father(som,harry)
Mother(Hillary,harry)
Brother(som,Roger)
Ø Father(som,harry)
1.Terms represent specific objects in the
world and can be constants, variables or
functions.

2.Predicate Symbols refer to a particular


relation among objects.

3.Sentences represent facts, and are made of


of terms, quantifiers and predicate symbols.

4.Functions allow us to refer to objects


indirectly (via some relationship).

Q6:- Differentiate between matching and indexing.

Solution:-

Q6:- Differentiate between matching and indexing.

ANS:-

Matching:-

1 The clever search involves choosing from among the rules that
can be applied at a particular point, the ones that are most likely to
lead to a solution.

2Using matching , we extract a particular rule from the entire


collection of rules those that can be applied at a given point.
3Best nearest are approximately matched giving the best of all
matching solution. There are various functions exist to compare
feature values based on compare logic.

4Matching process is easy but at the price of complete lack of


generality in the statement of the rules.

5Example:- if there is no student having qualification B.E(IT).the AI


would return result with B.tech(IT)

Top down search approach:

Matching can be gided intelligently asking only relevant parameters.


Parameters are more conceptually broken.

INDEXING:-

1.Select applicable rules is to do a simple search through all the


rules, comparing each one’s preconditions to the current state and
extracting all the ones that match.

2.Indexing scheme only works when preconditions of rules match


exactly.

You might also like