Million-to-one chances are a running theme in a few of his books, but aiming specifically for it as in Guards, Guards! is one of the better awesome things in the Discworld
It seems like a pretty direct homage to the Infinite Improbability Drive from Hitchhiker's Guide to the Galaxy, which is created from thin air by working out exactly how improbable such a device is and plugging this number into a finite improbability generator (such machines themselves "often used to break the ice at parties by making all the molecules in the hostess's undergarments leap simultaneously one foot to the left, in accordance with the theory of indeterminacy.").