Making Sandwiches
CPS 004.1, 1 July 2002
Form groups of size four persons. You
should start this group activity by introducing yourself to each member of the group.
You may also want to choose one person to write down the group's discussion on
the provided transparency as you go so that it can be displayed on the
classroom's overhead projector.
Specifications
A computer has no common sense with which to interpret your instructions the
way you really intended them to be carried out; it is one-hundred percent
literal minded. To simulate this experience, your instructions for making a
peanut butter and jelly sandwich will be read and followed by the professor
(i.e., computer) as literally as possible. The reader will not be allowed to
provide to additional information to the professor-computer as he is working.
On the other hand, all modern programming languages provide the computer with
some basic "knowledge", stuff it knows when it starts. For
example, most programming languages allow you to enter algebraic expressions in
the common infix format you have learned since elementary school. In other
words, the computer knows how to do algebra. It is convenient to have some
commands built in so that you do not have to build everything from scratch. To
simulate this knowledge, there are certain things you can assume our PB&J
computer knows how to:
- open any container (bread packaging, jars, drawers, etc.)
- close any container (bread packaging, jars, drawers, etc.)
- hold a thing (container, knife, plate, etc.)
- pick up a thing (knife, bread, plate, etc.)
- put down a thing (knife, bread, plate, etc.)
- move a thing (knife, bread, plate, etc.)
- spread a condiment (peanut butter, jelly, etc.)
- clean something (wipe a counter, wipe a knife, etc.)
But you must tell it to do them at the appropriate time! Note these are not easy
tasks --- many of them are still unsolved problems in
Computer Science.
Finally, our PB&J computer has the following things available on the
counter to create
a sandwich:
- a loaf of sliced bread
- a jar of peanut butter
- a jar of jelly
- a knife
- a spoon
- a fork
- a plate
- paper towels
For this activity, you will describe a procedure that others can
follow to make a peanut butter and jelly sandwich. When listing the steps in
your procedure, you should assume the person following your instructions is as
"dumb" as a computer.
Extra Credit
On a separate sheet of paper, describe how you would modify your procedure if
you were making your sandwiches in a restaurant, where your goal is to make many sandwiches quickly (but
with the same quality and care you showed in your own kitchen).
On a separate sheet of paper, describe how you would make a game out of making
peanut butter and jelly sandwiches. Your game could be a board game, a computer
game (for Nintendo or Sega, for example), or a game you might play with younger
siblings while following your procedure. Be creative!