Cs 173 discrete mathematical structures
Download
1 / 32

CS 173: - PowerPoint PPT Presentation


  • 252 Views
  • Updated On :

CS 173: Discrete Mathematical Structures. Dan Cranston [email protected] Rm 3240 Siebel Center Office Hours: Wed, Fri 11:30a-12:30p. CS 173 Announcements. Homework 2 returned this week (by email, in section, or in your section leader ’ s office hours).

Related searches for CS 173:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CS 173:' - ivanbritt


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Cs 173 discrete mathematical structures l.jpg

CS 173:Discrete Mathematical Structures

Dan Cranston

[email protected]

Rm 3240 Siebel Center

Office Hours: Wed, Fri 11:30a-12:30p


Cs 173 announcements l.jpg
CS 173 Announcements

  • Homework 2 returned this week (by email,

    in section, or in your section leader’s office hours).

  • Homework 3 available. Due 02/04, 8a.


Set theory definitions and notation l.jpg

Note:   {}

Set Theory - Definitions and notation

A set is an unordered collection of elements.

Some examples:

{1, 2, 3} is the set containing “1” and “2” and “3.”

{1, 1, 2, 3, 3} = {1, 2, 3} since repetition is irrelevant.

{1, 2, 3} = {3, 2, 1} since sets are unordered.

{1, 2, 3, …} is a way we denote an infinite set (in this case, the natural numbers).

 = {} is the empty set, or the set containing no elements.


Set theory definitions and notation4 l.jpg

A

Venn Diagram

B

Set Theory - Definitions and notation

x  S means “x is an element of set S.”

x  S means “x is not an element of set S.”

A  B means “A is a subset of B.”

or, “B contains A.”

or, “every element of A is also in B.”

or, x ((x  A)  (x  B)).


Set theory definitions and notation5 l.jpg
Set Theory - Definitions and notation

A  B means “A is a subset of B.”

A  B means “A is a superset of B.”

A = B if and only if A and B have exactly the same elements.

iff, A  B and B  A

iff, A  B and A  B

iff, x ((x  A)  (x  B)).

  • So to show equality of sets A and B, show:

    • A  B

    • B  A


Set theory definitions and notation6 l.jpg

A

B

Set Theory - Definitions and notation

A  B means “A is a proper subset of B.”

  • A  B, and A  B.

  • x ((x  A)  (x  B))  x ((x  B)  (x  A))

  • x ((x  A)  (x  B)) x ((x  B) (x  A))


Slide7 l.jpg

Vacuously

Set Theory - Definitions and notation

Quick examples:

  • {1,2,3}  {1,2,3,4,5}

  • {1,2,3}  {1,2,3,4,5}

    Is   {1,2,3}?

Yes!x (x  )  (x  {1,2,3}) holds, because (x  ) is false.

Is   {1,2,3}?

No!

Is   {,1,2,3}?

Yes!

Is   {,1,2,3}?

Yes!


Set theory definitions and notation8 l.jpg

Yes

Yes

Yes

No

Set Theory - Definitions and notation

Quiz time:

Is {x}  {x}?

Is {x}  {x,{x}}?

Is {x}  {x,{x}}?

Is {x}  {x}?


Set theory ways to define sets l.jpg

: and | are read “such that” or “where”

Primes

Set Theory - Ways to define sets

  • Explicitly: {John, Paul, George, Ringo}

  • Implicitly: {1,2,3,…}, or {2,3,5,7,11,13,17,…}

  • Set builder: { x : x is prime }, { x | x is odd }. In general { x : P(x) is true }, where P(x) is some description of the set.

Ex. Let D(x,y) denote “x is divisible by y.”

Give another name for

{ x : y ((y > 1)  (y < x)) D(x,y) }.


Set theory cardinality l.jpg

|S| = 3.

|S| = 1.

|S| = 0.

|S| = 3.

Set Theory - Cardinality

If S is finite, then the cardinality of S, |S|, is the number of distinct elements in S.

If S = {1,2,3},

If S = {3,3,3,3,3},

If S = ,

If S = { 1, {1}, {1,{1}} },

If S = {0,1,2,3,…}, |S| is infinity. (more on this later)


Set theory power sets l.jpg

aka P(S)

We say, “P(S) is the set of all subsets of S.”

2S = {, {a}}.

2S = {, {a}, {b}, {a,b}}.

2S = {}.

2S = {, {}, {{}}, {,{}}}.

Set Theory - Power sets

If S is a set, then the power set of S is

2S = { x : x  S }.

If S = {a},

If S = {a,b},

If S = ,

If S = {,{}},

Fact: if S is finite, |P(S)| = 2|S|. (if |S| = n, |P(S)| = 2n)


Set theory cartesian product l.jpg

A,B finite  |AxB| = ?

  • |A|+|B|

  • |A|-|B|

  • |A||B|

Set Theory - Cartesian Product

The Cartesian Product of two sets A and B is:

A x B = { <a,b> : a  A  b  B}

If A = {Charlie, Lucy, Linus}, and

B = {Brown, VanPelt}, then

A x B = {<Charlie, Brown>, <Lucy, Brown>, <Linus, Brown>, <Charlie, VanPelt>, <Lucy, VanPelt>, <Linus, VanPelt>}

A1 x A2 x … x An = {<a1, a2,…, an>: a1  A1, a2  A2, …, an  An}


Set theory operators l.jpg

B

A

Set Theory - Operators

The union of two sets A and B is:

A  B = { x : x  A v x  B}

If A = {Charlie, Lucy, Linus}, and

B = {Lucy, Desi}, then

A  B = {Charlie, Lucy, Linus, Desi}


Set theory operators14 l.jpg

B

A

Set Theory - Operators

The intersection of two sets A and B is:

A  B = { x : x  A  x  B}

If A = {Charlie, Lucy, Linus}, and

B = {Lucy, Desi}, then

A  B = {Lucy}


Set theory operators15 l.jpg

B

A

Set Theory - Operators

Another example

If A = {x : x is a US president}, and B = {x : x is deceased}, then

A  B = {x : x is a deceased US president}


Set theory operators16 l.jpg

B

A

Sets whose intersection is empty are called disjoint sets

Set Theory - Operators

One more example

If A = {x : x is a US president}, and B = {x : x is in this room}, then

A  B = {x : x is a US president in this room} = 


Set theory operators17 l.jpg

A

  • = U and

    U = 

Set Theory - Operators

The complement of a set A is:

A = { x : x  A}

If A = {x : x is bored},

then A = {x : x is not bored}

U


Set theory operators18 l.jpg

U

A

B

Set Theory - Operators

The set difference, A - B, is:

A - B = { x : x  A  x  B }

A - B = A  B


Set theory operators19 l.jpg

U

A

B

like “exclusive or”

Set Theory - Operators

The symmetric difference, A  B, is:

A  B = { x : (x  A  x  B) v (x  B  x  A)}

= (A - B) U (B - A)


Set theory operators20 l.jpg
Set Theory - Operators

A  B = { x : (x  A  x  B) v (x  B  x  A)}

= (A - B) U (B - A)

Proof:

{ x : (x  A  x  B) v (x  B  x  A)}

= { x : (x  A - B) v (x  B - A)}

= { x : x  ((A - B) U (B - A))}

= (A - B) U (B - A)


Set theory famous identities l.jpg

Don’t memorize them, understand them!

They’re in Rosen, p124.

Set Theory - Famous Identities

  • Two pages of (almost) obvious.

  • One page of HS algebra.

  • One page of new.


Set theory famous identities22 l.jpg

A  U = A

A U U = U

A U A = A

A U  = A

A  = 

A A = A

Set Theory - Famous Identities

  • Identity

  • Domination

  • Idempotent


Set theory famous identities23 l.jpg

A U A = U

A = A

A A=

Set Theory - Famous Identities

  • Excluded Middle

  • Uniqueness

  • Double complement


Set theory famous identities24 l.jpg

B U A

B  A

A U (B U C)

A U (B C) =

A  (B C)

A  (B U C) =

Set Theory - Famous Identities

A U B =

  • Commutativity

  • Associativity

  • Distributivity

A  B =

(A U B)U C =

(A  B) C =

(A U B)  (A U C)

(A  B) U (A  C)


Set theory famous identities25 l.jpg

(A UB)= A  B

(A  B)= A U B

Hand waving is good for intuition, but we aim for a more formal proof.

Set Theory - Famous Identities

  • DeMorgan’s I

  • DeMorgan’s II

p

q


Set theory 4 ways to prove identities l.jpg

Like truth tables

Like 

Not hard, a little tedious

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.


Set theory 4 ways to prove identities27 l.jpg

(A UB)= A  B

Set Theory - 4 Ways to prove identities

Prove that

  • () (x  A U B)  (x  A U B)  (x  A and x  B)  (x  A  B)

    2. () (x  A  B)  (x  A and x  B)  (x  A U B)  (x  A U B)


Slide28 l.jpg

(A B)= A U B

Set Theory - 4 Ways to prove identities

Prove that


Set theory 4 ways to prove identities29 l.jpg

(A UB)= A  B

Haven’t we seen this before?

Set Theory - 4 Ways to prove identities

Prove that

using a membership table.

0 : x is not in the specified set

1 : otherwise


Set theory 4 ways to prove identities30 l.jpg

(A UB)= A  B

(A UB)= {x : (x  A v x  B)}

= A  B

= {x : (x  A)  (x  B)}

Set Theory - 4 Ways to prove identities

Prove that using logically equivalent set definitions.

= {x : (x  A)  (x  B)}


Set theory a proof for you to do l.jpg
Set Theory - A proof for you to do

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’)


Set theory a proof for us to do together l.jpg

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.

Set Theory - A proof for us to do together.

A  B = 

Prove that if (A - B) U (B - A) = (A U B) then ______

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.

So x is not in (A - B) U (B - A).

But x is in A U B since (A  B)  (A U B).

Thus, A  B = .


ad