# Discrete Mathematics (Intermediate): Combinatorics, Permutations, Relations, Functions & Number Theory

> Counting principles, permutations, combinations, binomial theorem, pigeonhole principle, equivalence relations, partial orders, bijections, modular arithmetic, and RSA cryptography

- **Canonical URL:** https://flashcards.world/flashcards/sets/03f5e52b-fa85-42f1-9cd1-adb9ac9a8039/
- **Markdown URL:** https://flashcards.world/flashcards/sets/03f5e52b-fa85-42f1-9cd1-adb9ac9a8039.md
- **Category:** Discrete Mathematics
- **Level:** intermediate
- **Languages:** en → en
- **Total Cards:** 32

## Flashcards (32 Cards)

| # | Front (Term / Prompt) | Back (Definition / Answer) | Example | Multiple-Choice Options |
| :--- | :--- | :--- | :--- | :--- |
| 1 | In a partially ordered set (poset), what is the difference between a maximal element and a greatest (maximum) element? | An element m is maximal if no element is strictly greater than m (m ≼ x ⇒ x = m); an element g is the greatest element if every element in the poset is less than or equal to g (∀x, x ≼ g). A poset can have multiple maximal elements, but at most one greatest element. |  |  |
| 2 | What are the formulas for k-permutations P(n, k) and k-combinations C(n, k) from a set of n distinct elements? | P(n, k) = n! / (n − k)! (ordered selections without repetition); C(n, k) = (n choose k) = n! / (k!(n − k)!) (unordered subsets of size k). |  |  |
| 3 | How does Euclid's proof establish that there are infinitely many prime numbers? | Assume finitely many primes p₁, p₂, …, pₙ. Form N = p₁ p₂ … pₙ + 1. Since N > 1, it has a prime factor p, which cannot be any pᵢ because N leaves remainder 1 when divided by each pᵢ — a contradiction. |  |  |
| 4 | State the Generalized Pigeonhole Principle. | If N objects are placed into k boxes, then at least one box contains at least ⌈N / k⌉ objects. |  |  |
| 5 | What defines a partial order (poset) (S, ≼), and how does a total (linear) order differ from a general partial order? | A partial order is a relation that is reflexive, antisymmetric, and transitive. In a total order, every pair of elements is comparable (∀a, b ∈ S, either a ≼ b or b ≼ a). |  |  |
| 6 | What is a derangement of n elements, and what is the formula for the number of derangements Dₙ? | A permutation of n elements that leaves no element in its original position (no fixed points). By Inclusion-Exclusion, Dₙ = n! Σ_{k=0}^n (−1)^k / k! ≈ n! / e. |  |  |
| 7 | State the Chinese Remainder Theorem (CRT). | If m₁, m₂, …, m_k are pairwise coprime positive integers (gcd(mᵢ, mⱼ) = 1 for i ≠ j), then the system of congruences x ≡ aᵢ (mod mᵢ) has a unique solution modulo M = m₁ · m₂ · … · m_k. |  |  |
| 8 | How do the Product Rule and Sum Rule of counting differ? | Product Rule: if a procedure breaks into two sequential tasks with n₁ and n₂ ways respectively, there are n₁ · n₂ ways. Sum Rule: if a task can be done in one of two mutually exclusive ways with n₁ or n₂ options, there are n₁ + n₂ ways. |  |  |
| 9 | What is Euler's Totient Function φ(n), and how is it computed from the prime factorization of n? | φ(n) counts the positive integers k ≤ n that are coprime to n (gcd(k, n) = 1). If n = p₁^{a₁} … p_r^{a_r}, then φ(n) = n · ∏_{i=1}^r (1 − 1/pᵢ). |  |  |
| 10 | State the Fundamental Theorem of Arithmetic. | Every integer n > 1 can be written uniquely as a product of prime numbers, up to the order of the prime factors: n = p₁^{a₁} p₂^{a₂} … p_k^{a_k}. |  |  |
| 11 | What are the four fundamental properties (reflexive, symmetric, antisymmetric, transitive) of a binary relation R on a set A? | - Reflexive: ∀x ∈ A, (x, x) ∈ R. - Symmetric: ∀x, y, (x, y) ∈ R ⇒ (y, x) ∈ R. - Antisymmetric: ∀x, y, ((x, y) ∈ R ∧ (y, x) ∈ R) ⇒ x = y. - Transitive: ∀x, y, z, ((x, y) ∈ R ∧ (y, z) ∈ R) ⇒ (x, z) ∈ R. |  |  |
| 12 | What is Vandermonde's Identity for binomial coefficients, and what is its combinatorial proof? | C(m + n, r) = Σ_{k=0}^r C(m, k) C(n, r − k). Both sides count the number of ways to choose r items from two disjoint sets of sizes m and n (by summing over choosing k from the first set and r − k from the second). |  |  |
| 13 | State Fermat's Little Theorem. | If p is a prime number and a is an integer not divisible by p, then a^{p−1} ≡ 1 (mod p) (and for all integers a, a^p ≡ a (mod p)). |  |  |
| 14 | What does the congruence a ≡ b (mod m) mean, and how does it partition the integers ℤ? | a ≡ b (mod m) means m divides (a − b), i.e., a and b leave the same remainder upon division by m. Congruence modulo m is an equivalence relation that partitions ℤ into m residue classes. |  |  |
| 15 | If \|A\| = m and \|B\| = n for finite sets, how many total functions and how many injective functions exist from A to B? | Total functions: n^m. Injective functions: P(n, m) = n! / (n − m)! if m ≤ n, and 0 if m > n. |  |  |
| 16 | State the Binomial Theorem and Pascal's Identity for binomial coefficients. | Binomial Theorem: (x + y)ⁿ = Σ_{k=0}^n C(n, k) x^{n−k} y^k. Pascal's Identity: C(n, k) = C(n − 1, k − 1) + C(n − 1, k). |  |  |
| 17 | What is the transitive closure R⁺ of a relation R on an n-element set, and what algorithm computes it efficiently? | R⁺ = ⋃_{k=1}^n R^k is the smallest transitive relation containing R. Warshall's algorithm computes the Boolean adjacency matrix of R⁺ in O(n³) time. |  |  |
| 18 | When does the linear congruence ax ≡ b (mod m) have solutions, and how many incongruent solutions modulo m exist? | Let d = gcd(a, m). A solution exists if and only if d divides b; when it does, there are exactly d mutually incongruent solutions modulo m. |  |  |
| 19 | How many ways can k indistinguishable items be chosen from n categories with repetition allowed (Stars and Bars)? | C(n + k − 1, k) = C(n + k − 1, n − 1), which also equals the number of non-negative integer solutions to x₁ + x₂ + … + xₙ = k. |  |  |
| 20 | How many surjective (onto) functions exist from a finite set A of size m onto a finite set B of size n (m ≥ n)? | n! · S(m, n) = Σ_{k=0}^n (−1)^k C(n, k)(n − k)^m, where S(m, n) is the Stirling number of the second kind. |  |  |
| 21 | What defines a lattice in order theory? | A partially ordered set in which every pair of elements {a, b} has both a unique least upper bound (join, a ∨ b) and a unique greatest lower bound (meet, a ∧ b). |  |  |
| 22 | Under what exact condition does an integer a have a multiplicative inverse modulo m? | a has a multiplicative inverse modulo m (an integer x such that a·x ≡ 1 (mod m)) if and only if a and m are coprime, i.e., gcd(a, m) = 1. |  |  |
| 23 | What is a Hasse diagram of a finite poset, and what is topological sorting? | A Hasse diagram represents a poset by drawing edges upward for covering relations while omitting self-loops and transitive edges. Topological sorting embeds a partial order into a compatible total order. |  |  |
| 24 | Define an injective (one-to-one), surjective (onto), and bijective function f: A → B. | - Injective: ∀a₁, a₂ ∈ A, f(a₁) = f(a₂) ⇒ a₁ = a₂. - Surjective: ∀b ∈ B, ∃a ∈ A such that f(a) = b (Im(f) = B). - Bijective: both injective and surjective (invertible). |  |  |
| 25 | How many permutations of n objects exist when there are n₁, n₂, …, n_r indistinguishable objects of types 1, 2, …, r? | The multinomial coefficient n! / (n₁! n₂! … n_r!). |  |  |
| 26 | For positive integers a and b, what identity connects gcd(a, b) and lcm(a, b)? | a · b = gcd(a, b) · lcm(a, b). |  |  |
| 27 | State Euler's Theorem in modular arithmetic. | If n is a positive integer and a is an integer coprime to n (gcd(a, n) = 1), then a^{φ(n)} ≡ 1 (mod n). |  |  |
| 28 | How are public and private keys generated, and how do encryption and decryption work in the RSA cryptosystem? | Choose distinct large primes p, q; compute n = pq and φ(n) = (p−1)(q−1). Choose public exponent e with gcd(e, φ(n)) = 1, and compute private exponent d ≡ e⁻¹ (mod φ(n)). Encrypt message M via C = M^e mod n; decrypt via M = C^d mod n. |  |  |
| 29 | How many distinct binary relations can be defined on a finite set A with \|A\| = n, and how many of them are reflexive? | Since a relation is a subset of A × A (which has n² pairs), there are 2^{n²} total relations. A reflexive relation fixes the n diagonal pairs (x, x) and freely chooses from the remaining n² − n pairs, giving 2^{n(n−1)} reflexive relations. |  |  |
| 30 | How does the Euclidean Algorithm compute gcd(a, b), and what does Bézout's Identity state? | The Euclidean Algorithm repeatedly applies gcd(a, b) = gcd(b, a mod b) until the remainder is 0. Bézout's Identity states that there exist integers s and t (found via the Extended Euclidean Algorithm) such that gcd(a, b) = s·a + t·b. |  |  |
| 31 | What defines an equivalence relation on a set A, and how do its equivalence classes relate to partitions of A? | An equivalence relation is reflexive, symmetric, and transitive. Its equivalence classes [a] = {x ∈ A \| x R a} are either identical or disjoint, forming a partition of A. |  |  |
| 32 | State the Division Algorithm for integers a and d > 0. | For any integer a and positive integer d, there exist unique integers q (quotient) and r (remainder) such that a = d · q + r with 0 ≤ r < d. |  |  |

---
Study this deck interactively with FSRS-6 spaced repetition, audio review, and multiple-choice mode at [Flashcards World](https://flashcards.world/flashcards/sets/03f5e52b-fa85-42f1-9cd1-adb9ac9a8039/).
