Introduction to computational thinking
Introduction to computational thinking

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Introduction to computational thinking

2 Computational thinking and abstraction

In the next activity you will see Wing explain how computational thinking involves the process of abstraction.

Activity 3 Abstraction

Timing: 8 minutes

Watch the video and then complete this activity.

Download this video clip.Video player: Abstraction
Skip transcript: Abstraction

Transcript: Abstraction

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. In fact all of what I said is as we do in mathematics. After all it is not that computer scientists invented abstraction. Mathematicians and scientists use abstractions all the time. What’s different is that in computing we are always operating at least two layers of abstraction at the same time and we are very formal about the relationship between the two layers.

End transcript: Abstraction
Abstraction
Interactive feature not available in single page view (see it in standard view).

Wing talks about abstractions as a means of ignoring detail that is not of interest. Consider the following description of an algorithm for searching a paper and ink dictionary.

Given:

  • i.a dictionary
  • ii.a headword W which appears in the dictionary

to find the definition of W:

  • Begin the search with an entry that appears (roughly) in the middle of the dictionary. Then there are three possibilities:
    1. The current entry’s headword is W. In this case, the definition of W is the definition of the current entry.
    2. W appears alphabetically before the current entry’s headword. In this case, the entry with headword W must appear in the first half of the dictionary. Look for the word W, following the same approach, in the first half of the dictionary.
    3. W appears alphabetically after the current entry’s headword. In this case, the entry with headword W must appear in the second half of the dictionary. Look for the word W, following the same approach, in the second half of the dictionary.

This is an informal description of an algorithm, but the steps are sufficiently precise that a human should have no problem following them. This algorithm depends crucially on the fact that the words in a dictionary are alphabetically ordered. It also, however, ignores some of the details of paper and ink dictionaries. Can you list of few of these?

Described image
Figure 4 A dictionary

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.

Wing’s discussion of abstraction draws on a wide variety of concepts. You have come across phrases such as ‘ignoring’ and ‘hiding information’, ‘levels’ and ‘layers’, ‘models’ and ‘implementation’. It has been left somewhat in the air how these all hang together. So next, we will make the relations between them explicit. To do so, we will distinguish between two kinds of abstraction:

  • abstraction as modelling
  • abstraction as encapsulation.

Although Wing deals in great detail with the idea of abstraction as modelling, she only hints at the concept of abstraction as encapsulation. Both are, however, at play in computing. Distinguishing between them will give you a better understanding of the remainder of Wing’s story.

M269_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371