1 / 13

Chapter 2

Chapter 2. Mathematical Preliminaries. Sets and Relations. A set is a collection of distinguishable members or elements The members are usually drawn from some larger base set Each member is either a primitive element of the base set or a set itself

perrin
Download Presentation

Chapter 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 Mathematical Preliminaries

  2. Sets and Relations • A set is a collection of distinguishable members or elements • The members are usually drawn from some larger base set • Each member is either a primitive element of the base set or a set itself • The is no concept of duplication in a set • Each value from the base type is either in the set or not • Example 3, 4, 5 are in set P and the base type is ints

  3. Bags • Sometimes we wish to define a collection without order, like a set, but with duplicate items • Such a collection is called a bag • To distinguish a bag from a set we put square brackets around a bag’s elements

  4. Sequences • A sequence is a collection of elements with an order and which may contain duplicate-value elements. • A sequence is also sometimes called a tuple or a vector • A sequence is indicated using angle brackets <>

  5. A relation R over set S is a set of ordered pairs from S If tuple <x,y> is in relation R, we can show it as xRy We can define the following properties of relations: R is reflective if aRa for all a in S R is symmetric if whenever aRb, then bRa for all a,b in S R is antisymmetric if whenever aRb and bRa, then a=b for all a,b in S R is transitive if whenever aRb and bRc then aRc for all a,b,c in S Relation

  6. Equivalence Relation • R is an equivalence relation on set S if it is reflexive, symmetric and transitive • An equivalence relation can be used to partition a set into equivalence classes • An equivalence relation on set S partitions the sets into subsets whose elements are equivalent

  7. Partial Order • A binary relation is called a partial order if it is antisymmetric and transitive. • The set on which the partial order is defined is called a partially ordered set or a poset

  8. Miscellaneous Notation • B means bytes • b means bits • KB is a kilobyte 210 = 1024 byes • MB is a megabyte 220 bytes • GB is a gigabyte 230 bytes

  9. n! • The factorial function for integer n is the product of the numbers between 1 and n • Stirling’s approximation is n! ≈ √2πn(n/e)n

  10. Recursion • Recursion is awesome!! • Two parts • Base case • Recursive call • You’ll see a lot more of recursion this semester

  11. Proof Strategies • Proof by contradiction • Proof by Mathematical Induction • Base case • Inductive Hypothesis • (seem familiar)

  12. Estimating • Estimating can be formalized by a three step process • Determine the major parameters that affect the problem • Derive an equation that relates the parameters to the equation • Select values for the parameters, and apply the equation to yield an estimated solution

  13. Example • How many golf balls can fit in room that is 8” x 8” x 8” • Parameters: a golf ball is 1’ diameter • The room is 4096 cubic feet • You can fit 1728 golf balls in 1 cubic foot • So you can fit 4096 * 1728 total golf balls • 7,077,888 golf balls • The units do to match!!

More Related