Download presentation
Presentation is loading. Please wait.
1
Mastering Abstraction
Nature of abstraction Need for abstraction Differences between abstraction and reality Devising abstract moDes for different situations MODELLING DECOMPOSITION ALGORITHMS: PSEUDOCODE and FLOWCHARTS EXAM QUESTIONS and ANSWERS
2
Did you know? Plato was a famous ancient Greek philosopher. He postulated that all the objects that are seen in this world are not real, but literally mimic the real Forms. These Forms are the essences of various objects: they are that without which a thing would not be the kind of thing it is. For example, there are countless tables in the world but the Form of tableness is at the core; it is the essence of all of them
3
Plato’s theory of forms
A Form is an objective "blueprint" of perfection. The Forms are perfect themselves because they are unchanging. In the Phaedrus the Forms are in a "place beyond heaven" and in the Republic the sensible world is contrasted with the intelligible realm in the famous Allegory of the Cave. One interpretation of this is to say that Plato was suggesting that everything on this earth is just a instantiation of its respective true and perfect “form
4
…and what is Abstraction
Abstraction is one of the four cornerstones of Computer Science. It involves filtering out – essentially, ignoring - the characteristics that we don't need in order to concentrate on those that we do. Abstraction is the process of filtering out – ignoring - the characteristics of patterns that we don't need in order to concentrate on those that we do. It is also the filtering out of specific details. From this we create a representation (idea) of what we are trying to solve. Any idea what these two objects are?
5
Chairs and the concept of abstraction
Imagine you were given a task: to draw a series of chairs … You’ll note that though they take different forms, chairs all have certain general characteristics that are common to all (legs, back, seat type etc.) In addition, each chair has specific characteristics, colour (black legs), type of seat =hard/soft; material = leather/fabric. These details are known as specifics.
6
Abstraction: Drawing a basic chair
In order to draw a basic chair, we do need to know that it has legs (of some sort), a seat, a back, etc. (if it didn’t have a back I suppose it would be a stool) These general characteristics are relevant and essential We don’t however, need to know what fabric the chair is made of, or what colour the legs are. We don’t even need to know what the size of the chair is. These specifics can be filtered out. From our basics (general characteristics) we can build a basic idea of a chair i.e. what a chair basically looks like. We would then be able to describe how to draw a basic cat. This filtering out of the irrelevant details is ABSTRACTION. ?
7
Need for Abstraction So as we’ve been learning, Abstraction allows us to create a general idea of what the problem is and how to solve it. The process instructs us to remove all specific detail, and any patterns that will not help us solve our problem. This helps us form our idea of the problem. This idea is known as a ‘model’. If we don’t abstract we may end up with the wrong solution to the problem we are trying to solve. In the chair example, if we didn’t abstract we might think that all chairs are gold and velvety and look like the one in the picture! We know however, that although chairs have a colour and size, not all chairs are as grand as the one shown. In this case, abstraction has helped us to form a clearer model of a chair
8
How to abstract So, abstraction is the gathering of general characterises that we need and filtering out unnecessary details. I don’t know if you like Chocolate, but if you do, and you’ve ever tried making some, there are some general things that you always need to know: For example, here are some general essentials Chocolate needs ingredients Each ingredient needs a specified quantity Making chocolate needs timings
9
How to abstract General Patterns Specific Details
Recap: abstraction is the gathering of general characterises that we need and filtering out unnecessary details. For example: Chocolate needs ingredients Each ingredient needs a specified quantity Making chocolate needs timings When abstracting we can remove specifics and keep the relevant patterns - essentials General Patterns Specific Details We need to know chocolate has ingredients We don’t need to know what the ingredients are We need to know the quantities required We don’t need to know specific quantities …. We need to know the timings required We don’t need to know the specifics of timings
10
Creating a Model A Model is a general or essential/basic idea of the problem that we are hoping to solve. General: Ears Take elephants, a model elephant would not be an indian elephant will small ears, because a model has to represent ALL elephants. General: Trunk From our model of elephants, we should be able to learn about what any elephant might look like in the real world. Ears Once we have a model in place, we can design an algorithm to solve the problem! Trunk An algorithm is just a sequence of instructions that can be used to solve a problem. The sizes of the ears or trunk won’t be needed for our model
11
Pseudocode Pseudo means false! Pseudocode literally means ‘false’ code or ‘fake’ code. Pseudocode is not a programming language – it is just a way of writing code in simple statements that do not use programming language specific syntax. Code Pseudocode Dim x as integer = 10 DECLARE x as an integer Dim age as integer Textbox1.text = age GIVE x the value of 10 DECLARE age as integer INPUT age into textbox Pseudocode should not be specific to any language. It’s a bit like writing steps of instructions in plain English (or other languages) without worrying about the syntax
12
Flowcharts Start/Stop Decision Process Manual Input Output
A flowchart is a diagram that represents a set of instructions (step by step) – visual! Flowcharts have a range of standard symbols to represent different instructions in use Decision Start/Stop *indicates a jump from one point in the sequence to another Process Manual Input Output *connects symbols. Shows direction of flow of the instructions
13
Output “Access Denied”
Here’s a very simple flow chart! Start/Stop Pseudocode Enter age into textbox DECLARE age as integer INPUT age into textbox IF age > 16 If age >16 OUTPUT “Welcome” ELSE No Yes Output “Welcome” OUTPUT “Access denied” Output “Access Denied”
14
Decomposition Make Tea Make Toast Milk Cow Boil Egg
You may have heard this word in Biology – in reference to decomposing food or garbage … In computing, it refers to solving a problem by decomposing it into sub-problems (sub-modules) You would then compose the solutions together to solve the original problem. Consider this problem: MAKE BREAKFAST In reality, this has lots of sub tasks… Make Tea Make Toast Milk Cow Boil Egg
15
Decomposition Boil Milk Milk cow Transfer Milk Put on the gas
These tasks can be further decomposed …for instance boiling milk may involve a series of steps: Milk Cow Transfer milk to boiling pan Put on the gas Boil Milk Boil Milk Milk cow Transfer Milk Put on the gas Boil Milk… The process is known as recursive as each sub task is probably capable of further decomposition and so on and so on until you arrive at the smallest possible sub task. Organisation of data can also be decomposed. E.g. data representing the population of a country can be decomposed into entities such as individuals, occupations, places of residence, etc.
16
Final Notes on Abstraction
The process of abstraction takes many specific forms, such as modelling, decomposing (breaking down a big problem), and generalising. In each case, complexity is dealt with by hiding complicated details behind a simple abstraction, or model, of the situation. Example of a Model: Have you ever seen a London Underground map? Well, that is a simple model of a complex reality — but it is a model that contains precisely the information necessary to plan a route from one station to another. *Remember that Computational thinking values elegance, simplicity and modularity over complexity
17
Final Notes on Abstraction
Abstraction is the main mechanism used to deal with complexity and enabling computerisation. Abstraction is both presenting a simplified version through information hiding and making an analysis to identify the essence or essential features. Aspects of abstraction include: Computer hardware consists of components (black boxes) interacting through interfaces (a network cable, a CPU socket, a SATA disk interface). Computer software is built from layers of abstraction. For example, a procedure (or method, or library) implements a specification, but hides its implementation; an operating system provides facilities to programs but hides the complex implementation; a database implements SQL queries, but hides how the data is stored. Scientists, industrialists, engineers, and business people all use computers to simulate and model the real world, by abstracting away unnecessary detail and using a computer program to simulate (what they hope is) the essence of the problem Designing and hiding a complicated implementation (“how it works”) behind an interface (“what it does”). Representing or modelling through visualisations, metaphors or prose the essential features without the confusion of the detail. The process of categorisation or classification that breaks down a complex system into a systematic analysis or representation.
18
Examples of Modelling Storyboards for animations
Modelling is the process of developing a representation of a real world issue, system, or situation, that captures the aspects of the situation that are important for a particular purpose, while omitting everything else Further Examples: Storyboards for animations Mass, velocity and position of planets orbiting one another
19
Different purposes need different models
Example: a geographical map of the Underground is more appropriate for computing travel times than the well-known topological Underground map; a network of nodes and edges can be represented as a picture, or as a table of numbers. A particular situation may need more than one model. Example: a web page has a structural model (headings, lists, paragraphs), and a style model (how a heading is displayed, how lists are displayed). A browser combines information from both models as it renders the web page.
20
Questions on Abstraction
AS Level Questions: Taken with permission from OCR Exam Board (past papers and specification paper)
21
Question AS Level Questions and Answers
22
Answer
23
Question AS Level Questions and Answers
24
Answer AS Level Questions and Answers
25
Question
26
Answer AS Level Questions and Answers
27
Question AS Level Questions and Answers
28
Answer AS Level Questions and Answers
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.