Encoding pictures – practice for Years 4–6
Sample questions on Encoding pictures with the right answer and a worked solution, from easy to hard. In the Pickles Academy app a child gets new questions of the same kind every time, so they can't just learn the answers by heart.
- Subject
- Computing
- Year
- Years 4–6
- Curriculum area
- Data, information and modelling
Question types: A picture as numbers
Rule: Encoding pictures
A row is written as how many squares of the same colour come in a row: white, coloured, white… Always start with white.
If a row starts with a coloured square, the first number is 0.
Example: white, white, white, black, white, white, white → 3, 1, 3
Watch out: Check the total: the numbers must add up to the width of the row, 3 + 1 + 3 = 7 squares.
Sample questions
-
Question 1 Easy
A picture is written row by row as numbers: how many white squares in a row, then how many coloured, then white… Each row starts with the number of white squares (it may be 0). What is the code of row 2 of the picture?
Show the solution
Answer: A) 0, 4, 1, 1How it works: Row 2: 0, 4, 1, 1.
-
Question 2 Normal
A picture is written row by row as numbers: how many white squares in a row, then how many coloured, then white… Each row starts with the number of white squares (it may be 0). Which row of the picture has the code 2, 1, 2, 1, 1?
Show the solution
Answer: C) row 3How it works: 1: 0, 1, 2, 1, 2, 1; 2: 0, 3, 1, 1, 2; 3: 2, 1, 2, 1, 1; 4: 1, 3, 3; 5: 2, 1, 3, 1
-
Question 3 Hard
A picture is written row by row as numbers: how many white squares in a row, then how many coloured, then white… Each row starts with the number of white squares (it may be 0). The picture has 8 columns and 6 rows; each line of the code is one row. How many squares are coloured?
10, 1, 2, 1, 2, 2 20, 2, 1, 1, 4 30, 1, 2, 1, 2, 2 40, 1, 5, 1, 1 52, 1, 2, 1, 2 63, 2, 1, 1, 1
Show the solution
Answer: 18How it works: The 2nd, 4th, 6th … numbers of each row are coloured: 4 + 3 + 4 + 2 + 2 + 3 = 18.
Keep practising in the app
In a minute, your child has their own avatar and a first task. Free, no ads, data in the EU.
Start for free