Beruflich Dokumente
Kultur Dokumente
Informtica
Intelligent Systems
Solution:
A state is a 5x5 matrix with the current arrangement of the blocks, where 8 cells
are unused (the 2x2 blocks at the lower left and upper right corners). A dark token can
be identified by number 1, the empty cell by number 0, and a light token by number 2,
for example.
The state space is the set of all 5x5 matrices where the used cells contain a total
of 8 ones, 8 twos and one zero.
The step cost is always 1. The available actions in a certain state are (provided
that they are possible):
-Move a dark token down, to an adjacent empty square.
-Move a dark token down, over a light token.
-Move a dark token right, to an adjacent empty square.
-Move a dark token right, over a light token.
-Move a light token up, to an adjacent empty square.
-Move a light token up, over a dark token.
-Move a light token left, to an adjacent empty square.
-Move a light token left, over a dark token.
Please note that these actions can be reformulated in terms of moves of the
empty square.
The goal test consists in checking whether the current state has all the light
tokens in the upper left corner and all the dark tokens in the lower right corner.
The execution of the propositional resolution algorithm on the above clauses produces
the following clauses:
C5. P Q
C6. Q
C7. False
(2,3)
(1,5)
(4,6)
Question 1 (1 point):
Compute the following performance measures from the confusion matrix given
below:
a) Accuracy.
b) True positives, true negatives, false positives, false negatives.
Predicted class
Actual class
Positive
182
12
Positive
Negative
Negative
31
245
TP + TN
TP
FP
; Recall =
; Fallout =
TP + TN + FP + FN
TP + FN
FP + TN
TP
PrecisionRecall
; F measure = 2
Precision =
TP + FP
Precision + Recall
Accuracy =
Solution:
a)
n11 + n22
=
n11 + n12 + n21 + n 22
182 + 245
0.9085
182 + 31 + 12 + 245
Accuracy =
b)
TP = n11 = 182
TN = n 22 = 245
FP = n12 = 31
FN = n 21 = 12
c)
182
0.8545
182 + 31
31
Fallout =
0.1123
31 + 245
182
Recall =
0.9381
182 + 12
0.8545 0.9381
F measure = 2
= 0.8944
0.8545 + 0.9381
Precision =
Question 2 (1 point):
Design a single layer perceptron which computes the NAND Boolean function:
x1
0
0
1
1
x2
0
1
0
1
F(x1,x2)
1
1
1
0
Solution:
X1
f(x1,x2)
X2
where the activation function f is the step function and w1, w2 = -0,25; = -0,4.