Workshops for Fall 2002
- Lisp and Scheme as the ultimate programmable calculators.
The interactive programming environments of Common Lisp and Scheme can be
used as powerful programmable calculators. This workshop is an introduction
to the programming environment with a few applications to modular
arithmetic and complex numbers.
- The recursive definition of functions.
Defining a function in terms of itself is a powerful technique in
mathematics and computer science. This workshop illustrates the
notion of recurrence by presenting examples of functions, computer programs,
data structures, and solutions of puzzles which are based on recursive
procedures.
- The power of abstraction.
One of the features of Common Lisp and Scheme is that functions can be
passed as arguments and returned as values. This allows the programmer
to work at a very high level of abstraction and write code of great
simplicity and elegance. In this workshop we will demonstrate the power of
this technique through examples that include the extended euclidean algorithm,
the method of successive approximations, Newton's method for finding roots,
and basic methods of numerical integration.
September's mathematics/programming problems
Adapted from the ACM Contest Problems Archive
- Let us say that a number is ugly if its only prime factors are
2,3, or 5. For example, the first eleven ugly numbers are
2,3,4,5,6,8,9,10,12,15, and 16. Write a program to find and print the
1500th ugly number.
-
Write a program that takes as input the Cartesian coordinates of three distinct
points on the plane and outputs the equation of the unique circle (or straight
line) on which the points lie.
-
The New Zealand currency consists of bills of $100, $50, $10, and $5 as
well as coins of $2, $1, 50c, 20c, 10c, and 5c. Write a program that takes as input
some amount of money between $0 and $50 (multiple of 5c) and gives all possible
ways to make up this amount in terms of the coins and bills listed above. For
example, 20c can be given in four ways: as a 20c coin, two 10c coins, one 10c
coin and two 5c coins, and four 5c coins.
|