Re: [math-fun] Learning computer programming for a bright 13-year old?
While I'm replying I'll deviate back to the original question and suggest JavaScript. It's got pretty much all the theoretical purity of languages like LISP or even ML; it's a close syntactic relative of the more mainstream C/C++/Java, so a useful familiariser for those; and to top it off, it typically sits inside a framework (a browser) where all input/output/display issues already neatly handled. To the mathematician in me, JavaScript, when programmed well, is a very satisfying language. (But 99% of all real-world use of it would get this message negatively moderated ;-) ) From: "R. William Gosper" <rwg@osots.com>
I said
For a certain concrete thinker, I'm planning the following first program: Combine Macsyma's string manipulation functions, especially CARDINAL_STRING (12 -> "twelve") and ORDINAL_STRING (12 -> "twelfth") to make a FRACTION_STRING function (11/12 -> "eleven twelfths"). There are nice opportunities for bugs ("one twelfths", 1/2 -> "one second", 3 -> "three firsts")
This went great!! After he got those fixed and was sure it all worked, 3/2 -> "three halfs" and after the obvious fix, "three halvess". He *really* enjoyed that session.
Richard Fateman added
You might be surprised to learn that speaking fractions is ambiguous.
30/400 and 34/100 are quite different numbers, but each can be pronounced
thirty four hundredths
Luckily, we dodged that one. It probably can't happen with reduced fractions anyway,
twenty three hundred and oneths?
but just for kicks: block([gcd:false,fancy_display:false], for x in [34/100,30/400] do print(x=number_string(x)))$
34 --- = thirty-four one hundredths 100
30 --- = thirty four hundredths 400
One thing that used to drive both my (US) girlfriend and (UK) me absolutely mad was hearing sports commentators say things like "X has beaten Y by three one thousandths of a second". "Three thousandths!" we'd both shout at the idiot box simultaneously. I don't know how widespread such ire is though. I believe the additional (to me) "one" is certainly more US, but the commentator in question (Murray Walker) was as British as the day is long. The disambiguation can typically happen in the phrasing, but that's a lower-bandwidth part of the signal, alas, and more susceptible to noise. Phil ===== When inserting a CD, hold down shift to stop the AutoRun feature In the Device Manager, disable the SbcpHid device. http://www.cs.princeton.edu/~jhalderm/cd3/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
I've heard this about JavaScript from others in the theoretical computer science world, as well. I've seen direct translations of combinators into JavaScript, so it implements full closures correctly. I can't opine on its efficiency, and I suspect that it sucks, since most implementations assume a relatively small amount of processing to produce a visual page. I don't know whether JavaScript implements infinite precision integers and full rational numbers. These would seem to be essential for a bright 13-year old, so that (s)he could play with number theory. Ditto with complex numbers & trigonometry, so they can play with stuff they learn in high school. This is why Maxima (free Gnu license) is a pretty good way to start. At 12:51 AM 1/4/2005, Phil Carmody wrote:
While I'm replying I'll deviate back to the original question and suggest JavaScript. It's got pretty much all the theoretical purity of languages like LISP or even ML; it's a close syntactic relative of the more mainstream C/C++/Java, so a useful familiariser for those; and to top it off, it typically sits inside a framework (a browser) where all input/output/display issues already neatly handled. To the mathematician in me, JavaScript, when programmed well, is a very satisfying language.
(But 99% of all real-world use of it would get this message negatively moderated ;-) )
From: "R. William Gosper" <rwg@osots.com>
I said
For a certain concrete thinker, I'm planning the following first program: Combine Macsyma's string manipulation functions, especially CARDINAL_STRING (12 -> "twelve") and ORDINAL_STRING (12 -> "twelfth") to make a FRACTION_STRING function (11/12 -> "eleven twelfths"). There are nice opportunities for bugs ("one twelfths", 1/2 -> "one second", 3 -> "three firsts")
This went great!! After he got those fixed and was sure it all worked, 3/2 -> "three halfs" and after the obvious fix, "three halvess". He *really* enjoyed that session.
Richard Fateman added
You might be surprised to learn that speaking fractions is ambiguous.
30/400 and 34/100 are quite different numbers, but each can be pronounced
thirty four hundredths
Luckily, we dodged that one. It probably can't happen with reduced fractions anyway,
twenty three hundred and oneths?
but just for kicks: block([gcd:false,fancy_display:false], for x in [34/100,30/400] do print(x=number_string(x)))$
34 --- = thirty-four one hundredths 100
30 --- = thirty four hundredths 400
One thing that used to drive both my (US) girlfriend and (UK) me absolutely mad was hearing sports commentators say things like "X has beaten Y by three one thousandths of a second". "Three thousandths!" we'd both shout at the idiot box simultaneously. I don't know how widespread such ire is though. I believe the additional (to me) "one" is certainly more US, but the commentator in question (Murray Walker) was as British as the day is long.
The disambiguation can typically happen in the phrasing, but that's a lower-bandwidth part of the signal, alas, and more susceptible to noise.
Phil
===== When inserting a CD, hold down shift to stop the AutoRun feature In the Device Manager, disable the SbcpHid device. http://www.cs.princeton.edu/~jhalderm/cd3/
Javascript is a really awful language to use in teaching. The language syntax is not bad, but has no mandatory declarations, which I consider to be a mandatory feature for a good teaching language. In javascript, every typo becomes an error discovered only at runtime. That's bad, but the worst is that the only environment that supports javascript, your browser, is an absolute mess. If I had to pick a readily available language as a teaching tool, I would choose Java. It's flawed too, but at least it is well documented and well behaved. The choice of curriculum is just as important as the choice of language. I would stay away from anything involving graphics, threads, processes, and I/O until the student has definitely got the concepts.
On 4 Jan 2005 at 11:47, Dave Dyer wrote:
... That's bad, but the worst is that the only environment that supports javascript, your browser, is an absolute mess.
This isn't correct: JavaScript runs as a stadalone "Windows Scripting Host" language and when run from Windows [as opposed to run from your browser] has an object model that includes most of the system stuff [so you can browse the filesystem, run programs, etc]
The choice of curriculum is just as important as the choice of language. I would stay away from anything involving graphics, threads, processes, and I/O until the student has definitely got the concepts.
I'm not sure exactly what you mean by 'graphics' but my memory, from MANY years ago, is that graphics is one of the BEST things to start new- programmers doing. It is fun, and you get immediate, clear feedback [try having fun or understanding if your code is correct writing a program to find primes or the digits of pi..:o)]. /Bernie\ -- Bernie Cosell Fantasy Farm Fibers mailto:bernie@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <--
Bernie Cosell writes: [try having fun or understanding if your code is correct writing a program to find primes or the digits of pi..:o)]. You seem to have defined fun for most people on the list. (No :-) at all). I thought it was fun. It was also a good way to meet guys. Hilarie
On 4 Jan 2005 at 17:41, The Purple Streak, Hilarie Or wrote:
Bernie Cosell writes:
[try having fun or understanding if your code is correct writing a program to find primes or the digits of pi..:o)].
You seem to have defined fun for most people on the list. (No :-) at all).
Nope, I was referring to the original subject, a "bright 13-year-old". I think that folks like Seymore Papert and Wally Feurzig spent a fair bit of time pondering this problem and I'm pretty sure that their consensus is that drawing neat pictures [and making the turtle scoot around the furniture] is more "fun" [sic..:o)] than noticing that the 127,765th digit of 'e' is 7. [and when the turtle hits the wall or the like, it is more clear that there is a problem and what it might be, than if you've done some complicated sort algorthm and on the 125th test list it screwed up [because you got one of the boundary conditions wrong and that was the first data set with the particular 'situation']] Obviously, Y (and the 13-year-old's) MMV... /Bernie\ -- Bernie Cosell Fantasy Farm Fibers mailto:bernie@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <--
=Bernie Cosell ...making the turtle scoot around the furniture...is more "fun"... ...and when the turtle hits the wall or the like...
This touches on some important educational themes missed so far: 1. at the elementary stages the most fun and memorable lessons always end with spectacular explosions 2. today, no one actually programs anything real from scratch; all code descends from "Hello World" For example, my son quite reasonably had zero interest in the baroqueries of HTML until I showed him how he could edit the sources of actual pages he browsed to get silly variants. Soon he wanted to craft his own "cool" home page. Hence, a good modern learning environment might be something like a fully functional fault-tolerant open source online video game, having modules perhaps designed with educational accessibility in mind. "Grasshopper, it is one thing to give the boss monster a pointy head by hacking its seed data, but to make more interesting duel combos you will want to know about the following algorithm..." Barring that, just take the cover off any program that does something even vaguely interesting. Inevitably the Joy of Hacking will seek ever more substantive objects of its affections--reflecting the psyche of the hacker, for good or ill. Who do you think writes viruses? (Ender's Game, anyone?<;-)
Quoting Marc LeBrun <mlb@fxpt.com>:
Who do you think writes viruses? (Ender's Game, anyone?<;-)
Well, OSC has just barely released the first three chapters of the book in which they are probably going to find out who wrote (created ?) the descolada virus. In the meantime, Jane was an artificial intelligence that got out of hand, but I dont think it was ever made clear who the author was; anyway not the kids. However: they did hack the computer net soon after their first arrival, but that was more or less expected of them. If hacking HTML is so easy, why can't I do it? Does anyone remember, or have they used KIM-1? Those were really great for getting a feel for hardware and machine language, although their associated memory didn't allow for very complicated programs. That and the somewhat lousy order code of the 6502 vs 8080, for example. ------------------------------------------------- www.correo.unam.mx UNAMonos Comunicándonos
Check out http://home.pipeline.com/~hbaker1/sigplannotices/COMFY.TXT Also: http://home.pipeline.com/~hbaker1/sigplannotices/column04.tex.gz Complete "comfy" language compiler in Lisp for the 6502: http://home.pipeline.com/~hbaker1/sigplannotices/CFYCMP1.LSP At 09:56 PM 1/4/2005, mcintosh@servidor.unam.mx wrote:
Quoting Marc LeBrun <mlb@fxpt.com>:
Who do you think writes viruses? (Ender's Game, anyone?<;-)
Well, OSC has just barely released the first three chapters of the book in which they are probably going to find out who wrote (created ?) the descolada virus. In the meantime, Jane was an artificial intelligence that got out of hand, but I dont think it was ever made clear who the author was; anyway not the kids. However: they did hack the computer net soon after their first arrival, but that was more or less expected of them.
If hacking HTML is so easy, why can't I do it?
Does anyone remember, or have they used KIM-1? Those were really great for getting a feel for hardware and machine language, although their associated memory didn't allow for very complicated programs. That and the somewhat lousy order code of the 6502 vs 8080, for example.
Marc LeBrun wrote:
For example, my son quite reasonably had zero interest in the baroqueries of HTML until I showed him how he could edit the sources of actual pages he browsed to get silly variants. Soon he wanted to craft his own "cool" home page.
I learned programming on a Commodore Vic 20; I was eight or ten. There were a bunch of BASIC games on tapes we'd load and run. My dad must have shown me the LIST command; when the maze for Pac-Man scrolled by, editing it was the most natural thing in the world. The ghosts wandered up and got caught in the score. On Donkey Kong, I moved the princess off the edge of the platform (unfinished building? what was that thing?) so we had to fling ourselves off the edge and tumble flailing into the princess. Scott Adams (not Dilbert) wrote a bunch of text advenure games. Our family loved solving the puzzles together. When I tried writing one, I found it awkward to recode the command interpreter for each room. GOSUB was a blessed revelation. Eventually my adventure needed the 20k expander card to fit in memory. I learned binary by hand-coding the pixels of the monochrome graphics. When that got tiresome, I figured out how to scrape the screen and convert an 8x8 array of characters into a sprite. I copied & tweaked the fractal programs from Scientific American's Computer Recreations columns. This led into a lot more maths: what the heck does z^z mean when z is complex? My teacher didn't know, but she gave me an article on exp(i theta) that answered the question and opened up a lot more neat stuff. Most languages have shortcomings, but it won't stop anyone if they're having fun. -- Mike Stay staym@clear.net.nz http://www.cs.auckland.ac.nz/~msta039
I think that many of us wrote the primes, pi, e, Fibonacci, etc. stuff as our first computer programs, and it *WAS FUN*. I'd not deprive a bright 13 year old of such fundamental experiences. Graphics, bah humbug! I went to one of the fifth grade classrooms in Papert's study. They programmed in Logo, and one of the students showed me a program for computing the sums of consecutive powers of 2. I commented that it was interesting that the sums added to something very close to the next power of 2. The student was surprised and said it wasn't true. We began looking at the list. Somewhere, up around 25 digits, it was my turn to be surprised. Some random digit that should have been a 5 was a 7. The student was relieved to see the contradiction and immediately forgot the whole discussion. I never did find out how the error crept in, but it was probably a mechanical defect in the printer. Mathematical truth can be elusive in a physical world. Hilarie
On 1/4/05 8:18 PM, "Bernie Cosell" <bernie@fantasyfarm.com> wrote:
On 4 Jan 2005 at 17:41, The Purple Streak, Hilarie Or wrote:
Nope, I was referring to the original subject, a "bright 13-year-old". I think that folks like Seymore Papert and Wally Feurzig spent a fair bit of time pondering this problem and I'm pretty sure that their consensus is that drawing neat pictures [and making the turtle scoot around the furniture] is more "fun" [sic..:o)] than noticing that the 127,765th digit of 'e' is 7. [and when the turtle hits the wall or the like, it is more clear that there is a problem and what it might be, than if you've done some complicated sort algorthm and on the 125th test list it screwed up [because you got one of the boundary conditions wrong and that was the first data set with the particular 'situation']]
Seymour Papert was involved with Lego in the initial idea behind their MindStorms product, which I recommended earlier in this thread as a good way for a bright 13-year-old to learn programming: http://www.lego.com/eng/info/default.asp?page=timeline2 http://mindstorms.lego.com/eng/default.asp
--- Henry Baker <hbaker1@pipeline.com> wrote:
I don't know whether JavaScript implements infinite precision integers and full rational numbers. These would seem to be essential for a bright 13-year old, so that (s)he could play with number theory. Ditto with complex numbers & trigonometry, so they can play with stuff they learn in high school. This is why Maxima (free Gnu license) is a pretty good way to start.
The GNU Macsyma web site is http://maxima.sourceforge.net/ . It derives from DOE Macsyma. But now the Sourceforge site has a link to http://www.scientek.com/macsyma/main.htm . Who is ScienTek.com? Their Macsyma web pages and logo are the same as those of the former Symbolics. They also offer PDEase. Could they acquire the rights to Symbolics Macsyma? Apparently a Korean company, they also have products relating to chemistry and environmental safety. Gene __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com
Phil Carmody>twenty three hundred and oneths? block([fancy_display:false],for x in [23/101,20/301] do print(x=number_string(x)))$ 23 --- = twenty-three one hundred firsts 101 20 --- = twenty three hundred firsts 301
One thing that used to drive both my (US) girlfriend and (UK) me absolutely mad was hearing sports commentators say things like "X has beaten Y by three one thousandths of a second". "Three thousandths!" we'd both shout at the idiot box simultaneously. I don't know how widespread such ire is though.
Narrowly, I hope. "X has beaten Y by three thousandths of a second" to me means some unspecified number of thirds of a millisecond, e.g., 17/3000. That "redundant" "one" is what saves our 23/101 vs 20/301. --rwg
participants (11)
-
Bernie Cosell -
Dave Dyer -
Eugene Salamin -
Henry Baker -
M. Stay -
Marc LeBrun -
mcintosh@servidor.unam.mx -
Paul Reiners -
Phil Carmody -
R. William Gosper -
The Purple Streak, Hilarie Orman