Concepts you should know before the final (CSCI 2824, Spring 2015)

Logic (Chapter 1)

Propositional logic (Sect 1.3)

  • A proposition is a statement that has a truth value (which is either true or false).

  • Logical operators

    • AND (land)

    • OR (lor)

    • negation (neg)

  • Logical equivalence of two propositions:

    • two propositions p and q are logically equivalent if they have the same truth values.

    • we denote the logical equivalence of p and q by pequiv q

  • Truth table

Predicate logic (Sect 1.4)

  • predicates

    • a predicate is a statement that incorporates a variable

    • e.g. P(x): x>15 is a predicate

  • set membership

    • xin D means x in D

  • quantifiers

    • forall means “for all”; e.g. forall, xin D means “for all x in D

    • exists means “there exists”; e.g. exists, xin D means “for some x in D

    • we can get a quantified statement by combining quantifiers and predicates: e.g. forall,xin mathbb{R} (x^2geq0)

  • negating a quantified statement (Proposition 1, Page 45):

    • e.g. neg(forall, xin D  (p(x)))  equiv   exists, xin D ( neg p(x) )

    • e.g. neg(exists, xin D  (p(x)))  equiv   forall, xin D ( neg p(x) )

Implications (Sect 1.5)

  • pimplies q

    • p is called the hypothesis/premise/assumption

    • q is called the consequence

    • pimplies q means “if the premise p is true, then the consequence q must be true too” (or p implies q)

  • piff q means +(,pimplies q, ),land,(,qimplies p,).

    • iff reads if and only if.

    • On paper we also write iff in short.

  • The proposition pimplies q is true if and only if either one (or both) of the following is true:

    • p is false (i.e., the premise does not hold)

    • q is true (i.e., the consequence always holds)

  • Hence pimplies q is logically equivalent to neg p lor q

  • negating an implication

    • neg(pimplies q)  equiv neg(neg p lor q) equiv pland neg q

    • in other words, an implication is false if and only if the hypothesis holds true but the consequence is false.

  • contrapositive of pimplies q is neg qimplies neg p

    • an implication is always logically equivalent to its contrapositive

    • the contrapositive of forall, x  (p(x)implies q(x)) is forall, x (neg q(x)implies neg p(x)).

    • the contrapositive of exists, x  (p(x)implies q(x)) is exists, x (neg q(x)implies neg p(x)).

  • converse of pimplies q is +qimplies p

    • even if an implication is true, its converse may be false

    • e.g. the converse of “if xgeq1, then x^2geq1 (which is a true statement) is “if x^2geq1, then xgeq 1” (which is a false statement).

    • the converse of forall, x  (p(x)implies q(x)) is forall, x (q(x)implies p(x)).

    • the contrapositive of exists, x  (p(x)implies q(x)) is exists, x (q(x)implies p(x)).

  • inverse of pimplies q is neg pimplies neg q

    • the inverse of an implication is formed by taking the contrapositive of the converse.

    • given an implication, its inverse and the converse are always logically equivalent.

    • the inverse of forall, x  (p(x)implies q(x)) is forall, x (neg p(x)implies neg q(x)).

    • the inverse of exists, x  (p(x)implies q(x)) is exists, x (neg p(x)implies neg q(x)).

Proof techniques (Chapter 2)

  • Direct proofs (Sect 2.1)

  • Proof by contrapositive (Sect 2.1)

  • Proof by cases (Sect 2.2)

  • Proof by contradiction (Sect 2.4)

  • Weak induction (Sect 2.3-2.4)

    • Here is how we prove a statement of the form forall, ninmathbb{N} (p(n)).

    • Step 1: prove the base case, i.e., show that p(1) is true.

      • Beware!! the index for the base case is the smallest index for which the statement-to-be-proved is supposed to hold. (Not necessarily the first index of the recurrence.)

    • Step 2: state the induction hypothesis:  forall, ninmathbb{N} (text{ if } p(n)text{ is true},  text{ then } p(n+1)text{ is true too. })

    • Step 3: prove the above statement.

      • Start with “Fix any ninmathbb{N} and suppose that p(n) is true.”

      • Then show that p(n+1) is true, usually use the recurrence relation and the assumption that p(n) holds.

  • Strong induction (Sect 2.4)

    • Here is how we prove a statement of the form forall, ninmathbb{N} (p(n)) concerning recursive sequences of the form a_1=(some number), a_2=(some number), a_n defined in terms of a_{n-1} and a_{n-2}.

    • Step 1: prove the base cases.

      • Show that p(1) and p(2) are true.

    • Step 2: state the induction hypothesis: forall, ninmathbb{N} (text{ if } p(n)text{ and }p(n+1)text{ are true},  text{ then } p(n+2)text{ is true too. })

    • Step 3: prove the above statement.

  • Side topics

    • Division theorem (Theorem 8, Page 103)

    • Pigeonhole principle (Theorem 8, Page 143)

Set theory (Chapter 3)

  • A set is a collection of “objects”.

  • These objects in the set are formally called elements.

  • There are three common ways to describe a set:

    • explicit listing: all elements are listed.

      • E.g.A={1,3,5,7,9}

    • form description

      • E.g. A={2n | ninmathbb{Z}}

    • property description

      • E.g. A={minmathbb{Z} |  m!mod!2=0}.

  • We always use curly brackets to contain the elements.

  • Elements in a set are unordered and nonrepeating.

  • Some common sets that we use:

    • mathbb{R}: the set of real numbers

    • mathbb{R}_+: the set of nonnegative real numbers

    • mathbb{Z}: the set of integers

    • mathbb{Z}_+: the set of nonnegative integers

    • mathbb{N}: the set of natural numbers

    • for real numbers aleq b:

      • [a,b]triangleq{tinmathbb{R} | aleq tleq b};

      • (a,b)triangleq{tinmathbb{R} | a< t <b };

      • (a,b]triangleq{tinmathbb{R} | a< tleq b};

      • [a,b)triangleq{tinmathbb{R} | aleq t< b}.

Basic notation (Sect 3.1)

  • For any set A,

    • xin A means x is an element of A;

    • xnotin A means x is not an element of A.

  • For any sets A and B,

    • Asubseteq B means A is a subset of B, meaning xin Aimplies xin B

    • Asubset B means A is a proper subset of B, meaning +Asubseteq B and Aneq B.

  • The empty set is a set that has no elements, and is denoted by emptyset.

Set operations (Sect 3.1 and 3.2)

Let A,B,U be sets and suppose that Asubseteq U, Bsubseteq U. Here we assume U to be the universal set (which simply means that everything happens inside U).

  • Acup B (which reads A union B) is defined as the set {x | xin Alor xin B}.

  • Acap B (which reads A interset B) is defined as the set {x | xin Aland xin B}.

  • A- B or Asetminus B is defined as the set {x | xin Aland xnotin B}.

  • The complement of A (with respect to the universal set U) is defined as A^ctriangleq U-A.

  • The Cartesian product of A and B is defined as the set of all 2-tuples (i.e., ordered lists of length 2) with the first component from A and the second one from B. The notation is Atimes B triangleq{(a,b) | ain Aland bin B}.

  • We use A^k to denote Atimes A times cdots A (k copies of A here), which contains k-tuples (i.e., ordered lists of length k) with all components from A.

  • The power set of A is the set of all subsets of A, and is denoted by either 2^A or mathcal{P}(A).

  • A partiton of A is a set of disjoint subsets of A such that their union is A.

Cardinality and inclusion-exclusion principle (Sect 3.1 and 3.2)

Let A and B be sets.

  • If A has finitely many elements, we say that A is a finite set; otherwise we say that A is an infinite set.

  • Suppose that A is a finite set.

    • The cardinality of A is defined as the number of elements of A, and this number is denoted by |A|.

    • Then |2^A|=2^{|A|}.

  • Suppose that A and B are finite sets.

    • Inclusion-Exclusion principle: |Acup B|=|A|+|B|-|Acap B|.

    • |Atimes B|= |A|cdot |B|.

Relations and functions (Chapter 4)

Relations (Sect 4.1, 4.4, 4.5)

  • A relation from A to B is a subset of Atimes B.

  • A relation over A is a subset R of Atimes A.

    • R is said to be symmetric if (a,b)in R iff (b,a).

    • R is said to be reflexive if (a,a)in R for all ain A.

    • R is said to be transitive if (a,b),(b,c)in R implies (a,c)in R.

    • R is said to be an equivalence relation if R is symmetric, reflexive and transitive.

Functions

  • A function from A to B is a relation F from A to B such that:

    • for every ain A, there is exactly one bin B such that (a,b)in F$.

    • we usually use the arrow notations for describing a function.

      • e.g. f:mathbb{R}tomathbb{R}: xmapsto 2x.

  • Common functions

    • ceiling function lceil trceil, rounding a real number up

    • floor function lfloor trfloor, rounding a real number down

    • min/max functions

    • log functions

    • exponential functions

Injectiveness, surjectiveness and bijectiveness (Sect 4.1, 4.2)

  • A function f:Ato B is injective (or one-to-one) iff

 forall, x,uin A ( f(x)=f(u)implies x=u ).
  • A function f:Ato B is surjective (or onto) iff

 forall, yin B ( exists, xin A ( f(x)=y ) ).
  • A function is bijective (or said to be a /one-to-one correspondence) iff it is both injective and surjective.

  • A function f:Ato B has an inverse iff f is bijective.

    • In this case, we can define the inverse function of f, which is denoted by f^{-1}.

    • E.g. Let A=mathbb{Z} and B={2m |  minmathbb{Z}}. The function f:Ato B: xmapsto 2x is bijective, Its inverse is f^{-1}:Bto A: ymapsto frac{y}{2}.

Image and preimage

  • Given a function f:Ato B, sets Usubseteq A and Vsubseteq B,

    • the preimage of V under f is the set f^{-1}(V)triangleq {xin A | f(x)in V};

    • the image of U under f is the set f(U)triangleq{f(x) | xin U}.

Relations between functions and set cardinality (Sect 4.3)

Given any two nonempty finite sets A and B,

  • if there exists an injective function from A to B, then |A|leq |B|;

  • if there exists a surjective function from A to B, then |A|geq |B|;

  • if there exists a bijective function from A to B, then |A|= |B|.

Growth of functions (Sect 4.8)

Given any two functions f,g: mathbb{N}to mathbb{R}_+,

  • fin O(g) iff there exists positive numbers K,N such that f(n)leq Kcdot g(n) for all ngeq N;

  • fin Omega(g) iff there exists positive numbers K,N such that f(n)geq Kcdot g(n) for all ngeq N;

  • fin Theta (g) iff fin O(g) and fin Omega(g);

    • fin Theta (g) iff ginTheta f.

A few important results:

  • For any polynomial f(t)=c_0+c_1t+cdots+c_pt^p with c_pneq0, fin Theta(n^p).

  • Let h:mathbb{N}to mathbb{R}: tmapsto log(t). Then hin O(n) and hinOmega(1).

Please remember to review the master theorem. (See Theorem 9 in Section 4.8, Page 358.)

Basic combinatorics (Chapter 5)

Four basic structures

  • ordered lists (repetitions allowed, ordering matters)

  • unordered lists (repetitions allowed, ordering does not matters)

  • permutations (repetitions not allowed, ordering matters)

  • combinations (repetitions not allowed, ordering does not matter)

Counting lists

Please check the online lecture notes and the examples in the textbook (if you have it).

Permutations

  • P(n,r)triangleq number of permutations of r numbers from {1,2,ldots,n}

  • P(n,r) = ntimes (n-1)times cdots times (n-r+1).

Combinations

  • C(n,r)triangleq number of subsets of {1,2,ldots,n} that are of size r

  • C(n,r) = frac{n!}{(n-r)!r!}

Solving recurrence

  • you should be able to solve recurrences of the form

    • e.g. s_n=2s_{n-1}+4n via repeated substitution;

    • e.g. f_n=f_{n-1}+2f_{n-2} by solving the associated quadratic equation x^2=x+2.

Probability (Chapter 6)

Suppose we have an experiment where there are only finitely many possible outcomes.

  • The sample space S is the set of all possible outcomes.

  • An event E is a subset of the sample space.

  • The probability of an event E is the ratio frac{|E|}{|S|}.

Mutually exclusive events; independent events; conditional probability

Let A and B be two events from an experiment.

  • A and B are mutually exclusive if Acap B=emptyset.

    • In practices this simply means the two events cannot happen at the same time.

    • If A and B are mutually exclusive, then

      • mathrm{Prob}(Acap B)=0

      • mathrm{Prob}(Acup B)=mathrm{Prob}(A)+mathrm{Prob}(B).

  • The probability of A given B is defined by the fraction displaystylefrac{mathrm{Prob}(Acap B)}{mathrm{Prob}(B)}.

  • A and B are said to be independent if mathrm{Prob}(Acap B)=mathrm{A}mathrm{B}.

    • In practice this means that whether A happens or not does not depend on whether B happens or not.

Expected value

Given an experiment with sample space S,

  • A random variable is a function that maps each outcome to a real number. In other words, every function f:Sto mathbb{R} is a random variable.

  • The expected value of a random variable f:Stomathbb{R} is mathbb{E}[f] = sum_{sin S} f(s)cdot mathrm{Prob}({s}).

Bernoulli trials

  • A Bernoulli trial is an experiment that has only two outcomes (which we usually call “success” and “failure”).

  • Suppose that mathrm{Prob}(success)=p. (Then mathrm{Prob}(failure)=1-p.)

  • If a Bernoulli trial is repeated n times, the probability that there are exactly k successes is C(n,k)p^k(1-p)^{n-k}.

  • If the average payoff of one Bernoulli trial is alpha, then the average payoff of n Bernoulli trial is nalpha.

Graph theory (Chapter 7)

You will need to know what the following terms mean regarding directed and undirected graphs :

  • degrees; in-degree; out-degree; source; sink

  • walks (or paths in undirected graphs)

  • directed cycles (or cycles in undirected graphs)

  • Eulerian graphs

  • bipartite graphs

  • trees and leaves

  • strongly connected components of digraphs (or connected components of undirected graphs)