2ai

5
PART -A Q1. Explain how AND and OR tree can be used to represent games. What limitations do you think a system that uses game tree to play chess might face. Would it face different limitations if it played Tic Tac Toe. Answer: - AND and OR are the decision trees which can be used frequently in playing games. These trees provide an effective way for options and the possible results by choosing those options. Also decision tree helps in controlling the outcomes as result. AND and OR decision trees provide an effective method of decision making because they help us to make the best decisions on the basis of existing information. Limitations: - Decision tree is created to find all possible moves. In chess, there are infinite possible moves and it depends on ability. There are different types of moves in chess and according to them decision trees will be made and it will become very complex. So Decision trees have limitation in playing chess In case of tic tac toe, central node will give the maximum winning options. There is no decision tree which is complex so no limitation is there while playing TIC TAC TOE. Q2. How is real facts written in predicate Logic? Answer: - A predicate logic is a programming language as how to write various expressions and the meaning of the expressions in formula. For making a predicate logic needs: - logical symbols like and, or, not, equality, true, false, predicate and function symbols like man(x) for x is a man, term like variables and functions , a formula which is combination of terms and logical symbols, a sentence like formula without free. Example: - Let “a” is a perfect square and it is a predicate whose truth depends on the value of a.

Upload: piyush-jain

Post on 24-Nov-2014

329 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 2AI

PART -A

Q1. Explain how AND and OR tree can be used to represent games. What limitations do you think a system that uses game tree to play chess might face. Would it face different limitations if it played Tic Tac Toe.

Answer: - AND and OR are the decision trees which can be used frequently in playing games. These trees provide an effective way for options and the possible results by choosing those options. Also decision tree helps in controlling the outcomes as result. AND and OR decision trees provide an effective method of decision making because they help us to make the best decisions on the basis of existing information.

Limitations: - Decision tree is created to find all possible moves. In chess, there are infinite possible moves and it depends on ability. There are different types of moves in chess and according to them decision trees will be made and it will become very complex. So Decision trees have limitation in playing chess

In case of tic tac toe, central node will give the maximum winning options. There is no decision tree which is complex so no limitation is there while playing TIC TAC TOE.

Q2. How is real facts written in predicate Logic?

Answer: - A predicate logic is a programming language as how to write various expressions and the meaning of the expressions in formula. For making a predicate logic needs: - logical symbols like and, or, not, equality, true, false, predicate and function symbols like man(x) for x is a man, term like variables and functions , a formula which is combination of terms and logical symbols, a sentence like formula without free.

Example: - Let “a” is a perfect square and it is a predicate whose truth depends on the value of a.

Q3. Consider the following sentences:

John likes all kind of food. Apples are food. Chicken is food. Bill eats peanuts and is still alive. Sue eats everything bill eats.

(a) Translate these sentences into formulas in predicate logic

Answer: -

Page 2: 2AI

John likes all kind of food.

Answer: - x: food(x) likes (John, x)

Apples are food.

Answer: - food (Apples)

Chicken is food.

Answer: - food (chicken)

Bill eats peanuts and is still alive.

Answer: - eats (Bill, Peanuts) ^ alive (Bill)

Sue eats everything bill eats.

Answer: - A : eats (bill, A) eats (Sue, A)

PART-B

Q4. What problem would be encountered in attempting to represent the following statements in predicate logic? It should be possible to deduce the final statement from the others:

John only likes to see French movies. It’s safe to assume a movie is American unless explicitly told otherwise. The playhouse rarely shows foreign films. People do not do things that will cause them to be in situation that they do not like. John does not go to playhouse very often.

Answer: -

- A predicate p is unsatisfiable if and only if, it is false for all possible values of appropriate type.

- If a predicate p is associated with a variable x of type X, then p is unsatisfiable if , and only if,

This is all because of the face they don’t have any relation between them

And if there is any relation we might be able to have a predicate logic in between them

Q5. Write a program to implement Breadth First Search.

Answer: - Following is the program to implement breadth first search: -

Page 3: 2AI

Node * Breadth first search(Node *root, int searchValue)

{

Queue queue;

queue.Enqueue(root);

Node * currentNode;

while(currentNode = queue.Dequeue())

{

if(currentNode->data == searchVal)

return currentNode;

queue.Enqueue(currentNode->left);

queue.Enqueue(currentNode->right);

}}

Q6. Compare Declarative and Procedural knowledge and describe the areas in which each can be applied.

Answer: -

Declarative Procedural

Control information that is necessary to use the knowledge is considered to be embedded in the knowledge itself.

Need of specified knowledge.

Reliable on one who is properly officially qualified.

Need of training from trainer.

Can be forgotten in an easy manner. Power to retain for long time

These are the statements about the truth. To know that how to perform a problem.

Areas in which each can be applied: -

Page 4: 2AI

Advanced Traveler Information System: - Procedural

Creating a line graph to represent data: - Procedural

Determining breathing rate and heart rate: - It could be either procedural or declarative.

Sampling technique used in surveys: - Both either declarative or procedural.