Sandomhet

CMPSC 40 Discrete Mathematics

discrete mathematics and mathematical proof

Wed, May 28, 2025 17 min read

Discrete Mathematics

Propositions and Logics

Definition

Proposition: a declarative sentence that is T or F (not both)
Propositional variable (sentential): variables that represent propositions, denoted as letters p,q,rp, q, r.
Atomic proposition: propositions that cannot be expressed in terms of simpler propositions.
Compound proposition: new propositions formed from existing propositions using logical operators.

Logical Operators (Propositional Connectives):

  • Negation (NOT): ¬p\neg p or ∼p\sim p
  • Conjunction (AND): p∧qp \land q
  • Disjunction (OR): p∨qp \lor q
  • Exclusive (XOR): p⊕qp \oplus q

(DNF) Disjunctive normal form: OR of ANDs.
(CNF) Conjunctive normal form: AND of ORs.

Conditional Proposition

Conditional Statement (Implication): If pp, then qq, denoted by p→qp \rightarrow q. pp is hypothesis, and qq is conclusion.

pqp→qTTTTFFFTTFFT\begin{array}{|c c|c|} \hline p & q & p \rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline \end{array}

  • Contrapositive: ¬q→¬p\neg q \to \neg p
  • Converse: q→pq \to p
  • Inverse: ¬p→¬q\neg p \to \neg q

The original and contrapositive are equivalent; The converse and inverse are equivalent. (logically equivalent)

Biconditional Statement (Bi-implications): pp if and only if qq, denoted by p↔qp \leftrightarrow q

pqp↔qTTTTFFFTFFFT\begin{array}{|c c|c|} \hline p & q & p \leftrightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & T \\ \hline \end{array}

Logical Equivalence

Tautology: always True compound proposition.
Contradiction: always False compound proposition.
Contingency: neither tautology nor contradiction.

p≡qp \equiv q denotes logical equivalence if p↔qp \leftrightarrow q is a tautology.

De Morgan's Laws

  • ¬(p∧q)≡¬p∨¬q\neg (p \land q) \equiv \neg p \lor \neg q
  • ¬(p∨q)≡¬p∧¬q\neg (p \lor q) \equiv \neg p \land \neg q

Conditional Disjunction Equivalence: p→q≡¬p∨qp \to q \equiv \neg p \lor q

Logical Equivalence Table:

Law∨-Version∧-Version
Idempotent lawsp∨p≡pp \lor p \equiv pp∧p≡pp \land p \equiv p
Associative laws(p∨q)∨r≡p∨(q∨r)(p \lor q) \lor r \equiv p \lor (q \lor r)(p∧q)∧r≡p∧(q∧r)(p \land q) \land r \equiv p \land (q \land r)
Commutative lawsp∨q≡q∨pp \lor q \equiv q \lor pp∧q≡q∧pp \land q \equiv q \land p
Distributive lawsp∨(q∧r)≡(p∨q)∧(p∨r)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r)p∧(q∨r)≡(p∧q)∨(p∧r)p \land (q \lor r) \equiv (p \land q) \lor (p \land r)
Identity lawsp∨F≡pp \lor \mathrm{F} \equiv pp∧T≡pp \land \mathrm{T} \equiv p
Domination lawsp∨T≡Tp \lor \mathrm{T} \equiv \mathrm{T}p∧F≡Fp \land \mathrm{F} \equiv \mathrm{F}
Double negation¬¬p≡p\neg\neg p \equiv p¬¬p≡p\neg\neg p \equiv p
Complement lawsp∨¬p≡Tp \lor \neg p \equiv \mathrm{T}
¬F≡T\neg \mathrm{F} \equiv \mathrm{T}
p∧¬p≡Fp \land \neg p \equiv \mathrm{F}
¬T≡F\neg \mathrm{T} \equiv \mathrm{F}
De Morgan’s laws¬(p∨q)≡¬p∧¬q\neg(p \lor q) \equiv \neg p \land \neg q¬(p∧q)≡¬p∨¬q\neg(p \land q) \equiv \neg p \lor \neg q
Absorption lawsp∨(p∧q)≡pp \lor (p \land q) \equiv pp∧(p∨q)≡pp \land (p \lor q) \equiv p
Conditional identitiesp→q≡¬p∨qp \to q \equiv \neg p \lor qp↔q≡(p→q)∧(q→p)p \leftrightarrow q \equiv (p \to q) \land (q \to p)
ExpressionEquivalent Form
p→qp \to q¬p∨q\neg p \lor q
p→qp \to q¬q→¬p\neg q \to \neg p
p∨qp \lor q¬p→q\neg p \to q
p∧qp \land q¬(p→¬q)\neg\bigl(p \to \neg q\bigr)
¬(p→q)\neg(p \to q)p∧¬qp \land \neg q
(p→q)∧(p→r)(p \to q) \land (p \to r)p→(q∧r)p \to (q \land r)
(p→r)∧(q→r)(p \to r) \land (q \to r)(p∨q)→r(p \lor q) \to r
(p→q)∨(p→r)(p \to q) \lor (p \to r)p→(q∨r)p \to (q \lor r)
(p→r)∨(q→r)(p \to r) \lor (q \to r)(p∧q)→r(p \land q) \to r
ExpressionEquivalent Form
p↔qp \leftrightarrow q(p→q)∧(q→p)(p \to q) \land (q \to p)
p↔qp \leftrightarrow q¬p↔¬q\neg p \leftrightarrow \neg q
p↔qp \leftrightarrow q(p∧q)∨(¬p∧¬q)(p \land q) \lor (\neg p \land \neg q)
¬(p↔q)\neg\bigl(p \leftrightarrow q\bigr)p↔¬qp \leftrightarrow \neg q

Set

Definition: unordered collection of elements.

  • Set Equality: A=BA = B if they contain exactly the same elements.
  • Subset: A⊆BA \subseteq B if every element of AA is also an element of BB. ∀x(x∈A→x∈B)\forall x (x \in A \rightarrow x \in B).
  • Proper Subset: A⊊BA \subsetneq B, if A⊆BA \subseteq B and A≠BA \neq B.
  • Empty Set: The set with no elements, denoted {}\{\} or ∅\emptyset.

Roster method: list elements explicitly.
Set-builder notation: describe elements via properties.
Recursion: basis and recursive step.

Concatenation: A∘B={ab∣a∈A and b∈B}A \circ B = \{ab \mid a \in A \text{ and } b \in B \}

Cardinality of Sets

  • A set AA is finite if ∣A∣=n|A| = n for some n∈Nn\in\mathbb{N}.
  • A set AA is countably infinite if there is a bijection f:N→Af:\mathbb{N}\to A or ∣A∣=∣N∣\lvert A\rvert = \lvert \mathbb{N}\rvert.
  • Uncountable: cannot be put in bijection with N\mathbb{N}.
SetNotationCardinality
IntegersZ\mathbb{Z}countably infinite
Positive integersZ+\mathbb{Z}^+countably infinite
Nonnegative integersN\mathbb{N}countably infinite
Rational numbersQ\mathbb{Q}countably infinite
Real numbersR\mathbb{R}uncountable

Sum and Product Rules

  • Sum Rule (Disjoint Union): If AA and BB are disjoint finite sets, then ∣A∪B∣=∣A∣+∣B∣|A \cup B| = |A| + |B|.
  • Union of Non-Disjoint Sets: If A,BA,B are finite (possibly overlapping), ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A\cap B|.
  • Product Rule (Cartesian Product): If AA and BB are finite, then ∣A×B∣=∣A∣×∣B∣|A \times B| = |A|\times|B|.
    • Corollary: ∣A2∣=∣A∣2|A^2| = |A|^2 for any finite set AA.

Power Sets

Definition: The power set P(S)\mathcal{P}(S) is the set of all subsets of SS.

  • If ∣S∣=n|S| = n, then ∣P(S)∣=2n|\mathcal{P}(S)| = 2^n.
  • For any set SS, ∣S∣<∣P(S)∣\lvert S \rvert < \lvert \mathcal{P}(S)\rvert

Example: If S={1,2,3}S = \{1,2,3\},
P(S)={∅,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}.\mathcal{P}(S) = \{\emptyset, \{1\}, \{2\}, \{3\}, \{1,2\}, \{1,3\}, \{2,3\}, \{1,2,3\}\}.

Predicate and Quantification

Predicate

Predicate (propositional function): a function P(x)P(x) from a given domain to {T,F}\{ T,F \}
Can be represented by: input-output table, rule or condition, truth set (elements where P(x) is true)
For a predicate PP with domain X1×⋯×XnX_1 \times \cdots \times X_n, write P(x1,…,xn)P(x_1, \ldots, x_n) to mean P((x1,…,xn))P((x_1, \ldots, x_n)).

Quantifier

Quantification: to create a proposition from a propositional function. Highest precedence over all other logical operators

  • Universal Quantification ∀xP(x)\forall x P(x) : P(x)P(x) for all values of xx in the domain. An element where P(x)=FP(x) = F is a counterexample.
  • Existential Quantification ∃xP(x)\exists x P(x) : There exists an element xx in the domain such that P(x)P(x). An element where P(x)=TP(x) = T is a witness.
  • Uniqueness Quantification ∃!xP(x)\exists! x P(x) or ∃1xP(x)\exists_1 x P(x) : There exists a unique xx such that P(x)P(x). (uniqueness quantifier).

DeMorgan's Laws for Quantifiers:

¬∀xP(x)≡∃x¬P(x)¬∃xP(x)≡∀x¬P(x)\neg \forall xP(x) \equiv \exists x \neg P(x) \\ \neg \exists xP(x) \equiv \forall x \neg P(x)

Nested Quantifiers: order matters, read left to right.

Arguments and Validity

An argument in propositional logic is a sequence of propositions. All but the final proposition in the argument are called premises and the final proposition is called the conclusion. An argument is valid if the truth of all its premises implies that the conclusion is true. An argument form in propositional logic is a sequence of compound propositions involving propositional variables. An argument form is valid if no matter which particular propositions are substituted for the propositional variables in its premises, the conclusion is true if the premises are all true.

Rules of Inference

Rule of InferenceTautologyName
pp→q∴q\begin{aligned}p\\ p \to q\\ \hline \therefore q\end{aligned}(p∧(p→q))→q(p \land (p \to q)) \to qModus ponens
¬qp→q∴¬p\begin{aligned}\neg q\\ p \to q\\ \hline \therefore \neg p\end{aligned}(¬q∧(p→q))→¬p(\neg q \land (p \to q)) \to \neg pModus tollens
p→qq→r∴p→r\begin{aligned}p \to q\\ q \to r\\ \hline \therefore p \to r\end{aligned}((p→q)∧(q→r))→(p→r)((p \to q) \land (q \to r)) \to (p \to r)Hypothetical syllogism
p∨q¬p∴q\begin{aligned}p \lor q\\ \neg p\\ \hline \therefore q\end{aligned}((p∨q)∧¬p)→q((p \lor q) \land \neg p) \to qDisjunctive syllogism
p∴p∨q\begin{aligned}p\\ \hline \therefore p \lor q\end{aligned}p→(p∨q)p \to (p \lor q)Addition
p∧q∴p\begin{aligned}p \land q\\ \hline \therefore p\end{aligned}(p∧q)→p(p \land q) \to pSimplification
pq∴p∧q\begin{aligned}p\\ q\\ \hline \therefore p \land q\end{aligned}((p)∧(q))→(p∧q)((p) \land (q)) \to (p \land q)Conjunction
p∨q¬p∨r∴q∨r\begin{aligned}p \lor q\\ \neg p \lor r\\ \hline \therefore q \lor r\end{aligned}((p∨q)∧(¬p∨r))→(q∨r)((p \lor q) \land (\neg p \lor r)) \to (q \lor r)Resolution

Rules of Inference for Quantified Statements

  • Universal Instantiation: If ∀xP(x)\forall x P(x) is true, then P(c)P(c) is true for any element cc in the domain.
  • Universal Generalization: If P(c)P(c) is true for an arbitrary element cc, then ∀xP(x)\forall x P(x) is true.
  • Existential Instantiation: If ∃xP(x)\exists x P(x) is true, then there exists some element cc such that P(c)P(c) is true.
  • Existential Generalization: If P(c)P(c) is true for some element cc, then ∃xP(x)\exists x P(x) is true.

Proof

Terms

  • Proposition: A statement that is true and can be proven, usually less significant than a theorem.
  • Theorem: A major proven statement based on axioms, definitions, and previously established theorems.
  • Axiom: A foundational assumption accepted without proof.
  • Proof: A logical argument establishing the truth of a mathematical statement.
  • Lemma: A helping theorem used in the proof of a more important result.
  • Corollary: A statement that follows directly from a theorem.
  • Conjecture: An unproven statement believed to be true, often awaiting a proof or counterexample.

Techniques

  • Basic Proof
    • Direct Proof: Prove a statement by logical steps from known truths.
    • Proof by Contrapositive: Instead of proving p→qp \rightarrow q, prove ¬q→¬p\neg q \rightarrow \neg p.
    • Vacuous Proof: When pp is always false, so the implication is trivially true.
    • Trivial Proof: When qq is always true regardless of pp.
    • Proof by Contradiction: Assume the negation of the statement, which is ¬(p→q)≡p∧¬q\neg (p \rightarrow q) \equiv p \land \neg q, and derive a contradiction.
  • Case-Based Proof
    • Exhaustive Proof: Check all possible cases individually.
    • Proof by Cases: Break the problem into a finite number of scenarios and prove each one.
    • Without Loss of Generality: Simplify a proof by assuming a specific case that can be generalized.
  • Existence Proof
    • Constructive Proof: Provide a specific example (witness) that satisfies the condition.
    • Non-constructive Proof: Show something exists by contradiction or logical argument, without exhibiting it.
  • Uniqueness Proof: assume two elements xx and yy both satisfy the property, then show x=yx = y.
  • Reasoning Strategies
    • Forward Reasoning: Start from what you know and derive the conclusion step by step.
    • Backward Reasoning: Start from what you want to prove and figure out what needs to be true.
    • Adapting Existing Proofs: Modify or reuse the structure of known proofs for similar problems.
    • Looking for Counterexamples: Search for examples that disprove a statement (especially useful in testing conjectures).
    • Universal Generalization: Prove a property for an arbitrary element, and then conclude it holds for all.

Mathematical Induction

Mathematical Induction

To prove ∀n≥b,P(n)\forall n \ge b, P(n):

  1. Base Step: Prove P(b)P(b).
  2. Inductive Step: Assume P(n)P(n) holds for some n≥bn \ge b, prove P(n+1)P(n+1).

Strong Induction

To prove ∀n≥b,P(n)\forall n \ge b, P(n):

  1. Base Step: Prove P(b),P(b+1),…,P(b+j)P(b),P(b+1),\dots,P(b+j).
  2. Inductive Step: Assume P(b),…,P(n)P(b),\dots,P(n), prove P(n+1)P(n+1).

Structural Induction

To prove ∀x∈S,P(x)\forall x \in S, P(x) when SS is recursively defined.

  1. Basis Step: Show P(b)P(b) for each base element bb.
  2. Recursive Step: Assume PP holds for all smaller ("already constructed") elements; then show it holds for any element formed by the recursive rule.

Number Theory

Base-bb Expansion

decimal (10), binary (2), octal (8), hexadecimal (16).
Base bb Expansion: (ak−1…a0)b(a_{k-1}\dots a_0)_b.
Every positive integer nn has a unique expansion n=ak−1bk−1+ak−2bk−2+⋯+a1b+a0,0≤ai<b, ak−1≠0.n = a_{k-1} b^{k-1} + a_{k-2} b^{k-2} + \cdots + a_1 b + a_0, \quad 0 \le a_i < b,\ a_{k-1}\neq 0.

Divisibility

a∣ba \mid b: aa divides bb and bb is divisible by aa; aa is aa factor or divisor of bb, bb is a multiple of aa. ~ a ∤\nmid b

Let a≠0a\neq0 and a,b,ca,b,c be integers:

  • If a∣ba \mid b and a∣ca \mid c, then a∣(b+c)a \mid (b + c)
  • If a∣ba \mid b, then a∣bca \mid bc for all integers cc
  • If a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c
  • If a∣ba \mid b and a∣ca \mid c, then a∣(sb+tc)a \mid (sb + tc) for all integers s,ts, t

The Division Algorithm

Let aa be an integer and dd a positive integer. Then there are unique integers qq and rr, with 0≤r<d0 \le r < d, such that a=dq+ra = dq + r

dd: divisor, aa: dividend, qq: quotient, rr: remainder
q=a div d, r=a mod dq = a \text{ div } d,\ r = a \bmod d

Modular Arithmetic

Congruence: aa is congruent to bb modulo mm, mm is modulus. a≡b(modm)a \equiv b \pmod{m} is equivalent to

  • m∣(a−b)m \mid (a - b)
  • (a mod m)=(b mod m)(a \bmod m) = (b \bmod m)
  • a=b+kma = b + km

Theorems: If a≡b(modm)a \equiv b \pmod{m} and c≡d(modm)c \equiv d \pmod{m}, then

  • a±c≡b±d(modm)a \pm c \equiv b \pm d \pmod{m}
  • ac≡bd(modm)ac \equiv bd \pmod{m}
  • an≡bn(modm)a^n \equiv b^n \pmod{m}

Properties:

  • (a+b) mod m=((a mod m)+(b mod m)) mod m(a + b)\bmod m = \bigl((a\bmod m) + (b\bmod m)\bigr)\bmod m
  • (ab) mod m=((a mod m) (b mod m)) mod m(ab)\bmod m = \bigl((a\bmod m)\,(b\bmod m)\bigr)\bmod m.

Zm={0,1,…,m−1}\mathbb{Z}_m = \{0,1,\dots,m-1\}

  • a+mb=(a+b) mod ma +_m b = (a + b) \bmod m
  • a⋅mb=(a⋅b) mod ma \cdot_m b = (a \cdot b) \bmod m

Multiplicative Inverse

If aa and mm are relatively prime (gcd⁡(a,m)=1\gcd(a,m)=1) and m>1m>1, then there exists a unique integer a−1a^{-1} with 1≤a−1<m1\le a^{-1}<m such that aa−1≡1(modm)aa^{-1}\equiv 1\pmod m.
Solve for aa−1−tm=1aa^{-1} - tm = 1

Extended Euclidean Algorithm

Purpose: Compute integers s,ts, t such that sx+ty=gcd⁡(x,y)sx + ty = \gcd(x,y)
When gcd⁡(x,n)=1\gcd(x,n)=1, the coefficient s(modn)s \pmod n is the inverse of xx.

  1. Run Euclid's algorithm while recording quotients.
  2. Back-substitute to express gcd⁡(x,y)\gcd(x,y) as a linear combination.

Primes and Common Divisors

Prime and Composite

Fundamental Theorem of Arithmetic: Every integer n>1n > 1 can be written uniquely as a product of primes: n=p1c1p2c2⋯prcrn = p_1^{c_1} p_2^{c_2} \cdots p_r^{c_r}
If nn is a composite integer, then there exists a prime pp such that p∣np \mid n and p≤np \le \sqrt{n}.

Greatest Common Divisor (gcd)

For integers aa, bb (not both zero), the greatest common divisor gcd⁡(a,b)\gcd(a,b) is the largest positive integer dd such that d∣ad \mid a and d∣bd \mid b.

If a=∏ipici, b=∏ipidia = \prod\limits_i p_i^{c_i},\ b = \prod\limits_i p_i^{d_i}, then gcd⁡(a,b)=∏ipimin⁡(ci,di)\gcd(a,b) = \prod\limits_i p_i^{\min(c_i, d_i)}.

The integers aa and bb are relatively prime if gcd⁡(a,b)=1\gcd(a, b) = 1.

Least Common Multiple (lcm)

The least common multiple lcm⁡(a,b)\operatorname{lcm}(a,b) is the smallest positive integer divisible by both aa and bb.

If a=∏ipici, b=∏ipidia = \prod\limits_i p_i^{c_i},\ b = \prod\limits_i p_i^{d_i}, then lcm⁡(a,b)=∏ipimax⁡(ci,di)\operatorname{lcm}(a,b) = \prod\limits_i p_i^{\max(c_i, d_i)}.

ab=gcd⁡(a,b)lcm⁡(a,b)ab = \gcd(a,b)\operatorname{lcm}(a,b)

Euclid's Algorithm for gcd

gcd⁡(a,b)=gcd⁡(a−b,b)\gcd(a, b) = \gcd(a - b, b)
gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a, b) = \gcd(b, a \bmod b)

Bezout's Theorem: If aa and bb are positive integers, then there exist integers ss and tt such that gcd⁡(a,b)=sa+tb\gcd(a,b) = sa + tb

If a,b,ca,b,c are positive integers such that gcd⁡(a,b)=1\gcd(a,b)=1 and a∣bca \mid bc, then a∣ca\mid c.
Let mm be a positive integer and let a,b,ca,b,c be integers. If ac≡bc(modm)ac \equiv bc \pmod{m} and gcd⁡(c,m)=1\gcd(c,m)=1, then a≡b(modm)a \equiv b \pmod{m}

Functions

Precondition: statements that describe valid input.
Postcondition: conditions that output should satisfy.

A function f ⁣:A→Bf\colon A \to B is well-defined if assigns exactly one element of BB to each element of AA. We write f(a)=bf(a) = b if bb is the unique element of BB that ff assigns to a∈Aa\in A.

  • The domain of ff is AA.
  • The codomain of ff is BB.
  • bb is the image of aa, and aa is a preimage of bb.
  • The range (or image) of ff is the set {f(a):a∈A}\{f(a):a\in A\}.

Relations:

  • One-to-one (Injective): if and only if f(a)=f(b)  ⟹  a=bf(a)=f(b)\implies a=b.
    ∣A∣≤∣B∣|A|\le|B| no bigger than
  • Onto (Surjective): if and only if ∀b∈B ∃a∈A f(a)=b\forall b\in B\ \exists a\in A\ f(a)=b.
    ∣A∣≥∣B∣|A|\ge|B| no smaller than
  • Bijection: ff is both injective and surjective.
    • ∣A∣=∣B∣|A|=|B|
    • Cantor-Schroder-Bernstein Theorem: ∣A∣=∣B∣|A|=|B| if and only if ∣A∣≤∣B∣|A|\le|B| and ∣B∣≤∣A∣|B|\le|A|.

Cantor's Diagonalization (Uncountability of P(N)\mathcal{P}(\mathbb{N}))

  1. Goal: Show no bijection f:N→P(N)f: \mathbb{N} \to \mathcal{P}(\mathbb{N}) exists.
  2. Assume an arbitrary function f:N→P(N)f: \mathbb{N} \to \mathcal{P}(\mathbb{N}).
  3. Construct
    Df={ n∈N∣n∉f(n)}.D_f = \{\,n \in \mathbb{N} \mid n \notin f(n)\}.
  4. Claim: Df∈P(N)D_f \in \mathcal{P}(\mathbb{N}) but Df≠f(a)D_f\neq f(a) for every a∈Na\in\mathbb{N}.
  • If a∈Dfa \in D_f, then by definition a∉f(a)a \notin f(a). Thus f(a)≠Dff(a)\neq D_f.
  • If a∉Dfa \notin D_f, then a∈f(a)a \in f(a). Again f(a)≠Dff(a)\neq D_f.
  1. Conclusion: ff is not onto, so ∣N∣≠∣P(N)∣\lvert \mathbb{N}\rvert \neq \lvert \mathcal{P}(\mathbb{N})\rvert. Hence P(N)\mathcal{P}(\mathbb{N}) is uncountable.

Counting

Permutations and Combinations

  • Permutation: An ordered arrangement of all elements of a set of size nn.
    Number of permutations:
    P(n,n)=n!.P(n,n) = n!.
  • rr-Permutation: An ordered arrangement of rr distinct elements chosen from nn.
    P(n,r)=n×(n−1)×⋯×(n−r+1)=n!(n−r)!.P(n,r) = n \times (n-1) \times \cdots \times (n - r + 1) = \frac{n!}{(n - r)!}.
  • Combination: An unordered selection of rr elements from nn.
    (nr)=n!r! (n−r)!.\binom{n}{r} = \frac{n!}{r! \, (n - r)!}.

Binomial Theorem

For x,yx,y and integer n≥0n\ge0,

(x+y)n=∑r=0n(nr) x n−r yr.(x+y)^n = \sum\limits_{r=0}^n \binom{n}{r}\,x^{\,n-r}\,y^r.

Binary Relations

A binary relation RR from AA to BB is any subset R⊆A×BR \subseteq A \times B.
aRba R b denote (a,b)∈R(a, b) \in R. If (a,b)∈R(a, b) \in R, then aa is related to bb by RR.

When A=BA=B, then RR is a relation on AA.

f:A→Bf: A\to B is a relation, (a,f(a))∈Rf(a, f(a)) \in R_f

Alternative Representations

  1. Characteristic Function fTFf_{TF}:
    fTF ⁣:A×B → {T, F},fTF(a,b)={Tif (a,b)∈R,Fif (a,b)∉R.f_{TF}\colon A \times B \,\to\, \{\text{T},\,\text{F}\}, \quad f_{TF}(a,b) = \begin{cases} \text{T} & \text{if } (a,b)\in R,\\ \text{F} & \text{if } (a,b)\notin R. \end{cases}
  2. Adjacency Function fPf_{P}:
    fP ⁣:A → P(B),fP(a)  =  { b∈B:(a,b)∈R}.f_{P}\colon A \,\to\, \mathcal{P}(B), \quad f_{P}(a) \;=\; \{\,b\in B : (a,b)\in R\}.
  3. Set‐of‐Pairs Notation:
    R={ (a,b)∈A×B:some condition holds}.R = \{\,(a,b)\in A\times B : \text{some condition holds}\}.

Properties of Relations

Let R⊆A×AR\subseteq A\times A. Then:

  1. Reflexive: (a,a)∈R, ∀a∈A.(a,a)\in R,\ \forall a\in A.
  2. Symmetric: (a,b)∈R→(b,a)∈R, ∀a,b∈A.(a,b)\in R \to (b,a)\in R ,\ \forall a,b\in A.
  3. Antisymmetric: ((a,b)∈R∧(b,a)∈R)→a=b, ∀a,b∈A.((a,b)\in R \land (b,a)\in R) \to a=b ,\ \forall a,b\in A.
  4. Transitive: ((a,b)∈R∧(b,c)∈R)→(a,c)∈R, ∀a,b,c∈A.((a,b)\in R \land (b,c)\in R) \to (a,c)\in R,\ \forall a,b,c\in A.

Combining Relations

R⊆A×BR \subseteq A \times B and S⊆B×CS \subseteq B \times C, then the composite of RR and SS, S∘RS \circ R is the relation consisting of all ordered pairs (a,c)(a, c), where a∈Aa \in A, c∈Cc \in C, and there exists an element b∈Bb \in B such that (a,b)∈R(a, b) \in R and (b,c)∈S(b, c) \in S.

If RR is a relation on AA, Rn+1=Rn∘RR^{n+1} = R^n \circ R

Equivalence Relations and Partitions

Equivalence Relation

A relation R⊆A×AR\subseteq A\times A is an equivalence relation if it is reflexive, symmetric, and transitive.

a∼ba \sim b denotes aa and bb are equivalent elements with respect to a particular equivalence relation.

Equivalence Class

For a∈Aa\in A, the equivalence class of aa with respect to RR is [a]R={ x∈A:(a, x)∈R}[a]_R = \{\, x\in A : (a,\,x)\in R \}
Every equivalence class is nonempty (since a∈[a]Ra\in [a]_R)
If b∈[a]Rb \in [a]_R, then bb is a representative of this equivalence class.

Partition Induced by an Equivalence Relation

When RR is an equivalence relation on AA, the collection
{ [a]R:a∈A}\{\, [a]_R : a\in A \} is a partition of AA; that is,

  1. Each [a]R≠∅.[a]_R\neq \varnothing.
  2. If (a,b)∈R(a,b)\in R, then [a]R=[b]R.[a]_R = [b]_R.
  3. If (a,b)∉R(a,b)\notin R, then [a]R∩[b]R=∅.[a]_R \cap [b]_R = \varnothing.
  4. ⋃a∈A[a]R=A\bigcup\limits_{a\in A} [a]_R = A

Let RR be an equivalence relation on a set SS. Then the equivalence classes of RR form a partition of SS. Conversely, given a partition {Ai∣i∈I}\{A_i \mid i \in I\} of the set SS, there is an equivalence relation RR that has the sets AiA_i, i∈Ii \in I, as its equivalence classes.

  • From Equivalence Relation to Partition:
    R  ↦  { [a]R:a∈A }.R \;\mapsto\; \{\,[a]_R : a\in A\,\}.
  • From Partition to Equivalence Relation:
    Given a partition {A1,…,Ak}\{A_1,\dots,A_k\} of AA, define
    R={(x,y)∈A×A:∃i, x∈Ai∧y∈Ai}.R = \{ (x,y)\in A\times A : \exists i,\ x\in A_i \land y\in A_i \}.

Partial Order

A relation R⊆A×AR\subseteq A\times A is a partial order if it is reflexive, antisymmetric, transitive.
(A,R)(A, R) is a partially ordered set, or poset. Members of AA are elements of the poset.

Hasse Diagram

For a finite partially ordered set (A,R)(A,R), the Hasse diagram is drawn by:

  1. Omitting self-loops (a,a)(a,a).
  2. Omitting edges implied by transitivity: if (a,c)(a,c) follows from (a,b)(a,b) and (b,c)(b,c), do not draw (a,c)(a,c).
  3. Placing elements as nodes in the plane so that if (a,b)∈R(a,b)\in R (and a≠ba\neq b), then bb is "above" aa. Draw an undirected edge between aa and bb.
Search

Loading search…