Counting permutations of a string with repeating characters

Click For Summary

Homework Help Overview

The problem involves counting the number of five-letter strings of capital letters that contain a letter repeated twice in a row. Examples of valid strings include ABCCA and AAABC, while ABCAD is not valid.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the selection process for letters in the string, considering choices for the first letter, the placement of repeated letters, and the selection of remaining letters. There is a focus on calculating permutations and the implications of adjacent letters being the same.

Discussion Status

Some participants are exploring the total number of strings and considering how to compute those that do not meet the criteria of having adjacent letters the same. There is a recognition of errors in reasoning and attempts to clarify the counting process for valid strings.

Contextual Notes

Participants are working under the constraints of the problem statement and are questioning the assumptions made in their calculations, particularly regarding the choices available for each character in the string.

squelch
Gold Member
Messages
56
Reaction score
1
The problem statement:

How many five-letter strings of capital letters have a letter repeated twice in a row? For example, include ABCCA and AAABC and ABBCC but not ABCAD.

The attempt at a solution:

  • First, let's break down how we would perform the selection of a string that meets the question's criteria.
    • We select the first letter. There are 26 choices. This selection also triggers selection of the second letter, for which there is only one choice.
    • We then decide where in the five-position string to place these letters. There are four possible positions.
    • We then select for the other three letters. There are 26 possibilities for each letter, but we should exclude repeats. So the number of permutations for 26 letters to appear in three positions is P(26,3)=##\frac{26!}{(26-3)!}##
  • Then we combine the choices using the Product Rule.
    • [choices for first letter] * [choices for second letter] * [choices for position of first and second letter] * [permutations for remaining letters]
    • ##26*1*4*\frac{26!}{(26-3)!}=1622400##
  • We can then conclude that there are 1 622 400 such choices.
I have been having a bit of trouble with this topic, so I'm essentially looking for a sanity check on this solution. I get the sense that I may have missed some key point.
 
Physics news on Phys.org
squelch said:
The problem statement:

How many five-letter strings of capital letters have a letter repeated twice in a row? For example, include ABCCA and AAABC and ABBCC but not ABCAD.

The attempt at a solution:

  • First, let's break down how we would perform the selection of a string that meets the question's criteria.
    • We select the first letter. There are 26 choices. This selection also triggers selection of the second letter, for which there is only one choice.
    • We then decide where in the five-position string to place these letters. There are four possible positions.
    • We then select for the other three letters. There are 26 possibilities for each letter, but we should exclude repeats. So the number of permutations for 26 letters to appear in three positions is P(26,3)=##\frac{26!}{(26-3)!}##
  • Then we combine the choices using the Product Rule.
    • [choices for first letter] * [choices for second letter] * [choices for position of first and second letter] * [permutations for remaining letters]
    • ##26*1*4*\frac{26!}{(26-3)!}=1622400##
  • We can then conclude that there are 1 622 400 such choices.
I have been having a bit of trouble with this topic, so I'm essentially looking for a sanity check on this solution. I get the sense that I may have missed some key point.
Not sure I follow you reasoning, especially the part about "We then select for the other three letters ..."

Hint: compute the number of 5 letter words that don't meet the question's criteria, meaning that no two adjacent letters are the same.
 
Last edited:
  • Like
Likes   Reactions: squelch
Samy_A said:
Not sure I follow you reasoning, especially the part about "We then select for the other three letters."

Hint: compute the number of 5 letter words that don't meet the question's criteria, meaning that no two adjacent letters are equal.

Okay, so I know that the total number of strings is 265.

I consider a string where I'm selecting each character in turn to try to decide how many choices I get at each stage. If I want to construct a string where no two adjacent characters are the same, it seems that I could construct it in this way:
[ 26 choices for character 1] * [25 choices for character 2] * [25 choices for character 3] * [25 choices for character 4] * [25 choices for character 5]
... so 26*254 choices to exclude? That doesn't seem intuitive.

ninja edited to correct a horrible error
 
squelch said:
Okay, so I know that the total number of strings is 265.

I consider a string where I'm selecting each character in turn to try to decide how many choices I get at each stage. If I want to construct a string where no two adjacent characters are the same, it seems that I could construct it in this way:
[ 26 choices for character 1] * [25 choices for character 2] * [26 choices for character 3] * [25 choices for character 4] * [26 choices for character 5]
... so 263*252 choices to exclude? That doesn't seem intuitive.
Do you really have 26 choices for character 3 (and character 5)?
 
That was an awful error of mine that I thought I had corrected via edit fast enough, but alas, I did not.

Corrected:
[ 26 choices for character 1] * [25 choices for character 2] * [25 choices for character 3] * [25 choices for character 4] * [25 choices for character 5]
... so 26*25^4 choices to exclude?
 
squelch said:
That was an awful error of mine that I thought I had corrected via edit fast enough, but alas, I did not.

Corrected:
[ 26 choices for character 1] * [25 choices for character 2] * [25 choices for character 3] * [25 choices for character 4] * [25 choices for character 5]
... so 26*25^4 choices to exclude?
Yes, that is the result I also have : 265-26*254.
 
  • Like
Likes   Reactions: squelch
That was exceedingly helpful, thank you.
 

Similar threads

  • · Replies 36 ·
2
Replies
36
Views
8K
  • · Replies 52 ·
2
Replies
52
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K