How many 5 letter palindromes can be made using an alphabet with 5 letters?

  • Thread starter Thread starter Maria76
  • Start date Start date
AI Thread Summary
The discussion revolves around calculating the number of 5-letter palindromes that can be formed using a 5-letter alphabet. It is established that for a 5-letter palindrome, the pattern used is xyzyx, where x and y are letters from the alphabet. The calculation involves multiplying the number of combinations of the first two letters (xy) by the number of choices for the middle letter (z), resulting in a total of 64 unique palindromes. The conversation also clarifies that the initial examples mistakenly included letters outside the specified alphabet. The final conclusion is that there are 64 distinct 5-letter palindromes possible with a 5-letter alphabet.
Maria76
Messages
14
Reaction score
0
Hi,

Here is a weird question (I hope you don't mind).

Let's say we have an alphabet with only 4 letters (A, B, C, D)? How many combinations of give us palindromes (i.e. they read the same way backwards and forwards)? I count 36 possible combinations -
AAAA BAAB CAAC DAAD EAAE FAAF
ABBA BBBB CBBC DBBD EBBE FBBF
ACCA BCCB CCCC DCCD ECCE FCCF
ADDA BDDB CDDC DDDD EDDE FDDF
AEEA BEEB CEEC DEED EEEE FEEF
AFFA BFFB CFFC DFFD EFFE FFFF

This is the same number with an alphabet of only 3 letters -.
AFA, AEA, ADA, ACA, ABA, AAA
BFB, BEB, BDB, BCB, BBB, BAB
CFC, CEC, CDC, CCC, CBC, CAC
DFD, DED, DDD, DCD, DBD, DAD
EFE, EEE, EDE, ECE, EBE, EAE
FFF, FEF, FDF, FCF, FBF, FAF

Is that right?

Now, how about an alphabet with 5 letters? Is there any equation that can be used to determine the number of palindromes, or do I need to use a computer algorithm to work it out.

Thanks,
Maria
 
Mathematics news on Phys.org
Hi Maria! :smile:

This should help you to find the formula …

If the word-length is 2n (even), then the number of palindromes is the same as the number of ordinary words of length n.

If the word-length is 2n - 1 (odd), then the number of palindromes is the same as the number of palindromes of length 2n, since you just double the central letter. :wink:
 
Maria76 said:
Let's say we have an alphabet with only 4 letters (A, B, C, D)? How many combinations of give us palindromes (i.e. they read the same way backwards and forwards)?

You need to add some limit to the word length. Answer to the question as stated is "infinitely many". Take any, add the same letter at the end and at the beginning, and you have a new palindrome. Repeat ad nauseam.
 
Maria76 said:
Hi,

Here is a weird question (I hope you don't mind).

Let's say we have an alphabet with only 4 letters (A, B, C, D)? How many combinations of give us palindromes (i.e. they read the same way backwards and forwards)? I count 36 possible combinations -
AAAA BAAB CAAC DAAD EAAE FAAF
ABBA BBBB CBBC DBBD EBBE FBBF
ACCA BCCB CCCC DCCD ECCE FCCF
ADDA BDDB CDDC DDDD EDDE FDDF
AEEA BEEB CEEC DEED EEEE FEEF
AFFA BFFB CFFC DFFD EFFE FFFF

Why do you also use the letters E and F? I thought your alphabet consists only of the letters A,B,C,D.

To find the number of combinations write down what a palindrome is in general:
xyyx
 
Edgardo said:
Why do you also use the letters E and F? I thought your alphabet consists only of the letters A,B,C,D.

To find the number of combinations write down what a palindrome is in general:
xyyx


Additionally, your examples are only 4 letters, not 5.

As shown above, you just need the pattern xy and pair it with it's reverse to get xyyx.

How many xy patterns are there? That's the Cartesian Product of 4 letters taken 2 at a time.

That would be (length of alphabet) * (length of alphabet).
(Or in general, (length of alphabet)**(length of pattern).)

The number of xy patterns is (4*4).

To get 5 letter palindromes, you need to use the pattern xyzyx, so you would need to multiply the number of xy patterns by the length of the alphabet.

Thus, the number of xyzyx patterns is (4*4)*4.

Which can be generated thusly:
Code:
# Python 3.1
import itertools as it
count = 0
alpha = 'abcd'
for h in alpha:
  for i in it.product(alpha,alpha):
    j = ''.join(i)
    k = ''.join(reversed(j))
    print(j+h+k)
    count += 1
print(count)

aaaaa ababa acaca adada baaab bbabb bcacb bdadb caaac cbabc ccacc cdadc daaad dbabd dcacd ddadd aabaa abbba acbca adbda babab bbbbb bcbcb bdbdb cabac cbbbc ccbcc cdbdc dabad dbbbd dcbcd ddbdd aacaa abcba accca adcda bacab bbcbb bcccb bdcdb cacac cbcbc ccccc cdcdc dacad dbcbd dcccd ddcdd aadaa abdba acdca addda badab bbdbb bcdcb bdddb cadac cbdbc ccdcc cdddc dadad dbdbd dcdcd ddddd
64

 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top