Homeworks for the course
CS 5354/CS
4365, Summer 2021
General comments:
- Unless explicitly specified, each
homework should be turned in by email.
- For a programming
assignment, send:
- the softcopy of your program,
- if
needed, the softcopy of the code that you used to test this method,
and
- the softcopy of the results.
Feel free to use Java,
C, C++, Fortran, or any programming language in which the code is
understandable. - Homeworks are due at the beginning of the class
on the day when the homework is due.
- Solutions to the
homeworks will be posted two classes later, so:
- if there
are objective reasons why you cannot turn in your homework on time,
- you can submit it before the solution is posted.
Together
with your submission, please provide an explanation of why you are
submitting this homework late. If no explanation is provided, some
points will taken off for late submission. - If, for objective
reasons, you are very late -- did not submit yet, and the solution
is already posted, let the instructor know. We will prepare an
alternative assignment for you, so you can still earn credit for
this homework.
1. (Due July 8)
- Why do we need explainable AI in the
first place?
- Why is it a reasonable idea to try to use fuzzy
techniques when designing explainable AI?
- Why were fuzzy
technique invented in the first place -- and who was their
inventor?
Solution
2. (Due July 8) We know that:
- for x1 = 1, we
have y1 = 2, and
- for x2 = 2, we have
y2 = 3.
What you need to do: - Use the
general linear interpolation formula that we had in class to come
up with the expression y = f(x) for the dependence of y on x.
-
For your expression f(x), what is the value of f(1.5)?
- How is
linear interpolation used in fuzzy techniques?
- Explain, step
by step, how we can derive the general formula for the linear
interpolation.
Solution
3. (Due July 8) If the degree of confidence in a statement A is 0.7
and the degree of confidence in a statement B is 0.8, then what are
the estimated degrees of confidence in statements A & B and A
\/ B? Consider two cases:
- "and"-operation is min(a,b) and
"or"-operation is max(a,b);
- "and"-operation is a*b and
"or"-operation is a + b − a*b.
Solution
4. (Due July 12) Let us consider the following expert rules:
- if a cat is somewhat bored and you have a little bit of time,
play with it a little bit;
- if a cat is very bored and you have
a lot of time, play with it for a long time.
Describe
step-by-step -- like we did in class and like it is described in
the corresponding lecture -- how you would translate these rules
into a formula for the corresponding predicate R(b,t,p) meaning
that if the cat is in the state b and you have time t, then it is
reasonable to play it for time p.
Let us now assume that:
- the cat is somewhat bored with
degree 0.3 and very bored with degree 0.7,
- t = p = 1 hour;
- the degree to which this time is a little bit is 0.4, the
degree to which this is a long time is 0.6;
- we use a*b as the
"and"-operation and a + b − a*b as the "or"-operation.
What will then be the resulting degree μR(b,t,p)?
Solution
5. (Due July 9) Prepare a project that you would like to do for the
class.
- If you selected a project recommended by your
advisor, let me know what exactly you plan to do (and who is your
advisor).
- One of the options is to review a paper which is
related either to explainable AI or to fuzzy. The relation may be
weak, it is OK, the main idea is that you yourself are enthusiastic
about this paper.
- If you selected a paper for review, let
me know whether this paper was proposed by your advisor or you
selected it on your own.
- In both cases, send me a softcopy of
your paper.
- If you selected the paper yourself, I will
check:
- that this paper is sufficiently technical -- i.e.,
has at least some formulas or algorithms, and
- that this paper
is not too complex -- can be understood and reviewed in a month.
- If you decided to work on a yet-to-come challenging
theoretical project, let me know, and, if possible, indicate what
interests you, so that we can jointly select a project that will be
of interest to you.
6. (Due July 12) What is the distance D(a,b) between the points a =
(1, 2) and b = (6, −10)?
Solution
7. (Due July 12) What is the squared distance D2(a,b)
between the points a = (1, 2, 3) and b = (−1, −2,
−3)?
Solution
8. (Due July 12) Use differentiation to find the minimum (=
smallest value) of the expression (2x − 5)2 + 3x
− 6.
Solution
9. (Due July 12) Suppose that we have the following reasonableness
degrees:
- for u1 = 0, we have
μ(u1) = 0.5;
- for u2 = 1, we have
μ(u2) = 1.0;
- for u3 = 2, we have
μ(u3) = 0.5.
What will be the result of
centroid defuzzification?
Solution
10. (Due July 14) Write a program that simulates fuzzy control with
the three rules that we had in class:
- if ΔT is
negligible, then u is negligible;
- if ΔT is small
positive, then u is small negative;
- if ΔT is small
negative, then u is small positive.
Your program should:
- input ΔT, and
- return the corresponding control
u.
Use separate methods for computing the corresponding membership
functions, for computing the "and"-operation, and for computing the
"or"-operation, so that if you will need to change one of these
operations, all you would have to do it replace the corresponding
method without having to change the main method.
Test your program on the example of membership functions that we
had in class and values ΔT = +3 and ΔT = −3. For
each of these two values of ΔT, use your program to compute
the resulting control value corresponding to the following two
pairs of "and"- and "or"-operations: cases:
-
"and"-operation is min(a,b) and "or"-operation is max(a,b);
-
"and"-operation is a*b and "or"-operation is a + b −
a*b.
Solution
11. (Due July 13) Write a general program for computing an integral
of a given function over a given range. Test it by showing how to
compute the integral of x2 on the interval [0,1].
Solution
12. (Due July 14) Reproduce, in all detail, the proof that linear
interpolation is the most robust.
Solution: see Section 3 of Lecture 3.
13. (Due July 14) Different marks on a 0-to-5 scale correspond to
different degrees of confidence. For each possible degree
corresponding to marks on a scale from 0 to 5, find the mark on a
0-to-4 scale which leads to the closest value of the degree.
Solution
14. (Due July 14) Reproduce, in all detail, the proof that
algebraic product is the most robust "and"-operation.
Solution: se Section 5 of Lecture 3.
15. (Due July 14) As you know, in the usual 2-valued logic,
negation is defined by the formulas f(0) = 1 and f(1) = 0. We would
like to extend this function f(x) to all possible values x from the
interval [0,1]. Such an extension is known as the negation
operation. What is the most robust negation operation?
Solution
16. (Due July 16) Prove that for the case when f(a) > f(b), linear
interpolation is also the only maximally individually robust
interpolation.
Solution
17. (Due July 20) Use the least squares method to find the
dependence y = c1 * x + c2 for the case when
we have the following three measurements:
- x(1)
= −2, y(1) = 1;
- x(2) = 0,
y(2) = −1;
- x(3) = 2,
y(3) = −1.
Solution
18. (Due July 20) Suppose that we know that f(0) = 2 and f(2) = 1.
Use variational derivative to find the value f(1) for which the sum
(f(1) − f(0))2 + (f(2) − f(1))2
attains its smallest possible value.
Solution
19. (Due July 20) Let us assume that we know the values f(a) and
f(b) for some a and b, and we want to interpolate, i.e., to find
the values f(x) for all x between a and b. By definition, the
maximally individually robust interpolation f(x) must satisfy the
inequality |f(x) − f(y)| ≤ r * |x − y| for all x
and y, where r = |f(b) − f(a)|/|b − a|. Provide an
example of the values x and y showing that when a = 0, b = 1, f(a)
= 0, and f(b) = 1, the function f(x) = x2 is not a
maximally individually robust interpolation. Hint: it is
sufficient to consider values 0, 0.5, and 1.
Solution
20. (Due July 20) We have shown that the only maximally
individually robust "or"-operation is max(a,b). Maximally
individually robust means, in this case, that for all possible
values a, b, a′, and b′, we must have
|f\/(a,b) − f\/(a′,b′)|
≤ max(|a − a′|, |b − b′|). Provide an
example of the values a, b, a′, and b′ showing that the
"or"-operation a + b − a * b is not maximally individually
robust. Hint: it is sufficient to consider values 0, 0.5,
and 1.
Solution
21. (Due July 20). Which "and" and "or"-operations should we use in
the following two situations:
- if we are controlling a
group of objects, and malfunctioning of one of them is OK as long
as, on average, they all fulfil their mission;
- if we are
controlling a single object.
Solution
22. (Due July 20). So how can we use fuzzy techniques to come up
with explainable AI?
Solution
23. (Due July 20) What is tuning? What is the difference between
tuning and machine learning?
Solution
24. (Due July 21) Write a program that, given two arrays of values
x(1), ..., x(K) and y(1), ...,
y(K), uses the least squares method to find the values
of the parameters c1 and c2 of the linear
dependence y = c1 * x + c2. Test your method
on two examples:
- an example when you have x(1)
= 0, y(1) = 0, x(2) = 1, and y(2)
= 1; in this example, your program must return c1 = 1
and c2 = 0; and
- an example from Lecture 4.
25. (Due July 26) Suppose that a 2-layer neural network has two
inputs x1 = 0 and x2 = 1.
- In the
first layer, we perform a linear transformation and compute the
value y = w0 + w1 * x1 +
w2 * x2.
- In the second layer, we apply,
to the result of the first layer, the rectified linear activation
function and get z = F(y).
What will be the result z of this
data processing in the following two situations: - when
w0 = w1 = w2 = 1, and
- when
w0 = w1 = w2 = −1.
Solution
26. (Due July 26) What will be the result of max-pooling three
values x1 = 0, x2 = 1, and x3 =
−1? of sum-pooling these three values?
Solution