[Verba] Meeting Summary
Stuart D. Gathman
stuart at gathman.org
Fri Mar 17 18:17:34 EST 2006
Last week (I'm behind on summaries), we cut up paper to model the many
ways of gluing together the edges of a screen (choices for what to do when
reaching the edge of the screen in a 2D game). Most of the resulting 2D
surfaces can be modeled with paper, but 2, the Klein bottle and projective
plane require 4 dimensions. We then added a place_robot function.
This week, I went to the Chenettes, and Jilian joined via AIM. Rebecca
and I made the place_robot function actually work, while Jilian figured
out how to CD her Windows Command prompt to the proper directory and run a
python script. Then I played some hymns in Jazz style for Rebecca, who
very sweetly professed to like them.
Let me remind everyone that our excursions into group theory are not
directly related to programming, but were needed to understand a problem
domain of interest (solving Rubik's cube). But, understanding it will
help you excel at Math - especially abstract algebra and modern physics.
To build programming skills, you need to keep doing it - just like
learning an instrument or sport. Try to come up with problems to solve
using your skills, and solve them.
Here is a simple problem related to group theory. Remember that any group
(including Rubik's cube) is isomorphic to a permutation group. A basic
operation needed for dealing with permutation groups is to list their
members. We introduced Python "generators" for the deal_position
function. This assignment asks you to create a generator that lists all
the permutations of a sequence. It should be written as a generator.
For instance,
def permute(s):
... blah
blah ...
... yield something
... blah
print permute([1,2,3])
should output:
[1,2,3]
[1,3,2]
[2,1,3]
[2,3,1]
[3,1,2]
[3,2,1]
or the same permutations in any order. Do not assume that the members of
the permutation group are numbers. They can be any Python object.
--
Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
More information about the Verba
mailing list