Well, I started by having them construct very simple algebraic functions like f(x) = 2^x - 5, in both Python and Sage syntax, and then asking them to create lists of ordered pairs such as [(x, f(x)) for x in [-10..10]]. We did a bunch of these in the lab one day till they were comfortable creating things like this fluidly. I would simply throw out a function and a domain, and they had to implement it. I was a little surprised, but it was very good to see, how challenging just this little bit was for many of them. I found that they had to repeat over and over and over the same kind of constructs till it finally made sense.
So today I asked them to create* *functions like* def reciprocals(L): return [1/x for x in L]* on their own. Little details, for example - using '*for x in L'* instead of *'for x in range(..)'* or '*for x in [..]'* required some discussion. This was the first time we had constructed a list from some other already existing list. Though it is essentially the same thing we had been doing earlier using range() or interval notation, little tiny differences like this will throw them. Having written *reciprocals* I then asked them to create *def harmonic(n): return sum(reciprocals([1..n]))*. I described to them what the harmonic numbers were, and once we got the function written they could appreciate how the code essentially read like the English phrase I kept repeating. That's something I really want them to see. So again, this happened via class discussion. Getting them to be able to pursue this *independently* - wow, still a lot of work to do. - Michel On Wed, Dec 9, 2009 at 2:53 PM, <calcp...@aol.com> wrote: > >> > So, for example, write a function that will return a list of the > reciprocals of the values in list L. Now write a function, > harmonic(n), that will return the nth harmonic number making use of the > previous reciprocal function. Yeah, I had to ask just the right > questions, and it was a lot of work, but wow, they were getting it! > They could see the connections. There are some kids in there who have > always hated math and thought they couldn't do it but who are starting > to light up with this. So this was encouraging. > << > > Sounds like the MATLAB/Octave approach to manipulating data with > functions. COuld you show some more details as to how you did this > with SAGE/python? > > TIA, > A. Jorge Garcia > http://calcpage.tripod.com > > Teacher & Professor > Applied Mathematics, Physics & Computer Science > Baldwin Senior High School & Nassau Community College > > > > -- > > You received this message because you are subscribed to the Google Groups > "sage-edu" group. > To post to this group, send email to sage-...@googlegroups.com. > To unsubscribe from this group, send email to > sage-edu+unsubscr...@googlegroups.com<sage-edu%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/sage-edu?hl=en. > > > -- "Computer science is the new mathematics." -- Dr. Christos Papadimitriou -- You received this message because you are subscribed to the Google Groups "sage-edu" group. To post to this group, send email to sage-...@googlegroups.com. To unsubscribe from this group, send email to sage-edu+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-edu?hl=en.