Custom License Plates without specific characters

42 Views Asked by At

If I have a license plate that has 3 capital letters followed by 2 digits but it can't have both Z and 6 in it at the same time.

My guess for a possible logic is: All possible license plates - (License plates with any number of Z's and 6's simultaneously)

All possible license plates would be: $26^3 \cdot 10^2$

But I can't seem to figure out the subtraction part in my logic.

1

There are 1 best solutions below

4
On BEST ANSWER

There are $26^3 \cdot 10^2$ total plates.

You have to subtract off all plates with at least one Z and one $6$. There are $6 \cdot 26^2 \cdot 10$ of those.

But this double-counts plates that are "bad" for two reasons. So you have to add back plates with one Z and two $6$s ($3 \cdot 26^2$) and also add back plates with two Zs and one $6$ ($6 \cdot 26 \cdot 10$).

Now you've added back too many. Subtract back plates with two Zs and two $6$s ($3 \cdot 26$). Also subtract back plates with three Zs and one $6$ ($20$).

Finally, you must add plates with three Zs and two $6$s ($1$).

So the answer is $26^3 \cdot 10^2 -6 \cdot 26^2 \cdot 10 + (3 \cdot 26^2+6 \cdot 26 \cdot 10) - (3 \cdot 26+20) +1$.