Re: Math Problem - Probability of Password Duplication
- Posted by euphoria at carlw.legend.uk.com Oct 22, 2001
- 357 views
Brian Keene wrote: > Hi All: > Can someone who knows math & probability theory better than me (this isn't hard to > do :)!) tell me how to figure out how many possible passwords I can generate by > having the following parameters? > > Password Length = 11 to 14 characters > Possible Password Content = each character can be any 1 of 89 different > characters. > Character Set = a-zA-Z1-9{}[]()^_`~:;<=>? at !#$%&'+,-./ > Excluded Characters = 0|\" > > My understanding is that it would be: > > char14 = 89*89*89*89*89*89*89*89*89*89*89*89*89*89 -- (1.95641099e+027) > char11 = 89*89*89*89*89*89*89*89*89*89*89 -- (2.77517307e+021) > > result = char14 - char11 result = char14 + char13 + char12 + char11 = power(89,14)+power(89,13)+power(89,12)+power(89,11) ...since all groups are mutually exclusive. Here's what makes 'char14 - char11' seem logical (both of these are also the right answer): result = (char15 - char11)/88 = (power(89,15)-power(89,11))/(89-1) As for the function: constant validChars="abc..xyzABC..XYZ..etc" function password() sequence p integer len len = length(validChars) p = {} for i = 1 to 10+rand(4) -- 11..14 p &= validChars[rand(len)] end for return p end function Carl