Let m, n, and r be non-negative integers. How many distinct "words" are there consisting of m occurrences of the letter A, n occurrences of the letter B, r occurrences of the letter C, such that no subword of the form CC appears, and no other letters are used?

IJzerboor07

IJzerboor07

Answered question

2022-09-07

"Let m, n, and r be non-negative integers. How many distinct "words" are there consisting of m occurrences of the letter A, n occurrences of the letter B, r occurrences of the letter C, such that no subword of the form CC appears, and no other letters are used?"

Answer & Explanation

Waylon Jenkins

Waylon Jenkins

Beginner2022-09-08Added 17 answers

Step 1
Following the same basic principle, you want to know the number of words of the right form that have a CC in them. This has to start somewhere, and there are n + m + r 1 places it could start - i.e. the first C in the pair can occur as all but the last letter.
Then you just need to fill up the remaining letters with n As, m Bs and r 2 Cs (so we should make some allowances for the cases r = 0 and r = 1, when we won't deduct anything at this stage anyway as there are no words with a CC subword).
Step 2
In the same way you found the total number of words originally, there are:
( n + m + r 2 ) ! n ! m ! ( r 2 ) !
ways of completing the word, having put a CC somewhere. So your answer should be:
( n + m + r ) ! n ! m ! r ! ( n + m + r 1 ) ! n ! m ! ( r 2 ) !
(providing r 2)
faliryr

faliryr

Beginner2022-09-09Added 15 answers

Step 1
There are ( m + n m ) words of length m + n that use m A's and n B's.
Any such word determines m + n + 1 "gaps" (including the 2 endgaps) into which we can slip a C.
Step 2
We can choose r of these gaps in ( m + n + 1 r ) ways. The number of words is therefore
( m + n m ) ( m + n + 1 r ) .
(By convention, ( a b ) = 0 if a < b.)

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?