Mastering Abstraction

Slides:



Advertisements
Similar presentations
Copyright © 2014 ICT Inspires Ltd. All Rights Reserved. ICT (Computing) Subject Leader Course Session 2: Broader.
Advertisements

Chapter 1 Program Design
Course Instructor: Aisha Azeem
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
PROCESS MODELING Chapter 8 - Process Modeling
Simple Program Design Third Edition A Step-by-Step Approach
Mastering Abstraction NATURE OF ABSTRACTION NEED FOR ABSTRACTION DIFFERENCES BETWEEN ABSTRACTION AND REALITY DEVISING ABSTRACT MODES FOR DIFFERENT SITUATIONS.
By the end of this session you should be able to...
ALGORITHM CHAPTER 8. Chapter Outlines and Objectives  Define an algorithm and relate it to problem solving.  Define three construct and describe their.
User Interfaces 4 BTECH: IT WIKI PAGE:
2.1 Elements of Computational thinking
THINKING PROCEDURALLY OR CONCURRENT (SIMULTANEOUSLY OR SIDE BY SIDE OR IN LOGICAL ORDER A- IDENTIFY THE COMPONENTS OF A PROBLEM B-IDENTIFY THE COMPONENTS.
Computational Thinking
Algorithms and Pseudocode
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Computer Systems Architecture Edited by Original lecture by Ian Sunley Areas: Computer users Basic topics What is a computer?
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Algorithms and Flowcharts
Design Communication. Freehand Drawing Definition: The spontaneous representation of ideas on paper without the use of technical aids.
Component 1.6.
Computational Thinking
AP CSP: Creating Functions & Top-Down Design
Understand Problem Solving Tools to Design Programming Solutions
Algorithms and Problem Solving
Topic: Introduction to Computing Science and Programming + Algorithm
INTRODUCTION TO PROBLEM SOLVING
Software Testing.
Problem Solving How do we attack a large problem?
Unified Modeling Language
System Design and Modeling
System Design.
BTEC NCF Dip in Comp: Unit 01 Principles of Computer Science Lesson 01 – Computational Thinking Mr C Johnston.
Understand Problem Solving Tools to Design Programming Solutions
Teaching design techniques to design efficient solutions to problems
Introduction To Flowcharting
Introduction to Computer Programming
Introduction CSE 1310 – Introduction to Computers and Programming
Computational Thinking
Algorithm and Ambiguity
Computer Programming.
Print slides for students reference
VISUAL BASIC.
Learning to Program in Python
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Computational Thinking
Theory of Computation Turing Machines.
Computational Thinking for KS3
Chapter 0 : Introduction to Object Oriented Design
Introduction to Algorithms and Programming
Object Orientated Programming
Algorithm and Ambiguity
Algorithms.
Flowcharting & Algorithms
Algorithms and Problem Solving
CompSci 1: Principles of Computer Science Lecture 1 Course Overview
Lecture 6 Architecture Algorithm Defin ition. Algorithm 1stDefinition: Sequence of steps that can be taken to solve a problem 2ndDefinition: The step.
ICT Gaming Lesson 2.
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Tonga Institute of Higher Education IT 141: Information Systems
Applying Use Cases (Chapters 25,26)
Tonga Institute of Higher Education IT 141: Information Systems
Basic Concepts of Algorithm
WJEC GCSE Computer Science
Chapter 4: Writing and Designing a Complete Program
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Computational Thinking (How to think like a computer scientist)
Programming Techniques :: Flow Diagrams and Pseudocode
Concept Development and End Product Description
Presentation transcript:

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

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

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

…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?

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.

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

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

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

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

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

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

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

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”

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

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.

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

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.

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

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.

Questions on Abstraction AS Level Questions: Taken with permission from OCR Exam Board (past papers and specification paper)

Question AS Level Questions and Answers

Answer

Question AS Level Questions and Answers

Answer AS Level Questions and Answers

Question

Answer AS Level Questions and Answers

Question AS Level Questions and Answers

Answer AS Level Questions and Answers