At the beginning of this new Unit, the students will jump right into an activity - building a small arrangement of LEGO blocks and then creating text instructions a classmate could follow to construct the same arrangement. Groups will then trade instructions to see if they were clear enough to allow reconstruction of the original arrangement. The Wrap Up discussion is used to highlight the inherent ambiguities of human language and call out the need for the creation of a programming language which leaves no room for interpretation.
Students will be able to:
This is the first in a 3-lesson sequence in which we attempt to make connections between programming languages, the creative act of programming, and algorithms for the students. The main activity is a derivative of a classic strategy for beginning to learn about programming - writing precise instructions for another person to do just about anything - making a peanut butter and jelly sandwich, a simple line drawing, an arrangement of objects - is challenging. Human language is fraught with ambiguities and assumptions that machines (computers) simply cannot handle. Thus, the first step we take is to establish the need for programming languages.
The students will need to acknowledge the following:
Novices might think that a programming language looks like an archaic, impenetrable mass of abstract word groupings, but all programming languages are derived from the human need to concisely give instructions to a machine.
Welcome to Unit 3 - Introduction to Programming. This unit is an introduction to the principles of programming. As you'll see, one of the most important things you can do in programming starts well before you write any code. It's about how you think. We're going to launch into an activity right now that reveals an important principle of programming. Try your best, and we'll discuss at the end.
The students may be eager to program, but recognize that the course is about "principles" of programming, and as a class, we want to establish some of the thinking habits that people who are "good" at programming seem to have "naturally." There is nothing natural about it - these ways of thinking, these insights, are learned and practiced. And this thinking capabilities start here.
After downloading the activity guide, follow the setup instructions below:
Tips for the teachers: To make things interesting, try to strike a balance between all blocks being different colors and all blocks being the same. This forces students to be precise in identifying which block should be used in each step.
The students should disassemble their arrangements, place their instructions next to the LEGO pieces, and hide their image or drawing of the arrangement somewhere it cannot be seen. Have another person or group to follow the instructions to build the desired arrangements. The student who made the instruction should check whether the solutions are correct or let the person or the groups that followed the instructions to check their solutions themselves by looking at the recorded image of the arrangement afterwards.
Below are some of the questions and main points you can use to facilitate a discussion about the difficulty of writing instructions:
Students may say things like "We could be really careful about our language" or "We could include more detail." These are entirely true, but emphasize that if there's room for interpretation then we can't be certain about our results. Move towards the solution of creating a new language (a programming language!) in which we have strictly and precisely defined exactly what every word means. This is different from our normal human language, but necessary if we want perfect clarity in expressing instructions.
Today the students saw how the human language may not always be precise enough to express algorithms, even for something as simple as building a small LEGO arrangement. The improvements you have suggested actually create a new kind of language for expressing algorithms, which we as computer scientists call a programming language. In the coming unit we are going to learn a lot more about how we can use programming languages to express our ideas as algorithms, build new things, and solve problems.
Ask the student to rigorously define a small set of commands that could be used to build any arrangement of LEGO blocks. For example: "rotate," "attach," "detach," "move," etc. Feel free to test out these new and more precise set of commands by repeating today's activity using them.