Number of strings with one element as the most common element

312 Views Asked by At

Consider the number of strings formed from the set $\{1,2,3,4,5\}$ of length $n$.

What is the number of strings in which the number of occurrence of $1$ is greater or equal to the number of occurrence of any other number?

I'm wondering how can we use the generating function to solve this? Or is there any other way to do it?

1

There are 1 best solutions below

2
On BEST ANSWER

Pick the numbers of $1'$s that you want(This is RobPratt hint) say $k$ and then consider the number of $j'$s as $n_j,$ we want them to be such that $0\leq n_j\leq k$ and also we want them all of this occurrences to add up to $n$.

$$\sum _{k=1}^n\binom{n}{k}\sum _{\substack{n_2+n_3+n_4+n_5=n-k\\n_j\leq k}}\binom{n-k}{n_2,n_3,n_4,n_5}=n!\sum _{k=1}^n\sum _{\substack{n_2+n_3+n_4+n_5+k=n\\n_j\leq k}}\frac{1}{n_2!\,n_3!\,n_4!\,n_5!\,k!}.$$