Discrete Math distinct words. "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?"

kadejoset

kadejoset

Answered question

2022-07-18

Discrete Math distinct words
"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

Jeroronryca

Jeroronryca

Beginner2022-07-19Added 13 answers

Step 1
Not the best possible answer, because it doesn't explain where your solution breaks down, but a different derivation...
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.
Step 2
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).
Joanna Mueller

Joanna Mueller

Beginner2022-07-20Added 5 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

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?