Presentation is loading. Please wait.

Presentation is loading. Please wait.

S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A

Similar presentations


Presentation on theme: "S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A"— Presentation transcript:

1 S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A
= (A  )  (A  B) identity law = A  (  B) distributivity law = A   domination law = A identity law A B

2 S2: Prove that: Venn Diagram “Proof” Direct Proof ~(A  B) = ~A  ~B
~(A  B) = {x | xE and x(A  B)} definition = {x | xE and (xA or xB)} definition = {x | (xE and xA) or (xE and xB)} distributivity = {x | xE and xA}  {x | xE and xB} definition = ~A  ~B

3 S3: Prove that: Direct Proof
If R is a subset of S and S is a subset of T, then R is a subset of T Direct Proof Let xR Since R⊆S, then xS (by definition) Now, we know that xS Since S⊆T, then xT (by definition) Now we have that xT So, if xR then xT, in other words, R⊆T

4 F1: If A={a,b,c,d}, are the following functions from A to A injective, surjective or bijective? {(d, a), (b, c), (c, b), (a, c)} {(a, b), (b, c), (c, d), (d, a)} First function: injective, not surjective (hence, not bijective) Second function: injective, surjective (hence, bijective)

5 F2: If f(x)=2x+3 and g(x)=x-3, what is g∘f? g∘f(x) = g ( f(x) )

6 F3: Prove that: Assume NOT (known as proof by contradiction)
if f: A → B is a bijection then |A|=|B| Assume NOT (known as proof by contradiction) Assume |A|>|B| Then there must be 2 elements of A that hit the same element of B, so f is not injective, and hence cannot be a bijection Assume |B|>|A| Then there must be 1 element in B that is not hit by any element of A, so f is not surjective, and hence cannot be a bijection So, it must be that |A|=|B|

7 F4: Which is the largest: the set of even numbers or the set of odd numbers? Let E be the set of even numbers and O the set of odd numbers Consider f:E->O, such that f(x)=x+1 Is f injective? Assume f(x1)=f(x2), then x1+1=x2+1, and it follows that x1=x2. Hence, each element is hit at most once and f is injective Is f surjective? Any odd number y in O is hit by the even number y-1 in E. Hence, each element is hit at least once and f is surjective It follows that f is a bijection and |E|=|O|

8 F5: Which is the largest: the set of natural numbers or the set of integers? Let N be the set of natural numbers and Z the set of integers Consider the following functions f:N->Z and g:Z->N Let y be negative, fog(y)=f(-2y-1)=((-2y-1)+1/-2)=-2y/-2=y Let y be positive, fog(y)=f(2y)=2y/2=y So g is the inverse of f, and f is a bijection; hence |N|=|Z| f(x) = x odd: (x+1)/−2 x even: x/2 y negative: −2y−1 y positive: 2y g(y) = { x y −1 −2

9 F6: Which is largest: the set of natural numbers or [0,1]?
Assume that |N|=|[0,1]| Then there must exist a bijection N->[0,1]. Assume 1 -> … 2 -> … 3 -> … Consider the number y=0.(not 3)(not 4)(not 0)… Clearly y is in [0,1], but no x in N hits y; hence, the function is not surjective and not a bijection, so |N|≠|[0,1]| In fact, [0,1] is (much) bigger than N Not all infinities are created equal!

10 PS1-4: Power sets: { a, 1, x, 2 } -> { , {a}, {1}, {x}, {2}, {a,1}, {a,x}, {a,2}, {1,x}, {1,2}, {x,2}, {a,1,x}, {a,1,2}, {a,x,2}, {1,x,2}, {a,1,x,2} }  -> {  } {  } -> { , {} } { a, {} } -> { , {a}, {{}}, {a, {}} }

11 RE1: Valid usernames are any sequence of letters or digits, but they must start with a letter. L (L|D)* Valid passwords are any sequence of letters, digits or special characters (=, !, ?, $, &), but they must contain at least one digit, and at least one special character. L* ( (D(L|D)*S) | (S(L|S)*D) ) (L|S|D)*

12 RE2: In C++, a line comment consists of two '/' followed by any string of characters (letters, numbers and spaces). // (L|D|S)*

13 FSM1: Design one finite state machine to accept only valid usernames and one to accept only valid passwords. Username: L (L|D)* Password: L* ( (D(L|D)*S) | (S(L|S)*D) ) (L|S|D)* L|D L L|D L D S L|S|D D S L|S

14 FSM2-3: Finite state machine that recognizes/accepts any string that contains at least three A’s. Finite state machine with two accept states, one that is chosen if the input string is even, the other if it is odd B B B A|B A A A 1 1 1

15 FST1: Line comment vs. block comment vs. undefined comment.
ch<>EOF and #, nil EOF, UNDEF ch<>’#’, nil #, nil EOF, UNDEF ch<>’#’, nil |, BC #, nil |, nil #, nil ch<>EOL and EOF and |, nil ch<>|, nil EOL or EOF, LC ch<>EOL and EOF, nil EOL or EOF, LC


Download ppt "S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A"

Similar presentations


Ads by Google