1 chapter 3 set theory yen-liang chen dept of information management national central university

40
1 Chapter 3 Chapter 3 Set Theory Set Theory Yen-Liang Chen Yen-Liang Chen Dept of Information Managemen Dept of Information Managemen t t National Central University National Central University

Post on 21-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

11

Chapter 3Chapter 3Set TheorySet Theory

Yen-Liang ChenYen-Liang ChenDept of Information ManagementDept of Information Management

National Central UniversityNational Central University

22

3.1 Sets and subsets3.1 Sets and subsets

DefinitionsDefinitions– Element and set , Ex 3.1Element and set , Ex 3.1– Finite set and infinite set, cardinality Finite set and infinite set, cardinality A A

, Ex 3.2, Ex 3.2– CCDD a subset, a subset, C CDD a proper subset a proper subset – CC==DD, two sets are equal, two sets are equal– Neither order nor repetition is relevant Neither order nor repetition is relevant

for a general set for a general set – null set, {}, null set, {},

33

Subset relationsSubset relations

AABB x [xx [xAAxxB]B] A BA B x [xx [xAAxxB] B]

x x [x [xAAxxB]B] x x [( [(xxA)A)(x(xB)]B)] x [xx [xAA(x(xB)]B)] x [xx [xAAxxB]B]

44

Subset relationsSubset relations

AABB

(A(ABBBBA)A)

(A(AB)B)(B(BA)A)

(A B)(A B) (B A) (B A) AABB

AAB B AABB

55

Ex 3.5Ex 3.5

66

Theorems 3.1. and 3.2Theorems 3.1. and 3.2

Theorem 3.1Theorem 3.1– If If AABB and and BBCC, then , then AACC,,– If If AABB and and BBCC, then , then AACC,,– If If AABB and and BBCC, then , then AACC,,– If If AABB and and BBCC, then , then AACC,,

Theorem 3.2Theorem 3.2 AA. If . If A A is not empty, then is not empty, then AA. .

77

Power setPower set

For any finite set For any finite set AA with with A A ==nn, the , the total number of subsets of total number of subsets of AA is 2 is 2nn. .

Definition 3.4. the power set of A, Definition 3.4. the power set of A, denoted as denoted as ((AA) is the collection of all ) is the collection of all subsets of subsets of A.A.

What is the power set of {1, 2,3 4}?What is the power set of {1, 2,3 4}?

88

Ex 3.10 Ex 3.10

Count the number of paths in the Count the number of paths in the xyxy-plane fro-plane from (2,1) to (7,4) m (2,1) to (7,4)

The number of paths sought here equals the nThe number of paths sought here equals the number of subsets A of {1,2,…,8}, where umber of subsets A of {1,2,…,8}, where A A =3. =3.

99

Ex 3.11 Ex 3.11 Count the number of compositions of an Count the number of compositions of an

integer, say 7 integer, say 7 7=1+1+1+1+1+1+1, there are six plus 7=1+1+1+1+1+1+1, there are six plus

signs.signs.– Subset {1,4,6} Subset {1,4,6}

(1+1)+1+(1+1)+(1+1)(1+1)+1+(1+1)+(1+1)2+1+2+22+1+2+2– Subset {1,2,5,6}Subset {1,2,5,6}

(1+1+1)+1+(1+1+1)(1+1+1)+1+(1+1+1)3+1+33+1+3– Subset {3,4,5,6}Subset {3,4,5,6}

1+1+(1+1+1+1+1)1+1+(1+1+1+1+1)1+1+51+1+5 Consequently, there are 2Consequently, there are 2m-1m-1 compositions compositions

for the value m.for the value m.

1010

1111

An important identityAn important identity

CC((nn+1, +1, rr)= )= CC((nn,, r r)+)+CC((nn, , rr-1) -1) Pascal’a triangle in Ex 3.14 Pascal’a triangle in Ex 3.14

1212

3.2 Set operations and the laws of 3.2 Set operations and the laws of set theoryset theory

Definition 3.5. Definition 3.5. – AABB={x={xxxA A x xB} B} – AABB={x={xxxA A x xB} B} – AABB={x={xxxAAB B x xAAB} B} – Ex 3.15Ex 3.15

Definitions 3.6, 3.7, 3.8Definitions 3.6, 3.7, 3.8– SS, , TT are disjoint, written are disjoint, written SSTT==– The complement of The complement of AA, denoted as , denoted as – The relative complement of The relative complement of AA in in BB, denoted , denoted BB--AA

A

1313

Ex 3.18Ex 3.18

1414

Theorem 3.4 Theorem 3.4

The following statements are The following statements are equivalent equivalent – AABB– AABB==BB– AABB==AA– AB

1515

AABB AABB==B B AABB==AA

BB(A(AB) for any setsB) for any sets xx(A(AB) B) (x (xA)A)(x(xB)B) since Asince AB, B, (x (xB)B) this means (Athis means (AB)B)B B we conclude we conclude AABB==BB

AAAAB for any setsB for any sets yyAA y yAAB (1)B (1) Since ASince AB=B, (1)B=B, (1)yy

BByy(A(AB)B) This means AThis means AAABB we conclude A=Awe conclude A=ABB

1616

AABB==A A AABB AB

1717

1818

BABA

1919

AA(B(BC)=(AC)=(AB)B)(A(AC)C)

2020

The Duality The Duality

Definition 3.9Definition 3.9 LetLet s s be a statement dealing wit be a statement dealing with the equality of two set expressions. The dual h the equality of two set expressions. The dual of of ss, denoted , denoted ssdd, is obtained from , is obtained from ss by replacin by replacing (1) each occurrence of g (1) each occurrence of and and UU by by UU and and , r, respectively; and (2) each occurrence of espectively; and (2) each occurrence of and and by by and and , respectively., respectively.

Theorem 3.5. Theorem 3.5. ss is a theorem if and only if is a theorem if and only if ssdd is is also a theorem.        also a theorem.        

2121

Three approaches to proofThree approaches to proof

The first approach to prove a theorem is by The first approach to prove a theorem is by element argument. element argument.

The second is by Venn diagram, and The second is by Venn diagram, and the third is by membership table.the third is by membership table.

2222

Venn diagram to show Venn diagram to show BABA

2323

Venn diagram to showVenn diagram to show

CBACBA )()(

2424

membership tablemembership table

2525

Membership table for Membership table for AA((BBCC)=(A)=(AB)B)((AACC))

2626

Ex 3.20Ex 3.20

2727

Ex 3.22Ex 3.22

2828

1 23

4

A={1,2}, B={2,3}, A∆B={1,3}, A´={3,4}, B´={1,4}

A´∆B={2, 4}= B´∆A = (A∆B)´

2929

Generalized DeMorgan’s LawGeneralized DeMorgan’s Law

Ii

iIi

i AA

Ii

iIi

i AA

3030

3.3. Counting and Venn diagrams3.3. Counting and Venn diagrams

Finite sets Finite sets AA and and BB are disjoint if and only if are disjoint if and only if A A B B = = A A + + B B , , Figures 3.9 and 3.10Figures 3.9 and 3.10

Ex 3.25, If Ex 3.25, If AA and and BB are finite sets, then are finite sets, then AABB= = AA+ + BB--AABB , Figure 3.11 , Figure 3.11

When When UU is finite, we have is finite, we have

BABAUBAUBABA

3131

Ex 3.26Ex 3.26

How many gates have at least one of the How many gates have at least one of the defects Ddefects D11, D, D22, D, D33? How many are perfect?? How many are perfect?

Figure 3.12 and Figure 3.13. If Figure 3.12 and Figure 3.13. If A, BA, B and and CC are are finite sets, then finite sets, then AABBCC= = AA+ + BB++CC--AABB--AACC--BBCC + + AABBCC

When When UU is finite, we have is finite, we have

CBAUCBACBA

CBACBCABACBAU

3232

3.4. A first world on probability3.4. A first world on probability

Let Let be the sample space for an experiment. Each be the sample space for an experiment. Each subset subset AA of of , including the empty subset, is called an , including the empty subset, is called an event. Each element of event. Each element of determines an outcome. If determines an outcome. If ==nn, then , then PrPr({({aa})=1/})=1/nn and and PrPr((AA)=)= A A //nn

Ex 3.29, Ex 3.30, Ex 3.31Ex 3.29, Ex 3.30, Ex 3.31 Definition 3.11. For sets Definition 3.11. For sets AA and and BB, the Cartesian , the Cartesian

product of product of AA and and BB is denoted by is denoted by AABB and equals and equals {({(aa, , bb))aa A A , , bb B B}. We call the elements of }. We call the elements of AABB ordered pairs.ordered pairs.

3333

Ex 3.33Ex 3.33

Suppose we roll two fair dice.Suppose we roll two fair dice. Consider the following eventConsider the following event

– A: rolls a 6A: rolls a 6– B: The sum of dice is at least 7B: The sum of dice is at least 7– C: Rolls an even sumC: Rolls an even sum– D: The sum of the dice is 6 or lessD: The sum of the dice is 6 or less

What are P(A), P(B), P(C), P(D), What are P(A), P(B), P(C), P(D), P(AP(AB), P(CB), P(CD)?D)?

3434

ExamplesExamples

Ex 3.35. If we toss a fair coin four times, Ex 3.35. If we toss a fair coin four times, what is the prob that we get two heads awhat is the prob that we get two heads and two tails?nd two tails?

Ex 3.36. Among the letters WYSIWYG, whEx 3.36. Among the letters WYSIWYG, what is the prob that the arrangement has at is the prob that the arrangement has both consecutive W’s and Y’s? and thboth consecutive W’s and Y’s? and the prob that the arrangement starts and ee prob that the arrangement starts and ends with W?nds with W?

3535

3.5. The axioms of probability3.5. The axioms of probability

Ex 3.39. The outcomes of a sample space may Ex 3.39. The outcomes of a sample space may have different likelihoodshave different likelihoods

A warehouse has 10 motors, three of A warehouse has 10 motors, three of which are defective. We select two which are defective. We select two motors.motors.– A: exactly one is defectiveA: exactly one is defective– B: at least one motor is defectiveB: at least one motor is defective– C: both motors are defectiveC: both motors are defective– D: Both motors are in good condition. D: Both motors are in good condition.

3636

The axioms of probabilityThe axioms of probability

Let Let be the sample space for an experiment. If be the sample space for an experiment. If AA and and BB are any events, then are any events, then – PrPr((AA))00 – PrPr(()=1)=1 – If If AA and and BB are disjoint, are disjoint, PrPr((AA B B )= )=PrPr((AA) + ) + PrPr((BB))

Theorem 3.7. Theorem 3.7. )Pr(1)Pr( AA

3737

Ex 3.40Ex 3.40

The letters PROBABILITY are arranged in a ranThe letters PROBABILITY are arranged in a random manner. Determine the prob of the followdom manner. Determine the prob of the following event: The first and last letters are differening event: The first and last letters are different.t.– Neither B nor I appears at the start or finish.Neither B nor I appears at the start or finish.

(7)(9!/2!2!)(6)(7)(9!/2!2!)(6)– Only B appears at the start or finish.Only B appears at the start or finish.

(2)(7)(9!/2!)(2)(7)(9!/2!)– One of B is used at the start and I as the other.One of B is used at the start and I as the other.

(2)(9!)(2)(9!)

3838

Ex 3.41Ex 3.41 The prob that our team can win any tournameThe prob that our team can win any tourname

nt is 0.7. Suppose we need to play eight tournant is 0.7. Suppose we need to play eight tournaments. Consider the following cases:ments. Consider the following cases:– Win all eight games. (0.3)Win all eight games. (0.3)88

– Win exactly five of the eight. Win exactly five of the eight. C(8, 5)(0.7)C(8, 5)(0.7)55(0.3)(0.3)33

– Win at least one. 1-(0.3)Win at least one. 1-(0.3)88

If there are If there are nn trials and each trial has probability trials and each trial has probability pp of of success and 1-success and 1-pp of failure, the probability that there ar of failure, the probability that there are e kk successes among these successes among these nn trials is trials is

knk ppk

n

)1(

3939

Theorem 3.8Theorem 3.8

PrPr((AABB))

==PrPr((AABBcc) + ) + PrPr((BB))

== Pr Pr((AA) + ) + PrPr((BB)-)- Pr Pr((AABB ) ) Ex 3.42Ex 3.42

– What is the prob that the card drawn is a cluWhat is the prob that the card drawn is a club and the value is between 3 and 7.b and the value is between 3 and 7.

Ex 3.43Ex 3.43

4040

Theorem 3.9.Theorem 3.9.

PrPr((AABBCC)= )= PrPr((AA)+ )+ PrPr((BB)+)+PrPr((CC)-)-PrPr((AABB)-)-PrPr((AACC)-)-PrPr((BBCC) + ) + PrPr((AABBCC))