In this programming exercise we are going to construct a third version of the difference finding algorithm, along with a third version of a strategy for generating the two files of random integers.
First off, here is an alternative algorithm for generating a file of random numbers with no repeats similar to the files we generated in versions one and two:
Where the does the magic number N (1-1/e) come from? For this we need a little probability theory. The probability that any given number will appear at least once when we select N numbers at random from the range 0..N-1 is
In the limit where N gets large, this is 1 - 1/e. The expected total number of distinct numbers that appear in a sequence of N draws from 0..N-1 is then just N times this 1 - 1/e factor.
Secondly, here is an algorithm to determine the list of numbers that appear in exactly one of the two files:
To submit your work for grading, compress your project folder into a zip archive and upload that archive to the course Canvas page.