I want to generate 16-digits hexadecimal serial-number like: F204-8BE2-17A2-CFF3.
(This pattern give me 16^16 distinct serial-number But I don't need all of them as I describe below)
I need an idea about how I can generate such serial-numbers randomly with an special characteristic which is: each two serial-numbers have (at-least) 6 different digits with probabilty of $p$ (p should be something more than %99).
(= It means if you are given two serial-number, they should still have difference in 6 indexes(digits) with probability of p)
Is there any math-idea about generating such serial-numbers ?
Thanks in advanced =)
Getting random serial numbers is simple with a completely uniform distribution - with 16 hex digits, the probability of any particular string is 1/16^16. You can work out the probability of collisions using random strings by looking at birthday attacks or the birthday problem.
In general, its a bad idea to generate your serial numbers randomly. You usually embed some structure in them, such as a checksum to guard against typo's and some other function to make sure a serial number is possibly a valid one before using a server or something for validation. See this StackOverflow article for more details.