Chapter 13: Computational thinking and algorithms

OCR GCSE Computer Science Teaching and Learning Resources
Chapter 13: Computational thinking and
algorithms
ANSWERS TO QUESTIONS IN THE STUDENT’S BOOK
Page 101
Question
1. Make a list of three other abstractions in addition to those given on page 101
of the OCR GCSE Computer Science Student’s Book.
Answer
Many possibilities, including:
·
weather modeling
·
economic models
·
architectural plans
·
wiring diagrams
Question
2. Make a list of two or three problems that face humans and for which no
solution is likely.
Answer
Many possibilities.
Answers will be largely ‘human’ problems or environmental problems that are
beyond human control such as the weather, political beliefs, philosophical differences
or war.
Question
3. Describe a problem that can be solved, at least in part, by the combination of
human and computer resources.
Answer
Example: applying for a job. Research can be done using a computer but making a
decision involves emotion.
Question
4. Describe a problem that can be completely solved by using a computer.
Answer
Anything that is calculable and for which adequate data is available.
OCR GCSE Computer Science
© Hodder & Stoughton Limited 2016
OCR GCSE Computer Science Teaching and Learning Resources
Page 104
Question
5. Write a simple algorithm for making a cup of tea.
Answer
Example (could be extended):
fill kettle
boil water
get mug
get tea bag
put teabag in mug
pour water on teabag
until mug full
get milk
add milk
Question
6.
a) How could you test the effectiveness of the example algorithm given
on page 104 of the OCR GCSE Computer Science Student’s Book for
making your trip to school?
b) Describe what data you would need to compare it with an alternative
algorithm to achieve the same result.
Answer
a) Count the number of decisions made. Could more iteration be used?
b) A map of the area, to examine and compare alternative routes or bus
timetables.
Page 110
Question
7. Which of the two methods of ordering playing cards described on page 110 of
the OCR GCSE Computer Science Student’s Book seems to be the more
efficient? Why?
OCR GCSE Computer Science
© Hodder & Stoughton Limited 2016
OCR GCSE Computer Science Teaching and Learning Resources
Answer
Binary search is more efficient because fewer comparisons are made.
Page 115
Question
8. Show the stages of the bubble sort when applied to the list:
DCBA.
Answer
Main steps – flags not shown:
Compare D with C
Swap
Compare B with A
Swap
Now have CDAB
Compare C with D
No swap
Compare D with A
Swap
Now have CADB
Compare D with B
Swap
Now have
CABD
Compare C with A
Swap
Now have ACBD
Compare B with D
No Swap
Compare A with C
No swap
Compare C with B
OCR GCSE Computer Science
© Hodder & Stoughton Limited 2016
OCR GCSE Computer Science Teaching and Learning Resources
Swap
Compare B with D
No swap
Now have
ABCD
Repeat process – no swaps this time.
Question
9. For a binary search to work, what state must the data list be in?
Answer
In order
Question
10. In a binary search, which data item in a list is examined first?
Answer
The middle value
Question
11. A linear search is used on a pack of 52 playing cards. How many comparisons
must be made in order to prove that a certain card is not present?
Answer
52
Question
12. Show how an insertion sort can place in order the names: London, Cambridge,
Birmingham, Manchester, Leeds.
Answer
Move London to start of new list.
New list: London
Old list: Cambridge, Birmingham, Manchester, Leeds.
Cambridge is before London alphabetically so move in front of London.
New list: Cambridge, London
Old list: Birmingham, Manchester, Leeds.
Birmingham is before Cambridge so move in front of Cambridge
OCR GCSE Computer Science
© Hodder & Stoughton Limited 2016
OCR GCSE Computer Science Teaching and Learning Resources
New list: Birmingham, Cambridge, London
Old list: Manchester, Leeds.
Manchester is after London so place after London.
New list: Birmingham, Cambridge, London, Manchester
Old list: Leeds.
Leeds is before London so place in the correct place.
New list: Birmingham, Cambridge, Leeds, London, Manchester
Old list: empty.
Question
13. What is meant by the term abstraction?
Answer
Making a representation of reality.
Question
14. Explain why a bubble sort is rarely used in commercial applications.
Answer
·
There are far too many comparisons so a bubble sort is very inefficient
·
Bubble sorts are very slow compared with better algorithms
·
Big data sets are a particular problem for bubble sorts
OCR GCSE Computer Science
© Hodder & Stoughton Limited 2016