1 / 37

CS 173: Discrete Mathematical Structures

CS 173: Discrete Mathematical Structures. Cinda Heeren heeren@cs.uiuc.edu Rm 2213 Siebel Center Office Hours: M 11a-12p. CS 173 Announcements. Homework 2 returned in section this week. Homework 3 available. Due 09/17, 8a. New & important. Like truth tables. Like .

syshe
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 Cinda Heeren heeren@cs.uiuc.edu Rm 2213 Siebel Center Office Hours: M 11a-12p

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

  3. New & important Like truth tables Like  Not hard, a little tedious CS 173 Set Theory - 4 Ways to prove identities • Show that A  B and that A  B. • Use a membership table. • Use previously proven identities. • Use logical equivalences to prove equivalent set definitions. Cs173 - Spring 2004

  4. (A UB)= A  B CS 173 Set Theory - 4 Ways to prove identities Prove that • () (we did this last time) 2. () Cs173 - Spring 2004

  5. (A UB)= A  B Haven’t we seen this before? CS 173 Set Theory - 4 Ways to prove identities Prove that using a membership table. 0 : x is not in the specified set 1 : otherwise Cs173 - Spring 2004

  6. (A UB)= A  B (A UB)= A U B = A  B = A  B Feels fishy. CS 173 Set Theory - 4 Ways to prove identities Prove that using identities. Cs173 - Spring 2004

  7. (A UB)= A  B (A UB)= {x : (x  A v x  B)} = A  B = {x : (x  A)  (x  B)} CS 173 Set Theory - 4 Ways to prove identities Prove that using logically equivalent set definitions. = {x : (x  A)  (x  B)} Cs173 - Spring 2004

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

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

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

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

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

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

  14. B A Wrong. 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? What’s wrong? |A  B| = |A| + |B| - |A  B| Cs173 - Spring 2004

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

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

  17. 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 AND sneakers? How many people are wearing a watch OR sneakers? Cs173 - Spring 2004

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

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

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

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

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

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

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

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

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

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

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

  29. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa Not one-to-one Every b  B has at most 1 preimage. CS 173 Functions - injection A function f: A  B is one-to-one (injective, an injection) if a,b,c, (f(a) = b  f(c) = b)  a = c Cs173 - Spring 2004

  30. Michael Tito Janet Cindy Bobby Katherine Scruse Carol Brady Mother Teresa Not onto Every b  B has at least 1 preimage. CS 173 Functions - surjection A function f: A  B is onto (surjective, a surjection) if b  B, a  A f(a) = b Cs173 - Spring 2004

  31. Isaak Bri Lynette Aidan Evan Isaak Bri Lynette Aidan Evan Cinda Dee Deb Katrina Dawn Cinda Dee Deb Katrina Dawn Every b  B has exactly 1 preimage. An important implication of this characteristic: The preimage (f-1) is a function! CS 173 Functions - bijection A function f: A  B is bijective if it is one-to-one and onto. Cs173 - Spring 2004

  32. yes yes yes CS 173 Functions - examples Suppose f: R+  R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? Cs173 - Spring 2004

  33. no yes no CS 173 Functions - examples Suppose f: R  R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? Cs173 - Spring 2004

  34. no no no CS 173 Functions - examples Suppose f: R  R, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? Cs173 - Spring 2004

  35. CS 173 Functions - composition Let f:AB, and g:BC be functions. Then the composition of f and g is: (g o f)(x) = g(f(x)) Cs173 - Spring 2004

  36. CS 173 Functions - a little problem Let f:AB, and g:BC be functions. Prove that if f and g are one to one, then g o f :AC is one to one. Recall defn of one to one: f:A->B is 1to1 if f(a)=b and f(c)=b --> a=c. Suppose g(f(x)) = y and g(f(w)) = y. Show that x=w. f(x) = f(w) since g is 1 to 1. Then x = w since f is 1 to 1. Cs173 - Spring 2004

  37. CS 173 Functions - another Let f:AB, and g:BC be functions. Prove that if f and g are onto, then g o f :AC is onto. Cs173 - Spring 2004

More Related