What are the odds? I am trying to create a unique code for people who create an object in my application. I am wanting to determine the odds of the same unique code being generated. This may depend on how I generate random numbers, but for the sake of this exercise if we can pretend they're absolutely random and that would be fine.
The unique code consists of:


*

*The current date (e.g. 10102015)


I then generate an 8 character code using the following:


*

*Generate a random number between 1 and 100


If the random number is between 1 and 75 then I generate a second random number between 1 and 26 and assign the character to the correlating letter of the alphabet.
If the random number is between 75 and 100 then I generate a random number between 0 and 9 and assign the character this number.
For example, a final code might look like:
10102015gy7e4f5g
As the initial part of the code is date based the final figure will be the chance of this repeating on a single day. Which Im guessing is a ridiculously high number (hopefully).
EDIT:
The reasons this is being done this way is because the application is an 'offline' application, but has the functionality to push certain things (called Boards in the app) to other users.
From the comments below I've figured a better way to do this now. But still, interested to know how many possible combinations this way would produce.
Thanks :D
 A: Assuming that all characters are in fact equally likely, there are $36^8\approx 2.8\times 10^{12} \approx 2^{42}$ unique codes which can be generated on a single day.
Wikipedia has a table of values on its page about the Birthday Problem (which this is a rewording of), showing that for a scenario with a few fewer available codes (half as many) then with $1.5\times 10^5$ users on a given day, there would be a $1\%$ chance of (at least one) repeated code.  With 4700 users the probability is around $0.1\%$ (one in a thousand).  With 150 users on a given day, the probability of a repeated code would be a $1\times 10^{-6}$ (one in a million).  With 47 users on a given day, it would be one in a billion.
With $8\times 10^5$ users the probability has gone up considerably to $25\%$ chance of a collision, and with $1.2\times 10^6$, the probability of a collision is over $50\%$.  (A somewhat surprising result, despite having over a trillion unique id's available, it only requires a million users to have the probability of at least two people generating the same id be worse than $50\%$).
The expected waiting time until having a collision is $\frac{1}{p}$ (see negative-binomial distribution).  For example, if you have 4700 users per day, you should be able to expect it to run for 1000 days without any duplicate ids.

(the real odds will be somewhat different for two reasons, the estimates I used were for equally likely sequences.  As your pseudocode has a preference for letters rather than numbers, chances of matches will be higher and the odds slightly worse .  However, to offset this, I rounded down to the nearest entry on the table which uses fewer available sequences making matches more likely, causing your odds to be slightly better .  In all, even through the simplifications and estimates I wouldn't expect the true values to vary by more than an order of magnitude from those given here).
