Structure and Interpretation of Computer Programs Winter 2012

From UCL Undergrad Maths Colloquium

Jump to: navigation, search

Structure and Interpretation of Computer Programs Winter 2012

Group Contact: Matthew Eric Bassett

Following Structure and Interpretation of Computer Programs Available for free online, see link. Online Lectures

Scheme Package: Racket If for any reason Racket doesn't work for you, you can try MIT Scheme (mostly for education), Chicken Scheme, or Stalin Scheme

Next Meeting: Thursday 1 March, 7pm.

Location: Cilantro

Set Reading: SICP Sec 1.3. Plus Lecture 2a

This is a reading group for the classic computer science text - we'll use a language with a small, mathematical core (Lambda Calculus) and learn how to use it for practical applications. During each weekly meeting we do a summary of the reading and then work on a related programming project.

Group Members:

  • Matthew (QMUL)
  • Can Son
  • Dimitrios (NBCUniversal)
  • Nadine
  • Niko
  • Xiao (UCL Physics)


Week 1 - 19 Jan

Agenda: Installing and using Racket, naming symbols, conditional expressions, defining functions, lexical scoping. Example: Square root implementation. We'll be implementing another numerical function during the meeting, assuming that we're all up to speed on the reading.

Programming Exercises

From book: 1.6 and 1.8 in sec 1.1.7.

Of our own invention: Say we have a field with a number of rabbits. On any given day, they have a 21% chance of breeding (increasing the population by 1/4 at the end of the day) and a 27% chance of acquiring a virus (decreasing the population be 1/3 of the day). Write a function that takes as input a number for the population of rabbits and uses the (random) procedure to return the population at the end of the day. (random) will return a random number between 0 and 1.

Say we're trying to simulate the average population change for a given day from a number of different rabbit fields. The population for each field is randomly distributed between 35 and 400. Write a function (rand-rabbit) that returns a random number between those values (id est, a population for each field). Use that function and the monte-carlo method to write a function to calculate this average. That is, write a function that takes a number of fields, uses the previous function to "randomly sample" the fields, and averages the change in population over the fields.

Week 2 - 26 Jan

Agenda: Iterative vs Recursive processes. Sec 1.2.3 is an important part of programming and computer science, but we won't worry about it too much. If it's so desired, we may work on the exercises from the last week, too.

Week 3 - 2 Feb

Agenda: Practice with tree recursion

Week 4 - 9 Feb

Agenda: Higher order functions. Most excited stuff in the chapter. We're going to spend 2-3 weeks in this section, this week, we're just going to practice with let and lambda and get used to passing and returning functions.

Week 5 - 16 Feb

Reading Week for UCL Students. No meeting.

Week 6 - 23 Feb

Agenda: Higher order functions; more practice

Week 7 - 1 Mar

Agenda: Higher order functions; even more practice

Personal tools