Discrete Mathematics for Muggles

Fundamentals of Logic

Statements

  • Statements (or propositions)
    • Declarative sentences that are either true or false but not both
  • Primitive statements
    • There is really no way to break them down into anything simpler

New statements can be obtained from existing ones in two ways

  • Negation
    • We do not consider the negation of a primitive statement to be a primitive statement
    • The negation statement of pp is ¬p\neg{p}
    • NOT
  • Compound statements, using the following logical connectives
    • Conjunction \wedge
      • AND
    • Disjunction \vee
      • OR
      • pqp\vee{q} means inclusive disjunction. True if one or the other of p,qp, q is true or if both of the statements p,qp, q are true
      • pqp\veebar{q} maens exclusive disjunction. True if one or the other of p,qp, q is true but not both of the statements p,qp, q are true
    • Implication \to
      • THEN
      • pqp\to{q}
      • If pp, then qq
      • pp is sufficient for qq
      • pp is a sufficient condition for qq
      • qq is necessary condition for pp
      • qq is a necessary condition for pp
      • pp only if qq
      • The statement pp is called the hypothesis of the implication; qq is called the conclusion.
    • Biconditional or\leftrightarrow\text{or}\Leftrightarrow
      • IF AND ONLY IF
      • IFF
      • pqp\leftrightarrow{q} means pp is necessary and sufficient for qq.

The following is the graph of the truth table.

Truth Table

Tautology and Contradiction

  • Tautology
    • A compound statement is called a tautology if it is true for all truth value assignments for its component statement.
  • Contradiction
    • If a compound statement is false for all such assignments, then it is called a contradiction.

Logical Equivalence

Two statements s1,s2s1, s2 are said to be logically equivalent, and we write s1s2s1\Leftrightarrow s2 , when the statement s1s1 is true (respectively, false) if and only if the statement s2s2 is true (respectively, false).

The Laws of Logic

For any primitive statements p,q,rp, q, r, any tautology T0T_0 , and any contradiction F0F_0,

Law of Double Negation\text{Law of Double Negation}

  • ¬¬pp\neg\neg{p}\Leftrightarrow{p}

DeMorgan’s Laws\text{DeMorgan's Laws}

  • ¬(pq)¬p¬q\neg{(p\vee{q})}\Leftrightarrow\neg p \wedge\neg q
  • ¬(pq)¬p¬q\neg{(p\wedge{q})}\Leftrightarrow\neg p \vee\neg q

Commutative Laws\text{Commutative Laws}

  • pqqpp\vee{q}\Leftrightarrow q\vee{p}
  • pqqpp\wedge{q}\Leftrightarrow q\wedge{p}

Associative Laws\text{Associative Laws}

  • p(qr)(pq)rp\vee(q\vee r)\Leftrightarrow(p\vee q)\vee r
  • p(qr)(pq)rp\wedge(q\wedge r)\Leftrightarrow(p\wedge q)\wedge r

Distributive Laws\text{Distributive Laws}

  • p(qr)(pq)(pr)p\vee(q\wedge r)\Leftrightarrow(p\vee q)\wedge(p\vee r)
  • p(qr)(pq)(pr)p\wedge(q\vee r)\Leftrightarrow(p\wedge q)\vee(p\wedge r)

Idempotent Laws\text{Idempotent Laws}

  • pppp\vee p\Leftrightarrow p
  • pppp\wedge p\Leftrightarrow p

Identity Laws\text{Identity Laws}

  • pF0pp\vee F_0\Leftrightarrow p
  • pT0pp\wedge T_0\Leftrightarrow p

Inverse Laws\text{Inverse Laws}

  • p¬pT0p\vee\neg p\Leftrightarrow T_0
  • p¬pF0p\wedge\neg p\Leftrightarrow F_0

Domination Laws\text{Domination Laws}

  • pT0T0p\vee T_0\Leftrightarrow T_0
  • pF0F0p\wedge F_0\Leftrightarrow F_0

Absorption Laws\text{Absorption Laws}

  • p(pq)pp\vee(p\wedge q)\Leftrightarrow p
  • p(pq)pp\wedge(p\vee q)\Leftrightarrow p

Dual of Statement

  • Let’s say ss is a statement. If ss contains no logical connectives other than \wedge and \vee, then the dual of ss, denoted sds^d, is the statement obtained from ss by replacing each occorrence of \wedge with \vee, T0T_0 with F0F_0 and vice versa.

Here’s an example, if pp is any primitive statement, then

  • pdpp^d\equiv p
  • (¬p)d¬p(\neg{p})^d\equiv\neg{p}
  • pT0p\vee T_0 and pF0p\wedge F_0 are duals of each other

Duality Principle

Let ss and tt be statements that contain no logical connectives other than \wedge and \vee. If sts\Leftrightarrow t, then sdtds^d\Leftrightarrow t^d.

Substitution Rules

  1. Suppose that the compound statement PP is a tautology. If pp is a primitive statement that appears in PP and we replace each occurrence of pp by the same statement qq, then the resulting compound statement P1P_1 is also a tautology.
  2. Let PP be a compound statement where pp is an arbitrary statement that appears in PP, and let qq be a statement such that qpq\Leftrightarrow p. Suppose that in PP we replace one or more occurence of pp by qq. Then this replacement yields the compound statement P1P_1. Under these circumstances P1PP_1\Leftrightarrow P.

For example

P:¬(pq)(¬p¬q)is a tautologyP1:¬[(rs)q][¬(rs)¬q]is also a tautologyP2:¬[(rs)(tu)][¬(rs)¬(tu)]is also a tautology\begin{aligned} P&:\neg(p\vee q)\Leftrightarrow(\neg p\wedge\neg q)\quad\text{is a tautology}\\ P_1&:\neg[(r\wedge s)\vee q]\Leftrightarrow[\neg(r\wedge s )\wedge\neg q]\quad\text{is also a tautology}\\ P_2&:\neg[(r\wedge s)\vee(t\to u)]\leftrightarrow[\neg(r\wedge s)\wedge\neg(t\to u)]\quad\text{is also a tautology} \end{aligned}

Modus Ponens (Rule of Detachment)

  • Statement
    • If pp is true, and pqp\to q is true, then the conclusion qq must also be true

Law of The Syllogism

  • Statement
    • If pp then qq
    • If qq then rr
    • 2 of the aboves imply if pp then rr
  • Math Expression
    • [(pq)(qr)](pr)[(p\to q)\wedge(q\to r)]\to(p\to r)

Modus Tollens

  • Statement
    • If pp then qq, then not qq impies not pp
  • Math Expression
    • [(pq)¬q]¬p[(p\to q)\wedge\neg q]\to\neg p

Rule of Conjunction

  • If p,qp, q are true statement, then pqp\wedge q is also a true statement

Set Theory

Terms Definitions

  • Set

    • A well-defined collection of objects. Neither order nor repetition is relevant for a general set
  • Element

    • Objects inside the set is called elements. They are said to be members of the set
  • Universe

    • The set that contains all possible elements relevant to a particular discussion or problem
  • Subset

    • If every element of CC is an element of DD, then CC is a subset of DD, which will be denoted by CDC \subseteq D
  • Proper subset

    • If, in addition, DD contains an element that is not in CC, then CC is called a proper subset of DD. It will be denoted by CDC \subset D
  • Cardinality

    • Also called size, the number of elements in a set, denoted by A|A|
  • Equal

    • CC & DD are said to be equal when CDC \subseteq D and DCD \subseteq C

Subset Relations

Let A,B,CUA, B, C \subseteq U.

  1. If ABA \subseteq B and BCB \subseteq C, then ACA \subseteq C.
  2. If ABA \subset B and BCB \subseteq C, then ACA \subset C.
  3. If ABA \subseteq B and BCB \subset C, then ACA \subset C.
  4. If ABA\subset B and BCB\subset C, then ACA\subset C.

Null Set

  • The null set, or empty set, is the (unique) set containing no elements. It is denoted by ϕ\phi or {}\{\}.
  • ϕ=0|\phi| = 0, but {0}ϕ\{0\}\neq\phi.
  • ϕ{ϕ}\phi\neq\{\phi\}.

Theorem 3.2

For any universe UU, let AUA \subseteq U. Then ϕA\phi \subseteq A, and if AϕA\neq\phi, then ϕA\phi\subset A.

Power Set

  • If AA is a set from universe UU, the power set of AA, denoted P(A)P(A), is the collection (or set) of all subsets of AA.

For the set C={1,2,3,4}C=\{1, 2, 3, 4\}

P(C)={,{1},{2},{3},{4},{1,2},{1,3},{1,4},{2,3},{2,4},{3,4},{1,2,3},{1,2,4}{1,3,4}{2,3,4},C}P(C)=\{\varnothing,\{1\},\{2\},\{3\},\{4\},\{1,2\},\{1,3\},\{1,4\},\{2,3\},\{2, 4\},\{3,4\},\{1,2,3\},\{1,2,4\}\{1,3,4\}\{2,3,4\}, C\}

For any finite set AA with A=n0|A|=n \geq 0, we find that AA has 2n2^n subsets and that P(A)=2n|P(A)|=2^n. For any 0kn0 \leq k \leq n, there are (nk)\binom{n}{k} subsets of size kk. Counting the subsets of AA according to the number, kk, of elements in a subset, we have the combinatorial identity (n0)+(n1)+(n2)++(nn)=k=0n(nk)=2n\binom{n}{0}+\binom{n}{1}+\binom{n}{2}+\cdots+\binom{n}{n}=\sum_{k=0}^n\binom{n}{k}=2^n, for n0n \geq 0.

Gray Code

  • A systematic way to represent the subsets of a given nonempty set can be accomplished by using a coding scheme known as a Gray code.

Gray Code

Pascal’s Triangle

Pascal's Triangle

Set of Numbers

  1. Z=\mathbf{Z}= the set of integers ={0,1,1,2,2,3,3,}=\{0,1,-1,2,-2,3,-3, \ldots\}
  2. N=\mathbf{N}= the set of nonnegative integers or natural numbers ={0,1,2,3,}=\{0,1,2,3, \ldots\}
  3. Z+=\mathbf{Z}^{+}=the set of positive integers ={1,2,3,}={xZx>0}=\{1,2,3, \ldots\}=\{x \in \mathbf{Z} \mid x>0\}
  4. Q=\mathbf{Q}= the set of rational numbers ={a/ba,bZ,b0}=\{a / b \mid a, b \in \mathbf{Z}, b \neq 0\}
  5. Q+=\mathbf{Q}^{+}=the set of positive rational numbers ={rQr>0}=\{r \in \mathbf{Q} \mid r>0\}
  6. Q=\mathbf{Q}^*= the set of nonzero rational numbers
  7. R=\mathbf{R}= the set of real numbers
  8. R+=\mathbf{R}^{+}=the set of positive real numbers
  9. R=\mathbf{R}^*= the set of nonzero real numbers
  10. C=\mathbf{C}= the set of complex numbers ={x+yix,yR,i2=1}=\left\{x+y i \mid x, y \in \mathbf{R}, i^2=-1\right\}
  11. C=\mathbf{C}^*= the set of nonzero complex numbers
  12. For each nZ+,Zn={0,1,2,,n1}n \in \mathbf{Z}^{+}, \mathbf{Z}_n=\{0,1,2, \ldots, n-1\}
  13. For real numbers a,ba, b with a<b,[a,b]={xRaxb}a<b,[a, b]=\{x \in \mathbf{R} \mid a \leq x \leq b\}, (a,b)={xRa<x<b},[a,b)={xRax<b}(a, b)=\{x \in \mathbf{R} \mid a<x<b\},[a, b)=\{x \in \mathbf{R} \mid a \leq x<b\}, (a,b]={xRa<xb}(a, b]=\{x \in \mathbf{R} \mid a<x \leq b\}. The first set is called a closed interval, the second set an open interval, and the other two sets half-open intervals.

Closed Binary Operations

  • The addition and multiplication of positive integers are said to be closed binary operations on Z+\mathbf{Z}^{+}.
  • Two operands, hence the operation is called binary.
  • Since a+bZ+a+b \in \mathbf{Z}^{+}when a,bZ+a, b \in \mathbf{Z}^{+}, we say that the binary operation of addition (on Z+\mathbf{Z}^{+}) is closed.

Binary Operations for Sets

For A,BUA, B \subseteq U, we define the following

  • Union

    • AB={xxAxB}A \cup B = \{x\mid x\in A\vee x \in B\}
  • Intersection

    • AB={xxAxB}A \cap B = \{x\mid x\in A\wedge x \in B \}

    • Symmetric Difference (like XOR)

      • AB={x(xAB)xAB}={xxABxAB}A \triangle B=\{x\mid(x\in A\vee \in B)\wedge x\notin A\cap B\}=\{x\mid x \in A\cup B \wedge x \notin A \cap B\}

Disjoint

Let S,TUS, T \subseteq U. The sets SS and TT are called disjoint, or mutually disjoint, when ST=ϕS \cap T = \phi.

Theorem 3.3

If S,TUS, T \subseteq U, then S,TUS, T \subseteq U are disjoint if and only if ST=STS \cup T = S \triangle T.

Complement

  • For a set AUA \subseteq U, the complement of AA, denoted UAU - A, or AA, is given by {xxUxA}\{x \mid x \in U \wedge x \notin A\}.

  • For A,BUA, B \subseteq U, the (relative) complement of AA in BB, denoted BAB - A, is given by {xxBxA}\{x \mid x \in B \wedge x \notin A\}.

Subset, Union, Intersection, and Complement

Theorem 3.4

For any universe UU and any sets A,BUA, B \subseteq U, the following statements are equivalent:

  1. ABA \subseteq B
  2. AB=BA \cup B = B
  3. AB=AA\cap B = A
  4. BA\overline{B}\subseteq\overline{A}

The Laws of Set Theory

For any sets A,BA, B and CC taken from a universe UU.

Law of Double Complement\text{Law of Double Complement}

  • A=A\overline{\overline{A}}=A

DeMorgan’s Laws\text{DeMorgan's Laws}

  • AB=AB\overline{A\cup B}=\overline{A}\cap\overline{B}
  • AB=AB\overline{A\cap B}=\overline{A}\cup\overline{B}

Commutative Laws\text{Commutative Laws}

  • AB=BAA\cup B=B\cup A
  • AB=BAA\cap B=B\cap A

Associative Laws\text{Associative Laws}

  • A(BC)=(AB)CA\cup(B\cup C)=(A\cup B)\cup C
  • A(BC)=(AB)CA\cap(B\cap C)=(A\cap B)\cap C

Distributive Laws\text{Distributive Laws}

  • A(BC)=(AB)(AC)A\cup(B\cap C)=(A\cup B)\cap (A\cup C)
  • A(BC)=(AB)(AC)A\cap(B\cup C)=(A\cap B)\cup(A\cap C)

Idempotent Laws\text{Idempotent Laws}

  • AA=AA\cup A=A
  • AA=AA\cap A=A

Identity Laws\text{Identity Laws}

  • Aϕ=AA\cup\phi=A
  • AU=AA \cap U = A

Inverse Laws\text{Inverse Laws}

  • AA=UA\cup\overline{A}=U
  • AA=ϕA\cap\overline{A}=\phi

Domination Laws\text{Domination Laws}

  • AU=UA\cup U=U
  • Aϕ=ϕA\cap\phi=\phi

Absorption Laws\text{Absorption Laws}

  • A(AB)=AA\cup(A\cap B)=A
  • A(AB)=AA\cap(A\cup B)=A

Dual

Let ss be a (general) statement dealing with the equality of two set expressions. Each such expression may involve one or more occurrences of sets (such as AA, A\overline{A}, BB, B\overline{B}, etc.), one or more occurrences of ϕ\phi and UU, and only the set operation symbols \cap and \cup. The dual of ss, denoted sds^d , is obtained from ss by replacing (1) each occurrence of ϕ\phi and UU (in ss) by UU and ϕ\phi, respectively; and (2) each occurrence of \cap and \cup (in ss) by \cup and \cap, respectively.

Theorem 3.5

  • Let ss denote a theorem dealing with the equality of two set expressions. Then sds^d , the dual of ss, is also a theorem.
  • This result cannot be applied to particular situations but only to results (theorems) about sets in general

Index Set

Let II be a nonempty set and UU a universe. For each iIi\in I let AiUA_i \subseteq U. Then II is called an index set (or set of indices), and each iIi \in I is called an index. Under these conditions,

iIAi={xxAifor at least one iI}\displaystyle\bigcup_{i\in I}A_{i}=\{x\mid x\in A_{i}\quad \text{for at least one } i\in{I}\},

iIAi={xxAifor every iI}\displaystyle\bigcap_{i\in I}A_i=\{x\mid x\in A_i\quad\text{for every }i\in{I}\}.

For example, let I={3,4,5,6,7}I=\{3, 4, 5, 6, 7\}, and for each iIi\in{I} let Ai={1,2,3,,i}U=Z+A_i=\{1, 2, 3, \dots, i\}\subseteq{U}=\mathbf{Z}^{+}. Then iIAi=i=37Ai={1,2,3,,7}=A7\bigcup_{i\in{I}}A_i=\bigcup^7_{i=3}A_i=\{1, 2, 3,\dots, 7\}=A_7, whereas iIAi={1,2,3}=A3\bigcap_{i\in{I}}A_i=\{1, 2, 3\}=A_3.

Generalized DeMorgan’s Laws

Let II be an index set where for each iIi \in I, AiUA_i \subseteq U. Then,

  • iIAi=iIAi\displaystyle\overline{\bigcup_{i\in I}A_i}=\bigcap_{i\in I}\overline{A_i}
  • iIAi=iIAi\displaystyle\overline{\bigcap_{i\in I}A_i}=\bigcup_{i\in I}\overline{A_i}

Definition for Probability

Under the assumption of equal likelihood, let II be the sample space for an experiment EE. Any subset AA of II, including the empty subset, is called an event. Each element of II determines an outcome, so if I=n|I| = n and aI,AIa \in I, A \subseteq I, then Pr({a})Pr(\{a\}) = The probability that {a}\{a\} (or, aa) occurs = {a}I=1n\frac{|\{a\}|}{I} = \frac{1}{n}, and Pr(A)Pr(A) = The probability that AA occurs = AI=An\frac{|A|}{|I|} = \frac{|A|}{n}.

Cross Product

For sets AA, BB, the Cartesian product, or cross product, of AA and BB is denoted by A×BA \times B and equals {(a,b)aA,bB}\{(a, b)\mid a \in A, b \in B\}.

Properties of Integer