1 / 22

CS 173: Discrete Mathematical Structures

CS 173: Discrete Mathematical Structures. Dan Cranston dcransto@uiuc.edu Rm 3240 Siebel Center Office Hours: W, F 11:30a-12:30p. CS 173 Announcements. Homework 2 returned in section this week. Homework 3 available. Due 02/04, 8a. CS 173 Set Theory - A proof for us to do together.

maeve
Download Presentation

CS 173: Discrete Mathematical Structures

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. CS 173:Discrete Mathematical Structures Dan Cranston dcransto@uiuc.edu Rm 3240 Siebel Center Office Hours: W, F 11:30a-12:30p

  2. CS 173 Announcements • Homework 2 returned in section this week. • Homework 3 available. Due 02/04, 8a. Cs173 - Spring 2004

  3. CS 173 Set Theory - A proof for us to do together. X  (Y - Z) = (X  Y) - (X  Z). True or False? Prove your response. (X  Y) - (X  Z) = (X  Y)  (X  Z)’ = (X  Y)  (X’ U Z’) = (X  Y  X’) U (X  Y  Z’) =  U (X  Y  Z’) = (X  Y  Z’) Cs173 - Spring 2004

  4. A U B =  A = B A  B =  A-B = B-A =  Trying to pv p --> q Assume p and not q, and find a contradiction. Our contradiction was that sets weren’t equal. CS 173 Set Theory - A proof for us to do together. Pv that if (A - B) U (B - A) = (A U B) then ______ A  B =  Suppose to the contrary, that A  B  , and that x  A  B. Then x cannot be in A-B and x cannot be in B-A. DeMorgan’s!! Then x is not in (A - B) U (B - A). Do you see the contradiction yet? But x is in A U B since (A  B)  (A U B). Thus, A  B = . Cs173 - Spring 2004

  5. CS 173 Set Theory - Generalized Union Ex. Let U = N, and define: A1 = {2,3,4,…} A2 = {4,6,8,…} A3 = {6,9,12,…} Cs173 - Spring 2004

  6. Primes Composites  N I have no clue. primes CS 173 Set Theory - Generalized Union Ex. Let U = N, and define: Then Cs173 - Spring 2004

  7. CS 173 Set Theory - Generalized Intersection Ex. Let U = N, and define: A1 = {1,2,3,4,…} A2 = {2,4,6,…} A3 = {3,6,9,…} Cs173 - Spring 2004

  8. Multiples of LCM(1,…,n) CS 173 Set Theory - Generalized Intersection Ex. Let U = N, and define: Then Cs173 - Spring 2004

  9. B A CS 173 Set Theory - Inclusion/Exclusion Example: How many people are wearing a watch? How many people are wearing sneakers? How many people are wearing a watch OR sneakers? |A  B| = |A| + |B| - |A  B| Cs173 - Spring 2004

  10. 125 173 217 - (157 + 145 - 98) = 13 CS 173 Set Theory - Inclusion/Exclusion Example: There are 217 cs majors. 157 are taking cs125. 145 are taking cs173. 98 are taking both. How many are taking neither? Cs173 - Spring 2004

  11. Now let’s do it for 4 sets! kidding. CS 173 Set Theory - Generalized Inclusion/Exclusion Suppose we have: B A C And I want to know |A U B U C| |A U B U C| = |A| + |B| + |C| - |A  B| - |A  C| - |B  C| + |A  B  C| Cs173 - Spring 2004

  12. f(x) = -(1/2)x - 25 domain co-domain CS 173 Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? Notation: f: RR, f(x) = -(1/2)x - 25 Cs173 - Spring 2004

  13. CS 173 Functions Definition: a function f : A  B is a subset of AxB where  a  A, ! b  B and <a,b>  f. Cs173 - Spring 2004

  14. B A A point! A collection of points! CS 173 Functions Definition: a function f : A  B is a subset of AxB where  a  A, ! b  B and <a,b>  f. B A Cs173 - Spring 2004

  15. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa CS 173 Functions A = {Michael, Tito, Janet, Cindy, Bobby} B = {Katherine Scruse, Carol Brady, Mother Teresa} Let f: A  B be defined as f(a) = mother(a). Cs173 - Spring 2004

  16. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa What about the range? Some say it means codomain, others say, image. Since it’s ambiguous, we don’t use it at all. image(S) = f(S) CS 173 Functions - image & preimage For any set S  A, image(S) = {b : a  S, f(a) = b} So, image({Michael, Tito}) = {Katherine Scruse} image(A) = B - {Mother Teresa} Cs173 - Spring 2004

  17. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa preimage(S) = f-1(S) CS 173 Functions - image & preimage For any S  B, preimage(S) = {a: b  S, f(a) = b} So, preimage({Carol Brady}) = {Cindy, Bobby} preimage(B) = A Cs173 - Spring 2004

  18. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa  S CS 173 Functions - image & preimage What is image(preimage(S))? • S • { } • subset of S • superset of S • who knows? Cs173 - Spring 2004

  19. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa Suppose S is {Janet, Cindy} preimage(image(S)) = A CS 173 Functions - image & preimage What is preimage(image(S))? Cs173 - Spring 2004

  20. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa CS 173 Functions - misc. properties • f() =  • f({a}) = {f(a)} (this is a definition, actually) • f(A U B) = f(A) U f(B) • f(A  B)  f(A)  f(B) Cs173 - Spring 2004

  21. CS 173 Functions - misc. properties f(A  B)  f(A)  f(B)? Choose an arbitrary c  f(A  B), and show that it must also be an element of f(A)  f(B). f(A  B) = {x : a  (A  B), f(a) = x} So, a (A  B) such that f(a) = c. If a  A (it is), then f(a) = c  f(A). If a  B (it is), then f(a) = c  f(B). c  f(A), and c  f(B), so c  f(A)  f(B). Cs173 - Spring 2004

  22. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa CS 173 Functions - misc. properties • f-1() =  • f-1(A U B) = f-1(A) U f-1(B) • f-1(A  B) = f-1(A)  f-1(B) Cs173 - Spring 2004

More Related