2.8. What is Abstraction¶
This lesson introduces the concept of abstraction, which is one of the seven big ideas. This will be one of many lessons in the course that focuses on abstraction. In this first look, the focus is on the everyday concept and promotes the idea hat the process of abstraction is a fundamental element of human thought and language. Through a number of examples of abstraction in everyday life as well as in computing, students explore and reflect on what abstraction is and how it is exemplified in their own worlds. This lesson also makes an initial connection to how abstraction is used in programming. The examples of an App Inventor variable and an App Inventor procedure are shown as examples of data abstraction and procedural abstraction respectively, thereby reinforcing the enduring understanding that abstractions are a fundamental element of building computer programs and other computational artifacts.
The Student Lesson: Complete the activities for Mobile CSP Unit 2 Lesson 2.8: What is abstraction?.
- Projection system
- Piece of blank paper for each student
- Writing instrument for each student
2.8.1. Learning Activities¶
Estimated Length: 45 minutes
Hook/Motivation (10 minutes)
- Activity: Ask each student to take a piece of paper and without talking communicate to the class what 'chair' means. Students may use words, phrases, pictures, etc but they cannot talk. When the students are finished have the students hold up their papers to show the entire class. Next, ask the students to do the same thing for 'rectangle'. What do the students notice about what they have put on their papers? Other ideas for a hook are playing 20 questions where you go from a more abstract description of something to more and more specific, or asking students what they ate for breakfast where breakfast is an abstract term that can stand for many different specific food items.
- Explanation: Explain: All of the students' answers are correct. This is because 'chair' and 'rectangle' are both abstractions
- Abstraction can be looked at in two ways, as a practice or a habit of mind, sometimes called abstracting or as a particular thing, such as an idea or a word where we say, for example, that the word 'chair' is an abstraction. The words 'chair' and 'rectangle' represent an idea of something.
- We refer to anything that we can sit in as a 'chair'. But, there are different kinds of chairs (e.g. desk chairs, office chairs, wooden chairs, rolling chairs, etc.) When we say 'chair' we can mean any one of these.
- Any shape that has 4 sides and 4 right angles, with opposite sides of equal length, is a 'rectangle'. But, there are different kinds of rectangles (e.g. 4x6 rectangles, 2x6 rectangles, 3x9 rectangles, etc) When we say 'rectangle' we can mean any one of these.
Experiences and Explorations (25 minutes)
- Lecture: Topic: Abstraction (Slides)
Use this presentation to give a brief explanation of abstraction with some examples. Explain to students that an abstraction is a general representation or concept or idea that stands for some collection of individual instances. Abstractions can be found in language, design, maps, and computer science.
Explanation: The students will learn variables, procedures, and data abstraction while in the course. In the next lesson, the students will begin learning data abstraction which includes bits and binary numbers.
- Activity: After the lecture/class discussion, have students complete one of the following activities:
- In pairs, have students play a guessing game, where 1 student draws something in 10 seconds, and the other student tries to guess what it is. After each drawing, discuss what were the essential features that were drawn that helped to guess what it was, and which features of the actual object were left out. The essential features make up the abstraction or abstract drawing for that object.
- Split students into two even teams for three rounds of Fishbowl. Fishbowl (sometimes called Salad Bowl) is a game named by the bowl you put the slips of paper in. Have teams take turns guessing the words on the paper. After each round, the points are added up and the papers are added back into the fish bowl. Each round lasts until either the papers are out, or each member of the team has gone for one minute. Each round adds and extra layer of abstraction for the students to get through. Use these slides to guide you. Tips: To shorten the game have students only submit 1-2 pieces of paper or skip round 3. To extend the game add a round 4 (sound effect) and a round 5 (shadows on a wall with a flashlight). (Acknowledgement: Thank you to Mobile CSP Teacher Sarah Walsh for contributing this activity.)
- Work in pairs to draw abstract objects for each other to guess and to look at the Google scientific calculator to identify the functions associated with abstract buttons such as + and -.
Rethink, Reflect and/or Revise (10 minutes):
- Ask the students to complete the interactive exercises on the Mobile CSP lesson.
- Briefly review the major ideas of the lesson with students. Provide an “exit slip” that asks students to write down one major idea they learned today along with one question they still have. Collect the slips and use them to review any misconceptions or answer any questions before the next lesson.
- Exit slip example:
- Provide one interesting/compelling idea that you learned today.
- What is one idea or concept that is unclear?
The College Board's AP Classroom provides a question bank and Topic Questions. You may create a formative assessment quiz in AP Classroom, assign the quiz (a set of questions), and then review the results in class to identify and address any student misunderstandings.The following are suggested topic questions that you could assign once students have completed this lesson.
Suggested Topic Questions:None
Solutions Note: Solutions are only available to verified educators who have joined the Teaching Mobile CSP Google group/forum in Unit 1.
Assessment Opportunities and Solutions
You can examine students’ work on the interactive exercise and their reflection portfolio entries to assess their progress on the following learning objectives. If students are able to do what is listed there, they are ready to move on to the next lesson.
- Interactive Exercises:
- Portfolio Reflections:
LO X.X.X - Students should be able to ...
- In the XXX App, look for:
Differentiation: More Practice
(Suggested by Joan Goldberg) Have students play a game such as Guess Who or 20 Questions. Afterwards, explain how the person or thing they were trying to guess was very abstract in the beginning but became more concrete as they discovered more details through the questioning.
Background Knowledge: Everyday Examples of Abstraction
Here are some everyday examples of abstraction.
Language example: A definition of any word we use in our language -- e.g., 'chair' -- is an abstraction. When we define 'chair' -- or cognitively think of a chair -- we don't think of its color or what type of material its made of. The word or idea is a general representation of chairs. A name is sort of the ultimate abstraction. It's just a simple symbol that represents an individual. Imagine what life and language would be like if we had to give a detailed description every time we wanted to refer to someone?
Design example: If you were remodeling your kitchen you might create a schematic model of the floor plan with rectangles or squares to represent the size and location of the appliances. The model is a general representation of an actual kitchen and its appliances. Among other things, we've 'abstracted away' the brand and color of the appliances and the entire Z-axis, if we're doing this in a 2-d model (bird's eye view).
Map example: Think of a hand-drawn map. It's a general representation of some particular geographical region in which we've abstracted away the actual dimensions, foliage, etc. The abstraction contains just those details that we need to get us from point A to point B.
What does this have to do with the study of computer science? In computer science the process of abstracting – simplifying, condensing, encapsulating – is an important problem solving technique that is used in designing computer systems from the lowest levels of the hardware to the highest levels of the software. And, as we will see in this course, computer scientists constantly strive to create abstractions, in hardware and software, that help reduce complexity and make computer systems and computer programs easier to use and understand.
In this course we will deal with two main types of abstraction, data abstraction and procedural abstraction. Here are a couple of brief examples
Data Abstraction. In a computer program a variable is named section of memory, e.g., ‘X’, that can store a piece of data – i.e., a number or a word or a list of objects. When we want to manipulate the data, we can use its name rather than the data itself. So the name, the variable, is an abstraction of the data stored in the variable. Using the name, rather than the data itself, simplifies things for the programmer, especially because the data stored in the variable can change.
There’s another sense in which the variable is an abstraction. First, inside the computer’s memory, everything is stored as electronic signals, on or off, high voltage or low voltage. It’s hard to see electronic signals or write them on a piece of paper. So computer scientists represent those electronic signals as bits, binary digits – i.e., 0s and 1s. So bits are a higher-level of abstraction and, as such, easier for us to deal with. But strings of bits – 000100010100010 – are relatively hard for most people to manipulate. We prefer to deal with higher-level symbols, such as decimal numbers (5) and words (tree) and lists of numbers ([1,2,3,4,5]). These then, are higher-level abstractions that make it easier for us to manipulate data. [There are different levels of abstraction, for example, using words vs. using pictures vs. using bits (where words are at the highest level - the easiest for us to understand- and bits are at a lower level.) The next abstraction lesson Adding 1+1=2 covers this in more detail by explaining to students how a computer adds 1+1.)] Finally, because these data can change within the computer’s memory, we use variables to achieve an even higher level of abstraction. In effect, the variable lets us say ‘take whatever data are stored in X and put it in Y.’
Procedural Abstraction. A procedure is a named chunk of code that performs a particular task. An example might be the square root procedure, which calculates the square root of X, sqrt(X). The nice thing about procedures is that they hide the details of how they carry out their task. For example, we may no longer remember how to calculate a square root by hand, but we do know how to use the sqrt() procedure (on a computer or a calculator) to calculate the square root of any number: I simply call it and give it the number. So sqrt(4) is 2. And sqrt(5) is 2.236.
The sqrt() procedure is an abstraction. It encapsulates a complex task and gives us the ability to perform that task without worrying about the details of how it works. It ‘abstracts away’ the details of how to calculate a square root. And just like with data abstraction, procedures can be organized into levels of abstraction. For example, if you remember your Pythagorean theorem you will recall that the “length of the hypotenuse of a right triangle is the square root of the sum of the squares of the other two sides.” So, once we have low-level procedures, such as sqrt(X), we can use them to define higher-level procedures such as hypotenuse(a,b). Then to calculate the hypotenuse of a 3-4-5 right triangle, we can just call hypotenuse(3,4) and it will give us the value 5.
2.8.2. Teacher PD Reflection¶
Discuss the following questions with other teachers in your professional development program.
- How do the lesson activities reinforce the concept of abstraction?
- In this course we will see many examples of abstraction throughout our study of computer science. Is there anything else you would need to have or know to teach this lesson effectively? What specific elements of this lesson (examples, activities, etc.) would you change? How would you modify or add to the interactive exercises (formative assessments)?
I am confident I can teach this lesson to my students.
- 1. Strongly Agree
- 2. Agree
- 3. Neutral
- 4. Disagree
- 5. Strongly Disagree