+ All Categories
Home > Documents > Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.

Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.

Date post: 20-Dec-2015
Category:
View: 216 times
Download: 0 times
Share this document with a friend
30
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department
Transcript

Discrete StructuresChapter 3Set Theory

Nurul Amelina NasharuddinMultimedia Department

Basics of Set Theory• Sets are used to group objects together• Set notation: {1, 2, 3}, {{1, 2}, {3}, {1, 2, 3}},

{1, 2, 3, …}, , {x R | -3 < x < 6}• Set A is called a subset of set B, written as A B, when

x, x A x B (A is contained in B and B contains A) is a subset for every set• Any set is a subset of itself• Visual representation of the sets• Distinction between and

Basics of Set Theory

• A is a proper subset of B, written as A B, when A is a subset of B and x B and x A (every element A is in B but there is at least one element B not in A)

• When A is a proper subset of B, A B

• Eg:

The set of all men is a proper subset of the set of all people.

{1, 3} {1, 2, 3, 4}

{1, 2, 3, 4} {1, 2, 3, 4}

Example• Let U = {1, 2, 3, 4, 5, 6, x, y, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}} Then |U| = 11.

(a)If A = {1, 2, 3, 4} then |A| = 4 and

A U A U A U

{A} U {A} U {A} U

(b) Let B = {5, 6, x, y, A} = {5, 6, x, y, {1, 2, 3, 4}}. Then |B| = 5, not 8. And

A B {A} B {A} B

{A} B A B (that is, A is not a subset of B)

A B (that is, A is not a proper subset of B).

Cardinality of Sets

• If A is a finite set, then cardinality of A, denoted by n(A) or |A|, the number of elements A contains

• Eg: A = {x, y, z}. n(A) = 3• Eg: Let S be the set of odd positive integers less than

10 Then |S| = 5

• We see that

A B |A| |B|, and

A B |A| |B|.

Example

• For U = {1, 2, 3, 4, 5}, A = {1, 2}, and B = {1, 2}, we see that A is a subset of B (that is, A B), but it is not a proper subset of B (or, A B).

• A B |A| |B|, 2 2 so it is true that A B • A B |A| |B|, 2 2 false so it is false that A

B.

Set Operations

• Set A equals set B, written A = B, iff every element of set A is in set B and vice versa (A B and B A)

• Proof technique for showing sets equality• Eg: Let A = {n Z | n = 2p, for some integer p},

B = {k Z | k = 3r + 1, for some integer r}.Is A = B? Ans: No.2 A since 2 = 2(1); but 2 B.

3r + 1 = 2 3r = 1 r = 1/3 (not an integer), so 2 B

There is an element in A that not in B, A B.

Set Operations

• Union of two sets (A B) is a set of all elements that belong to at least one of the sets

• Intersection of two sets (A B) is a set of all elements that belong to both sets

• Difference of two sets (B – A) is a set of elements in one set, but not the other

• Complement of a set (Ac or ) is a difference between universal set and a given set

• Symmetric difference of two sets (A B) is the set that contains the elements which is in A but not in B and in B but not in A

A

Set Operations• Symbolically:

A B = {x U | x A or x B}

A B = {x U | x A and x B}

B – A = {x U | x B and x A}

Ac = {x U | x A}

A B = {x | x A B but x A B}

• Eg: Let U = {a, b, c, d, e, f, g}, A = {a, c, e, g}, B = {d, e, f, g}

A B = Ac =

A B = A B = {a, c, d, f}

B – A =

Venn Diagrams

Union Intersection

Difference ( A – B) Complement

Difference

Empty Set

• Empty set (null set) is the set containing no elements

• Denoted by or {}

• Eg: {1, 3} {2, 5} = • Eg: Describe the set D = {x R | 3 x 2}

D = • Empty set is a subset of any set• There is exactly one empty set

Disjoint Set• Two sets are disjoint, iff they have no elements in common• A and B are disjoint, A B = • Eg: Are A = {1, 3, 5} and B = {2, 4, 6} disjoint?

Yes. {1, 3, 5} {2, 4, 6} = • Sets A1, A2, …, An are mutually disjoint, iff no two sets Ai and

Aj with distinct subscripts have any elements in common

• Ai Aj = whenever i j

• Eg: Are B1 = {2, 4, 6}, B2 = {3, 7}, B3 = {4, 5} mutually disjoint?

No. B1 and B3 both contain 4.

Power Set

• Power set of A, denoted by P(A), is the set of all subsets of A

• Theorem: If A B, then P(A) P(B)• Theorem: If set X has n elements, then P(X) has 2n

elements• Eg: P({x, y}) = {, {x}, {y}, {x, y}}

Power Set

• Eg: Let C = {1, 2, 3, 4}. What is the power set of C?

P(C) = {, {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4},{2, 3, 4}, C}

Cartesian Products• Ordered n-tuple is a set of ordered n elements

• Two ordered n-tuples (x1, x2, …, xn) and (y1, y2, …, yn) are equal iff x1 = y1, x2 = y2, …, xn = yn

• Eg: Is (1, 2) = (2, 1)? No. By definition of equality of ordered pair, (1, 2) = (2, 1) 1 = 2 and 2 = 1

• Cartesian product of A and B, denoted by A x B, is the set of all ordered pairs (a, b) where a is in A and b is in B.

• A x B = {(a, b) | a A and b B}

• Eg: Let A = {x, y} and B = {1, 2, 3}

A x B = {(x, 1), (x, 2), (x, 3), (y, 1), (y, 2), (y, 3)}

Set Properties and Laws of Set Theory• Inclusion of Intersection:

A B A and A B B

• Inclusion in Union:A A B and B A B

• Transitivity of Inclusion:(A B B C) A C

• Set Definitions:i. x X Y x X or x Yii. x X Y x X and x Yiii.x X – Y x X and x Yiv.x Xc x Xv. (x, y) X Y x X and y Y

Rules Name of rule

A B = A B A B = B A

Commutative Laws

(A B) C = A (B C)(A B) C = A (B C)

Associative Laws

A (B C) = (A B) (A C) A (B C) = (A B) (A C)

Distributive Laws

A U = A A = A

Identity Law

A Ac = A Ac = U

Complement Law

(Ac)c = A Double Complement Law

A A = A A A = A

Idempotent Laws

A = A U = U

Universal Bound Laws

(A B)c = Ac Bc (A B)c = Ac Bc

De Morgan’s Laws

A (A B) = A A (A B) = A

Absorption Laws

A – B = A Bc Set Difference Law

Uc = c = U

Complements of U and

If A B, then A B = A and A B = B Intersection and Union with a subset

Formal Proving for Set Identities

• Basic method for proving that sets are equal:

Let sets X and Y be given. To prove that X = Y:

1. Prove that X Y

2. Prove that Y X.

Proving: Distributive LawProof by cases

• Prove that A(B C) = (A B) (A C)

We must show that A(B C) (A B) (A C) and (A B) (A C) A(B C)

For A(B C) (A B) (A C):Suppose that x A(B C). Then x A or x (B C)

Case 1: (x A) Since x A, then x A B and also x A C by definition of

unionHence x(A B) (A C) by definition of intersection

Case 2: (x B C)Since (x B C), then x B and x CSince x B, then x A B andsince x C, then x A C by definition of unionHence x(A B) (A C)

In both cases, x(A B) (A C)

Hence A(B C) (A B) (A C) by definition of subset

Do for (A B) (A C) A(B C)!

Proving: Distributive LawProof by cases

• Prove that A (B C) = (A B) (A C)

A (B C)

= {x | (x A) (x (B C))}

= {x | (x A) (x B x C)}

= {x | ((x A) (x B)) ((x A) (x C))}

= {x | (x A B) (x A C)}

= (A B) (A C)

Proving: Distributive LawProof by cases

• Prove that (A B)c = Ac Bc

(A B)c = {x | x (A B)}

= {x | ~ (x A x B)}

= {x | ~ (x A) ~ (x B)}

= {x | x A x B}

= {x | x Ac x Bc}

= {x | x (Ac Bc)}

= Ac Bc

Proving: De Morgan’s LawProof by cases

Algebraic Proofs of Set Identities

• Can use set identities to derive new set identities or to simplify a complicated set expression, eg. (AB)c AcBc

• Eg: Prove that (A B) – C = (A – C) (B – C)

(A B)–C = (A B) Cc by the set difference law

= Cc (A B) by the comm. law

= (Cc A) (Cc B) by the distributive law

= (A Cc) (B Cc) comm. law

= (A - C) (B - C) by the set difference law

Example of Simplification

• Using laws of set theory, simplify the expression:

De Morgan’s Law

Double Complement Law

Associative Law

Commutative Law

Associative Law

Absorption Law

BCBA )(

BCBA )(

BCBA ))((

)()( BCBA

)()( CBBA CBBA ))((

CB

Membership table• To establish set equalities• We observe that for sets A, B U, an element x U satisfies exactly

one of the following four situations:

a) x A, x B

b) x A, x B

c) x A, x B

d) x A, x B

• When x is an element of a given set, we write a 1(T); when x is not in the set, we enter a 0 (F).

• 3rd row of the table shows that x A, but x B. So, x A B but x is in A B.

A B Ac A B

A B

0 0 1 0 0

0 1 1 0 1

1 0 0 0 1

1 1 0 1 1

Membership Table• Using membership table, prove the A (B C) = (A B) (A C)

A B C B C A (B C) A B A C

(A B) (A C)

0 0 0 0 0 0 0 0

0 0 1 0 0 0 1 0

0 1 0 0 0 1 0 0

0 1 1 1 1 1 1 1

1 0 0 0 1 1 1 1

1 0 1 0 1 1 1 1

1 1 0 0 1 1 1 1

1 1 1 1 1 1 1 1

Since these columns are identical,A (B C) = (A B) (A C)

Duality

• The dual of s, denoted sd is obtained from a statement, s by replacing by U and U by and by and by • Eg: s:

sd: )())(()( qpqppqp

)())(()( qpqppqp

Counting and Venn Diagrams• By using Venn diagrams, show that

For example,

• Set = regions 1, 3, 4, 6; while set = regions 1, 2, 4, 7. Therefore, = regions 1, 4.

• Set C = regions 4, 6, 7, 8; therefore set = regions 1, 2, 3, 5.

• = regions 1, 2, 3, 4, 5.

• ?

CBACBA )()(

A B BA

CCBA

CBA )(

Counting and Venn Diagrams

• If A and B are finite sets, then

n(A B) = n(A) + n(B) - n(A B). • In particular, if A and B are disjoint then

n(A B) = n(A) + n(B). • If A and B are finite sets, then

n(AB) = n(A)*n(B)

Example• In a class of 50 college freshmen, 30 are studying C++, 25 are

studying Java, and 10 are studying both languages. How many freshmen are studying either computer language?

We let U be the class of 50 freshmen, A is the subset of those students studying C++, and B is the subset of those studying Java.

n(A) = 30, n(B) = 25, n(A B) = 10

n(A B) = n(A) + n(B) - n(A B)

= 30 + 25 – 10

= 45


Recommended