Help with difficult problem on permutations/combinations of n lower case letters

111 Views Asked by At

Find how many strings of n lowercase letters from the English alphabet contain

a) the letter a?

  • is the answer $26^n - 25^n$? I got this answer because the total number of letters in the alphabet is $26^n$ and the remaining number is $25$ because "a" is subtracted from the total number of letters.

b) the letters a and b?

  • is the answer $26^n - 24^n$?

c) the letters a and b in consecutive positions with a preceding b, with all the letters distinct?

  • don't know how to do

d) the letters a and b, where a is somewhere to the left of b in the string, with all the letters distinct?

  • don't know how to do
2

There are 2 best solutions below

5
On

For a you are right.

But for b you must use Inclusion–Exclusion Principle (as you mentioned in the comment with a little mistake): $$26^n-2\times25^n+24^n$$

Option c: The number of string of length $n-2$ with distinct letters without a,b is $P_{n-2}^{24}$ then you have $(n-1)$ position to place ba, so there is $(n-1)P_{n-2}^{24} = C_{n-2}^{24}(n-1)!$ strings. The right side of equality can achieve directly if we do as @Certainly not a dog said. Obviously for $n \geqslant 25$ there is no string!

Option d: The number of string of length $(n-2)$ with distinct letters without a,b is $P_{n-2}^{24}$ then you have $(n-1)$ places for the first of a,b, and then produce $(n)$ places for the later one. Symmetrically half of them is desired, so there is $n(n-1)/2P_{n-2}^{24}=C_2^nP_{n-2}^{24}=\frac{C_{n-2}^{24}n!}{2}$ strings. If you first choose positions of a,b that is $C_2^n$, and after that place others, the middle equation produces directly. If you first choose $(n-2)$ other letters, then sort them with a,b, and then consider exactly in half of them is desired, the right equation is achieved directly. Obviously for $n \geqslant 25$ there is no string!

0
On

For c) since repetition is not allowed, we must choose the $n-2$ other letters from the 24 remaining options, which can be done in $\binom {24}{n-2}$ ways. Now, taking “$ab$” as one unit so they are not separated in any arrangement, we have $n-1$ objects to arrange. So, the answer comes out to be: $$\binom{24}{n-2}(n-1)!$$


For d) let us first choose and arrange our other $n-2$ characters, which may be done in $\binom{24}{n-2}(n-2)!$ ways. Now, we may place $a$. There are $n-1$ spots left in this string (between the characters and at the termini) and we may assign any of them to $a$. The remaining possible spots for $b$ depend on where we placed $a$ so we must divide it into cases.

If $a$ is at spot $1$ (to the left of our string of $n-2$ other characters) $b$ may go to any of the $n-1$ (counted similarly) spots to the right of $a$. If $a$ is at spot $2$, $b$ may go to any of the $n-2$ Basically, if $a$ is at spot $k$ b has $n-k$ choices, so our answer is the earlier factor multiplied by the sum of $n-k$ where $k$ is a natural number up to $n-1$, which comes out as $n(n-1) - \frac{n(n-1)}2$ or just $\frac{n(n-1)}2$, so our answer is $\binom{24}{n-2}(n-2)!\frac{n(n-1)}2$, or $$\binom{24}{n-2}n!\over 2$$