# CS6015: Linear Algebra and Random Processes

## Lecture 25:  Counting collections

\neq

### all the 6 words have the same letters: {t, c, a}

\frac{n!}{(n-k)!}

### Number of sequences

= N * k!
= \frac{n!}{(n-k)!}
\therefore N = \frac{n!}{(n-k)!k!}

### What is the number of ways of selecting 3 vowels from 5 vowels ?

Collections Sequences
(a,e,i) {(a,e,i), (a,i,e), (e,a,i), (e,i,a), (i,a,e),(i,e,a)}
(a,e,o) {(a,e,o), (a,o,e), (e,a,o), (e,o,a), (o,a,e), (o,e,a)}
(a,e,u) {(a,e,u), (a,u,e), (e,a,u), (e,u,a), (u,a,e), (u,e,a)}
(a,i,o) {(a,i,o), (a,o,i), (i,a,o), (i,o,a), (o,a,i), (o,i,a)}
(a,i,u) {(a,i,u), (a,u,i), (i,a,u), (i,u,a), (u,a,i), (u,i,a)}
(a,o,u) {(a,o,u), (a,u,o), (o,a,u), (o,u,a), (u,a,o), (u,o,a)}
(e,i,o) {(e,i,o), (e,o,i), (i,e,o), (i,o,e), (o,e,i), (o,i,e)}
(e,i,u) {(e,i,u), (e,u,i), (i,e,u), (i,u,e), (u,e,i), (u,i,e)}
(e,o,u) {(e,o,u), (e,u,o), (o,e,u), (o,u,e), (u,e,o), (u,o,e)}
(i,o,u) {(i,o,u), (i,u,o), (o,i,u), (o,u,i), (u,i,o), (u,o,i)}

### 60

\frac{5!}{~2!~3!~}

### 3!

Sequences
{(a,e,i), (a,i,e), (e,a,i), (e,i,a), (i,a,e),(i,e,a)}
{(a,e,o), (a,o,e), (e,a,o), (e,o,a), (o,a,e), (o,e,a)}
{(a,e,u), (a,u,e), (e,a,u), (e,u,a), (u,a,e), (u,e,a)}
{(a,i,o), (a,o,i), (i,a,o), (i,o,a), (o,a,i), (o,i,a)}
{(a,i,u), (a,u,i), (i,a,u), (i,u,a), (u,a,i), (u,i,a)}
{(a,o,u), (a,u,o), (o,a,u), (o,u,a), (u,a,o), (u,o,a)}
{(e,i,o), (e,o,i), (i,e,o), (i,o,e), (o,e,i), (o,i,e)}
{(e,i,u), (e,u,i), (i,e,u), (i,u,e), (u,e,i), (u,i,e)}
{(e,o,u), (e,u,o), (o,e,u), (o,u,e), (u,e,o), (u,o,e)}
{(i,o,u), (i,u,o), (o,i,u), (o,u,i), (u,i,o), (u,o,i)}

ABCD
ABDC
ACBD
ACDB
BACD
BCDA
BDAC
BDCA
CABD
CBDA
CDAB
CDBA
DABC
DACB
DBAC
DBCA
DCAB
DCBA

### All these 4! = 24 sequences are equal in a collection

ABCD
ABDC
ACBD
ACDB
BACD
BCDA
BDAC
BDCA
CABD
CBDA
CDAB
CDBA
DABC
DACB
DBAC
DBCA
DCAB
DCBA
\frac{15!}{~~~~~(15-4)!~~~~~~}
\frac{~}{4!}
n \choose k

### The number of ways of selecting kk objects from given nn objects is                     and is denoted as           n(n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

\frac{n!}{(n-k)!k!}

### 2

{10 \choose 2} = 45

### 10

{10 \choose 3} = 120

### 2

{6 \choose 2} = 15

{n \choose 3}

### with repetitions

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
?

{14 \choose 5}

### n original counters

{n+k-1 \choose k}

### The number of ways of selecting kk objects from given nn objects with repetitions is             n(n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

{n+k-1 \choose k}

### with repetitions

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
{n+k-1 \choose k}

{8 \choose 2}
{7 \choose 2}
*

{7 \choose 5}
{2 \choose 1}
{4 \choose 3}
{3 \choose 2}
{7 \choose 5}
{2 \choose 1}
{4 \choose 3}
{3 \choose 2}
*
*
*

### (n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

m_1 + m_2 + \dots + m_i = n
k_1 + k_2 + \dots + k_i = k
Given:n~items~of~i~different~types
{m_1 \choose k_1} * {m_2 \choose k_2} * \cdots * {m_i \choose k_i}
Form:collection~of~k~items

### C = all possible committees containing no gynaecologist

count(A) = {21 \choose 4}
count(C) = {16 \choose 4}
count(B) = {21 \choose 4} - {16 \choose 4}

### "at least one"

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
{n+k-1 \choose k}