1 / 21

CSE 311: Foundations of Computing

CSE 311: Foundations of Computing. Fall 2013 Lecture 9: Set theory and functions. announcements. Reading assignment Set theory 2.1-2.3 (both editions). set theory. Formal treatment dates from late 19 th century Direct ties between set theory and logic Important foundational language.

Download Presentation

CSE 311: Foundations of Computing

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. CSE 311: Foundations of Computing Fall 2013 Lecture 9: Set theory and functions

  2. announcements Reading assignment Set theory 2.1-2.3 (both editions)

  3. set theory • Formal treatment dates from late 19th century • Direct ties between set theory and logic • Important foundational language

  4. definition: a set is an unordered collection of objects : “x is an element of A” “x is a member of A” “x is in A” :  () Give some examples: Finite sets, Multiple domains N, Z, Q, R Emptyset Sets containing sets

  5. definitions • A and B are equal if they have the same elements • A is a subset of B if every element of A is also in B A = B x (x A x B) A  B x (x A x B) A  B

  6. empty set and power set • Empty set does not contain any elements • Power set of a set A = set of all subsets of A

  7. cartesian product

  8. set operations union intersection set difference symmetric difference (with respect to universe U) complement

  9. it’s Boolean algebra again • Definition for  based on  • Definition for  based on  • Complement works like 

  10. De Morgan’s Laws Proof technique: To show C = D show x C x  D and x D x C Prove A  B = A  B Begin with x  A  B  x  A  x  B

  11. distributive laws A B A B C C

  12. representing sets using bits • Suppose universe is • Can represent set as a vector of bits: wherewhen when • Called the characteristic vector of set B • Given characteristic vectors for and • What is characteristic vector for ? ?

  13. bitwise operations on vectors 01101101 Java: z=x|y00110111 01111111 00101010         Java: z=x&y  00001111 00001010 01101101 Java: z=x^y  00110111 01011010

  14. a simple identity • If x and y are bits: (x y)  y = ? • What if x and y are bit-vectors?

  15. private key cryptography • Alice wants to communicate message secretly to Bob so that eavesdropper Eve who hears their conversation cannot tell what Alice’s message is. • Alice and Bob can get together and privately share a secret key K ahead of time.

  16. one-time pad • Alice and Bob privately share random n-bit vector K • Eve does not know K • Later, Alice has n-bit message m to send to Bob • Alice computes C = m  K • Alice sends C to Bob • Bob computes m = C  K which is (m  K)  K • Eve cannot figure out m from C unless she can guess K

  17. unix/linux file permissions • ls–l drwxr-xr-x ... Documents/ -rw-r--r-- ... file1 • Permissions maintained as bit vectors • Letter means bit is 1 • “--” means bit is 0.

  18. russell’s paradox

  19. functions review • A function from to • an assignment of exactly one element of to each element of . • We write . • “Image of a” = • Domain of: • Range of = set of all images of elements of

  20. image, preimage 1 a b 2 c 3 d 4 e

  21. is this a function? one-to-one?onto? 1 a b 2 c 3 d 4 e 5 6

More Related