Professional Documents
Culture Documents
Artificial Intelligence
Assignments
INDEX
S. No. Programs Page No.
1. Explore and discuss Physical symbol 4
system Hypothesis.
2. Discuss the applications of Game playing. 5
3. Explain the Artificial Intelligence (AI) 6
technique for Tic-Tac-Toe Game playing
with example.
4. Explain the following search techniques 8
with example for each.
(i) Depth limited search
(ii) Greedy Best First Search
5. Compare and contrast Best First Search, 14
(BFS), Greedy BFS and A* Algorithms.
6. Consider any two example sentences 16
(different from those discussed in class)
and convert them into predicate logic
form and then into clausal form.
7. Consider any two example sentences 18
(different from those discussed in class)
and represent them using semantic
networks.
8. Give a detailed example of a script 19
different from that discussed in the
Class.
9. Provide (i) top-down parsing and (ii) 21
bottom-up parsing for the following
sentence.
3
100A+10B+C–(100D+10E+F)
Alpha-Beta Strategy:
If beta value of any MIN node below a MAX node is less than or
equal to its alpha value, then prune the path below the MIN node.
If alpha value of any MAX node below a MIN node exceeds the
beta value of the MIN node, then prune the nodes below the MAX
node.
8
Advantages:
Disadvantages:
Example:
f(n)= h(n).
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 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.
CLOSED list. If the node has not been in both list, then add it to the
OPEN list.
Advantages:
Best first search can switch between BFS and DFS by gaining
the advantages of both the algorithms.
This algorithm is more efficient than BFS and DFS algorithms.
Disadvantages:
Example:
In this search example, we are using two lists which are OPEN and
CLOSED Lists. Following are the iteration for traversing the above
example.
13
(iii) A* Algorithm:
Predicate form:
Clausal Form:
Or
Predicate form:
∃S ∃K ( Person(S) ∧ Person(K) ∧ Uncle(S,K) ) → ∃A(Person(A) ∧Brothers(K , A))
Clausal form:
Age Age
A1 A2
Less than
Late
Instance
Steve Event
Agent
For
Meeting
19
Entry Conditions:
o P has no money.
o The bank is open.
Result:
o P has more money.
Scene 1: Entering
o P enters the Bank
o P moves to Counter
o P requests to E
Advantages of Scripts:
Disadvantages of Scripts:
Ans.:
(i) Top-Down Parsing:
S → NP
→ NP DET
→ ART NOUN DET
→ The NOUN DET
→ The Breeze DET
→ The Breeze ART ADJ
→ The Breeze is ADJ
→ The Breeze is cool
22
Lisp Assignments:
(defun temprature(c)
Output:
2. Factorial of a number.
factorial.lisp
(defun factorial(n)
(if (= n 0) 1
(* n factorial (- n 1))))
24
Output:
(defun sum-n-no(n)(if (= n 1)
1
(+ n (sum-n-no (- n 1)))))
Output:
(defun power(m n)
Output:
Output:
(defun table(n)
Output:
(defun fibonacci(n)
((> b n) a)
(print a))))
27
Output:
3. Tower of Hanoi.
tower_of_hanoi.lisp
(cond
(t (block defaultCase
Output:
(hanoi (- N 1) src spare dest)
Output:-
28
(defun roots (a b c)
((and (= a 0) (= b 0) (= c 0))
((and (= a 0) (= b 0))
Output:
(format nil "(none)~%"))
((= a 0) (/ (- c) b))
(t (let
( (b2m4ac (- (* b b) (* 4 a c))))
(defun area(rad)
(terpri)
Output:
=========================END=====================