CSCE 222 Lecture 10

From Notes
Jump to navigation Jump to search

« previous | Friday, February 11, 2011 | next »


Truth Sets

Let P be a predicate with domain D.

The set of all elements x in D such that P(x) is true is denoted by:

{x∈D|P(x)}

Set operations

A−B={x|x∈A∧x∉B}={x∈A|x∉B}


Let U be a universal set.

Let A⊆U, then A¯=U−A


Fun with Sets

(Oh boy!)

Suppose that A and B are finite sets.

How many elements are in their union?

|A∪B|=|A|+|B|−|A∩B|


Big O — Redefined

Big O is actually a set of all functions asymptotically less than a given function (read as a subset of O(n)) What is the set {f:ℕ→ℝ|f(n)=O(g(n))} ?

={f:ℕ→ℝ|∃n0∈ℕ∃C>0∀n≥n0:|f(n)|≤C|g(n)|}


Functions

Let A and B be nonempty sets. A function f that maps from A to B is an assignment of exactly one element of B to each element of A.

f:A→B:

  • A is domain (input type)
  • B is codomain (output type; superset of range)
  • {f(a)|a∈A} is range

Example

f:ℤ→ℤ, f(x)=x2

range={0,1,4,9,16,…}={y∈ℤ|∃x∈ℤ:y=x2}={y∈ℕ0|y is a perfect square}

Injective Functions

Function is one-to-one (A maps uniquely to B)

Surjective Functions

Range of A is B