2 nu e Nnn 2 no Y e 1 Combinatorial Theorem xn y 7 Mlb Inn yn - - PDF document

2
SMART_READER_LITE
LIVE PREVIEW

2 nu e Nnn 2 no Y e 1 Combinatorial Theorem xn y 7 Mlb Inn yn - - PDF document

CS 70 July 15 2020 Counting 2 1 Combinatorial Theorem and Exclusion Simple Inclusion 2 and Exclusion Inclusion 3 4 Derangement's Sampling 5 and 6 Star Bars e nu 2 nm no t T XZ 2mg The number of subsets LHS 2 X 2 as of Is g


slide-1
SLIDE 1

Counting 2

CS 70 July 15 2020

1 Combinatorial

Theorem

2

Simple

Inclusion

and Exclusion

3

Inclusion

and Exclusion

4

Derangement's

5

Sampling

6 Star

and

Bars

2

nm

e nu

t

no

T

LHS

2

2 X

XZ

2mg The number of subsets

as

  • f

Is

g n

RHS

subsets iz

y

  • r

I

  • r

2

  • r

n

b

F

2

e

nu

2

no

Y

e

Nnn

slide-2
SLIDE 2

1 Combinatorial Theorem

Hey

Mlb

xn y 7

a

Inn yn

How

to

distribute

my ball

among I red bins and y blue bins

LHS

City acxey

X

XLxty

w

make subsequent choices

f

Hey'T possibilities

I20 h

RHS

inred.aerni

i

r.edeuef

fin

u i i

Indy xn

Hy

X

Enix

no

x

e 7 x

y

e

h yn

City

Eno

xn

i.si

i II

2n

E

g

i

slide-3
SLIDE 3

2 Simple Inclusion 1 Enclusion

sum

Rule

for disjoint sets A and B

1AABled

to count the number of elements of A V B

we have

IA UBI

Alt 1B I

when A and

B

have

common element

Inclusion Enclusion Rude e

k

1AvB

IAABI

A AB

A um

i'It'mII

in

I

IAnBl

are

counted twice

subtract IA ABI

slide-4
SLIDE 4

Example

Howmany lb digit Phone numbers have

5 as their

first

  • r second

digit

A numbers with

5

as

first digit

stood

as

9

B numbers

with

5

as

second digit 1131 10

g

lo

A

5

B

5

AAB

numbers

with 5

as

first and second digit

IAAB1

108

IAU Bls IAI11131 IA

Is 18 18

108

Three way inclusion Exclusion

Rule

Set

It

Beg

LAU BU GI

IAI 1431 14

IAABI

land

HAD

1 Brett

Ian Brel

slide-5
SLIDE 5

3 Inclusion

Exclusion principle

sets

Ai

Ah

I ViAit

flail

  • ff Air Ajit

L yn

E

IAah Ain l

2Hiv to

n

4 Derangement

see

Permutations of l

n

n

How many permutations where

no item in its proper

place or

fixed Points

Derangement

Example

number of derangement 123

Derangement

If

Tooo

231

Yes

slide-6
SLIDE 6

we can count the complement.ro count permutations

with

at least

  • ne

fined Points

Permutation

where

I is

fined Points

2slg2,3

Complement

Permutations

with

at

least

  • ne

fined Points

1A VA zu Ast

IA UAzUA3l

IA il 11A de IA31 IA in Az I

f

1AM

Azl

IANAste IAA AznAg

2

2

t

2

I

I

I

I

4

Subtract this from the total Permutations

Derangement

3

4 2

For

n items

h

permutations

Permutations with at least one fined point

YELII Efi of Aintidt

him

nan I

7 Ch y

th cn u

GyntInn

slide-7
SLIDE 7
  • f derangement

h

7 Cn D

t 4 In 21

e C un

nu

m

h

I

1

eosin

e

ye

un

n xd

LT

Y

h x Eot.fi

n xte

  • r37n

W

n

a

Roughly

0 37

  • f

the Permutations

are

5 Sampling

derangements

Assume sample K items

  • ut of

n

as

Without replacement

  • order matters

nx Ch y x n 2

Ah

Kel

ht

a

  • rder does not matter

Ch K

Second rule

divid by number of orders

k

nd

h K

K

slide-8
SLIDE 8

with replacement

K

  • rder matters

h X h X

x n

n

  • orderamatters

can

we

use

second rule

doesn't

a

Problem

depends

  • n how many
  • f

each

item

we

choose

For

chosen string

ABCD 4

  • rderings

a n n

IAC D

4z

  • rdering

Different number of

  • rdered elements

map to

each unordered Anotherexample

How many ways

can Alice and Bob

split

5 For each

  • f 5 dollars

Pick Alice

  • r Bob

25 and divid out order

slide-9
SLIDE 9

A 5 B D CA A A A A

i

1

I

A 4 B

1B Aga A A B gLAgAgAyBgA

I

5

E

is i.i

li

A

I 13 45

Ag BoB B B

g

5

A O

B S B B B B B

t

second

rule

  • f

counting

is

no

good

here

Anotherexample How ma

ways

can Alice Bob and Eve split

5

Idea

separat

Alice's dollars

from Bob's

and

then Bob's from Eve's Assume dollars

are

5

stars.o

MAYBE

see

II's.IR

manddbajars

IfIYI

split Alice D

Bob 3 Eve 3

ftp.ff

slide-10
SLIDE 10

Zeroth Rule Counting

If

there

is

a

  • ne

to

  • ne

mapping

between

two

set they have

the

Same

size

So

we

can

ask

How

many different

sequence

  • f

5

stars

and

2

bars

are

there µ

00000

A

A

a

a

a

x

a

e

Ig

Positio

7 positions

in which

to

Place

2

bars

7

7 choose

2 e

z

way

to do this

I

ways

to

split

5 among 3 People

6 Star and Bars

ways

to

split

k dollarsamong n people

K

from

n

with

replacement

where

  • rder doesn't matter

correspondence n

1

bars

to

split

the K

stars

I

I

I

I

slide-11
SLIDE 11

nyk

1

Positions

from which

to

choose

n 1

bar

positions

ni D