# Class 34: Randomized (Unpredictable) Drawing

This outline is also available in PDF.

Held: Monday, 2 November 2009

Summary: We consider Scheme's `random` procedure, how one might use that procedure in writing simple simulations, and how the procedure can be used to generate unpredictable images.

Related Pages:

Notes:

Overview:

• Random art.
• Why use randomness.
• The `random` procedure.
• Simulation.

## Randomized Images - The Theory

• Non-mainstream art philosophy: The images that come from random processes (or from nature) can be as interesting as the images that come from artists who intentionally plan the canvas.
• One important movement: Dada. (Early 20th century; also a reaction to facism and industrialization and ...)
• An example: Tristan Tzara's How to make a Dadaist Poem
• Disclaimer: After creation by random processes, some filtering of good from bad often happens.
• Modernized suggestion:
• Randomized processes can provide inspiration
• The ability to constrain some aspects of the process can provide a new mechanism for creation.

## Randomized Images - Practice

• Many of the procedures we've written or used have numeric parameters.
• Those parameters can be generated randomly.
• Many of the procedures we've written take one of a restricted number of inputs (e.g., there are only so many brushes).
• Those inputs can also be selected randomly.

## The `random` Procedure

• Scheme helps us by providing a `(random n)` procedure.
• `n` must be a positive integer.
• `random` returns an integer between 0 and `n`-1, inclusive.

## Other Uses of Randomness

• We often use randomness in simulating unpredictable events, such as the rolling of an unbiased die.
• More requently, such randomness is used in larger-scale simulations.
• We'll stick with images, though.

## Lab

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Fri Dec 11 09:38:47 2009.
The source to the document was last modified on Fri Aug 21 17:03:06 2009.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2009F/Outlines/outline.34.html`.

You may wish to validate this document's HTML ; ;

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright © 2007-9 Janet Davis, Matthew Kluber, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials copyright by John David Stone and Henry Walker and used by permission.) This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit `http://creativecommons.org/licenses/by-nc/2.5/` or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.