1 / 45

Sets

Sets. Set builder notation. N = {0,1,2,3,…} the “natural numbers” R = reals Z = {… -3,-2,-1,0,1,2,3,…} Z+ = {1,2,3,4,5,…} Q = the set of rational numbers. Set builder notation. S contains all elements from U (universal set) That make predicate P true.

nedaa
Download Presentation

Sets

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. Sets

  2. Set builder notation • N = {0,1,2,3,…} the “natural numbers” • R = reals • Z = {… -3,-2,-1,0,1,2,3,…} • Z+ = {1,2,3,4,5,…} • Q = the set of rational numbers

  3. Set builder notation S contains all elements from U (universal set) That make predicate P true Brace notation with ellipses (wee dots)

  4. Set Membership x is in the set S (x is a member of S) y is not in the set S (not a member)

  5. Am I making this up?

  6. Set operators

  7. Set empty The empty set

  8. The universal set U

  9. Venn Diagram U B A U is the universal set A is a subset of B

  10. Venn Diagram U B A U is the universal set A united with B

  11. Venn Diagram U B A U is the universal set A intersection B

  12. Cardinality of a set The number of elements in a set (the size of the set)

  13. Power Set The set of all possible sets

  14. Power Set The set of all possible sets

  15. Power Set The set of all possible sets We could represent a set with a bit string 0th element

  16. Is this true for a set S?

  17. Cartesian Product A set of ordered tuples

  18. (improper) Subset • is empty {} a subset of anything? • Is anything a subset of {}? • We have an implication, what is its truth table? • Note: improper subset!!

  19. (proper) Subset Consequently A is strictly smaller than B |A| < |B|

  20. Equal sets? Two show that 2 sets A and B are equal we need to show that And we know that

  21. Try This • Using set builder notation describe the following sets • odd integers in the range 1 to 9 • the integers 1,4,9,16,25 • even numbers in the range -8 to 8

  22. Answers • Using set builder notation describe the following sets • odd integers in the range 1 to 9 • the integers 1,4,9,16,25 • even numbers in the range -8 to 8

  23. How might a computer represent a set? Remember those bit operations?

  24. Computer Representation (possible} • How do we compute the following? • membership of an element in a set • union of 2 sets • intersection of 2 sets • compliment of a set • set difference (tricky?)

  25. Power set Try this • Compute the power set of • {1,2} • {1,2,3} • {{1},{2}} • {}

  26. Power set • Compute the power set of • {1,2} • {1,2,3} • {{1},{2}} • {} Think again … how might we represent sets?

  27. Cartesian Product • A set of ordered tuples • note AxB is not equal to BxA Just reminding you (and me)

  28. Try This • Let A={1,2,3} and B={x,y}, find • AxB • BxA • if |A|=n and |B|=m what is |AxB|

  29. My answer • Let A={1,2,3} and B={x,y}, find • AxB • BxA • if |A|=n and |B|=m what is |AxB|

  30. The thinking behind the code Power Set PS(A) 0 1 10 00 01 11 011 101 001 010 100 111 110 000 Go left: take Go right: don’t take

  31. The thinking behind the code Power Set PS(A) ▫▫▫ ▪▪▪ ▫▫▪ ▪▪▫ ▫▫▫ ▫▫▫ ▫▪▫ ▪▫▫ ▪▫▫ ▪▪▫ ▪▫▪ ▫▫▪ ▫▫▪ ▪▫▫ ▫▫▫ ▫▫▫ don’t select select ▫▪▪ ▪▫▫

More Related