A language has 28 different letters in total. Each word in the language is consists of maximum 7 letters. You want to create a data-type to store a word of this language. You decide to store the word as an array of letters. How many bits will you assign to the data-type to be able to store all kinds of word of the language?
Answers
Answered by
5
Answer:
35 bits
Explanation:
In binary, there are only two possibilities- zero and one.
Thus, looking at the powers of 2, we realize that 32 is the closest exponential result of 2 to 28, where 2^5 = 32.
Hence, to cover all the possibilities, we need 5 bits at the least.
But there are seven letters. Thus, the number of bits we require is 7 * 5 = 35 bits
Similar questions