What is probability of having a String with random length with random characters ? For example I want to generate 100 Strings with random length k
(between 1 to 100) and generate k
numbers of characters (between 1-256 ASCII characters). What's the probability to get a duplicate (exact same string with same length and characters) ?
Here's the psuedocode
for i=0 to 100 int size = random_int_range(1,100) str = "" for j=0 to size str += (char) random_int_range(1,256)
random_int_range is uniformly distributed.