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?
We already know 2 of the digits, so there are 4 choices for the final digit.
Now, we have to order them. Divide this into 2 cases.
Case 1: All 3 digits are distinct.
There are \(3! = 6\) ways to do this, and there are 2 options (C or D), which makes for \(6 \times 2 = 12\) options.
Case 2: The 3rd digit is A or B
There are \(3! \div 2! = 3\) ways to order them, and there are 2 options (A or B), which makes for \(3 \times 2 = 6\) options.
So, there are \(12 + 6 = \color{brown}\boxed{18}\) words.