Buckinghamshire CC ANPR cameras

David Goodenough david.goodenough at btconnect.com
Tue Jan 10 13:53:30 GMT 2012

```On Tuesday 10 Jan 2012, Clive D.W. Feather wrote:
> John Wilson said:
> > As the hash is only 24 bits and there are 34.5 million licensed
> > vehicles on the road there must be collisions even if the hash
> > function were perfect (and it's not).
>
> Hmm. Let's assume for the moment that the overall algorithm brings 3 cars
> into one hash on average. Then that's about 11.5 million hashes. At
> 2-second spacing, a camera over a lane would see 1800 cars per hour, so
> let's assume 20,000 cars per day and assume no car passes the camera twice.
> What's the chance of a hash collision in that lot?
>
> If I've done my algebra correctly, I get the probability of no collision
> as approximately:
>
>     p = {r^k (n/r)!/(n/r - k)!} / {n!/(n - k)!}
>
> where r = 3, n = 11.5 million, k = 20000. So that's:
>
>     p = 3^20000 *  3833333! * 11480000! / (11500000! * 3813333!)
>
> Using Stirling's formula and logs [ln n! = n (ln n - 1) + 0.5 ln n +
> 1.837877] we get:
>
>     ln p = 20000 ln 3 +  3833333 (ln  3833333 - 1) + 0.5 ln  3833333
>                       + 11480000 (ln 11480000 - 1) + 0.5 ln 11480000
>                       - 11500000 (ln 11500000 - 1) - 0.5 ln 11500000
>                       -  3813333 (ln  3813333 - 1) - 0.5 ln  3813333
>
>          = 21972.2458 +  3833333 (15.15925 - 1) + 0.5 * 15.15925
>                       + 11480000 (16.25611 - 1) + 0.5 * 16.25611
>                       - 11500000 (16.25786 - 1) - 0.5 * 16.25786
>                       -  3813333 (15.15401 - 1) - 0.5 * 15.15401
>
>          = -108.09
>
> So the probability of a collision is 1 - 1.14e-47, or just about certain.
Have you factored in that most of the cars in a given area will share
part of their number (all cars registered in Oxford in the post 2001
scheme start OX)?  On a motorway this will not make much difference, in
an urban setting it might well skew the distribution of plates.

David

```