1. Objective / Мета роботи
Understand and implement the Cartesian product of sets and the related operations on binary relations.
By the end of the work the student should be able to:
- construct the Cartesian product of two finite sets as the set of all ordered pairs with and , using only basic data structures;
- explain a binary relation as a subset of , and validate whether a given list of ordered pairs is a legitimate relation for two sets;
- generate a relation on a set from a predicate (relation function), such as a divisibility rule;
- filter a Cartesian product to the pairs that satisfy a supplied condition;
- reason about the size of a product () and about the time complexity of each operation.
The work builds directly on the set operations of Laboratory Work 1 and prepares the ground for the study of relations, functions, and graphs later in the course.