Introduction To Computational Thinking
Introduction To Computational Thinking
M269_1
Introduction to computational
thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
There you’ll also be able to track your progress via your activity
record, which you can use to demonstrate your learning.
Intellectual property
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
978-1-4730-1811-2 (.kdl)
978-1-4730-1043-7 (.epub)
Page 5 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Contents
Introduction
Learning outcomes
2.2 Encapsulation
Conclusion
Glossary
References
Acknowledgements
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Introduction
One can major [i.e. graduate] in computer science and do
anything. One can major in English or mathematics and go on to a
multitude of different careers. Ditto computer science. One can
major in computer science and go on to a career in medicine, law,
business, politics, any type of science or engineering, and even
the arts.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Learning outcomes
After studying this course, you should be able to:
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
1.1 Automation
Activity 2 Automation, abstraction and
modelling
5 minutes
Page 14 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
The aim of this activity is to get you to think about what Wing is
saying in the following, rather long but important, sentence: ‘… this
feedback loop that one has when you’re abstracting from some
physical-world phenomenon, creating a mathematical model of this
physical-world phenomenon, and then analysing the abstraction,
doing sorts of manipulations of those abstractions, and in fact
automating the abstraction, that then tells us more about the
physical-world phenomenon that we’re actually modelling.’
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 3 Abstraction
8 minutes
Abstraction
Given:
i. a dictionary
ii. a headword W which appears in the dictionary
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Figure 4 A dictionary
abstraction as modelling
abstraction as encapsulation.
2.1 Models
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
For the purpose of the current example, the part of reality that
we’re interested in is the paper and ink dictionary of Activity 3. The
algorithms in Section 1 for looking up words work with a model of a
dictionary as an alphabetically sorted list of headwords, each
paired with its definition. The model corresponds to how the data
that the algorithm works with are structured. This model captures
the essentials (i.e. that the dictionary consists of an alphabetically
sorted list of words and their definitions) and ignores certain details
(for example, that a physical dictionary is divided into pages of a
certain size and has a cover to protect it). In other words, the
irrelevant details are not reflected by the structure of the data that
the algorithm works with.
Activity 4 Representations
Page 20 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
2.2 Encapsulation
The model of the solar system in Figure 10 also illustrates the
second type of abstraction: abstraction as encapsulation. The
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
The layer through which the user interacts with the model is called
the interface. It hides the detailed workings of the model from the
user. The interface sits between the user and the layer at which
the model is implemented. The latter is responsible for making the
model do what it is supposed to do. This is where the automation
of the model takes place.
The incredibly short Python program below will display the date
and current time (see Figure 13). It depends on a built-in Python
module which is imported in the first line.
Page 26 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
import time
print(time.ctime())
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Think about it: if layers of encapsulation did not exist, the short and
easily understood program to display the time (above) would be
impossible. We would have to deal directly with instructions written
in machine language. There would be many of them and they
would be in a language which is very hard for humans to
understand.
def timesTable(n):
for m in range(1, 10):
print(m, 'times', n, 'is', m*n)
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
timesTable(9)
def printUsersTimesTable():
aNumber = input('Please enter your number: ')
timesTable(int(aNumber))
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
from Layer 1 above it, Layer 1 hides its details from Layer 2, etc.
Conversely, Layer 1 depends on Layer 0, Layer 2 depends on
Layer 1, etc.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
a physical-world phenomenon
a mathematical model
an automaton.
real-world problem
computational problem
algorithm and data structures?
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Parts 1-8
Watch the video and complete the activity by ticking the
appropriate boxes.
Part 1
1. Which of the following use formal notation?
Computational thinking
Mathematical thinking
Engineering thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Part 2
2.Which of the following involve at least two layers?
Computational thinking
Mathematical thinking
Engineering thinking
Part 3
3. For which of the following are beauty and elegance measures of
goodness?
Computational thinking
Mathematical thinking
Engineering thinking
Part 4
4. For which of the following is correctness a measure of
goodness?
Computational thinking
Page 39 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Mathematical thinking
Engineering thinking
Part 5
5. For which of the following is efficiency a measure of goodness?
Computational thinking
Mathematical thinking
Engineering thinking
Part 6
6. For which of the following are usability, modifiability,
maintainability and cost measures of goodness?
Computational thinking
Mathematical thinking
Engineering thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Part 7
7. Which of the following are constrained by physics?
Computational thinking
Mathematical thinking
Engineering thinking
Part 8
8. Which of the following can go beyond physics?
Computational thinking
Mathematical thinking
Engineering thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
can do many things that we are familiar with in the real world,
including walking around, talking to people, and interacting with
objects. They can, however, also do things that are not possible in
the real world, such as teleport from one location to a
geographically distant other location. This is another instance
where the automation of abstractions allows us to go beyond the
things that can exist in the physical world. Note the big difference
here between computing and conventional engineering. Engineers
are generally interested in creating artefacts that are physically
possible – what would be the point of designing a bridge that
cannot be built?
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Computational biology
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Model checking
Machine learning
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Conclusion
The underlying theme of this course has been ‘computational
thinking’. We’ve defined this as consisting of the skills to:
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Glossary
abstraction
provides a handle on complexity by either ignoring detail by means of a
model, or hiding detail through the use of encapsulation.
algorithm
A precisely stated, step-by-step list of instructions.
data structure
A way of organising data for use by an algorithm.
encapsulation
Hiding details of an implementation from users. This is achieved through an
interface that sits between the user (or client) and the implementation.
interface
An interface sits between a user (or client) and an implementation. It hides the
details of the implementation from the users or clients of the implementation.
(See encapsulation.)
model
A representation or abstraction of a part of reality which ignores certain
details.
simulation
A working model of a process or a system which changes over time.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
References
Gough, J. (1767) Practical Arithmetick in Four books, Dublin.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Acknowledgements
This course was written by Paul Piwek (with input from Alistair
Willis for Activities 1 and 3).
Except for third party materials and otherwise stated (see terms and
conditions), this content is made available under a Creative
Commons Attribution-NonCommercial-ShareAlike 4.0 Licence.
Figure 3a: NASA
Figure 3b: NASA
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
If reading this text has inspired you to learn more, you may be
interested in joining the millions of people who discover our free
learning resources and qualifications by visiting The Open
University - www.open.edu/openlearn/free-courses
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
So, let’s assume that the text does have the first property. Does it
also have the other two properties?
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 3 Abstraction
Discussion
Details of a paper and ink dictionary that come to mind include: the
size and thickness of its pages, the colour of its cover and the size
of the printed font. None of these played a role in the algorithm that
is described above. Perhaps the most salient abstraction relates to
the fact that paper and ink dictionaries are made of pages. They
are not simply a list of words and definitions. Rather, the words are
distributed across the pages of the dictionary. The algorithm
doesn’t take into account the distribution of the words in a
dictionary across pages: for example it would work equally well
with a dictionary printed on a single, enormously long paper scroll.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 4 Representations
Discussion
When looking at this painting, my initial thought was: ‘Look, a pipe
– why does it say in French that this is not a pipe?’ Then it dawned
on me that of course this is indeed not a pipe: it’s merely a painting
of a pipe. With this painting, Magritte reminded me that
representations usually involve two levels: in this case the painting
of a pipe and a real pipe on which the painting is based. The
former is an abstraction which ignores some of the properties of
actual pipes (for example, that they have a smell, usually of
tobacco). Interestingly, the title of this painting is La trahison des
images (The Treachery of Images).
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 1
Discussion
In all three disciplines, the use of formal/mathematical notation is
common:
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 2
Discussion
Mathematics typically works only with a single layer: there is no
distinction between the ‘properties of interest’ and the ‘ignored
detail’. The abstraction is studied in its own right, without reference
to some other layer which it represents. Of course, this is an
idealisation. Many areas of mathematics did start as a
representation of some aspect of the real world. For example,
geometry began with Euclidean geometry, which was intended as
a model of physical space.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
the car, and many other things that are not relevant for calculating
the forces in question. We’ve seen that a computer scientist who
simulates a dictionary may, similarly, ignore certain properties of a
physical dictionary.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 3
Discussion
In all three disciplines, beauty and elegance are criteria that are
used to compare competing abstractions. These are, however,
more central in mathematics, where the abstraction is often judged
in its own right, without reference to an underlying reality that it
represents.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 4
Discussion
In connection with this criterion, Wing asks in particular: ‘Does it do
the right thing?’ and ‘Does it do anything?’ These questions are
clearly relevant for both computational and engineering
abstractions. It is perhaps less clear what they mean in the context
of mathematics. Arguably, since mathematics is about the
abstraction itself, one can’t really distinguish correct from incorrect
abstractions because there is nothing to compare them with.
However, even when dealing with pure abstractions, we may want
to make sure that they are consistent. A mathematical theory that
states that a mathematical object both does and does not have
some property would be in violation of this criterion (e.g. a theory
which says that two lines cross and do not cross each other).
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 5
Discussion
In connection with computing, Wing mentions three dimensions of
efficiency: time (how fast?), space (how much space?) and energy
(how much power?). Each of the three efficiency criteria can also
be applied in engineering contexts (e.g. how fast can the engine
run, how much space does it occupy, and how much energy does
it consume?). None of these considerations has a clear equivalent
in mathematics.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 6
Discussion
All of these practical considerations are important in both
engineering and computing contexts. They are not directly
applicable to mathematics.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 7
Discussion
Both engineering and computing are constrained by physical
reality. For example, the classical model of computing uses the bit
(0 or 1) as the basic unit of information. It is constrained by
whichever physical means is used to represent a bit (whether it be
an electrical current or, for instance, the position of a mechanical
lever). The physical hardware constrains, among other things, how
quickly the state of a bit can be changed (from 0 to 1 or vice
versa).
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Activity 6 Computational,
mathematical and engineering
thinking
Part 8
Discussion
Mathematics, as the study of pure abstractions, is independent of
physical reality. Computing, though always constrained by the
physical layer at which the hardware operates, allows us to build
on top of the hardware layer software layers that model non-
existent realities. By automating these virtual realities, it allows us
to see and even experience realities that go beyond what is
physically possible.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Perhaps this has set you wondering what numbers are, if they
aren’t physical objects. Unfortunately, philosophers have been at
loggerheads about this question since the ancient Greeks started
Page 67 of 109 9th April 2019
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
The first painting (at the bottom right-hand side of the figure)
depicts a cow on a green background, but the cow is composed of
blocks (mostly rectangular) of solid colour.
Back to Figure 1
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Addition
General Rule
54327 A
8062 B
5041 C
---------
67430
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Then drawing a line under them; begin the Addition at the first
place (or units) and add together all the figures in that place, and if
their sum be under ten, set it down below the line underneath its
own place; but if their sum be more than ten, set down only the
overplus above the ten (or tens) and so many tens as the sum of
these units amount to, carry to the place of tens, adding them and
the figures which stand in the place of tens together; then proceed
in the same manner to the third place or hundreds, and so from
place to place to the last, and set down the whole sum of the last
place.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Figure 4 A dictionary
Description
The figure shows a photograph of the top half of page 37 of Collins
English Dictionary. The photograph illustrates that each page of the
dictionary consists of a list of entries, with the headword of each
entry in bold font, and the definition of the term in normal font.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Figure 6 Diagrammatic
representation of abstraction as
modelling
Description
This figure contains two rectangles. The one at the top is labelled ‘model’. The one at
the bottom is labelled ‘part of reality’. An arrow labelled ‘represented/modelled by’
goes up from the ‘part of reality’ rectangle to the ‘model’ rectangle. Another arrow,
labelled ‘ignores detail of’, goes down from the ‘model’ rectangle to the ‘part of
reality’ rectangle.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Each rectangle is linked to the one below it with two arrows: the
arrow on the left points upwards and is labelled ‘hides detail from’,
the arrow on the left points downwards and is labelled ‘depends
on’.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
vertical dots, but includes ‘machine code’. Each pair of items in the
hierarchy is linked with an upward-pointing arrow labelled ‘hides
detail from’ and a downward-pointing arrow labelled ‘depends on’.
Finally, moving back to the top level of the diagram, a set of green
arrows link some of the items. A green arrow labelled ‘create an
abstraction’ points from the ‘REAL-WORLD PROBLEM’ cloud to
the ‘COMPUTATIONAL PROBLEM’ rectangle. A green arrow
labelled ‘transform’ leads from ‘COMPUTATIONAL PROBLEM’ to
‘algorithms and abstract data types’. From ‘algorithms and abstract
data types’ a green arrow labelled ‘implement’ points to the
‘MACHINE’ rectangle. Finally, a green arrow labelled ‘learn more
about’ goes from the ‘MACHINE’ to the ‘REAL-WORLD
PROBLEM’ cloud.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Abstraction
Transcript
Computational thinking is all about the process of abstraction. Let
me explain what I mean by that. First of all, it is choosing the right
abstraction. Not every abstraction is going to be appropriate for the
problem you are trying to solve. So first you choose an abstraction
and then by definition of abstraction are ignoring irrelevant detail
and encapsulating in this abstract model the details of importance.
That means I’m immediately talking about at least two levels of
interest. The level I am ignoring the detail from and the level of
interest so the abstraction process immediately means that you
are talking about at least two levels of abstraction, and in fact the
way in which computer scientists deal with scale and complexity in
the kind of artefacts that we build and design is through layers of
abstraction. That allows us to focus at each layer only on the
properties or behaviours of interest and then we build these
complex systems by layering or other means of composition. So
when we talk about abstraction it’s not just the abstraction or the
particular model. It’s the layers and also the relationships between
the layers and because we usually define these abstract models in
very precise terms, mathematical terms, we are able to define the
relationships between these layers also precisely in mathematics.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
are going to have to throw out all our algorithm text books and
rewrite them all in terms of these three dimensions now. The other
measure of goodness for the abstractions that computer scientists
like to invent is correctness. After all when you are writing a
program or building a system you want it to do the right thing and
so we always ask not only how fast does this, say algorithm,
perform but does it do the right thing? And what does, does it do
the right thing mean? We usually ask does the program compute
the right answer and asking that question alone opens up a lot of
research questions. But we also wanted it to do something useful
so it is not enough that it does the right thing we actually want the
answer to be spit out eventually and that is the question, does the
program produce an answer? There are complexity results that
show that this is not always an easy question to answer, and then
of course there is the other ‘ilities’ if you will when we look at a
particular abstraction and judge whether it is good or not.
Simplicity and elegance as we have for mathematics, usability,
modifiability, maintainability, cost and so on. Now if you look at this
list you will say, well that is no different from good engineering, and
so in fact computational thinking or computing very much draws on
mathematical thinking and draws from engineering thinking and
comes together in terms of the automation of the kinds of
abstractions we build. What I would like to … I promise that I will
say a few more high level remarks and then I will get into some
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Computational biology
Transcript
So now what I wanted to do is convince you that computational
thinking has already influenced other disciplines. So let’s start with
one discipline influenced by many different computational methods
or concepts. So who can guess what that discipline might be?
Don’t be shy. Scream out the answer, scream out any answer. Yes
sir – that is an interesting answer. I’ll come back to that one.
Medicine – is close to my answer. Biology, biology – that is my
answer. It is just an answer. Computational thinking has greatly
influenced biology to the point now that we have biology and
computer sciences working together hand-in-hand but more than
that we have now started to produce a new generation of
computational biologists. Hold on, you are now answering my next
question. My next question is; what was the tipping point, at which
point did the biologist look over their shoulder and say, ‘you
computer scientists have something to bring to the table. You
computer scientists are making me think differently, making me
approach my problem in a new way.’ Answer is … right, it was the
shotgun algorithm that expedited the sequencing of the human
genome that all of a sudden caused a lot of interest by the
biologists, by the whole medical and biological communities who
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Model checking
Transcript
I want to be slightly a little more technical in this part of my talk
that’s not the shotgun algorithm, so I am going to go through one
example that is not the shotgun algorithm to show a different kind
of computational model and thinking that has influenced biology,
and this is very recent work. So to do that you have to bear with
me for a few slides because I am going to go into a slightly more
technical part of my talk and I going to do a primer on this
particular computational method, and its called model checking. I
always in my talk at this point ask the audience … how many
people have heard of model checking? I am surprised. After this
slide you will all know what model checking is, at least in the
abstract. OK, so let me go through it. There is a black box, it’s
called the ‘model checker’ and it has two inputs. One is a finite
state machine – what that means is that there are states and those
are circles and there are transitions between the states, those are
the state transitions, the lines, the arrows. And, what makes this a
finite state machine is that there are a finite number of circles, finite
number of states. OK, so that is one input and that is critical for
this technique that it be finite. The second input is a property that
we would normally write in English but, because computers can’t
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
this property will hold or, no, you will get into trouble if you do this
sequence of events. OK? That is a particular computation model,
computational concept, computational approach and it has been
used in fact very successfully for hardware design, companies like
Intel, HP, Fujitsu, IBM, they all use this kind of technique for
verifying and debugging hardware/processor design. This is almost
a ‘bread and butter’ kind of technique in computing. Let me … I’m
going to skip that … for those of you who are interested in the
formal definitions that is what it looks like. OK there are many
efficient algorithms and many efficient data structures that allow us
to push a button and get that black box answer. What does that
have to do with biology? Well for the face of it absolutely nothing! It
certainly wasn’t invented because there was a biological problem
to solve. But it turns out that when you put computer scientists and
biologists together or when you have a person trained in both
biology and computer sciences sparks will fly and that is exactly
what happened to that particular person who worked in this
intersection of computer science and biology, particular model
checking and protein folding and he represents a protein that has
three residues in this particular case in terms of this very simplistic
finite state machine where you could imagine where this state with
three zeros (000) represents the folded state and this state with
the three ones (111) represents the unfolded state and these
numbers in parenthesis represent how much energy does it take to
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
go from this state to this state, where you are unfolding one of the
residues. OK, and so the question is what are all the paths, the
ways in which this protein can unfold itself and what are the paths
in which the protein can unfold itself using the least amount of
energy. So now this is a very simple example, you can probably
figure this out in your head, right, but suppose you had 76
residues? You couldn’t even write that out on a piece of paper!
There is actually where the scale of computers come in handy
because they can do that sort of calculation, no problem. So in fact
they show that you can use this modelling checking technique to
explore state spaces as large as 2 to the 76th using this kind of
particular model-checking algorithm/model-checking approach,
and this technique, it’s a pretty recent result, you see its 2007, with
14 orders of magnitude greater than comparable techniques. So
this is already new stuff that we are talking about protein folding
and so on but here is where you can see sparks fly when you bring
computational methods to these kinds of biological problems. OK,
so I promise this is the most technical part of my presentation. So
that’s one discipline, many methods …
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
Machine learning
Transcript
So let’s flip it. How about one method that has influenced many
disciplines? So I actually have to call on any computer scientists in
the audience to help me answer this one, because I doubt the
general public would know the answer. But I know there are some
computer scientists in the audience so I challenge you. What
method do you think has influenced so many disciplines today? –
conceptional modelling – Of course I have the answer I want you
to say. The answer is ‘machine learning’. How many people have
heard of ‘machine learning’? More people have heard about
‘machine learning’ than ‘model checking’ so that’s good. So
machine learning has completely transformed the whole field of
statistics. In fact there is a whole department of machine learning
at Carnegie Mellon, if you can believe that within the school of
Computer Science and it’s made of faculties from Computer
Science and Statistics and what they really do is Statistical
Machine Learning. Another example is that there are departments
of statistics now at universities for instance Purdue which has an
excellent Statistics department who are hiring computer scientists
because they see their future as in this combination of statistics
and computing particularly in Statisitical Machine Learning. So we
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
are seeing this in the next generation if you will. So let me give you
some examples of where machine learning has influenced many,
many fields. So in the sciences it is a technique that has been
used to discover new brown dwarfs and fossil galaxies. This is
really new scientific discoveries because of this particular
technique. In medicine it has been used for discovering and
inventing these kinds of drugs and uses in these applications. In
meteorology: for tornado formation. In the neurosciences for
understanding the brain, so I should at least give you a one
sentence definition of Machine Learning given that many people
may not know it. What it is, it’s a technique that allows you to
analyse huge data sets, large amounts of data and find patterns
and clusters in large amounts of data. So in this particular case
what you feed this algorithm is lots and lots of fMRI scans, (scans
of your brain). What they are able to do through using Machine
Learning is to find out what part of your brain lights up when a
subject sees a noun versus a verb or this kind of adjective versus
that kind of adjective and it’s looking at lots and lots of fMRI scans
that allow you to see those clusters, those patterns. Machine
learning has been used beyond science and engineering, so for
instance it is used in detecting credit card fraud. It’s used on Wall
Street, (the answer from the back of the room). When you go to
the supermarket and you hand the clerk your Safeway card, your
affinity cards, they are tracking your purchases and the coupon
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
you get out after your receipt, is using that kind of analysis of large
amounts of data. Recommendation Systems and Reputation
Systems like Netflix when you go to Travelocity to find out what
customers use and so on. Machine learning is even used in sports,
so I don’t know what basketball player this, is but maybe you do,
but what they did was videotape lots of professional basketball
players and then the coaches would use Machine Learning to find
out what are the skills of these professionals so they can teach
those skills to their own students. This is Lance Armstrong who
used Machine Learning to analyse the kind of data he kept of
himself. As you know, he is a machine – and he was quite
mathematical and analytical in his training so that he could really
hone his skills.
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0
Introduction to computational thinking
https://www.open.edu/openlearn/science-maths-technology/computing-and-ict/introduction-
computational-thinking/content-section-0