One wrong digit changes the picture

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

One wrong digit changes the picture

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A 5x5 picture is coded as 0s and 1s. One digit in the code is wrong. How many pixels will look wrong?
A The whole picture
B One pixel
2. The code for a row should be 1 1 1 1 1, but it says 1 1 0 1 1. What will you see when you decode it?
A A white pixel in the middle of the row
B The whole row turns white
3. How can you check if a coded picture has a mistake?
A Count how many 1s there are and guess
B Decode it back into a picture and look for a wrong pixel
4. You find one wrong pixel in the decoded picture. What is the best fix?
A Change the one digit that makes that pixel
B Rewrite every digit in the code
5. A row should be 0 1 1 0 but it says 0 1 0 1 (two digits swapped). What happens?
A Two pixels in that row show the wrong colour
B Nothing changes in the picture

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
10110 -> 0100 ATwo digits were swapped, so two pixels in the row change places.
20110 -> 0101 Bdecode to check
3A row should have 4 digits, but a digit went missing, so the rest of the row shifts along. CA wrong digit is hard to see in a string of 0s and 1s. Decode the code back into a picture to find the mistake.
4To check a coded picture, decode each row into pixels and look for a pixel that does not fit the picture. DOnly one digit is wrong, so only one pixel needs fixing. Change the single digit instead of redrawing everything.
5Row 2 is 1001 but the picture needs 1011, so I will redraw the whole picture. E011 (should be 0110)
6The code looks fine, so I will not decode it to check. FOne digit changed from 1 to 0, so just one pixel in the row turns from black to white.

Definitions

decode to check

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Picture: B W W B Wrong code: 1 1 0 1 Fixed code: 1 _ 0 1
2.
Wanted row: 1 0 0 1 Typed row: 1 0 1 0 The last two digits are _______
3.
Row should have 4 pixels: 1 0 1 0 Code with a digit missing: 1 0 0 Missing digit: row has _ pixels, not 4
4.
code ← 1001 picture ← ______(code) show(picture)
5.
Picture row: W B B B W Code: 0 1 0 1 0 Wrong digit is number _ from the left

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Picture: 4 wide, 4 tall
B Row 1: 0110
C Row 2: 1001
D Row 3: 0110
Question 2
A Plus sign, 3 by 3
B Row 1: 011
C Row 2: 111
D Row 3: 010
Question 3
A Letter L, 3 by 3
B Row 1: 010
C Row 2: 100
D Row 3: 111
Question 4
A Each row has 5 digits
B Row 1: 01110
C Row 2: 1001
D Row 3: 11111
Question 5
A X shape: 3 rows of 3
B row1 = 111
C row2 = 010
D row3 = 101

Answer Key

One wrong digit changes the picture
Section A: Quick Questions
Q1
B — One pixel
Q2
A — A white pixel in the middle of the row
Q3
B — Decode it back into a picture and look for a wrong pixel
Q4
A — Change the one digit that makes that pixel
Q5
A — Two pixels in that row show the wrong colour
Section B: Match the Pairs
Q1
0110 -> 0100 → One digit changed from 1 to 0, so just one pixel in the row turns from black to white.
Q2
0110 -> 0101 → Two digits were swapped, so two pixels in the row change places.
Q3
A row should have 4 digits, but a digit went missing, so the rest of the row shifts along. → 011 (should be 0110)
Q4
To check a coded picture, decode each row into pixels and look for a pixel that does not fit the picture. → decode to check
Q5
Row 2 is 1001 but the picture needs 1011, so I will redraw the whole picture. → Only one digit is wrong, so only one pixel needs fixing. Change the single digit instead of redrawing everything.
Q6
The code looks fine, so I will not decode it to check. → A wrong digit is hard to see in a string of 0s and 1s. Decode the code back into a picture to find the mistake.
Section C: Definitions
Q1
decode to check — One wrong digit in an image code changes just one pixel. Decode the code back into a picture to spot the wrong pixel, then fix that digit.
Section D: Fill in the Blanks
Q1
Picture: B W W B Wrong code: 1 1 0 1 Fixed code: 1 0 0 1
Q2
Wanted row: 1 0 0 1 Typed row: 1 0 1 0 The last two digits are swapped
Q3
Row should have 4 pixels: 1 0 1 0 Code with a digit missing: 1 0 0 Missing digit: row has 3 pixels, not 4
Q4
code ← 1001 picture ← decode(code) show(picture)
Q5
Picture row: W B B B W Code: 0 1 0 1 0 Wrong digit is number 3 from the left
Section E: Spot the Error
Q1
A — The code has only 3 rows, so decoding gives a picture that is 3 tall, not 4. The line should say '3 tall'.
Q2
B — Decoding row 1 gives an extra black pixel on the right, so the plus sign is spoiled. One digit is wrong. Row 1 should be 010.
Q3
B — The first two digits were swapped. This moves the black pixel one place to the right. Row 1 should be 100 so the L stands up straight.
Q4
C — Row 2 has only 4 digits when every row needs 5. A missing digit shifts the row and the picture goes wrong. It should be 10001.
Q5
B — Decoding row1 gives three black pixels, but an X has a gap in the middle of the top row. One digit is wrong. It should be 101.