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

AI MID Answers

Uploaded by

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

AI MID Answers

Uploaded by

hafeeza
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1. Explain uniform cost search.

Uniform-cost search is an uninformed search algorithm that uses the lowest cumulative cost
to find a path from the source to the destination. Nodes are expanded, starting from the
root, according to the minimum cumulative cost. The uniform-cost search is then
implemented using a Priority Queue.
Algorithm for uniform cost search:
• Insert the root node into the priority queue
• Repeat while the queue is not empty:
Remove the element with the highest priority
If the removed node is the destination, print total cost and stop the algorithm
Else, enqueue all the children of the current node to the priority queue, with their
cumulative cost from the root as priority.
2. What is meant by imperfect real time decisions?
Imperfect real-time decisions
Because moves must be made in a reasonable amount of time, usually it is not feasible to
consider the whole game tree (even with alpha-beta), so programs should cut the search off
at some point earlier and apply a heuristic evaluation function to states in the search,
effectively turning nonterminal nodes into terminal leaves.
i.e., Alter minimax or alpha-beta in 2 ways:
1) replace the utility function by a heuristic evaluation function EVAL, which estimates the
position’s utility.
2) replace the terminal test by a cut-off test that decides when to apply EVAL.

Evaluation function
An evaluation function returns an estimate of the expected utility of the game from a given
position.

Two ways to design a evaluation function:


a. Expected value (requires too many categories and hence too much experience to
estimate) e.g.
e.g.
72% of the states encountered in the two-pawns vs. one-pawn category lead to a
win(utility+!); 20% to a loss (0) and 8% to a draw(1/2).
Then a reasonable evaluation for states in the category is the expected value:
(0.72*1)+(0.20*0)+(0.08*1/2)=0/76.
As with terminal states, the evaluation function need not return actual expected values as
long as the ordering of the sates is the same.
b. weighted linear function (most evaluation function use that.)
We can compute separate numerical contributions from each feature and then combine
them to find the total value.
3. Write about Constraint Satisfaction Problems.
Constraint Satisfaction Problems
CSPs are mathematical questions defined as a set of objects whose state must satisfy a
number of constraints.

The picture depicts A CSP over finite domains. We have a set of variables — X, a set of list of
domains — D, and a set of constraints — C.
Values assigned to variables in X must be one of their domain
A constraint restricts the possible values of a subset of variables from X.
Example
A good example is Map Coloring Problem. In that problem we have the variables which are
the regions, the domains are the colors that we can assign to the variables (red, green,
yellow, blue); in this example all variables have the same domains.
Encoding Planning Problems into CSPs
Just like with the “Planning as Satisfiability” in which we encode the Planning Problem into
the Propositional Satisfiability Problem, we can do the same with this approach.
We encode the Bounded Planning Problem — restricted Planning Problem with a fixed
length of plan into a Constraint Satisfaction Problem. There are four steps to fully encode it.
We will see them one-by-one below.
CSP Variables and Domains
In this first step, we want to create CSP Variables and their corresponding CSP Domains.
There are two components that we need to convert into CSP Variables, they are:
* Predicates
* Actions
For predicates, we instantiate all predicates for each step. Remember that we have a fixed
length of plan (k).

4. List and explain Greedy best-first search.


Greedy best-first search algorithm always selects the path which appears best at that
moment. It is the combination of depth-first search and breadth-first search algorithms. It
uses the heuristic function and search. Best-first search allows us to take the advantages of
both algorithms. With the help of best-first search, at each step, we can choose the most
promising node. In the best first search algorithm, we expand the node which is closest to
the goal node and the closest cost is estimated by heuristic function, i.e.
f(n)= g(n).
Were, h(n)= estimated cost from node n to the goal.
The greedy best first algorithm is implemented by the priority queue.
Best first search algorithm:
* Step 1: Place the starting node into the OPEN list.
* Step 2: If the OPEN list is empty, Stop and return failure.
* Step 3: Remove the node n, from the OPEN list which has the lowest value of h(n), and
places it in the CLOSED list.
* Step 4: Expand the node n, and generate the successors of node n.
* Step 5: Check each successor of node n, and find whether any node is a goal node or not.
If any successor node is goal node, then return success and terminate the search, else
proceed to Step 6.
* Step 6: For each successor node, algorithm checks for evaluation function f(n), and then
check if the node has been in either OPEN or CLOSED list. If the node has not been in both
lists, then add it to the OPEN list.
* Step 7: Return to Step 2.
5. Describe Hill-climbing search.
Hill Climbing is a heuristic search used for mathematical optimization problems in the field
of Artificial Intelligence.
Given a large set of inputs and a good heuristic function, it tries to find a sufficiently good
solution to the problem. This solution may not be the global optimal maximum.
• In the above definition, mathematical optimization problems implies that hill-
climbing solves the problems where we need to maximize or minimize a given real
function by choosing values from the given inputs. Example-Travelling salesman
problem where we need to minimize the distance traveled by the salesman.
• ‘Heuristic search’ means that this search algorithm may not find the optimal solution
to the problem. However, it will give a good solution in reasonable time.
• A heuristic function is a function that will rank all the possible alternatives at any
branching step in search algorithm based on the available information. It helps the
algorithm to select the best route out of possible routes.
Features of Hill Climbing
1. Variant of generate and test algorithm : It is a variant of generate and test algorithm. The
generate and test algorithm is as follows :
1. Generate possible solutions.
2. Test to see if this is the expected solution.
3. If the solution has been found quit else go to step 1.
Hence we call Hill climbing as a variant of generate and test algorithm as it takes the
feedback from the test procedure. Then this feedback is utilized by the generator in deciding
the next move in search space.
2. Uses the Greedy approach : At any point in state space, the search moves in that direction
only which optimizes the cost of function with the hope of finding the optimal solution at
the end.
6. Explain Knowledge Engineering in First-Order Logic.
The process of constructing a knowledge-base in first-order logic is called as knowledge-
engineering. In knowledge-engineering, someone who investigates a particular domain,
learns important concept of that domain, and generates a formal representation of the
objects, is known as knowledge engineer.
In this topic, we will understand the Knowledge engineering process in an electronic circuit
domain, which is already familiar. This approach is mainly suitable for creating special-
purpose knowledge base.
The knowledge-engineering process:
Following are some main steps of the knowledge-engineering process. Using these steps, we
will develop a knowledge base which will allow us to reason about digital circuit (One-bit
full adder) which is given below

1. Identify the task


2. Assemble the relevant knowledge
3. Decide on vocabulary
4. Encode general knowledge about the domain
5. Encode a description of the problem instance
6. Pose queries to the inference procedure and get answers
7. Debug the knowledge base
7. What is Agents Based Propositional Logic?
8. Write about Syntax and Semantics of First-Order Logic.
Syntax has to do with what ‘things’ (symbols, notations) one is allowed to use in the
language and in what way; there is/are a(n):
• Alphabet
• Language constructs
• Sentences to assert knowledge
Semantics: Formal meaning, which has to do what those sentences with the alphabet and
constructs are supposed to mean.
The syntax of FOL determines which collection of symbols is a logical expression in first-
order logic. The basic syntactic elements of first-order logic are symbols. We write
statements in short-hand notation in FOL.
Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai, cat,....

Variables x, y, z, a, b,....

Predicates Brother, Father, >,....

Function sqrt, LeftLegOf, ....

Connectives ∧, ∨, ¬, ⇒, ⇔

Equality ==

Quantifier ∀, ∃

You might also like