MT131 - Discrete Mathematics Lecture Flashcards

THE FOUNDATIONS: LOGIC

  • Mathematical Logic Definition: This is a tool for working with compound statements. It is the study of correct reasoning.

  • Applications of Logic:

    • In Mathematics: Used to prove theorems.

    • In Computer Science: Used to prove that programs perform exactly what they are supposed to do.

PROPOSITIONAL LOGIC

  • Definition of a Proposition: A proposition (denoted by letters like pp, qq, rr) is a declarative statement that is either True (TT) or False (FF), but not both or anything in between.

  • Examples of Propositions:

    • "Washington, D.C., is the capital of USA"

    • "California is adjacent to New York"

    • "1+2=31 + 2 = 3"

  • Non-Propositions:

    • Questions: "What time is it?"

    • Meaningless statements: "La la la la la."

    • Commands: "Read this carefully!"

    • Expressions with non-truth values: "1+21 + 2"

    • Expressions with unknown variables: "1+2=x1 + 2 = x"

LOGICAL OPERATORS AND CONNECTIVES

  • Operands and Operators: An operator combines one or more operands into a larger expression.

    • Unary Operators: Take one operand (e.g., −3-3).

    • Binary Operators: Take two operands (e.g., 3×43 \times 4).

    • Boolean Operators: Operate on propositions or truth values.

Popular Boolean Operators
  1. Negation (NOT): Symbol ¬\neg. Arity: Unary. Definition: Let pp be a proposition; the negation is ¬p\neg p (not pp). If p="London is a city"p = \text{"London is a city"}, then ¬p="London is not a city"\neg p = \text{"London is not a city"}.

    • Truth Table for NOT:

      • If p=Tp = T, then ¬p=F\neg p = F

      • If p=Fp = F, then ¬p=T\neg p = T

  2. Conjunction (AND): Symbol ∧\wedge. Arity: Binary. Definition: The proposition "p AND qp \text{ AND } q" is true only when both pp and qq are true.

    • Truth Table for AND:

      • T∧T=TT \wedge T = T

      • T∧F=FT \wedge F = F

      • F∧T=FF \wedge T = F

      • F∧F=FF \wedge F = F

  3. Disjunction (OR): Symbol ∨\vee. Arity: Binary. Also called "Inclusive OR." Definition: True if at least one of the propositions is true.

    • Truth Table for OR:

      • T∨T=TT \vee T = T

      • T∨F=TT \vee F = T

      • F∨T=TF \vee T = T

      • F∨F=FF \vee F = F

  4. Exclusive OR (XOR): Symbol ⊕\oplus. Arity: Binary. Definition: True if exactly one of pp or qq is true, but not both.

    • Truth Table for XOR:

      • T⊕T=FT \oplus T = F

      • T⊕F=TT \oplus F = T

      • F⊕T=TF \oplus T = T

      • F⊕F=FF \oplus F = F

  5. Implication (Condition): Symbol →\rightarrow. Nickelname: IMPLIES. Definition: p→qp \rightarrow q states that if pp is true, then qq must be true. If pp is false, the statement is true regardless of qq. pp is the hypothesis/antecedent; qq is the conclusion/consequent.

    • Truth Table for Implication:

      • T→T=TT \rightarrow T = T

      • T→F=FT \rightarrow F = F (The only False case)

      • F→T=TF \rightarrow T = T

      • F→F=TF \rightarrow F = T

  6. Biconditional: Symbol ↔\leftrightarrow. Nickname: IFF (If and only if). Definition: True only when pp and qq have the same truth value.

Precedence of Logical Operators
  1. Parentheses: ()()

  2. Negation: ¬\neg

  3. Conjunction/Disjunction/XOR: ∧\wedge, ∨\vee, ⊕\oplus

  4. Implication/Biconditional: →\rightarrow, ↔\leftrightarrow

  5. Evaluation direction: Left to Right.

LOGICAL EQUIVALENCES AND LAWS

  • Tautology: A compound proposition that is always True (e.g., p∨¬p≡Tp \vee \neg p \equiv T).

  • Contradiction: A compound proposition that is always False (e.g., p∧¬p≡Fp \wedge \neg p \equiv F).

  • Contingency: A compound proposition that is neither a tautology nor a contradiction.

  • Logical Equivalence (≡\equiv or ⇔\Leftrightarrow): Compound propositions that always have the same truth values.

Key Logic Laws
  • Identity Laws: p∧T≡pp \wedge T \equiv p; p∨F≡pp \vee F \equiv p

  • Domination Laws: p∨T≡Tp \vee T \equiv T; p∧F≡Fp \wedge F \equiv F

  • Idempotent Laws: p∨p≡pp \vee p \equiv p; p∧p≡pp \wedge p \equiv p

  • Double Negation: ¬(¬p)≡p\neg(\neg p) \equiv p

  • Commutative Laws: p∨q≡q∨pp \vee q \equiv q \vee p; p∧q≡q∧pp \wedge q \equiv q \wedge p

  • Associative Laws: (p∨q)∨r≡p∨(q∨r)(p \vee q) \vee r \equiv p \vee (q \vee r); (p∧q)∧r≡p∧(q∧r)(p \wedge q) \wedge r \equiv p \wedge (q \wedge r)

  • Distributive Laws: p∨(q∧r)≡(p∨q)∧(p∨r)p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r); p∧(q∨r)≡(p∧q)∨(p∧r)p \wedge (q \vee r) \equiv (p \wedge q) \vee (p \wedge r)

  • De Morgan's Laws: ¬(p∧q)≡¬p∨¬q\neg(p \wedge q) \equiv \neg p \vee \neg q; ¬(p∨q)≡¬p∧¬q\neg(p \vee q) \equiv \neg p \wedge \neg q

  • Implication Representation: p→q≡¬p∨qp \rightarrow q \equiv \neg p \vee q

PREDICATES AND QUANTIFIERS

  • Predicates: A part of a sentence that characterizes a variable (the subject). Example: In "x>3x > 3", xx is the variable and "is greater than 3" is the predicate P(x)P(x).

  • Universal Quantifier (∀\forall): "For all." ∀xP(x)\forall x P(x) asserts that P(x)P(x) is true for every xx in the domain.

  • Existential Quantifier (∃\exists): "There exists." ∃xP(x)\exists x P(x) asserts that P(x)P(x) is true for at least one xx in the domain.

  • Negating Quantifiers:

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

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

SET THEORY

  • Set: An unordered collection of objects. Objects are called elements or members.

  • Notation: a∈Aa \in A (element is in the set); a∉Aa \notin A (element is not in the set).

  • Empty Set (∅\emptyset): A unique set containing no elements. ∅={}\emptyset = \{\}.

Important Number Sets
  • N={0,1,2,3,… }\mathbb{N} = \{0, 1, 2, 3, \dots\} (Natural numbers)

  • Z={…,−2,−1,0,1,2,… }\mathbb{Z} = \{\dots, -2, -1, 0, 1, 2, \dots\} (Integers)

  • Z+={1,2,3,… }\mathbb{Z}^+ = \{1, 2, 3, \dots\} (Positive integers)

  • Q=Set of rational numbers\mathbb{Q} = \text{Set of rational numbers}

  • R=Set of real numbers\mathbb{R} = \text{Set of real numbers}

  • C=Set of complex numbers\mathbb{C} = \text{Set of complex numbers}

Set Operations
  • Subset (S⊆TS \subseteq T): Every element of SS is also an element of TT.

  • Proper Subset (S⊂TS \subset T): S⊆TS \subseteq T and S≠TS \neq T.

  • Union (A∪BA \cup B): Elements in AA, or BB, or both. A∪B={x∣x∈A∨x∈B}A \cup B = \{x \mid x \in A \vee x \in B\}.

  • Intersection (A∩BA \cap B): Elements in both AA and BB. A∩B={x∣x∈A∧x∈B}A \cap B = \{x \mid x \in A \wedge x \in B\}.

  • Difference (A−BA - B): Elements in AA but not in BB. A−B={x∣x∈A∧x∉B}A - B = \{x \mid x \in A \wedge x \notin B\}.

  • Symmetric Difference (A⊕BA \oplus B): Elements in AA or BB but not both. (A−B)∪(B−A)(A - B) \cup (B - A).

  • Complement (Aˉ\bar{A}): Elements in the universal set UU that are not in AA.

  • Cardinality (∣S∣|S|): The number of distinct elements in a set.

  • Power Set (P(S)P(S)): The set of all subsets of SS. If ∣S∣=n|S| = n, then ∣P(S)∣=2n|P(S)| = 2^n.

  • Cartesian Product (A×BA \times B): The set of ordered pairs (a,b)(a, b) where a∈Aa \in A and b∈Bb \in B.

FUNCTIONS

  • Definition: A function f:A→Bf: A \rightarrow B assigns each element of domain AA to exactly one element of codomain BB.

  • Injective (One-to-One): ff is injective if f(a)=f(b)f(a) = f(b) implies a=ba = b for all a,ba, b in the domain.

  • Surjective (Onto): ff is surjective if every element in the codomain has at least one preimage in the domain.

  • Bijective: A function that is both injective and surjective (one-to-one correspondence).

  • Inverse Function (f−1f^{-1}): Only exists if the function is a bijection. Reverses the mapping.

  • Floor Function (⌊x⌋\lfloor x \rfloor): Largest integer less than or equal to xx.

  • Ceiling Function (⌈x⌉\lceil x \rceil): Smallest integer greater than or equal to xx.

  • Factorial (n!n!): f(n)=n(n−1)...(1)f(n) = n(n-1)...(1). Note: 0!=10! = 1.

NUMBER THEORY AND CRYPTOGRAPHY

Division and Modular Arithmetic
  • Divisibility: a∣ba \mid b means aa divides bb (b=acb = ac for some integer cc).

  • Division Algorithm: For integer aa and positive integer dd, there exist unique integers qq (quotient) and rr (remainder) such that a=d×q+ra = d \times q + r and 0≤r<d0 \le r < d.

    • q=a div dq = a \text{ div } d

    • r=a mod dr = a \text{ mod } d

  • Modular Congruence: a≡b(modm)a \equiv b \pmod{m} if mm divides (a−b)(a - b), implying a mod m=b mod ma \text{ mod } m = b \text{ mod } m.

Primes and Greatest Common Divisors
  • Prime: A positive integer p>1p > 1 whose only factors are 11 and pp.

  • Fundamental Theorem of Arithmetic: Every positive integer >1> 1 has a unique prime factorization.

  • Greatest Common Divisor (gcd(a,b)\text{gcd}(a, b),): The largest integer that divides both aa and bb.

  • Least Common Multiple (lcm(a,b)\text{lcm}(a, b),): The smallest positive integer that is a multiple of both aa and bb.

  • Relation: gcd(a,b)×lcm(a,b)=ab\text{gcd}(a, b) \times \text{lcm}(a, b) = ab

Cryptology
  • Caesar Cipher: Encryption function f(p)=(p+3)(mod26)f(p) = (p + 3) \pmod{26}. Decryption: f−1(p)=(p−3)(mod26)f^{-1}(p) = (p - 3) \pmod{26}.

  • Hashing Functions: Used to map data to memory locations. Example: h(x)=(x+c)(modm)h(x) = (x + c) \pmod{m}.

Number Representations
  • Binary expansion: Base 2.

  • Octal expansion: Base 8.

  • Hexadecimal expansion: Base 16 (Digits: 0−9,A−F0-9, A-F where A=10A=10 to F=15F=15).

  • Conversion to Decimal: Multiply each digit by the base raised to its positional power.

COUNTING AND DISCRETE PROBABILITY

Counting Rules
  • Product Rule: If a task consists of sequential tasks with n1n_1 and n2n_2 ways, there are n1×n2n_1 \times n_2 total ways.

  • Sum Rule: If tasks are disjoint, there are n1+n2n_1 + n_2 ways.

  • Subtraction Rule (Inclusion-Exclusion): Total ways = n1+n2−ways common to bothn_1 + n_2 - \text{ways common to both}.

  • Division Rule: There are n/dn/d ways to do a task if for every way ww, exactly dd of the nn ways correspond to ww.

Permutations and Combinations
  • Permutations (P(n,r)P(n, r)): Ordered arrangements. P(n,r)=n!(n−r)!P(n, r) = \frac{n!}{(n-r)!}.

  • Combinations (C(n,r)C(n, r)): Unordered selections. C(n,r)=n!r!(n−r)!C(n, r) = \frac{n!}{r!(n-r)!}.

Discrete Probability
  • Laplace's Definition: For a finite sample space SS of equally likely outcomes, the probability of event EE is p(E)=∣E∣∣S∣p(E) = \frac{|E|}{|S|}.

  • Complementary Event: p(Eˉ)=1−p(E)p(\bar{E}) = 1 - p(E).

  • Union of Events: p(E1∪E2)=p(E1)+p(E2)−p(E1∩E2)p(E_1 \cup E_2) = p(E_1) + p(E_2) - p(E_1 \cap E_2).

  • Bernoulli Trials: Probability of exactly kk successes in nn independent trials with probability of success pp and failure q=(1−p)q = (1 - p) is given by:

    • b(k;n,p)=C(n,k)pkqn−kb(k; n, p) = C(n, k) p^k q^{n-k}

RELATIONS

  • Binary Relation: A subset of A×BA \times B.

  • Relation Properties on Set AA:

    • Reflexive: "∀a∈A,(a,a)∈R""\forall a \in A, (a, a) \in R"

    • Irreflexive: "∀a∈A,(a,a)∉R""\forall a \in A, (a, a) \notin R"

    • Symmetric: "(a,b)∈R↔(b,a)∈R""(a, b) \in R \leftrightarrow (b, a) \in R"

    • Antisymmetric: "If (a,b)∈R and (b,a)∈R, then a=b""\text{If } (a, b) \in R \text{ and } (b, a) \in R, \text{ then } a = b"

    • Transitive: "If (a,b)∈R and (b,c)∈R, then (a,c)∈R""\text{If } (a, b) \in R \text{ and } (b, c) \in R, \text{ then } (a, c) \in R"

  • Equivalence Relation: A relation that is reflexive, symmetric, and transitive.

  • Partial Ordering (Poset): A relation that is reflexive, antisymmetric, and transitive.

  • Hasse Diagrams: Used to represent partial orderings after removing self-loops and transitive edges.

GRAPHS AND TREES

Graph Terminology
  • Simple Graph: Undirected, no loops, no multiple edges.

  • Multigraph: May have multiple edges between the same vertices.

  • Pseudograph: May include loops and multiple edges.

  • Degree of a Vertex (deg(v)\text{deg}(v)): Number of incident edges.

  • Handshaking Theorem: ∑v∈Vdeg(v)=2∣E∣\sum_{v \in V} \text{deg}(v) = 2|E| (Sum of degrees is twice the number of edges).

  • Connected Graph: Path exists between every pair of vertices.

Trees
  • Tree Definition: A connected undirected simple graph with no simple circuits.

  • Properties:

    • A tree with nn vertices has exactly n−1n-1 edges.

    • A unique simple path exists between any two vertices.

  • Rooted Tree: One node is the root; edges are directed away from it.

    • Leaf: Node with no children.

    • Internal Node: Node with at least one child.

  • mm-ary Tree: Every internal vertex has no more than mm children. In a full mm-ary tree, every internal vertex has exactly mm children.

  • Balanced Tree: Heights of all leaves differ by at most 1.