Writing N-Letter Words with A, B, and C | Avoiding Repeated A's in Combinations

  • Thread starter Thread starter heman
  • Start date Start date
AI Thread Summary
The discussion focuses on calculating the number of n-letter words that can be formed using the letters A, B, and C without placing two A's adjacent to each other. The approach involves defining a function w(n) to represent the count of valid words of length n. The formula derived is w(n) = 2w(n-1) + 2w(n-2), with initial conditions w(1) = 1 and w(2) = 8. The reasoning includes starting words with B or C and considering the placement of A's in subsequent positions. The conversation emphasizes counting possibilities and clarifying the equations used for the calculation.
heman
Messages
353
Reaction score
0
How many n-letter words can be written with A,B,C without placing two A's
adjacent to each other?

will this question involve some kind of genereating function...if not,,how to do it?
 
Physics news on Phys.org
You can do it as a difference equation.

Let w(n) be the number words with no repeated A's of length n.

any such can start with a B or C and be followed by any other word of n-1 letters with no repeated As, thus

w(n)=2w(n-1)+no. of words starting with A.

how many words start with A? Well, the next letter can be either B or C, then there is any of the words of length n-2 with no repeated As, thus

w(n)=2w(n-1)+2w(n-2)

subject to the initial conditions w(1)=1, w(2)=8 (3 choices of first letter, 3 of second, minus the one double A choice).
 
just bit more insight ...the first equation is not clear,,
 
just bit more insight ...the first equation is not clear,,
 
yes it is. think about it. I've just 'counted the possibilities'
 
its done..Thanks Matt.
 
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Back
Top