Suppose the domain set of an attribute consists of signed four digit numbers. What is the percentage of reduction in storage space of this attribute if it is stored as an integer rather than in character form?
View worked solution
Answer: C
To find the percentage reduction in storage space, we compare the storage requirements of the attribute in character form versus integer form.
1. Storage in Character Form
A signed four-digit number (e.g., -9999 or +1234) consists of:
- sign character (
+or-) - digit characters
This requires a total of characters. Since each character typically takes byte of storage, the total space required in character form is:
2. Storage in Integer Form
The range of signed four-digit numbers is from to . The total number of distinct values in this range is:
To represent distinct values, the minimum number of bits required is:
In standard computer systems, memory is allocated in bytes. The smallest standard integer size that can accommodate bits is a -byte (-bit) short integer (which can store values from to ). Thus, the space required in integer form is:
3. Percentage Reduction
The reduction in storage space is:
Hence, the percentage of reduction in storage space is 60%.
Free practice · Your answers on this page are not saved.
