Calculator Inputs
Use a numeric interval or a custom set. The calculator partitions the chosen universe using congruence modulo n.
Example Data Table
Sample partition for the universe from -3 to 10 using modulus 4.
| Residue Class | Elements | Size |
|---|---|---|
| [0]4 | {0, 4, 8} | 3 |
| [1]4 | {-3, 1, 5, 9} | 4 |
| [2]4 | {-2, 2, 6, 10} | 4 |
| [3]4 | {-1, 3, 7} | 3 |
Formula Used
Equivalence relation: x ~ y if and only if x ≡ y (mod n).
Divisibility form: n | (x - y).
Equivalence class of a: [a]n = { x in U : x ≡ a (mod n) }.
Canonical residue: r = ((a % n) + n) % n.
The calculator first converts each value into its canonical residue from 0 to n - 1. It then groups all numbers sharing that residue into the same equivalence class.
How to Use This Calculator
- Choose Range of integers or Custom integer set.
- Enter the representative a and modulus n.
- Add a start and end value for range mode, or paste integers for custom mode.
- Pick ascending or descending output order.
- Enable the residue toggle if you want empty classes displayed too.
- Press Calculate Equivalence Classes to view the target class, quotient set, table, and Plotly chart.
- Use the export buttons to save the output as CSV or PDF.
Frequently Asked Questions
1) What is an equivalence class?
An equivalence class is a group of elements considered equivalent under a chosen relation. In this calculator, numbers are grouped when they have the same remainder after division by the modulus.
2) Why is modulo arithmetic used here?
Modulo arithmetic gives a standard equivalence relation on integers. It partitions a set into non-overlapping residue classes, which makes quotient sets and class membership easy to compute and visualize.
3) What does the notation [a]n mean?
It means the equivalence class of the representative a modulo n. Every element in that class has the same canonical residue as a when divided by n.
4) Can the representative be negative?
Yes. The calculator normalizes negative values into a canonical residue between 0 and n-1, so negative representatives still map correctly to their equivalence classes.
5) What is the quotient set shown in results?
The quotient set is the collection of all equivalence classes formed from the chosen universe. It shows how the universe is partitioned by the selected modular relation.
6) Why might some classes be empty?
If your universe does not contain values for every residue, some residue classes have no members. The optional toggle lets you display those empty classes for a complete overview.
7) Does custom set mode remove duplicates?
Yes. The calculator keeps unique integers only, because repeated values do not create new class members. This makes the partition cleaner and easier to interpret.
8) What does the chart represent?
The Plotly chart displays the size of each residue class in the chosen universe. It helps you compare balance, sparsity, and class distribution at a glance.