0
$\begingroup$

I came across following problem:

How many number of 5 letter words that use letters from the 3 letter set {a,b,c} in which each letter occur atleast once?

This can be solved manually by enumerating individual cases as follows:

Number of words contains no A: 32, no B:32, no C:32. Total:96. Each of AAAAA,BBBBB and CCCCC are counted twice. Thus 96-3 = 93. Number of letters in which each letter occurs at least once = $3^5-93=150$

Now I see that this problem sounds like a problem of number of onto function from set A (with n elements) to set B (with k elements) which solution is given as $k! \begin{Bmatrix}n\\k\\\end{Bmatrix}$ where $\begin{Bmatrix}n\\k\\\end{Bmatrix}$ is a Stirlings number of second kind.

In onto function elements of set $A$ are distinguishable. Elements of set $B$ are distinguishable groups. And each group should have at least 1 element. This exactly maps to the above problem, where $A=\{a,b,c\}$ and $B=\{$5 letter word$\}$.

So, if I am not wrong, in above question $n=3$ and $k=5$. But we cannot define $\begin{Bmatrix}3\\5\\\end{Bmatrix}$. So how we can use Stirling number's onto functions counting approach to this problem. Surprisingly, if we make it reverse, i.e. $n=5$ and $k=3$, then answer comes correctly as $3! \begin{Bmatrix}5\\3\\\end{Bmatrix}=150$. How it works if I reverse the values of $n$ and $k$. Am I wrong in thinking that its $n=3$ and $k=5$ in this question? Or I miss something?

  • 0
    It concerns surjections $A=\{1,2,3,4,5\}\to\{a,b,c\}=B$, so $n=5$ and $k=3$ here.There are $3!S(5,3)$ such surjections. Function $f$ represents word $f(1)f(2)f(3)f(4)f(5)$.2017-02-06

1 Answers 1

0

The number of words with at most $3$ types of letters i.e. $\binom{3}{3}. 3^5$ here we have overcounted and hence we exclude the number of words with at most $2$ types of letters i.e. $\binom{3}{2}.2^5$ and we have to exclude more and hence have to include the number of words with at most $1$ types of letters: $\binom{3}{1}.1^5$. Here we have used PIE.