Functional Problem Solving (CSC 151 2015S) : Handouts
Primary: [Front Door] [Schedule]  [Academic Honesty] [Disabilities] [Email]  [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric]  [Calendar]
Current: [Assignment] [EBoard am] [EBoard pm] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards am] [EBoards pm] [Labs] [Outlines] [Readings]  [Examples] [Handouts]
Reference: [Setup] [VM] [Errors]  [Functions AZ] [Functions By Topic]  [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2014F)] [Weinman (2014F)]
Misc: [Submit Questions]  [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell]  [Book Office Hours]  [Issue Tracker (Course)]
This is an approximate schedule. Expect topics and dates of topics to change. (I will try to keep due dates of assignments the same.)
Some of the information here can also be found in the Google calendar for the course, which is available at <http://bit.ly/151gcal>.
Week 01: An Introduction to ...  

Date  Topic  Reading  Lab  Work Due  
01  Tuesday, 20 January 2015  An Introduction to Algorithms Introduction: What is CS? Exercise: An everyday algorithm. Debriefing on exercise.  
02  Wednesday, 21 January 2015  An Introduction to Linux Lessons from day one. Common parts of an algorithm. About the course. Getting started with Linux. Some administrative details (if there's time).  The Linux Environment and Parts of Algorithms  Getting Started with Linux  HW 1: Introductory Survey (due 10:30 p.m. Wednesday night) 
03  Friday, 23 January 2015  An Introduction to Scheme Why use programming languages? Scheme history. Scheme basics.  Parts of Algorithms, The DrRacket ProgramDevelopment Environment, Beginning Scheme, & How Scheme Evaluates Expressions (Take 1)  Starting Scheme Writeup 03: Exercise 2  Quiz 1 
Week 02: Scheme Basics  
Date  Topic  Reading  Lab  Work Due  
04  Monday, 26 January 2015  Computing with Symbols and Numbers Values and types. Kinds of numbers. The modulo operation.  Numeric Values & Symbolic Values  Numeric Computation Writeup 04: Exercise 2, parts d, e, and f  
05  Tuesday, 27 January 2015  Drawings as Values Representing images. Thinking about drawings through composition/decomposition. The underlying representation. Pure approaches vs impure approaches.  Drawings as Values  Drawings as Values Writeup 05: Exercise 4, parts a, c, and e  HW 2: Exploring Algorithms 
06  Wednesday, 28 January 2015  Writing Your Own Procedures Sequencing operations in Scheme. The drawingsasvalues model, revisited. Why define your own procedures? How to define your own procedures. Evaluating expressions in Scheme.  Writing Your Own Procedures and How Scheme Evaluates Expressions (Take 2)  Writing Your Own Procedures Writeup 06: Exercise 2, parts a and b  
07  Friday, 30 January 2015  Writing Your Own Procedures, Continued Lab, continued. Questions and reflection.  Writing Your Own Procedures and How Scheme Evaluates Expressions (Take 2)  Writing Your Own Procedures Writeup 07: Exercise 6  Quiz 2 
Week 03: Thinking About Procedures  
Date  Topic  Reading  Lab  Work Due  
08  Monday, 2 February 2015  Documenting Programs and Procedures Debrief on procedures lab. Pair programming. The need for documentation. The Six P's  a strategy for documenting procedures. A few additional P's. Practice.  Documenting Your Procedures and Wray: How Pair Programming Really Works  Writeup 08: Document the rectangle procedure from the procedures lab 

09  Tuesday, 3 February 2015 
Side Effects: Images, Output, and More
Output with display and newline .
Using output procedures to trace code.
More procedures for working with images.

Output in Scheme and Basic Image Operations  Side Effects Writeup 09: Exercise 3a  HW 3: Drawing Procedures; Exam 1 assigned 
10  Wednesday, 4 February 2015  Testing Your Procedures Why test? Strategies for testing. The primary testing operations.  Testing Your Procedures  Testing Your Procedures Writeup 10: Exercise 9  
11  Friday, 6 February 2015  Testing Your Procedures, Revisited Key ideas in testing. Careful postconditions. Exhaustive testing. Making yourself more efficient.  Testing Your Procedures  Testing Your Procedures  Quiz 3; Exam 1 prlogue (due 10:30 p.m.) 
Week 04: Color  
Date  Topic  Reading  Lab  Work Due  
12  Monday, 9 February 2015  A Design Perspective A bit about design. A bit about color theory. Exploring some images and design spaces.  Design and Color  
13  Tuesday, 10 February 2015  Raster Graphics and RGB Colors Representing images, revisited. Pixels and colors: The basics. RGB colors. Those weird numbers.  Raster Graphics: Images from Pixels and Colors and RGB Colors  Raster Graphics and RGB Colors Writeup 13: Exercise 10  Exam 1 (due 10:30 p.m. via Web form) 
14  Wednesday, 11 February 2015  Transforming Colors Review: Color basics. Integerencoded RGB colors. Computing new colors from old. An example.  Transforming RGB Colors  Transforming RGB Colors  Exam 1 (due in class in paper form); epilogue (due 10:30 p.m.) 
15  Friday, 13 February 2015 
Boolean Values and Predicate Procedures
Boolean values.
Predicates  Procedures that return Boolean values.
Combining booleans with and and or .

Boolean Values and Predicate Procedures  Boolean Values and Predicate Procedures  Quiz 4 
Week 05: Control  
Date  Topic  Reading  Lab  Work Due  
16  Monday, 16 February 2015  Transforming Images Transforming images by transforming each pixel. Sequencing transformations with compose. Anonymous transformations.  Transforming Images  Transforming Images Writeup 16: Exercise 3  
17  Tuesday, 17 February 2015  Homogeneous Lists: Making and Manipulating Groups of Drawings Context: What and why lists? Building lists. Mapping lists. Other list operations.  Making and Manipulating Homogeneous Lists  Making and Manipulating Lists of Drawings  HW 4: From Color Transformations to Image Filters 
18  Wednesday, 18 February 2015  Programming the GIMP Tools A new model of images making. Coding algorithms for drawing. Other useful techniques.  The GNU Image Manipulation Program and Programming the GIMP Tools  Scripting the GIMP Tools  
19  Friday, 20 February 2015 
Conditionals
The parts of an algorithm, revisited.
Choosing between two options with if .
Optional evaluation with when .
Making multiple choices with cond .
Comparing approaches.

Conditionals  Conditionals Writeup 19: Exercises 3 c and d  Quiz 5 
Week 06: Miscellaneous  
Date  Topic  Reading  Lab  Work Due  
20  Monday, 23 February 2015  Anonymous Procedures, Revisited What is a procedure? Describing procedures. Anonymous procedures. Anonymous procedures through lambda expressions. Other kinds of anonymous procedures.  Anonymous Procedures  Anonymous Procedures Writeup 20: Exercise 5, parts bf  
21  Tuesday, 24 February 2015 
Naming Local Values
Why name things.
Naming things with let .
Naming things with let* .
Naming procedures.

Local Bindings  Local Bindings Writeup 21: Exerises 5d and 6b  HW 5: Transforming Colors, Shapes, and Images 
22  Wednesday, 25 February 2015  Images as Functions from Position to Colors Models of images. Iterating over positions: Images as functions from position to color. Blends and other positionallycomputed images. Drawing simple shapes. Some strange computations.  Building Images by Iterating Over Positions  Building Images by Iterating Over Positions Writeup 22: Exercise 3  
23  Friday, 27 February 2015  Revisiting Lists Lists, revisited. New list operations. Drawings as values.  Building Data Structures with Heterogeneous Lists  Exploring Lists  Quiz 6 
Week 07: Recursion  
Date  Topic  Reading  Lab  Work Due  
24  Monday, 2 March 2015  Recursion Basics Background. The idea of recursion. Some sample recursive procedures. Expressing recursion in Scheme.  Recursion Basics  Recursion Basics  
25  Tuesday, 3 March 2015  Recursion Basics, Continued Reflection. Questions. Recursion vs. other forms of repetition.  Recursion Basics  Recursion Basics Writeup 25: Exercises 4 and 5  HW 6: Polar Conditionals; Exam 2 assigned 
26  Wednesday, 4 March 2015 
Preconditions, Revisited
Verifying preconditions.
The error procedure.
Husk and Kernel programming.

Verifying Preconditions  Verifying Preconditions Writeup 26: Exercises 4 and 5  
27  Friday, 6 March 2015  Characters and Strings Representing text. Characters: The basic building blocks. Combining characters into strings.  Characters and Strings  Characters and Strings Writeup 27: Exercises 5 and 6  Quiz 7 
Week 08: Recursion, Continued  
Date  Topic  Reading  Lab  Work Due  
28  Monday, 9 March 2015  Recursion with Helper Procedures Basics of helper recursion. A term: Tail recursion. Why write tail recursive procedures?  Recursion with Helper Procedures  Recursion with Helper Procedures  
29  Tuesday, 10 March 2015  Recursion with Helper Procedures, Continued Further issues in helper recursion. Tail recursion.  Recursion with Helper Procedures  Recursion with Helper Procedures Writeup 29: Exercises 4l and 5b  
30  Wednesday, 11 March 2015  Other Forms of List Recursion Questions and answers. Some notes on yesterday's lab. Some key ideas from the reading.  List Recursion, Revisited  List Recursion, Revisited Writeup 30: Exercises 3ab and 4ab  Exam 2 (due Thursday at 10:30 p.m. via email) 
31  Friday, 13 March 2015  Numeric Recursion Recursion, generalized. Numeric recursion.  Numeric Recursion  Numeric Recursion  Quiz 8; Exam 2 (due in class in paper form) 
Spring Break  
Week 09: New Approaches  
Date  Topic  Reading  Lab  Work Due  
32  Monday, 30 March 2015 
Naming Local Procedures
Why have local procedures.
Creating local procedures with letrec .
Creating local procedures with named let.

Local Procedure Bindings  Local Procedure Bindings Writeup 32: Exercise 4  
33  Tuesday, 31 March 2015  Turtle Graphics Modeling images through process: Turtle graphics. Some historical notes. Turtle graphics in MediaScheme.  Turtle Graphics  Turtle Graphics  
34  Wednesday, 1 April 2015 
Iteration
Reflecting on procedures and sideeffects.
A useful tool for repetition: foreach .
Contrasting map , foreach , repeat , and recursion.

Iteration  Iteration Writeup 34: Problems 8, 9, and 10  
35  Friday, 3 April 2015  Geometric Art Through Numeric Recursion Using numeric recursion for making images. Parallel lines, concentric circles, and beyond.  Geometric Art  Geometric Art Writeup 35: Exercise 5 (optional)  Quiz 9 
Week 10: Data Structures  
Date  Topic  Reading  Lab  Work Due  
36  Monday, 6 April 2015  Pairs and Pair Structures Representing lists: Pairs and cons cells. Why care about the underlying representation?  Pairs and Pair Structures  Pairs and Pair Structures Writeup (paper): Exercises 1 and 3  
37  Tuesday, 7 April 2015 
Trees
Thinking about trees in terms of cons .
Thinking about trees recursively.
Writing recursive tree procedures.

Trees  Trees Writeup 37: Exercises 2 and 4a (optional)  HW 7: Producing Playful Polygons; Exam 3 available 
38  Wednesday, 8 April 2015  Vectors Problems with lists. A solution: Vectors. Behind the scenes: How Scheme implements vectors. Important vector procedures.  Vectors  Vectors Writeup 38: Exercise 4  Exam 3 distributed 
39  Friday, 10 April 2015 
Randomized (Unpredictable) Drawing
Random art.
Why use randomness.
The random procedure.
Simulation.

Randomized Drawing  Randomized Drawing Writeup 39: Exercise 4c  Quiz 10 
Week 11: Thinking About Procedures, Revisited  
Date  Topic  Reading  Lab  Work Due  
40  Monday, 13 April 2015  On TwoDimensional Design Background: About the project. Some examples. General elements of design. Relationships between elements. Broader design principles. Some examples.  Elements and Principles of TwoDimensional Design & About the Project  
41  Tuesday, 14 April 2015  Project Kickoff Time to form groups. A few more notes on design. Playing and brainstorming.  Project Ideas  Playing with Project Ideas  Exam 3 (due 10:30 p.m. via email); Project assigned 
42  Wednesday, 15 April 2015  HigherOrder Procedures, Revisited Some program design principles. Thinking about repetition. Procedures as firstclass values.  Design Patterns and HigherOrder Procedures  Design Patterns and HigherOrder Procedures Writeup 42: Exercises 3, 4, and 6  Exam 3 (due in class in paper form) 
43  Friday, 17 April 2015  Analyzing Procedures Comparing algorithms. Two related metrics: Time and Number of steps. Counting procedure calls by printing. Tools for analysis.  Analyzing Procedures  Analyzing Procedures  Quiz 11 
Week 12: Searching  
Date  Topic  Reading  Lab  Work Due  
44  Monday, 20 April 2015  Association Lists Storing information in tables. Representing table entries as lists. Representing tables as lists. Association lists: Scheme's standard table representation. Implementing key association list procedures.  Association Lists  Association Lists Writeup 44: Exercises 1a, 1b, and 5a  Project proposal due at 10:30 p.m. 
45  Tuesday, 21 April 2015  Binary Search The problem of searching. Analyzing algorithmic efficiency. Making searching more efficient using divideandconquer. A demo: Destructive binary search. Considering the parameters to binary search.  Search Algorithms  Project proposal images due in class  
46  Wednesday, 22 April 2015  Binary Search Lab Exploring the search API. Remaining questions.  Search Algorithms  Binary Search Writeup 46: Exercise 4  
47  Friday, 24 April 2015  Pause for Breath Project work time. Key techniques.  No Reading  Quiz 12  
Week 13: Sorting  
Date  Topic  Reading  Lab  Work Due  
48  Monday, 27 April 2015  An Introduction to Sorting The problem of sorting. Writing sorting algorithms. Examples: Insertion, selection, etc. Formalizing the problem.  No Reading  Exam 4 distributed  
49  Tuesday, 28 April 2015  Insertion Sort Insertion sort basics. Four questions about insertion sort. Analyzing insertion sort.  Sorting  Insertion Sort Writeup 49: Exercises 2e and 4f  Project due 
50  Wednesday, 29 April 2015  Merge Sort More efficient sorting techniques. Divide and conquer, revisited. Merge sort. Analyzing merge sort.  Merge Sort  Merge Sort Writeup 50: Exercise 4, parts f, g, and h  
51  Friday, 1 May 2015  Files in Scheme File basics: Data persistence and beyond. Ports. Basic file operations.  Files in Scheme  Files in Scheme  Quiz 13 
Week 14: Wrapup  
Date  Topic  Reading  Lab  Work Due  
52  Monday, 4 May 2015  Project Assessment: Images Reviewing images: The "big picture". Reviewing images: Policies for doing individual images. Image review. Debrief, if appropriate.  Exam 4 (due 10:30 p.m. via email)  
53  Tuesday, 5 May 2015  Project Assessment: Algorithms Additional images. Debriefing from image analysis. Students discuss programming techniques. Programming challenges.  Exam 4 (due in class in paper form)  
54  Wednesday, 6 May 2015  Recap The subject matter(s) of the course. Topics within each subject matter. Looking behond the class.  
55  Friday, 8 May 2015  Wrapup Course evaluation. Comments on the final. Final comments. 