Lesson 3.1: Abstraction and Generalization

Student Objectives

Students will be able to…

  • Define the terms Abstraction and Generalization.

  • Recognize opportunities to improve algorithms by abstracting or generalizing parts into sub-procedures.

Materials/Preparation

Pacing Guide

Duration

Description

5 minutes

Welcome, attendance, bell work, announcements

15 minutes

Introduce terminology, demo, introduce activity

20 minutes

Draw Shapes (Again) activity

10 minutes

Debrief and wrap-up

Instructor’s Notes

Introductory discussion

  • Define and discuss the following terms:

  • Abstraction: removing the specifics that are not relevant in each context.

    • e.g. being able to drive a car without understanding how an internal combustion engine works.

  • Generalization: combining a group of related concepts or processes into a single category.

    • e.g. spreading any condiment or ingredient onto a slice of bread (butter, jam, peanut butter, mayo, etc.).

  • Demonstrate constructing a custom command block.

Lab 3.1: Drawing Shapes (Again)

  • Students should complete the Drawing Shapes Again activity individually or in diverse pairs.

  • Work with students to be certain that they are using custom blocks and variables as described by the activity.

  • Point out places where a script can be abstracted and generalized

  • Emphasize conciseness into a script.

Debrief

  • Discuss one or two student submissions.

  • Point out differences between different student solutions.

  • Point out missed opportunities for abstraction (if any).

  • Discuss how this custom block can be useful.

BJC Lecture Suggestions

Background Information for Instructors

BJC Video Suggestion:

BJC Lecture 1: Abstraction

  • Abstraction: 11:40-15:40

  • Generalization: 15:50-20:00

BJC Lecture 4: Functions

MIT Scratch –> BYOB Snap! (Development of Snap!, Demo) 10:00-11:30

BYOB-Custom Blocks (Explains functions with examples) 11:30-14:50

Accommodation/Differentiation

  • In addition to attempting the bonus in the lab, advanced students can be encouraged to write a new custom block that draws a specified number of the given shape (for example, 2 squares or 5 hexagons). The number of shapes should be taken as user input.

  • Struggling students can be given solution code for all of section 1. Work with these students to answer the questions in part 1.5 so that they are prepared to attempt the custom block authoring.

Forum discussion

Lesson 3.1: Abstraction and Generalization (TEALS Discourse account required).