Explain your answer and receive 10 points.
-
it depends on the base of your ID. if the Id number is 10 based, 2 digits would be enough - from 0 to 99. if it's meant to be a computer science question, computers are 2 based, hence you need to have as many number of digits (bits) as the total number of students.
If you have 1 bit, the ID can be 0 or 1, a total of 2 unique IDs.
if you have 2 bits, the ID can be 00,01,10,11, a total of 2 unique IDs.
if you have n bits, the ID has a total of 2^n bits.
if you want the total to be larger than 100, solve:
2^n =100, n = log2(100), n = 6.64, hence the minimum number of digits needed. If we take the closest larger integer, 7 bits is needed to assign 100 students with unique base 2 IDs.
to check, 2^7 = 128, which is larger than 100.
If you have 1 bit, the ID can be 0 or 1, a total of 2 unique IDs.
if you have 2 bits, the ID can be 00,01,10,11, a total of 2 unique IDs.
if you have n bits, the ID has a total of 2^n bits.
if you want the total to be larger than 100, solve:
2^n =100, n = log2(100), n = 6.64, hence the minimum number of digits needed. If we take the closest larger integer, 7 bits is needed to assign 100 students with unique base 2 IDs.
to check, 2^7 = 128, which is larger than 100.