[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [seul-edu] Programming Mathematics



Roger Dingledine wrote:
> 
> On Mon, Sep 25, 2000 at 07:34:26AM -0700, lp wrote:
> > What I want are some super simple programs, that have something
> > to do with math, 

> I'm a little bit confused about what you mean by this. Based on some of
> the programs below, doing them well requires rather more than 2-10 lines
> of code. I guess the problem lies in the fact that you have underspecified
> certain aspects of the problem; in particular, "a program that factors
> a number": what is "a number"?  Are you assuming it's 32 bits? 

What I'm thinking of for the section on programming mathematics is a 
whole series of activities from very simple to advanced. So the
particulars would probably depend on the program. For the very simple
programs I'm looking for now, short/long integer and single precision
numbers would probably suffice.

The intent is to not only provide classroom activities for math, but
also to help math teachers new to Linux (who may have little or no 
experience with computers), to learn something about the command line.
  
Here's some examples I threw together for some one line commands 
in bash and bc that math teachers completely new to Linux might 
find helpful. (Long journeys start with short steps.)

http://math.cochise.cc.az.us/math/K12/teacher_guide/bash_math.html

http://math.cochise.cc.az.us/math/K12/teacher_guide/bc_math.html

> Do you want to do it quickly, or just show "a way" and put a disclaimer 
> on the side that says "this has nothing to do with real problems"?
...
> Part of math is algorithms -- learning how to do things efficiently.
> For instance, you're going to want a good number sieve system if you're
> generating primes after a certain point, or if you're trying to factor
> something tough (they're very related problems).

I think they need to see programming examples that illustrate these 
kinds of issues. I think that one of the biggest things that kids 
learn is a sense of how to solve problems. They may not remember all 
the details but they see enough examples of problems that they get a 
'sense' of how to approach a problem and how to get at the answer.

Kids can be taught, for instance, that there are many different ways of 
solving a problem and that some ways are more appropriate for a 
particular problem than others. Some problems require a 'flexible' 
solution while other problems require 'efficient' solutions, etc,, 
etc. Take for example a program that finds the sum of the numbers 
from 1 to 1000 and compare the speed of this program with a formula 
like n(n+1)/2  that computes the sum automatically. Those are short 
programs that can be tied to stories about Gauss and work well with
kids.

The great thing about factoring and other applications 
from number theory is that you can pose a whole spectrum of questions
and activities from very simple questions to very complex. The programs 
I'm looking for right now are at the super simple end of the spectrum.

> If you want to handle arbitrary numbers, you'll want to use gmp (gnu
> multiprecision library), and you'll start running into problems like
> "perl can handle arbitrary precision numbers, except in the cases where
> it silently rounds them off and doesn't tell you" and similar issues.
> It will get complex quickly.

....
> The sh-utils rpm includes a program called 'factor' (with c code) that
> does this. wc -l puts it at 207 lines, but many of those are license and
> comments (good things, imo). a program called 'primes' is also running
> around somewhere; it was standard in redhat 4.2, I think it's been taken
> out of 6.x for some reason. It's probably still in debian.

Yes, I remember it. I put a goofy little lab on the factor and seq 
command in the math teachers guide, under Basic Skills (I think.)

I wondered about pointing more experienced students to the source code 
for programs about this size (I actually was thinking about the source 
code for First Math), and some other more complex programs, to learn 
more about programming if they were interested.

> Google seems to turn up some large math collections, but none of them
> looks quite perfect. You should spend some time hunting before you
> duplicate work. Because while you can whip out some 10 line programs to
> do things, they won't necessarily be the best teaching tools.

When using programming to teach mathematics, I don't think we want to 
teach programming, (all though there will be a lot of learning about 
programming going on.) It's just that programming mathematics affords 
many opportunities to get kids to think about math concepts. Many of
those opportunities are not explicit, they just sort of 'pop up' 
during an activity. For instance, if I can take your original remark 
out of context a little, "what's a number" is an extrordinary question 
to pose to youngsters. It leads to all kinds of things like "what's the 
difference between a number to a human and a number to a computer?"

Programming is just another context for math concepts, just like other 
applied applications, internet activities.

Students really appreciate simple things. If the activities are done 
right, even though the programs are not optimal in some sense, I think 
they could learn many things: 

The command line can be fun.
It's important to pay attention to detail.
Programming is something I might (or might not) be interested in.

Things like that.

L. Prevett
Mathematics Instructor
Cochise College, Sierra Vista, AZ, US
prevettl@cochise.cc.az.us