11
CS1800 Discrete Structures Fall 2017 Lecture 16 10/12/17

CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Embed Size (px)

Citation preview

Page 1: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

CS1800 Discrete Structures

Fall 2017

Lecture 16 10/12/17

.

Page 2: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Last time Today Next time

⇒J . Finish set operations . Permutations &

. Set operations . Computer representations Combinations

of sets

. Basic rules

for counting

Page 3: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Pott

PC A) = set of all subsets of A

A={ d.is!) -P( A) = { %

,

tag,

I'bT,

{ c ),

@{ a .cl,

{ b. 4,

{ 9.b.cl )

IAI a b C

IPLAII = 2 Too ¢0 o I { cl

- O 10 { b )

P( 0 ) = { 0 )°

!1 { b. 4

1

|P( A) 1=21^4 1 I 1 { 9. b. c)101=0

1810 )/= 1

101011=210120--1

Page 4: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

mail.IE#@*.r*it....x@Ax B = { ( x. y ) | XEA, yeB )

e. 9 . A= {

42,31B= { a. b )( lia ) =/ ( a. 1 )

AXB = { ( 1,

a ),

( 2. a ),

( 3,

a),

4. b ),

(21 b ),

13,

b ) )

( Bx A = { ( a. I ),

( a. 2),

- ( b,

} ) ) AXB # B×A

abii.MY#PiaPIAxBl=lHxlB11 2 3

Page 5: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

AXBXC = { ( x. y.tl/xeA,yeB,

zct )

1 AxBxcl= IAIXIBIXKI

|Ai×AhxA, x. -×An/= IAIXIAHX . -× IAUI

( 9,92 , - -

,an ) - n - tuples

Page 6: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Representatimsofsets

U= { 1,2 , ),

- -

,10 ) 1 2 3 4 5 6 7 8 9 10

A = { 2,4 , 6,8/10 ) 0 I 0 I 0 I 0 I 0 I

B= { 112,3, 4,5 ) I I I 1 I 0 0 0 0 0

bitwiseoR→AUBl1ll1l#bitwise AND → ANB 0 I 0 I 0 0 0 0 0 0

bitwise XOR → ASB I 0 I 0 I I 0 I 0 1

bitwise Not → B- 0 0 0 0 0 I I I L I

iai÷E¥i's #

Page 7: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Sumruledproductrule. 8 parts

,6 shorts parts 01 shorts ⇒ 14=8+6

sillyexample . 8 parts ,

12 shirts parts AID shirts ⇒ 8×12=96

mmm

Product Rule : If A & B are finite sets,

then-

the number of ways to pick an element

from A andthen an element from B

is IAIXIBI = IAXBI

More generally .

- A,

,Aa

, - An → IAIXIAHX . -× IAN

Page 8: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Exaplesc4 - char passwords ,upper Hover case El digib A={ a ,b , -

t

A ,B , .-

Z,

0,1/2, -

- 9). how may ?

AXAXAXA

62×62×62×62=621 14,776,336

÷W : Jay Kevin Virgil⇒7 79 103

3- person. tee ) 407×79×103 = 3,311,759count

onestudent

persection

Page 9: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

SumrwleifA and B are tent finite sets

,then the number

of ways of pocking an object from A of B B IAIHBI

Generally An An,

-

,An ace all mutually disjoint

then 1 A , U Aa - U Ant IA ,1HAs1t - +

ItPrinciple of Inclusion - Exclusion Student

2 sets A & B

, au , ,= ,µ+ , , , . ,an , ,|smg§!vein

WVH

Page 10: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

} satin

@1 AUBUCI = IAITIBITICI

- IANBI - IAACI - IBNCI

+ IANDNCI

Page 11: CS1800 Discrete Structures Fall 2017 Lecture 16 … · Discrete Structures Fall 2017 Lecture 16 ... for counting. Pott PCA) ... 407×79×103 = 3,311,759 count one student per section

Exaiple : Passwords between 6 and 10 chars,

upperllwer case letters

or digits,

at least of digit and at least one letter

How many ? . pick length 6 I 7 I 8 I . .a 10

-

mutually disjoint → apply Lumru#fours on length 6 pass winds

.

all passant ,

all - illegal

" It,:L; "

in "#:* /

total :

(62aiotsi)-lb2±io±52⇒t--(Yo[Y?s_=