Open the Commutativity and Associativity Starter File. Complete the exploration to determine if beside, above, and overlay are associative.

1 Is beside associative? Make a prediction, then translate the two Circles of Evaluation into code. Test your code in Pyret.

Circle of Evaluation

(beside (beside aqua-star orange-dot) red-star)

(beside aqua-star (beside orange-dot red-star))

Code

2 Did both expressions produce identical images? Is the beside function associative or not?

3 Is above associative? Make a prediction, then draw a second Circle of Evaluation that changes the grouping without changing the order. Translate into code and test in Pyret.

Circle of Evaluation

(above yellow-rect (above purple-square orange-dot))

Code

4 Did both expressions produce identical images? Is the above function associative or not?

5 Is overlay associative? Draw two Circles of Evaluation that will help you decide if overlay is commutative. Translate into code and test in Pyret.

Circle of Evaluation

Code

6 Did both expressions produce identical images? Is the overlay function associative or not?

Make a prediction: is blend-images associative? Why or why not?

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.