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:

{xD|P(x)}

Set operations

AB={x|xAxB}={xA|xB}


Let U be a universal set.

Let AU, then A¯=UA


Fun with Sets

(Oh boy!)

Suppose that A and B are finite sets.

How many elements are in their union?

|AB|=|A|+|B||AB|


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:|n0C>0nn0:|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:AB:

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

Example

f:, f(x)=x2

range={0,1,4,9,16,}={y|x:y=x2}={y0|y is a perfect square}

Injective Functions

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

Surjective Functions

Range of A is B