Fog Creek Software
Discussion Board




number of license plate combinations, occurence

License plates have this format: AAA-000 (3 letters, 3 numbers). All combinations are possible.

I was wondering what are the chances that the letter Q appears as one of the letters. The rest I don't care about.

If the license plate had one letter (format: A-000), then chances for Q are 1 in 26.

If the license plate had two letters (format: AA-000), then I think chances for Q appearing are 1 in 26*26 = 676.

What about three letters?

Stefaan R. M. Meeuws
Friday, September 17, 2004

I think this is how to solve this kind of problems.

Assuming no restrictions, the total number of possible license plates is 26*26*26*10*10*10 = (26*10)^3

The total number of license plates without the letter Q is (25*10)^3.  We just use 25 instead of 26 because Q is not allowed.

The total number of license plates with at least one Q is (26*10)^3 - (25*10)^3

Therefore the chance that Q is one of the letter is

[(26*10)^3 - (25*10)^3] / (26*10)^3

= (26^3 - 25^3) / 26^3

which is about .11

JHY
Friday, September 17, 2004

.. is that .11%? Meaning one in a thousand? (feeling not so smart while asking)

Stefaan R. M. Meeuws
Saturday, September 18, 2004

A little easier way to solve this problem:
First of all we can totally ignore the last 3 digits since they can never be a Q.
So now we need to find the probability of having a Q appear in a sequence of 3 letters.
This is similar to tossing 3 coins but with each coin having 26 faces, not just heads and tails :)
So we need to calculate the probability of having:
First letter is a Q OR 2nd letter is a Q OR 3rd letter is a Q
you can usually replace the OR with a + when calculating probability so this translates to:
1/26 + 1/26 + 1/26 = 3/26
This would translate to the same 0.115.... that we found earlier, but I think it's much easier.

Also note that this is the probability of having at least one Q in the 3 letters, not exactly one Q. So some of these combinations have 2 and 3 Qs not just one.

Christian Kamel
Saturday, September 18, 2004

Oh and also 0.115 is not "percent", it's just 0.115 so it means 115 in a thousand actually.

Christian Kamel
Saturday, September 18, 2004

1/26 + 1/26 + 1/26 = 3/26

That's wrong.  Following that logic, the odds for a sequence of 26 letters containing a Q is 1. 
The right answer is:
- probability of first letter being other than Q = (25/26)
- probability of first AND second letter being other than Q = (25/26)*(25/26)
- probability of first, second and third letter being other than Q =
(25/26)*(25/26)*(25/26)
- probability of at least one Q =
1 - ((25/26)*(25/26)*(25/26)) = about 1.11

Joe
Saturday, September 18, 2004

1.11 => 0.11 of course, so about 11%

Joe
Saturday, September 18, 2004

hmmmm well I think the probability for at least 1 letter Q in a 26 letter sequence is actually 1, that is considering normal distribution of the letters in the sequence....
but I'm not quite sure now, anybody with input about that?

Christian Kamel
Saturday, September 18, 2004

Think about this simpler problem.

I flip two coins, what is the chance that I get at least one head?

According to your logic, it is 1/2 + 1/2 = 1.

But the right answer is 3/4 because out of the four possible outcomes HH, HT, TH, and TT, three of the outcomes contains at least one head.

JHY
Sunday, September 19, 2004

Here is another way to look at it.  If the probability of at least one letter Q in a sequence of 26 letters is 1, then it is impossible to find a sequence of 26 letters without a Q.  You just have to find a counterexample to show this is wrong, for example the first sentence above.

Joe
Sunday, September 19, 2004

Sorry about that :$ I dunno what I was thinking

Christian Kamel
Sunday, September 19, 2004

*  Recent Topics

*  Fog Creek Home