Send to a Friend

PhiNotPi's avatar

Is there a way to order the letters A, B, and C so that every possible trigraph appears once? (see details)

Asked by PhiNotPi (12681points) October 19th, 2011

If you have a simple alphabet (for now, just three letters), is there a way to create a list of letters so that every possible trigraph (group of three letters) appears once and only once? Assume that the list loops around, so the last letters connect to the first letters.

An example for an alphabet of size two is “AABBBABA”. Here, you can see that every possible trigraph (aaa, aab, aba, abb, etc.) is located in the string. The AAA is formed by the last letter being connected to the first two.

How would this be done with an alphabet of size n=3? If it helps, any solution would have to have a length of n^3, and there needs to an equal number of each letter in the string. There are going to be many solutions, but I only want one.

So, is it possible to do this with an alphabet of any size? Is there an algorithm to solve this problem?

This is NOT homework.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.