Laboratory Work 3 — Relations and Their Properties
Third laboratory work of Computer Discrete Mathematics. You implement checks for the fundamental properties of a binary relation on a set — reflexivity, symmetry, transitivity, and antisymmetry — combine them to recognise an equivalence relation and a partial order, and generate the inverse of a relation.
At a glance
| Topic | Binary relations on a set: reflexivity, symmetry, transitivity, antisymmetry, equivalence, partial order, inverse |
| Prerequisite lectures | L03 — Relations |
| Deliverable | Source code + report (see 5report.md) |
| Grading | Banded: Easy 60–74 / Medium 75–89 / Hard 90–100 (see 4task.md) |
Contents
| # | Part | File |
|---|---|---|
| 1 | Objective | 1purpose.md |
| 2 | Methodical guidelines (theory & algorithms) | 2method.md |
| 4 | Task and order of execution | 4task.md |
| 5 | Report contents | 5report.md |
| 6 | Control questions | 6questions.md |
Conventions
- Language — source code and the report are in English.
- Implement it yourself — no built-in shortcuts. Do not call a library or
built-in that performs the core task for you (e.g. no
HashSet/set()/Setfor sets, no library graph/relation type, nomath.gcd, noeval). Build the mechanism from basic primitives — arrays/lists, loops, arithmetic, strings. - Deliverable — submit the source code and a report structured as in 5report.md; the code must reproduce the example outputs in 4task.md.
- Self-contained theory — everything needed is in 2method.md; no external material is required.
Summary
A relation on a set is a set of ordered pairs drawn from , and its character is captured by a few key properties. Reflexivity, symmetry, and transitivity together define an equivalence relation — the abstraction that partitions a set into classes of “equivalent” elements, one of the most reused ideas in mathematics and computing. In this work you test each property in isolation, combine them into an equivalence check and a partial-order check, and construct the inverse of a relation. The tasks are grouped into three difficulty bands.