Unit 2. Developing Programming Tools
Revision Date: Jan 05, 2020 (Version 3.0)Summary
This is the first day of a two-session lesson sequence with topics covered by mini-lectures, explorations, and practice exercises.
Outcomes
Overview
Students will provide a definition of "algorithm".
Students will identify the characteristics of describing algorithms in English, pseudocode, or a programming language.
Students will demonstrate an understanding that there are different algorithms for different situations, such as parallel processing for multiple CPUs.
Student computer usage for this lesson is: none
PowerPoint Slides for mini-lectures (AlgorithmsPseudocode1.pptx in the Lesson Resources folder)
Excel sheet summary for creating a 4-by-4 Magic Square (MagicSquare4by4.xls in the Lesson Resources folder)
(optional) 16 papers, each with a number from 1-16 on it for students to use when acting out the magic square.
–Small group, then large group, review of two previous homework assignments (students were assigned to use two sources to find definitions of "algorithm" and were assigned to write down the steps involved in a daily task – creating a peanut butter and jelly sandwich; getting to school; brushing teeth; completing homework; etc…) The definitions, sources, and algorithm steps were to have been entered into their journal.
- Have students consider solving problems alone or with others. Point out that some computers have more than one processor and an algorithm can be written to do 2 or more processes in parallel. Consider some complications that might arise in the simple algorithms that have been developed by students if there were multiple CPUs.
Say: In programming, a code statement is a part of program code that expresses an action to be carried out. Note that it is a single action. Each step of an algorithm is to be carried out on its own and exactly as written.
– Act out selected homework “steps of a daily task” to highlight the potential ambiguity of English instructions. While acting out the algorithm have students look for the three sufficient parts of any algorithm - steps done in sequence, steps selected if a condition is met and steps done that are repeated.
Algorithms that appear similar differ in that they yield different side effects or results. For many tasks however, more than one algorithm has been developed that accomplish the same tasks - though they may not be equivalent in some ways. For instance, some may be simpler, some may be faster, some may be more efficient but all may still be be correct in the sense of achieving the desired result.
– Review Understanding by Design (UBD)-style slide for “Algorithms and Pseudocode: Need to Understand / Important to Know or Do / Worth Being Familiar With” (slide 2 of AlgorithmsPseudocode1.pptx presentation in Lesson Resources folder).
Students join groups that have developed algorithms to accomplish the same task. Students are to exchange algorithms and determine:
Time permitting, the class creates a 4-by-4 Magic Square, as described in MagicSquare4by4.xls in Lesson Resources folder. Sixteen students should be chosen to represent the sixteen numbers, and physically move into the 16 spaces following the algorithm in this document. (This provides an example of a “simple” algorithm that solves a more complex problem; it also gets the students out of their seats and moving around).
Reflect: Would it be easier or harder for 2 people to work on this together? (multiple CPUs or parallel processing)
–In AlgorithmsPseudocode1.pptx (presentation in Lesson Resources folder), walk through “Main Ideas”; “Representing Algorithms”; and “Sequential Algorithms” slides, including pseudocode circle example.
"In your words" pair/share as the concept of what an algorithm is (and what is not an algorithm -- e.g. "sort the numbers") is developed.
Class-wide development of the graphical organizer should be facilitated with scaffolding to support students who are having difficulty with the concept.
The following "Checks for Understanding" could be used to guide the students towards the two learning objectives.
Objective: Students will be expected to learn to provide a definition of "algorithm".
Objective: Students will learn to identify the characteristics of describing algorithms in English, pseudocode, or in a programming language.
Students will research formal definitions of algorithms. These will be entered into their journals and pair-shared with a peer.
Students will write out the sequence of steps in one or more daily living tasks, such as "brushing their teeth" or "building a peanut butter and jelly sandwich." These will be entered into their jourmals and pair-shared with a peer. Selected solutions will be "acted out" in the classroom.