Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 7

Mohammad Mahmoody
September 13, 2017

Class 7

Discrete Math

Mohammad Mahmoody

September 13, 2017
Tweet

More Decks by Mohammad Mahmoody

Other Decks in Education

Transcript

  1. Plan • Sets (as a Data Type) • Review: SAT

    problem and its importance Thursday: continue other data types..
  2. Data Types Mathematical • Defines a set of possible values

    and operations on those values • Finite or infinite Programming Languages • Defines a set of possible values and operations on those values • Finite (in practice), but often “viewed” as infinite
  3. Sets as Data Type Unordered collection of objects Infinite or

    finite Objects may be of any type not necessarily the same including sets 4 2102 { 1, 2, 3, …} Each object only counts once (multiset has count for each object)
  4. Not being a member (∉) ∉ is true iff is

    not in the set 4 2102 { 1, 2, 3, …}
  5. Subset (⊆) ⊆ iff every element of A is an

    element of B. 4 2102 { 1, 2, 3, …}
  6. Set Equality = ⟺ ⊆ ∧ ⊆ 4 2102 {

    1, 2, 3, …} How should we define = for sets?
  7. Complement Complement: ҧ A ∀ ∈ . ∈ ⟺ ∉

    ҧ . D = “domain of discourse” (Universe) B U 4 2102 { 1, 2, 3, …}
  8. ∈ ⟺ is in the set Membership ∉ ⟺ ¬(

    ∈ ) ∈ ҧ ⟺ ( ∈ ∧ ∉ ) Complement ∀. [ ∈ − ⟺ ∈ ∧ ∉ ] Difference ∀. [ ∈ ∩ ⟺ ∈ ∧ ∈ ] Intersection ∀. [ ∈ ∪ ⟺ ∈ ∨ ∈ ] Union ⊆ ⟺ ∀ ∈ . ∈ Subset Equality = ⟺ ⊆ ∧ ⊆ Non-membership Which ones are necessary?
  9. Self-Membership ? Is there any set where ∈ ? Is

    it even meaningful to ask ∈ ?
  10. Conundrum notself = the set of all sets that are

    not members of themselves Is notself ∈ notself ? all = the set of all sets notself is a subset of all .
  11. notself = the set of all sets that are not

    members of themselves Is notself ∈ notself ? Slack break…
  12. notself = the set of all sets that are not

    members of themselves Is notself ∈ notself ? Russell’s Paradox! IF Yes, it means notself ∈ notself , so notself is a member of itself and should not be in notself . IF No, it means notself ∉ notself , so notself is not a member of itself and should be in notself .
  13. Conundrum notself = the set of all sets that are

    not members of themselves Is notself ∈ notself ? all = the set of all sets notself is a well-defined subset of all .
  14. Sets as data type Unordered collection of objects Infinite or

    finite Objects may be of any type... 4 2102 { 1, 2, 3, …} Apple
  15. Charge • PS3 Due this Friday (6:29pm) start early •

    Next session: Other Data Types – Sequences, Functions, etc. – Read MCS Chapter 4