0% found this document useful (0 votes)
185 views10 pages

Sample Paper - CS607P

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views10 pages

Sample Paper - CS607P

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Sample Paper

FINALTERM EXAMINATION
Fall 2022
CS607P – Artificial Intelligence Practical

Time: 90 min
Marks: 40

Question No: 1 (Marks: 01) - Please choose the correct option

Identify the correct statement to list facts numbers 1 through 5.


A. clips> (facts 1 5)
B. clips> (facts 1 to 5)
C. clips> (facts 5)
D. clips> (facts 1)

Question No: 2 (Marks: 01) - Please choose the correct option

Select the right command to add 34 in clips:


A. CLIPS> (+ 3 4)
B. CLIPS> (3 + 4)
C. CLIPS> (3 4 +)
D. CLIPS> + (3 4)

Question No: 3 (Marks: 01) - Please choose the correct option

Select the right output for CLIPS> (+ 3 4 5) function:


A. 5
B. 6
C. 12
D. 7

Question No: 4 (Marks: 01) - Please choose the correct option

MATLAB software is used for _______.


A. Video editing
B. Design analysis
C. Mathematical work
D. Software testing

Question No: 5 (Marks: 01) - Please choose the correct option

The weather is hot. Here the hot (use of linguistic variable is used) can be represented by
_______.
A. Fuzzy Set
B. Crisp Set
C. Linguistic Set
D. Logic Set

Question No: 6 (Marks: 01) - Please choose the correct option

When was the Eight Queen Puzzle published?


A. 1838
B. 1848
C.1858
D. 1868

Question No: 7 (Marks: 01) - Please choose the correct option

Which command is used to define the relation’s structure in CLIPS IDE.


A. facts
B. relation
C. assert
D. deftemplate

Question No: 8 (Marks: 01) - Please choose the correct option

Placing n-queens so that no two queens attack each other is called___________.


A. n-queen’s problem
B. 8-queen’s problem
C. Logic gate problem
D. Fuzzy problem

Question No: 9 (Marks: 01) - Please choose the correct option

A tree with N number of vertices contains________ Edges.


A. (N-1)
B. (N^2)-1
C. N
D. (N+1)

Question No: 10 (Marks: 01) - Please choose the correct option

The DFS is ______ efficient.


A. time
B. space
C. search
D. depth
Question No: 11 (Marks: 01) - Please choose the correct option

John McCarthy is known as __________ .


A. Father of Artificial Intelligence
B. Father of 8-Queens problem
C. Father of Fuzzy logic
D. Father of Expert Systems

Question No: 12 (Marks: 01) - Please choose the correct option

In CLIPS IDE which option is used to display the list of facts exist?
A. CLIPS> (facts)
B. CLIPS> (retract)
C. CLIPS> (assert)
D. CLIPS> (duplicate)

Question No: 13 (Marks: 01) - Please choose the correct option

We have added the given fact in CLIPS IDE.


CLIPS>(assert ( father ( fathersName “Ahmed”) (sonsName “Belal”) ) )
Which of the following function will be used to modify the fathers name slot.

A. CLIPS> (modify 1 ( fathersName “Ali Ahmed”))


B. CLIPS> (modify 2 ( fathersName “Ali Ahmed”))
C. CLIPS> (edit 1 ( fathersName “Ali Ahmed”))
D. CLIPS> (edit 2 ( fathersName “Ali Ahmed”))

Question No: 14 (Marks: 01) - Please choose the correct option

Select the right option that will remove the fact no. 1 in CLIPS IDE.
We have added the given fact in CLIPS IDE.
CLIPS>(assert ( father ( fathersName “Ahmed”) (sonsName “Bilal”) ) )
Which of the following function will be used to duplicate a modified fact.

A. CLIPS> (copy 1 (name “name”) )


B. CLIPS> (copy 2 (name “name”) )
C. CLIPS> (duplicate 1 (name “name”) )
D. CLIPS> (duplicate 2 (name “name”) )

Question No: 15 (Marks: 01) - Please choose the correct option

The (run) command starts _________ a CLIPS program.


A. halt
B. exit
C. executing
D. terminating
Question No: 16 (Marks: 01) - Please choose the correct option

The (clear) command in CLIPS IDE is used to ________.


A. remove facts only
B. remove rules only
C. remove both facts and rules
D. remove errors

Question No: 17 (Marks: 01) - Please choose the correct option

The (reset) command in CLIPS IDE is used to remove ________ from memory.
A. facts
B. rules
C. both facts and rules
D. remove duplications

Question No: 18 (Marks: 01) - Please choose the correct option

__________ in CLIPS are always written in a question mark (?) followed by a symbolic
field name.
A. Facts
B. Agenda
C. Rules
D. Variables

Question No: 19 (Marks: 01) - Please choose the correct option

Recursive Call sums up to formulate the possible moves in ________ queens problem.
A. 4x4 only
B. 8x8 only
C. NXN only
D. all

Question No: 20 (Marks: 01) - Please choose the correct option

The extended version of Eight Queen Puzzle applicable for n*n squares deals with
________ queens.
A. 5
B. 6
C. 8
D. n

Question No: 21 (Marks: 01) - Please choose the correct option


The WATCH command is used for debugging programs. Select the right format used to
enter the watch command in CLIPS IDE.
A. CLIPS> (watch system)
B. CLIPS> (watch functions)
C. CLIPS> (watch logics)
D. CLIPS> (watch facts)

Question No: 22 (Marks: 01) - Please choose the correct option

Select the right format used to use stop the watch command in CLIPS IDE.
A. CLIPS> (clear facts)
B. CLIPS> (unwatch facts)
C. CLIPS> (watch facts)
D. CLIPS> (stop facts)

Question No: 23 (Marks: 01) - Please choose the correct option

Select the right option that will remove the fact no. 1 in CLIPS IDE.
A. CLIPS> (facts 1)
B. CLIPS> (retract 1)
C. CLIPS> (assert 1)
D. CLIPS> (clear 1)

Question No: 24 (Marks: 01) - Please choose the correct option

Select the right option that will add the fact “Virtual University” in CLIPS IDE.
A. CLIPS> (facts(Virtual University))
B. CLIPS> (clear(Virtual University))
C. CLIPS> (assert (Virtual University))
D. CLIPS> (retract(Virtual University))

Descriptive Part:
Question No: 25 (Marks: 05)

Write code for the following function using CLIPS and also write the output.
• (+ 6 3 6)
• (* 5 4.5 8)
• (+ 4 (* 8 8) 2 )
• (* 6 (+ 3 (* 3 3) 4) (* 6 6))
• (+ 4 4(- 6 2))
Answer
• CLIPS> (+ 6 3 6) Output: 15
• CLIPS> (* 5 4.5 8) Output: 180.0
• CLIPS> (+ 4 (* 8 8) 2 ) Output: 70
• CLIPS> (* 6 (+ 3 (* 3 3) 4) (* 6 6)) Output: 3456
• CLIPS> (+ 4 4(- 6 2)) Output: 12

Question No: 26 (Marks: 05)

Write the program in CLIPS IDE that will save the facts about information of enrolled AI
courses like course id (CS607, CS607P) and name (Artificial Intelligence, Artificial
Intelligence Practical). You are required to make templates for enrolled courses. After
loading the facts in working memory use the facts command to see the index of courses
facts. After that remove any one of the course fact and again list the total index of courses
facts. Just send the screen shot of your CLIPS IDE and added fact should also be
displayed in fact window.

Answer
CLIPS> (deftemplate course “Enrolled Courses” (slot id) (slot name))
CLIPS> (assert (course (id CS607) (name “Artificial Intelligence”))
(course (id CS607P) (name “Artificial Intelligence Practical”)))
CLIPS> (facts)
f-0 (course (id CS607) (name “Artificial Intelligence”))
f-1 (course (id CS607P) (name “Artificial Intelligence Practical”)))
For a total of 2 facts
CLIPS> (retract 1)
CLIPS> (facts)
f-0 (course (id CS607) (name “Artificial Intelligence”))
For a total of 1 fact
Question No: 27 (Marks: 05)

CLIPS operates by maintaining a list of Facts and a set of Rules which operate on them.
Facts on their own are of only limited use. The application of Rules is necessary to
develop a program capable of some useful function and this can be achieved by using
rule-based programming. Write a program in CLIPS IDE to generate the given below rule
and add a fact that will fire the added rule and use the facts command to see the index of
total facts present in working memory both prior and after running of rule.

Generate a Rule:
IF Lunch Time
THEN Eat Lunch

Answer
CLIPS>(defrule diet (lunch time) => (assert (eat lunch)))
CLIPS>(assert (lunch time))
CLIPS>(facts)
f-0 (lunch time)
For a total of 1 fact.
CLIPS>(run)
CLIPS>(facts)
f-0 (lunch time)
f-1 (eat lunch)
For a total of 2 facts.
CLIPS>(exit)

Question No: 28 (Marks: 05)

Write the program in CLIPS IDE that will save the facts about stationary products (at
least 5 products). You are required to make fact list of items. After loading the facts in
working memory use the facts command to see the index of product facts. Remove fact 3
by using the relevant command and again use the facts command to see the index of
remaining product facts.

Answer
CLIPS> (assert (Pen) (Pencil) (Notebook)(Book)(Ink))
<Fact-4>
CLIPS> (facts)
f-0 (Pen)
f-1 (Pencil)
f-2 (Notebook)
f-3 (Book)
f-4 (Ink)
For a total of 5 fact.
CLIPS> (retract 2)
CLIPS> (facts)
f-0 (Pen)
f-1 (Pencil)
f-3 (Book)
f-4 (Ink)
For a total of 4 fact.
CLIPS> (exit)

Question No: 29 (Marks: 05)

Explain Depth First Search algorithm and illustrate with an example.


Answer
Depth-First Search (DFS) is an algorithm for traversing or searching tree or graph data
structures. Depth First Search dives into a tree deeper and deeper to fine the goal state.
The algorithm starts at the root node and explores as far as possible along each branch
before backtracking.

Extra memory, usually a stack, is needed to keep track of the nodes discovered so far
along a specified branch which helps in backtracking of the graph.

Question No: 30 (Marks: 05)

Consider the Eight-Queen problem to use representation and strategy on chess board.
Show the positions of Individuals on chess board table and calculate the fitness values for
both individuals in first iteration. The individuals (board positions) are given below:
(a) 47285421
(b) 52416782

Answer
Part a)
Q8
Q3 Q7

Q1 Q6
Q5

Q2
Q4

47285421
Fitness Value:
Q1 can attack Q6, Q3 Q5 can attack Q6
Q2 can attack Q7, Q8 Q6 can attack Q1,Q5
Q3 can attack Q7, Q1 Q7 can attack Q3, Q2, Q8
Q4 can attack None Q8 can attack Q7, Q2
Fitness value= 1
Part b)
Q4
Q2 Q8

Q3
Q1
Q5
Q6
Q7

52416782
Fitness Value:
Q1 can attack None Q5 can attack Q3,Q6, Q7
Q2 can attack Q8 Q6 can attack Q3, Q5, Q7
Q3 can attack Q5, Q6, Q7 Q7 can attack Q3, Q5, Q6
Q4 can attack None Q8 can attack Q2
Fitness value= 2

You might also like