Lab Storage and Roll-Number Encoding
A school in Nagaon is preparing a digital archive of 480 scanned answer scripts. Each scan is 2.5 MB. The lab has one 16 GB pen drive, but 1.5 GB is already occupied by software installers that cannot be deleted during the exam week. The teacher wants to copy the scans to the drive and keep at least 10% of the drive's total capacity free as a safety margin. Separately, each student's roll number (1 to 120) must be stored as an 8-bit binary code in the file header; roll number 91 is the first one being tested. A helper suggests ignoring leading zeros because 'they do not change the value'. The archive must also be split into folders of 60 scans each. The teacher is unsure whether the drive is sufficient and whether the 8-bit rule is being applied correctly.
1. Using 1 GB = 1024 MB, calculate whether the 480 scans fit on the pen drive while preserving the 1.5 GB of installers and the 10% free-space margin. Show each step.
Read the worked answer
Step 1: total scan size = 480 x 2.5 MB = 1200 MB. Step 2: drive capacity in MB = 16 x 1024 = 16384 MB. Step 3: installer space = 1.5 x 1024 = 1536 MB. Step 4: required safety margin = 10% of 16384 = 1638.4 MB. Step 5: space available for scans = 16384 - 1536 - 1638.4 = 13209.6 MB. Step 6: compare 1200 MB with 13209.6 MB. The scans fit easily, leaving about 12009.6 MB unused after the margin is reserved. The conclusion is the same if decimal GB is used, but the working must state the convention. The key judgement is that the 10% margin applies to total drive capacity, not to the remaining free space, and that the installer files must be counted before the scans.
2. Convert decimal 91 to 8-bit binary and to hexadecimal. Explain why the helper's suggestion to drop leading zeros is unsafe in this file header.
Read the worked answer
91 = 64 + 16 + 8 + 2 + 1. In 8-bit form this is 01011011. Grouping the bits as 0101 and 1011 gives hexadecimal 5B. Dropping the leading zero gives 1011011, which is still 91 as a number but is only 7 bits long. The header specification says the roll-number field is exactly 8 bits. A parser reading fixed-width fields will take the next bit from the following field, or shift the field boundary, and may decode the wrong roll number. The leading zero is padding that preserves the width, so it carries structural meaning even though it does not change the arithmetic value. Fixed-width encoding must never be shortened just because the numeric value is unchanged.