# 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** $A \times B$ of two finite sets as the set of all **ordered pairs** $(a, b)$ with $a \in A$ and $b \in B$, using only basic data structures; - explain a **binary relation** as a **subset** of $A \times B$, 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 ($|A \times B| = |A|\cdot|B|$) 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.