Exercises for Week 09
Exercise 00
- The index of concepts for this week is in a separate chapter. Peruse it and make sure that its
entries make sense to you (otherwise, click on them to check them
out).
- The lecture notes start with updates (Chapter Lecture Notes, updates).
Make sure to check them out regularly,
as they reflect the development of the lecture.
- Do take the time to peruse the lecture notes of this week and to
reproduce their OCaml content.
Optional exercises
- Exercise 17:
computing the Cartesian product of four sets generically
- Exercise 24:
computing the Cartesian product of a list of sets
Exercise 41
- Using The logical counterpart of the map function for lists,
from Week 08, i.e., list_andmap, implement a predicate that checks
whether a given list only contains integers that lie between -16 and +16,
exclusively.
- Using List.init, Random.int, and Random.bool,
implement an OCaml function that, when applied,
constructs a list of random length
that contains random integers lying between -15 and 15, inclusively.
- Consider
(1) the unit-test function for the implementation in Part a.,
(2) the implementation in Part a.,
(3) the unit-test function for the implementation in Part b.,
and
(4) the implementation in Part b.
How do these OCaml functions relate with each other?
- Using words like “developers” and “testers”,
characterize the rôles of the people who implemented
(1) the unit-test function for the implementation in Part a.,
(2) the implementation in Part a.,
(3) the unit-test function for the implementation in Part b.,
and
(4) the implementation in Part b.
Is there any overlap?
Version
Created
[10 Jan 2023]