Every student has a a student number comprised of 7 digits.
Write a short program which randomly generates a 7 digit value and then write some code to test for the following:
- Find the first student number which repeats the last two digits of a previously generated student number. Record how many tries it took to encounter this "collision". Run this code 200 times (with different seeds please), record the counts, and present the data in a nice visual. Have a look at https://matplotlib.org/ for some help creating visualizations in Python. There are also some simple examples in my intro notebook.
- Repeat for the last three digits.
- Repeat for the last four digits.
Consider using a binary array or hashmap.