Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) What is the minimum number of bits required to store each binary string of l

ID: 3842107 • Letter: #

Question

(a) What is the minimum number of bits required to store each binary string of length 50?

(b) What is the minimum number of bits required to store each number with 9 base ten digits?

(c) What is the minimum number of bits required to store each length 10 fixed-density binary string with 4 ones?

(d) In terms of n, what is the minimum number of bits required to store each subset of a set with n elements?

(e) What is the minimum number of bits required to store each rearrangement of the numbers 1 through 8?

(f) What is the minimum number of bits required to store each three-letter string? (26 alphabetical letters, not case-sensitive)

Explanation / Answer

a) To store a single char you need a space of 1 byte == 4 bits, incase of 50 characters that will be 50 * 4 bits + a null byte to represent the end of the string. So that's 200 + 4 == 204 bits.

b) For a base of 9, the maximum number is 8 (1000 in binary) and hence evidently it occupies 4 bits aka 1 byte. so for 10 digits == 10 * 4 == 40 bits.

c) In a binary string even numbers are considered chars so 10 length char* will occupy 10 * 4 == 40 bits + 4 bits for null == 44 bits.

e) Each rearrangement what ever way will occupy as an int unless you specify something else. An int is a 32 bit / 8 byte number in modern compilers using c++ so 1 - 8 decimal each will occupy 32 bit each == 8 * 32 = 256 bits. No matter what way you toggle arround a contiguos set of 8 ints like 1 - 8 will occupy 256 bits / 64 bytes.

f) To store a single char you need a space of 1 byte == 4 bits, incase of 3 characters that will be 3 * 4 bits + a null byte to represent the end of the string. So that's 12 + 4 == 16 bits.