Year 10 Computing — Making a file smaller
Squeeze a run of repeated values into a count and a value, work out what that saves, and recognise the rows where it costs more than it saves.
Name: ________________________
1.A picture is 20 pixels wide and 15 pixels tall. Every row of it is a single colour the whole way across, and a run is never allowed to carry on from one row into the next. How many runs does the whole picture have?
2.A row of pixels reads “RRRRRRRGGG”. Write it in counted form, using a number and then the letter for each run.
3.Put these rows of pixels in order of how many runs each one has, fewest first.
- RRWWBBGG
- GGGGGGGG
- RRRRWWWW
- RGBRGBR
4.A row of 20 pixels changes colour at every single pixel along it. Writing it as runs costs two things per run. What does counting the runs do to the size of this row?
- a) It leaves it at exactly 20 things
- b) It halves it, from 20 things to 10
- c) It brings it down to 2 things
- d) It doubles it, from 20 things to 40
5.Two photographs have exactly the same number of pixels. One is of a clear sky and the other is of a crowd of people. Counting runs makes one of them much smaller than the other. Which one, and why?
- a) The sky, because long stretches of it are the same colour
- b) The sky, because it has fewer pixels in it
- c) Neither: counting runs saves the same amount on any picture
- d) The crowd, because there are more colours in it altogether
6.Match each row of pixels to the number of runs it has.
- BBBWWBB
- RRRRRRRR
- RGRGRG
- WWWWBB
- RRGGBBRRG
- 1
- 6
- 5
- 2
- 3
7.A row of 90 pixels has 12 runs. Written out pixel by pixel it costs one thing per pixel; written as runs it costs two things per run. How many things does writing it as runs save?
8.A counted row reads “4W2B5W”. How many pixels long is the row it stands for?
Answer key — Year 10 Computing — Making a file smaller
- 1. 15
- 2.
- 7R3G
- 7R 3G
- 3. 1. GGGGGGGG 2. RRRRWWWW 3. RRWWBBGG 4. RGBRGBR
- 4. d) It doubles it, from 20 things to 40
- 5. a) The sky, because long stretches of it are the same colour
- 6. BBBWWBB → 3; RRRRRRRR → 1; RGRGRG → 6; WWWWBB → 2; RRGGBBRRG → 5
- 7. 66
- 8. 11