OCR
A Level
Thinking
abstractly
Computer Science
Unit 10
H446 – Paper 1
Computational thinking
1
DNA
• Give 4 points on how computers have
changed the way in which people work
and the impact this may have on their
wellbeing. [4]
Start of the lesson
Learning outcomes and knowledge components
By the end of the lesson, you will:
• know about Thinking abstractly
To achieve this, you will need to know:
• the nature of and need for abstraction
• the differences between an abstraction and reality
• How to devise an abstract model for a variety of situations
Thinking abstractly
Unit 10 Computational thinking
What is computational thinking?
Computational thinking is simply working out how to
work things out, or:
‘The ability to think
logically about a
problem and apply
techniques for solving it’
• It is closely related to the
skill of designing
algorithms which can be
turned into computer
programs
Thinking abstractly
Unit 10 Computational thinking
Computational thinking
“Computational thinking involves solving problems,
designing systems, and understanding human
behaviour, by drawing on the concepts fundamental to
computer science.”
Jeannette M Wing
Vice President, Head of Microsoft Research International
Computational
Thinking
Computational thinking is
thinking in a way that
allows computers to solve
problems. It has to do with
both how we formulate a
problem and how we solve
it – the steps to do it.
Elements of computational
thinking include:
1. Thinking abstractly
2. Thinking ahead
3. Thinking procedurally
4. Thinking logically
Thinking abstractly
Unit 10 Computational thinking
Computer Science
• …is about using mathematical principles to solve
problems
• …is not about how to use a spreadsheet, a word
processor or a graphics package
• …involves learning to think computationally
• … and applying the principles of abstraction
What is
abstraction?
“The process of separating ideas
from reality.”
• Abstraction can be an odd concept
to get your head around at first –
however, it is very simple.
• Abstraction is the process of
separating ideas from reality – in
other words, hiding unnecessary
detail and showing details that are
important in context.
• Here is an abstract painting of a
mountain landscape – the artist has
chosen a specific approach for this
painting, choosing to remove
several details while exaggerating
others to achieve their desired
visual style.
Abstraction and computer science
• When it comes to designing
computer systems, software
and interfaces, abstraction
often uses similar themes such
as:
o Symbols
o Legends
o Colour-coding
o Icons
• These are all methods of
accentuating real-life features.
• Icons are a great example of
abstraction – they can be used
to suggest a function or process
in a simple, efficient way.
Abstraction in everyday life
• We see abstraction every day
– it is not confined to
computer science.
• All three of these images are
clearly of a cat – the only
difference is the level of
abstraction used.
• In the middle image, some
details have been removed
and others highlighted to
create this cartoon-style
abstraction.
• Almost all details have been
removed in the rightmost
version to create a black
silhouette abstraction.
Thinking abstractly
Unit 10 Computational thinking
Task 1
Thinking abstractly
Unit 10 Computational thinking
Thinking abstractly
• Abstraction typically involves:
• devising a model that represents the reality – for example,
think of a simple queue, or something as complex as a
climate change model
• removing details that are not relevant to the problem
• What details about a queue are irrelevant to figuring
out how many tills are needed in a new store?
Thinking abstractly
Unit 10 Computational thinking
Another queueing problem
• Suppose you are trying to find a solution to the
problem of bottlenecks at toll booths on a motorway
• What factors would be relevant, and what
would be irrelevant?
Thinking abstractly
Unit 10 Computational thinking
Abstraction and reality
• Abstraction is an important tool in problem-solving
• All the details that do not contribute to the essential
characteristics of the problem are omitted
• The London Underground map is a good example of
information hiding
• Can you think of others?
Abstraction
• We are going to be using the
example of London and
various different map styles
to cover abstraction in more
detail.
• Maps are a great example of
abstraction – but remember,
the concept has far widerreaching uses.
The need for
abstraction
•
We often need to remove some
details and highlight others to
improve the clarity of what we are
trying to convey.
•
Take the example of London – here
is a satellite view of part of the city.
The need for
abstraction
•
We often need to remove some
details and highlight others to
improve the clarity of what we are
trying to convey.
•
Take the example of London – here
is a satellite view of part of the city.
•
Here is a very different version of
the same image – this time, the
road layouts are clearly highlighted.
The need for
abstraction
•
We often need to remove some
details and highlight others to
improve the clarity of what we are
trying to convey.
•
Take the example of London – here
is a satellite view of part of the city.
•
Here is a very different version of
the same image – this time, the
road layouts are clearly highlighted.
•
This image is highlighting the area’s
rail network.
The need for
abstraction
•
We often need to remove some
details and highlight others to
improve the clarity of what we are
trying to convey.
•
Take the example of London – here
is a satellite view of part of the city.
•
Here is a very different version of
the same image – this time, the
road layouts are clearly highlighted.
•
This image is highlighting the area’s
rail network.
•
This one focuses on local parks and
green spaces.
The need for
abstraction
•
We often need to remove some
details and highlight others to
improve the clarity of what we are
trying to convey.
•
Take the example of London – here
is a satellite view of part of the city.
•
Here is a very different version of
the same image – this time, the
road layouts are clearly highlighted.
•
This image is highlighting the area’s
rail network.
•
This one focuses on local parks and
green spaces.
•
Finally, this image shows locations
of interest for tourists such as
hotels.
The need for
abstraction
• All these maps are accurate
representations of London in one
way or another.
• However, only the satellite view
photo is a true representation –
arguably, it is also the least useful.
• All the other images are
abstractions – certain details have
been removed and others
highlighted.
• Without abstraction, it would be
difficult and confusing to model
and display certain features.
Abstraction vs reality
• This third map – overlayed over
part of the last map we looked
at – has been abstracted even
further.
• The only above-ground feature
still visible is the River Thames.
• This map follows the geography
of London – each of the tube
stations and lines are clearly
shown.
• We are now very far removed
from reality, but this version of
the map is finally starting to
meet its intended purpose – to
help tourists travel via London's
tube network.
• Could we make it better by
applying even more
abstraction?
The need for
abstraction
• In computer science, abstraction is a
method of computational thinking and
problem-solving that focuses on what is
important.
• What has been abstracted when you
save a file?
• For example, when you save a file:
o Where is it stored?
o How is the data represented?
• This level of detail is abstracted. Users
only need to be able create, open,
move, save and delete files – they don’t
need to be concerned with how it all
happens.
Abstraction and interface design
• What is important in the user
interface of a sat-nav device?
• The image shown here would be
pointless – it’s realistic, but the
driver might as well look out the
windscreen.
• So, what should be included on
the display? What is less
important?
• Include:
o Location
o Road layout
o Additional icons (volume,
time, signal strength, etc.)
• Remove:
o Buildings
o Trees
o Countryside
Thinking abstractly
Unit 10 Computational thinking
A robot vacuum cleaner… this?
Thinking abstractly
Unit 10 Computational thinking
… or this?
Thinking abstractly
Unit 10 Computational thinking
Scuba diving map
• This abstract map of underwater rocks at a dive
resort helps scuba divers to orient themselves
Thinking abstractly
Unit 10 Computational thinking
Problem abstraction
• This involves removing details until
the problem reduces to one which
has already been solved
• What do maps of a town, of the
ocean floor, of a country, have in
common?
• What do fingerprint recognition, iris
scanning, footprint scanning, text
recognition, number plate
recognition, have in common?
Thinking abstractly
Unit 10 Computational thinking
Modelling and simulation
• Building a model of a real world object or
phenomenon may be used to help solve a particular
problem
• Computer scientists have to decide what details are
relevant to the problem and discard everything else
• Algorithms and data structures can then be designed
to solve the problem
• The algorithm is then implemented in program code
and executed
Thinking abstractly
Unit 10 Computational thinking
Models of real-world problems
• A financial model which calculates the likely profit
from a coffee shop, based on the available data
Thinking abstractly
Unit 10 Computational thinking
Models of real-world problems
• A climate change model which predicts the
consequences of a 2OC rise in temperature
Thinking abstractly
Unit 10 Computational thinking
Models of real-world problems
• An aircraft simulator which can be used to train pilots
Devising an abstract
model
Here is an example of abstracting the original map to make it more suitable for tourists – methods include colours, icons, graphics and labels.
Abstraction and program design
Plug in the lamp
NO
Lamp doesn’t work
Is the lamp
plugged
in?
YES
Replace the bulb
YES
Is the bulb
broken?
NO
Repair the lamp
• Flowcharts are another
example of how we can use
abstraction when designing
a solution to a problem.
• A flowchart is simply an
abstraction of program
code.
Thinking abstractly
Unit 10 Computational thinking
TASK 2
End of the lesson
Exit ticket – knowing and remembering more
You should now know:
• the nature of and need for abstraction
• the differences between an abstraction and reality
• How to devise an abstract model for a variety of situations
To demonstrate this, your challenge is to:
A group of A-level students are working together to program a computer game.
In the game, the player controls a character who moves through a virtual world. The game
starts with a load-up screen. The player can select which area to move to on an on-screen
map, and then they control the movements of their character using a keyboard to solve
puzzles on the screen.
Explain, using examples, how abstraction would be used to create the virtual world.