Peanut Butter Not Included – Adapting CS50X for the High School Classroom

This summer I had the opportunity to participate in the CS50 AP Bootcamp sponsored by Microsoft. I’m so excited to bring this incredible curriculum into my classroom. I couldn’t wait to introduce my students to all the fun, so I let an activity from CS50 inspire my first lesson.

After the obligatory syllabus and classroom procedures administrivia, I decided to kick off my intro level Coding course with an activity to demonstrate how a computer “thinks”. I wanted to do the peanut butter and jelly demo they use in CS50, but I was worried about time constraints, bringing food into the computer labs, and finding time to run to the grocery store during my last weekend of summer. With these concerns in mind, I decided to adapt the lesson so it better suited my classroom.

  1. We began with a discussion of the topic: Who is smarter – a human or a computer? After a brief conversation, we agreed that a computer may be better at certain tasks, but that it would only know how to do what someone tells it to do.
  2. Here’s where the pb&j demo would go. Instead I asked a student to hang a piece of paper on the back wall. The student found the supplies (a roll of tape and stack of paper I set out on a desk at the front of the room before class) and proceeded to follow-through with the request. Then I played the part of a computer and had the students instruct me to do the same thing. I was worried that this tamed-down version would lose some of the fun from the CS50 original, but honestly, it worked out great. I think the secret is in how you sell it. I tried to take every instruction as literally as possible. When they said, “Turn right,” I spun in circles on the spot. When they instructed me to walk forward, I plowed right into a desk that was in my path. They thought it was hilarious and, by the end, they had determined that a lot more thought went into a simple process than what they had originally assumed.
  3. After the demo, we had a chat about computers, computational thinking, and algorithms.
  4. To reinforce the activity, I paired up the students and asked them to turn their chairs so they were seated back-to-back. Each pair assigned one person to be the computer and the other person was the programmer. The programmer was given a random design and her task was to try to get the computer to replicate the design. The computer couldn’t see the design (of course) and couldn’t communicate to the programmer through questions or responses. It was fun watching them try to communicate with precision. (It was even more entertaining listening to the “computers” grumble while they tried to decipher their tasks. I wonder if my computer has ever felt that way while I’m working on a program!) When the programmer finished her instructions, the computers revealed the (usually laughable) output. I spent a few minutes with each pair discussing how they could have improved their program. (I.e. Why do you think the computer drew the circles in a row instead of each one inside the previous one? How could you fix that bug?)
  5. For homework, I asked each student to email me a program that would teach a robot how to move in a square. This was a great informal assessment tool to check in with each individual. It also allowed me the opportunity to challenge the students who already “got it” by asking them to find a way to simplify their programs.

These activities really set the tone that I was hoping for with the course. It was interactive, collaborative, and fun – a fantastic start to the semester! The ideas for this combination of activities came from the following sources:

Check them all out!

And for your enjoyment, here is a sample output from one of my students and the design she was trying to replicate.  Nailed it, right?  I’m posting this with her permission (she’s quite proud!).

And our "computer's" output.

Our “computer’s” output.

Here's the assigned design.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s