Repetition of the letter 'x' in a particular string is allowed ?
–
VelvetThunderDec 5 '11 at 20:06

4

I would start with how many four-digit strings don't contain the letter "x". We have $25 \cdot 25 \cdot 25 \cdot 25$ possibilities, since each position can take on any of $(26 - 1)$ values. Subtract this from $26^4$. The reason that this is easier is that you have to consider four-digit strings that contain exactly one, two three and four "x's". For your "two letter" result, haven't you counted the string "xx" twice?
–
The Chaz 2.0Dec 5 '11 at 20:10

2 Answers
2

When you want to know the number of objects of some kind that contain at least one of something, it’s usually easiest to calculate the number that contain none and subtract that from the total number of objects. In your problem, for example, there are $26^3$ three-letter strings, of which $25^3$ contain no $x$’s, so there must be $26^3-25^3=1951$ three-letter strings containing at least one $x$. The same analysis can be applied to strings of any length: there are $26^k$ possible $k$-letter strings, of which $25^k$ contain no $x$’s, so there must be $26^k-25^k$ $k$-letter strings that contain at least one $x$.

It’s possible to count the number of strings of a given length that contain at least one $x$, but you have to consider multiple cases. Take strings of length three, for instance: a ‘good’ string can have one, two, or three $x$’s. There are $25^2\cdot 3$ that have one $x$, $25\cdot 3$ that have two $x$’s, and just one that has three $x$’s, for a total of $1875+75+1=1951$ ‘good’ three-letter strings. But you can see that this is going to be quite tedious for even moderately long strings.

I am just thinking should we assume repetition 'implicitly' in these sorts of problems?
–
VelvetThunderDec 5 '11 at 20:27

@MaX: In my experience that’s usually what’s intended if it isn’t explicitly ruled out. If I’m in any real doubt or think that the student may not be distinguishing the two possibilities, I’ll say something about it.
–
Brian M. ScottDec 5 '11 at 20:46