Bits and Bytes Examples: 47 Problems with Answers
Worked examples of Bits and Bytes to try before you open each solution, then practice problems with answers.
Worked Examples
Example 1
easyShow solution
Answer
First step
Full solution
- 2. Step 2: The patterns are: 000, 001, 010, 011, 100, 101, 110, 111.
- 3. Step 3: These represent the values 0 through 7 in decimal. In general, n bits can represent different values.
Example 2
mediumExample 3
mediumExample 4
hardPractice Problems
Try each one, then open the solution to compare your method.
Example 1
mediumExample 2
hardExample 3
easyExample 4
easyExample 5
easyExample 6
easyExample 7
easyExample 8
easyExample 9
easyExample 10
easyExample 11
mediumExample 12
mediumExample 13
mediumExample 14
mediumExample 15
mediumExample 16
mediumExample 17
mediumExample 18
challengeExample 19
challengeExample 20
challengeExample 21
mediumExample 22
mediumExample 23
easyExample 24
easyExample 25
easyExample 26
easyExample 27
easyExample 28
easyExample 29
mediumExample 30
mediumExample 31
mediumExample 32
mediumExample 33
mediumExample 34
mediumExample 35
mediumExample 36
mediumExample 37
mediumExample 38
mediumExample 39
hardExample 40
hardExample 41
hardExample 42
hardExample 43
challengeWhat to focus on
Core idea: All digital data—text, images, music—is ultimately stored as sequences of bits grouped into bytes.
Common stuck point: KB, MB, GB are each other, not (though marketing often uses 1000).
Ask yourself: Is the question how many values some bits can hold, or how much space or speed something needs in bits or bytes?
Concept recap
A bit is a single binary digit (0 or 1), the smallest unit of digital data. A byte is a group of 8 bits that can represent 256 different values (0 to 255), enough to encode one text character. All digital storage and communication is measured in bits and bytes.
Bits behave like coin flips in a row: one flip has 2 outcomes, two flips have 4, ten flips have 1,024, because each new flip doubles every list of results so far. A byte is a row of 8 flips, 256 possible rows. The comparison stops at chance: a computer sets each bit on purpose.
Read the full lesson on Bits and BytesCommon mistakes to watch for
Bits and Bytes is covered with related ideas in the guide Computational Thinking Fundamentals: Dependency Graphs, Patterns, Bits and Bytes.
Related concepts
Background knowledge
These ideas may be useful before you work through the harder examples.