First, it is important to note that digits refers to the numerals 1, 2, 3, 4, 5, 6, 7, 8, 9 and 0. Therefore, when we say a four digit code, it strictly means that the code uses these digits only. So, a four digit code here could take any number from 0000 to 9999 if every digit is used more than one time.

This results in a total of 10,000 different combinations. This is assuming that the code must contain a minimum of four digits. Also, just to mention it, the probability of guessing the code correctly is equal to the inverse of the number of different possible codes. Thus, if we take a four digit code (with less than 4 digits not being permitted), the probability of guessing the code correctly in one attempt is 1/10,000 (or 0.0001).

More Info: www.reference.com