How many 3-letter words can we make from the letters A, B, C, and D, if we are allowed to repeat letters, and we must use the letter A at least once, and the letter B at least once?
I believe that the answer is 18.
Counting is a difficult mathematical topic for me, so make sure to check my work.
With repeats being tricky to count, I honestly think it is easier to simply calculate it manually, as opposed to with complicated counting tricks.
1. Repeats A twice.
There are 3 combinations, revolving around where to put the B
2. Repeats B twice.
3 combinations, revolving around where to put the A
3. Does not repeat A or B.
Because it is impossible to repeat a C, or a D, repeats are nonexistent here.
First, we place the A, then B, resulting in 6 total combinations.
After that, we have one space left for either a C or a D, making the total for this case as 6*2 or 12.
In total, there are 12+3+3 combinations or 18 total.
A, B appear once
Choose any 2 of 3 positions for them = C(3,2) = 3 and arrange each of these in 2 ways
And for each of these arrangements, we have 2 choices for the remaining letter (C or D)
So 3 * 2 * 2 = 12 words
ABX AXB XAB
BAX BXA XBA
(2 choices for X in each case)
A or B appear twice
Choose 2 of the 3 positions for either letter = 2*C(3,2) = 6
And for each of these....we have 1 choice (only B or A)
So 6 * 1 = 6 words
AAX AXA XAA
BBX BXB XBB
(1 choice for X in ieach case)
I get 12 + 6 = 18 "words" (same as EnchantedLava )