# 2.6 Varieties of abstraction

In the next video clip, Wing compares and contrasts abstraction in computational thinking with abstraction in mathematics and engineering. In the following activity you will make these comparisons explicit.

## Activity 6 Computational, mathematical and engineering thinking

### Parts 1-8

Watch the video and complete the activity by ticking the appropriate boxes.

#### Transcript: Computational, mathematical and engineering thinking

So this isn’t anything new from what mathematicians do but in computing we don’t just invent abstractions for the beauty and elegance of the abstraction as mathematicians tend to strive for. We have other concerns that constrain the abstractions we choose. So in particular I would like to talk about the measures of a good abstraction in computational thinking. The first and foremost typical question a computer scientist would ask is, ‘how efficient is this. Is this the most efficient way to solve the problem’, and when I talk about efficiency I talk about it in terms of space and time. Is this the fastest way to get from here to there? Is this a procedure which is going to require the least amount of space for that space and time? And I think what is most interesting right now is there is a lot of interest in what I would call the third dimension of analysing the complexity of the kinds of abstractions that we invent and that has to do with energy. There is so much interest now in a society and the administration on energy and I think of computing as a discipline needs to revisit a lot of the abstractions we have invented already in terms of this third dimension. So for those of you who are researchers in computer science I advocate that we 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 concrete examples. But I like to think that computational thinking really does draw on mathematical and engineering thinking, it draws on mathematics certainly as its foundation but we in computing are unconstrained by the physics of the underlying … we are constrained by the physics of the underlying machines. So, in the end there is going to be some machine or there is going to be some human brain and we are in terms of what we can execute or automate are going to be constrained. So a typical computer like this is going to have finite memory, it can only go so fast and so it is constrained by the physics of this device. The brain scientists are trying to understand the physical and intellectual limitations of our brain as an automaton. Computational thinking certainly draws on engineering since our systems interact with the real world. However we in computing can build virtual worlds, worlds that are unconstrained by physical reality and so when you interact in a virtual world. So how many people have heard of second life. Second Life is a virtual world which you can enter and this virtual world defies the laws of physics. You have avatars who fly around, you have corpse-like beings that die and come alive again. That’s not like in the real world so what is it in computing that enables this kind of defying the laws of nature, building worlds that are virtual. It’s the software. Software enables these physical devices to be beyond the real world. When I talk about computational thinking, I really mean the concept and not the artefact that computer scientists produce. This is a little abstract, I promise to get a little more concrete. And finally, I talk about computational thinking as being something for everyone everywhere. It will be a reality when it is so integral to our endeavours that it disappears as an explicit philosophy. So being more specific, here is unfortunately a laundry list of what I would say computational thinking concepts and those of you who are computer scientists or engineers or mathematicians will recognise many of these classes of abstractions. What I mean by putting this list down is not for all you to understand all this of this, but just to say that I distinguish between computational thinking and computer literacy, that is how to use Word, or Excel, PowerPoint. Computational thinking is not that and I distinguish between computational thinking and computer programming because computing is a lot more than computer programming. Ideally I could come up with a better list if you will rather than this potpourri of concepts. I’m actually working on that as I speak.

### Part 1

1. Which of the following use formal notation?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a, b and c.

#### Discussion

In all three disciplines, the use of formal/mathematical notation is common:

### Part 2

2.Which of the following involve at least two layers?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a and c.

#### 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.

Both engineering and computing rely on at least two layers. At the basis, there is a layer grounded in the real world. This is the layer in which the problem of interest lies (for example a bridge or car in engineering). In addition to this layer, there is at least one further layer which ignores certain of its details. For instance, an engineer may use mechanics to calculate the forces operating on a bridge when a car crosses it. In doing so, the engineer will abstract away (or ignore), the colour in which the bridge is painted, the brand of 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.

### Part 3

3. For which of the following are beauty and elegance measures of goodness?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a, b and c.

#### 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.

### Part 4

4. For which of the following is correctness a measure of goodness?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a, b and c.

#### 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).

### Part 5

5. For which of the following is efficiency a measure of goodness?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a and c.

#### 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.

### Part 6

6. For which of the following are usability, modifiability, maintainability and cost measures of goodness?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a and c.

#### Discussion

All of these practical considerations are important in both engineering and computing contexts. They are not directly applicable to mathematics.

### Part 7

7. Which of the following are constrained by physics?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a and c.

#### 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).

### Part 8

8. Which of the following can go beyond physics?

a.

Computational thinking

b.

Mathematical thinking

c.

Engineering thinking

The correct answers are a and b.

#### 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.