Year 9 · Y9.2 Data Representation · Lesson 3

Stretch tasks Representing text, images and sound

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each term card to its meaning card.

  • 12 cards: each term has a meaning
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Representing text, images and sound

Representing text, images and sound: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. In ASCII, A is 65. What is the code for E?

    • 70
    • 68
    • 5
    • 69
  2. If a is 97 in ASCII, what is f?

  3. The character 5 is stored as the number 5.

    • True
    • False
  4. Why does Unicode text take more storage than ASCII?

    • Unicode stores a picture of every letter
    • Unicode adds spaces between characters
    • Unicode files are never compressed
    • Each character uses more bits
  5. How many colours can an image with 4 bits per pixel show?

  6. An image is 100 x 50 pixels with 8-bit colour depth. What is its size in bytes?

    • 40,000 bytes
    • 400 bytes
    • 500 bytes
    • 5,000 bytes
  7. Which TWO changes make an image file bigger?

    Tick 2.

    • Reducing the number of pixels
    • Using fewer colours
    • Removing the metadata
    • Increasing the resolution
    • Increasing the colour depth
  8. What is the sample rate of a sound recording?

    • How loud the sound is
    • The number of samples taken each second
    • The number of bits in each sample
    • The length of the recording
  9. A sound is sampled 1,000 times a second, at 8 bits per sample, for 10 seconds. How many bits is that?

  10. Order these images from the smallest file to the largest.

    Number these 1 to 4.

    • 10 x 10 pixels, 8-bit colour
    • 100 x 100 pixels, 1-bit colour
    • 100 x 100 pixels, 24-bit colour
    • 10 x 10 pixels, 1-bit colour
  11. Doubling the sample rate roughly doubles the size of a sound file.

    • True
    • False
  12. Why does an image file need metadata?

    • To store the photographer's password
    • So the computer knows its width and height to arrange the pixels
    • To make the colours brighter
    • To compress the image automatically

Quiz Challenge, round 2: Quick Fire

  1. Explain why Unicode has replaced ASCII for most uses. [2 marks]

  2. Calculate the file size of a 200 x 100 pixel image with a colour depth of 4 bits. Give your answer in bytes, with working. [2 marks]

  3. Explain the trade-off when the sample rate of a recording is increased. [2 marks]

  4. How many colours can an image with a 24-bit colour depth show? Explain. [2 marks]

Quiz Challenge, round 3: Big Think

  1. Explain how a sound is turned into binary, and why a higher bit depth improves the quality. [4 marks]

  2. A website wants its photos to load quickly but still look good. Evaluate how changing the resolution and colour depth would help. [6 marks]

This or That: tick the right answer

  1. Which character set can store emoji and every major writing system?

    • Unicode
    • ASCII
  2. How many different characters can 7-bit ASCII represent?

    • 256
    • 128
  3. What does resolution mean for an image?

    • The number of pixels, width by height
    • The number of colours a pixel can be
  4. Colour depth rises from 1 bit to 2 bits. How many colours can each pixel be now?

    • 4
    • 3
  5. What is the bit depth of a sound recording?

    • The samples taken each second
    • The bits used for each sample
  6. Which change makes a recording sound closer to the original?

    • A higher sample rate
    • A shorter recording
  7. What is the trade off across text, images and sound?

    • Better quality means bigger files
    • Better quality means smaller files
  8. An image is 10 by 10 pixels with 1 bit per pixel. How many bits is that?

    • 100
    • 20

Memory Match: match each term to its meaning

TermMeaning
A ASCII1 Over a million characters, including emoji
B Unicode2 Data about the file, such as its dimensions
C Pixel3 Measurements taken per second, in hertz
D Colour depth4 7 bits per character, 128 characters
E Sample rate5 The bits used for each pixel
F Metadata6 One dot of colour in an image
Answers

Round 1: Quiz Blitz

  1. 69 Letters are in order: A 65, B 66, C 67, D 68, E 69.
  2. 102 f is five letters after a, so 97 + 5 = 102.
  3. False The character 5 has its own code. In ASCII it is 53.
  4. Each character uses more bits ASCII uses 7 bits per character. Unicode uses 16 or more, to fit over a million characters.
  5. 16 n bits give 2 to the power n colours: 2 x 2 x 2 x 2 = 16.
  6. 5,000 bytes 8 x 100 x 50 = 40,000 bits. Divide by 8 for bytes: 5,000.
  7. Increasing the resolution; Increasing the colour depth More pixels, or more bits per pixel, means more numbers to store.
  8. The number of samples taken each second Sample rate is measured in hertz: samples per second.
  9. 80000 1,000 x 10 x 8 = 80,000 bits.
  10. 10 x 10 pixels, 1-bit colour → 10 x 10 pixels, 8-bit colour → 100 x 100 pixels, 1-bit colour → 100 x 100 pixels, 24-bit colour 100, 800, 10,000 and 240,000 bits. Multiply width, height and colour depth each time.
  11. True Twice as many samples each second means twice as many numbers to store.
  12. So the computer knows its width and height to arrange the pixels Without the dimensions, a long list of pixel colours could not be put back into the right grid.

Round 2: Quick Fire

    • ASCII has only 128 characters, enough for English only
    • Unicode covers every major writing system and emoji
    Model answer

    ASCII only has 128 characters, which is enough for English but not for other languages. Unicode has over a million characters, covering every major writing system and emoji.

    • 4 x 200 x 100 = 80,000 bits
    • 80,000 / 8 = 10,000 bytes
    Model answer

    4 x 200 x 100 = 80,000 bits. 80,000 / 8 = 10,000 bytes.

    • The quality is better: closer to the original sound
    • The file is bigger
    Model answer

    More samples each second capture the sound wave more accurately, so the quality is better and closer to the original. But there are more numbers to store, so the file is bigger.

    • 16,777,216, about 16.7 million
    • Because n bits give 2 to the power n colours, and each extra bit doubles them
    Model answer

    Each extra bit doubles the number of colours, so n bits give 2 to the power n colours. 2 to the power 24 is 16,777,216, about 16.7 million colours.

Round 3: Big Think

    • The sound wave is sampled: measured at regular intervals
    • Each measurement is stored as a binary number
    • The sample rate is how many samples are taken each second
    • A higher bit depth gives more possible values, so each sample is more precise
    • But the file is larger
    Model answer

    Sound is a continuous wave, so it is sampled: its height is measured at regular intervals, and each measurement is stored as a binary number. The sample rate is how many samples are taken each second, measured in hertz. The bit depth is how many bits store each sample. A higher bit depth gives more possible values for each sample, so each measurement can be more precise and closer to the real wave, which improves the quality, but the file is larger.

    • A lower resolution means fewer pixels, a smaller file and faster loading
    • Too low a resolution looks blocky or pixelated
    • A lower colour depth means fewer bits per pixel, so a smaller file
    • Too few colours makes photos look unrealistic, with banding
    • File size is colour depth x width x height
    • Photos need no more pixels than the screen will display
    • Compression could also reduce the size
    • A reasoned conclusion
    Model answer

    File size is colour depth x width x height, so reducing either helps. A lower resolution means fewer pixels, a smaller file and faster loading, and there is no point storing more pixels than the screen will display. But too low a resolution makes photos look blocky and pixelated, especially when enlarged. A lower colour depth means fewer bits per pixel and a smaller file, but photos need many shades, so too few colours makes them look unrealistic, with visible banding. Compression could also reduce the size. Overall, the best approach is to resize each photo to the size it is actually shown at and keep a high colour depth, because photos suffer far more from too few colours than from a sensible resolution.

This or That

  1. Unicode ASCII has only 128 characters. Unicode has over a million.
  2. 128 7 bits give 2 to the power 7 different codes, which is 128.
  3. The number of pixels, width by height Resolution is the pixel count. The bits per pixel are the colour depth.
  4. 4 n bits give 2 to the power n colours, so 2 bits give 4.
  5. The bits used for each sample Bit depth is the bits per measurement. The samples per second is the sample rate.
  6. A higher sample rate More samples per second follow the wave more closely, at the cost of a bigger file.
  7. Better quality means bigger files Better quality always needs more numbers, and more numbers always make a bigger file.
  8. 100 colour depth x width x height = 1 x 10 x 10 = 100 bits.

Memory Match

  • A 4 ASCII: 7 bits per character, 128 characters
  • B 1 Unicode: Over a million characters, including emoji
  • C 6 Pixel: One dot of colour in an image
  • D 5 Colour depth: The bits used for each pixel
  • E 3 Sample rate: Measurements taken per second, in hertz
  • F 2 Metadata: Data about the file, such as its dimensions