Raw

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

Laboratory/Laboratory2/1purpose.md · 1.0 KB · updated 2026-07-31 21:14