PBJinParallel

PD_CommunicationAndCoordination TCPP_Programming TCPP_Algorithms TCPP_Pervasive CS0 CS1 CS2 Systems OS movement touch

Note: The “Make a Peanut Butter and Jelly Sandwich” serial exercise is an extremely old way to describe how a computer executes a set of instructions. The earliest known description is the “Great Peanut Butter Caper” by Lewandowski and Morehead in 1998. A variation was presented by Davis and Rebelsky in 2007. Unlike the original described exercises, this activity explores how to put together a Peanut Butter and Jelly sandwich in parallel

iPDC Modules

Variation (Bogaerts2014)

Steve Bogaerts suggested using the example of making a PB&J sandwich as a way of explaining clock speed and explaining Moore’s Law:

“Suppose you tell someone to make one peanut butter and jelly sandwich every hour. That is easy to accomplish. Every minute? Perhaps possible, with a bit of practice. Every second? That would be impossible. A person can’t be told to “speed up” beyond a certain point; some improvement in sandwich-making must be devised. Likewise, a processor cannot speed up with out some improvement in processor technology.”


CS2013 Knowledge Unit Coverage

Communication and Coordination (Core Tier 1)

2. Core Tier 1: Give an example of an ordering of accesses among concurrent activities (e.g., program with a data race) that is not sequentially consistent. [Familiarity]


TCPP Topics Coverage

Programming Topics

Algorithms Topics

Emerging and Pervasive Topics



Accessibility

The “sandwich” concept can be extended to other cheap ingredients, in case particular students have nut allergies or other food-related allergies. The most important part is to have a limited set of “ingredient” resources, and multiple people trying to access those resources.

There is a lot of movement involved in this exercise; we recommend that mobility-impaired students be encouraged to take on the role of a single student making sandwiches.


Assessment

Activity Assessment Unknown.

(Bogaerts2014) used making a PB&J sandwich as an analogy for explaining clock speed and Moore’s Law as part of a larger unit in parallelism in a CS1 course. He mentions that the total amount of time spent on parallelism was larger in the section that used analogies and hands-on activities compared to the one that presented the topics in a traditional lecture-style format (4 hours vs 90 minutes). However, the section that used analogies and hands-on activities performed better than those who received the information in a traditional lecture-format. Bogaerts argues that it is much better to spend more time on fewer parallel concepts in a hands-on way in an introductory course, rather than covering a variety of parallel concepts in a non-hands-on way. The final conclusion drawn is that analogies and hands-on activities enabled students to learn better and stimulated greater interest in the subject than a course that delivered the material in a typical lecture-style fashion. (Bogaerts2017) extends the assessment of the original paper, but found that while student interest increased, the desire to learn more decreased. The authors theorize that this is because most of the students in the course were non-majors who will not be pursuing computing in the future.


Citations