# Combinations

• Aug 30th 2006, 05:20 PM
ashkash
Here is the problem:

A sequence of letters of the form abcba is an example of a palindrome of five letters.

a. If a letter may appear more than twice, how many palindromes of five letters are there? of six letters?

b. Repeat part a under the condition that no letter appears more than twice.

I do not know how to go about doing this problem. Any help would be appreciated. thanks.
• Aug 30th 2006, 05:56 PM
Soroban
Hello, ashkash!

I used Brute Force . . . and started making a list.

Quote:

A sequence of letters of the form ABCBA is an example of a palindrome of five letters.

(a) If a letter may appear more than twice,
how many palindromes of five letters are there? of six letters?

With five letters, consider the first three letters.

3 different letters: .$\displaystyle ABC\;\;\Rightarrow\;\;ABCBA$

2 different letters: .$\displaystyle \begin{array}{ccc}ABA\;\;\Rightarrow\;\;ABABA \\ AAB\;\;\Rightarrow\;\;AABAA \\ ABB\;\;\Rightarrow\;\;ABBBA\end{array} \begin{array}{ccc}* \\ * \\ *\end{array}$

. . Only one letter: .$\displaystyle AAA\;\;\Rightarrow\;\;AAAAA\;\;\;\:*$

With six letters, again consider the first three letters.

3 different letters: .$\displaystyle ABC\;\;\Rightarrow\;\;ABCCBA$

2 different letters: .$\displaystyle \begin{array}{ccc}ABA\;\;\Rightarrow\;\;ABAABA \\ AAB\;\;\Rightarrow\;\;AABBAA \\ ABB\;\;\Rightarrow\;\;ABBBBA\end{array} \begin{array}{ccc}* \\ * \\ * \end{array}$

. . Only one letter: .$\displaystyle AAA\;\;\Rightarrow\;\;AAAAAA\;\;\;\:*$

Quote:

(b) Repeat part (a) under the condition that no letter appears more than twice.

Disregard answers in (a) marked with an asterisk $\displaystyle (*).$

• Aug 30th 2006, 05:59 PM
ashkash
for the question you need to consider all 26 letters of the alphabet and not just a,b,and c.
• Aug 30th 2006, 06:22 PM
Quick
Quote:

Originally Posted by ashkash
for the question you need to consider all 26 letters of the alphabet and not just a,b,and c.

Would $\displaystyle AAAAA$ be a valid combination?
• Aug 30th 2006, 06:25 PM
ashkash
yes, it would.
• Aug 30th 2006, 06:34 PM
Quick
As soroban pointed out all you have to consider is the first three letters, each is independent of the other...

Here's an example problem. Flip a coin. After one flip you have only two possible outcomes (2^1):

$\displaystyle \boxed{\begin{array}{cc}H\\T\end{array}}$

After two flips you get four possible outcomes (2^2):

$\displaystyle \boxed{\begin{array}{cccc}HH\\HT\\TH\\TT\end{array }}$

After three flips you get eight possible outcomes (2^3):

$\displaystyle \boxed{\begin{array}{cccccccc}HHH\\HHT\\HTH\\HTT\\ THH\\THT\\TTH\\TTT\end{array}}$

You can see that after each flip the outcome multiplies by two (because a flip can give 2 different results)

Now your problem can give 26 different results per letter, and only 3 letters matter. Therefore we get the answer of 26^3

you get the same answer with 6 places as well
• Aug 30th 2006, 06:45 PM
Soroban
Hello again, ashkash!

If we are considering all 26 letters of the alphabet,
. . we simply append a permutation factor.

Quote:

With five letters, consider the first three letters.

3 different letters: .$\displaystyle ABC\;\;\Rightarrow\;\;ABCBA$ . . . one way

There are $\displaystyle 26$ choices for the "$\displaystyle A$",
. . $\displaystyle 25$ choices for the "$\displaystyle B$",
. . and $\displaystyle 24$ choices for the "$\displaystyle C$".

Hence, there are: .$\displaystyle 26\cdot25\cdot24 \times 1 \:=\:15,600$ ways.

Quote:

2 different letters: .$\displaystyle \begin{array}{ccc}ABA\;\;\Rightarrow\;\;ABABA \\ AAB\;\;\Rightarrow\;\;AABAA \\ ABB\;\;\Rightarrow\;\;ABBBA\end{array}$ . . . three ways

There are $\displaystyle 26$ choices for the "$\displaystyle A$"
. . and $\displaystyle 25$ choices for the "$\displaystyle B$".

Hence, there are: .$\displaystyle 26\cdot25 \times 3 \:=\:1950$ways.

Quote:

Only one letter: .$\displaystyle AAA\;\;\Rightarrow\;\;AAAAA$ . . . one way

There are $\displaystyle 26$ choices for the "$\displaystyle A$".

Hence, there are: .$\displaystyle 26 \times 1 \:=\:26$ ways.

Therefore, there are: .$\displaystyle 15,600 + 1950 + 26 \:=\:\boxed{17,576\text{ ways.}}$

• Aug 30th 2006, 06:48 PM
Quick
just to clear confusion: $\displaystyle \underbrace{\overbrace{15600+1950+26}^{\text{Sorob }\!\!\text{an's Way}}=17576=\overbrace{26^3}^{\text{my way}}}_{\text{both ways give the same answer}}$