Minimum bits to encode a set of values

A program must store each item below as a binary code, giving every possible value its own distinct pattern. For each row, enter the minimum whole number of bits needed.

Item to encodeNumber of possible valuesMinimum bits
Light switch state2
Decimal digit10
Letter of the English alphabet26
Score from 1 to 100100
Day of the year in a leap year366
Seat in a 1000-seat arena1000

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Computer Representation of Data Questions: