Mathematica versus Sage

Quick version:  If you want to learn math get Mathematica.  If you have access to Mathematica use it.  If you have the money, buy it.  If you want to study mathematics, pray that your school provides it for free.  It’s wonderful.  If you don’t believe me watch these videos or look at the Wolfram Demonstrations Project.  I believe if every K-12 kid or college student was taught math with Mathematica far more of them would becomes scientists and engineers.  Unfortunately, Mathematica costs a lot of money.  If you don’t have the dough, consider Sage, the open source alternative.  But if there’s any way to get Mathematica, go that route.  If you can’t, let me tell you about Sage in a roundabout way.

When I was a kid I wanted to be an astronomer.  I even took astronomy and physics courses when I started college, but I hit a math wall – I finished Calculus I, but then stayed out several semesters.  When I returned to Calculus II, my math knowledge was gone.  This was partly due the distraction of girls and getting high, but I mostly blame myself for being lazy.  I didn’t have whatever it took to focus and work hard.  I’ve always wondered how my life would have been different if I had taken school more seriously when I was young, and applied myself.

Now forty years later I fantasize about testing my aging brain by studying math again.  Could I go back and relearn math, catch up to what I had learned, and go further?  It’s the old question:  Can an old dog learn new tricks?  My regrets about life involve two kinds.  First, all the real jobs I wanted, astronomer, computer scientist, robot engineer, etc. involved mastering math.  Second, my fantasy ambitions were about writing science fiction or popular science, and those involved intense verbal skills.  I think I failed at both because I’m lazy or I can’t focus deeply enough.  Now that I’m older, with fewer distractions in my life, I wonder if I could break through those barriers.

Kids today should have a better time of it because of technology.  If young grade school kids could start out learning with Mathematica it could give them a tremendous edge.  It might make the abstract and boring subject of mathematics real and alive.

One test of my old brain would be to study math again.  I eventually finished college and went into computer programming, but with office applications and databases, not with computer science concepts.  I’ve wondered if I could take my computer programming skills and apply them to learning math.  Could programming a math problem teach me to understand how math works?

Searching the web, I looked for people who had already tried this, but what I thought of as an obvious match made in heaven doesn’t bring up many hits.  Then I found “Mathematical Software and Me: A Very Personal Recollection” by William Stein.  Sage is system for using dozens of mathematical programs that have evolved on Unix/Linux OS over the years and tying them together with a Web 2.0 front end and using the programming language Python as the underlying user input language.  It’s a free, open source alternative to Mathematica and similar expensive commercial programs.  From reading many blogs I had already decided that Python was probably the best programming language to use with learning math, so Sage intrigued me.

When I started out on this project I imagined myself finding a beginning math book, maybe just a 7th grade algebra book and seeing if I could write Python programs to do the problems.  But there’s another kind of problem – math has its own language and character set of symbols.   Programs like Sage and Mathematica have to create a way to enter formulas without using the traditional symbols of math.  Imagine putting this formula into code:

MathematicaTypesetExpression

If I just used plain Python I’d have to develop my own subroutines of conversion and I didn’t want to do that.  Also, there is the problem of binary to decimal accuracy.  Often computer programs will produce 3.99999999 when I need 4.000.  Programs like Sage and Mathematic have already solved those problems with custom formula editors and built in subroutines that are time tested.  They created programming conventions for entering mathematical formula and subprograms to show that code with standard mathematical symbols.  Think of word processing for mathematicians.

What’s the difference between Mathematica and Sage?  For some people it’s thousands of dollars.  Sage has the goal of providing a free and open source alternative to the commercial Mathematica.  Since I work at a university I have access to Mathematica, and thus I’m offered a choice.  It’s an odd choice too!  Mathematica is gorgeous, elegant, refined and advanced.  Mathematica is like being at NASA with state of the art tools.  Sage is like a poor garage inventor who has to buy their own.

If I would retire from the university I would no longer have access to Mathematica.  Also, if I develop something cool and wanted to share it, with Sage I could, but if I used Mathematica, I could only share notebooks with other Mathematica users.  Mathematica is a black box, users don’t know how the results are calculated.  With Sage you can look at the source code.

Sage seems like an obvious choice, doesn’t it.  Well, there’s one huge stumbling block, you need Unix/Linux to run it – there’s no native Windows application.

Now anybody can go to the free online version of Sage called The Sage Notebook, create an account and start using it for free.  A lot of people do, and that’s the problem, sometimes processing is iffy because of demand.  Next in ease of use, is to get a Live boot CD with Sage installed on it.  Just put it in a PC, reboot and make sure the CD is the first drive to boot – this bypasses Windows on your hard drive and boots Linux instead, leaving Windows untouched.  This is a great solution so long as you don’t really get into Sage heavily.

If you happen to already use Linux or Mac OS X, you can get binaries to install on your machine, but that still leaves out all those Windows users.  The way to actually run Sage in Windows is to install a virtual machine on your Windows PC.  Currently the Sage docs recommend VirtualBox, but that solution seems to be on the way out, and you need to use the free VMWare Player because at the Sage mirrors all they offer is the sage-vmware distributions.

Sage constructed a VMware distribution that you can load directly and run – no installing Ubuntu and Sage in steps.  The VMware distro has been pre-customized with all the Sage utilities.  This works very slick.  You can run Sage from within the virtual machine, or get it running as a server app, minimize the VMware window and call Sage from your Windows browser (the Sage notebook is just a Web 2.0 app.).

I’ve used all four different methods, online, LiveCD, Linux box, and Windows with VMWare.  All work.  Depending on how heavy duty your math processing needs are, will determine which version you want.  However, you have to get used to using a program that’s running other programs under Linux, and that can be tricky.  If you are a math teacher and want to use Sage with your students you’ll want to set up a Linux box that has some horsepower and then run Sage as a server app to Windows and Mac machines in your lab.

If Mathematica was free like Sage, I’d just recommend everyone use it.  It’s much easier to set up and far more consistent in its use.  It’s a shame that Mathematica isn’t given to every K-12 and college kid in the world. Mathematica would be a fantastic teaching platform, but it’s just so damn expensive.  But if little kids were taught to use Mathematica (or Sage) when they got their first math lessons a far greater percentage of the population would think mathematically.

What William Stein offers is a free alternative to Mathematica.  It requires a bit more work and knowledge to set up and use.  In fact, its Unix/Linux origins will turn off most users, so I’d recommend to math teachers to set up a Sage server and just get the kids used to Sage Notebook online.

Sage doesn’t teach math.  Mathematica and Sage are like the ultimate graphing math calculator, but with the notebook feature, it can record and animate math and statistics.  To see the potential of Sage see “Exploring Mathematics with Sage” by P. Lutus, especially the pages that start with “Trapezoidal Storage Tanks.”  This is fairly advanced math, but it illustrates what math teachers could require of their students.  Set up a problem, illustrate how to break it down mathematically, and then show the formula working with Sage.

You can visit the Sage Notebook site where users have saved and posted their notebooks online for all to see.  Studying these notebooks show the diverse way mathematics is applied to many problems.  This is the language of math, science and engineering.  I’d like to think if I had access to Sage when I was in grade school my life would have been significantly different.

Like I said, it would be best if Mathematica was given to all kids.  If that isn’t practical, I would recommend trying Sage.

JWH – 8/1/10

Boneshaker by Cherie Priest

Earlier this year, when the novel nominees for the 2010 Hugo Award were announced, I decided to read all six.  Boneshaker by Cherie Priest is the fifth story I’ve finished, and I thought from the book’s blurbs the one I’d like the least.  I was wrong.  I thought I had a zombie prejudice, but evidently if you mix a colorful steampunk novel with great characters, zombie prejudice can be overcome.

boneshaker-by-cherie-priest

Actually, I would find it hard to imagine any reader not liking this novel is they gave it a serious try.  Sure it’s hard to ignore the fact that you’re reading a novel about zombies – that is embarrassing – but I’ve found that biting the bullet and just accepting the undead as literary fashion and remembering this too shall pass, allows me to concentrate on the quality story that Boneshaker presents.

Here’s the situation, a woman and her teenage boy are the wife and son of a man that everyone hates in a alternate history 19th century Seattle.  Their lives has been destroyed by this hatred, and the boy desperately wants to prove his dad had some virtues, despite what his mother confirms about his father. 

This Seattle, Washington is unlike the one we know.  The civil war has been going on for twenty years, and an evil inventor has caused gases from beneath Seattle to well up and kill thousands of people.  To protect the country a giant wall is built around Seattle to contain the gas.  However, years later some people remain within the city, living in pockets of good air, knowing that if they breathe the gas they will die, or turn into a zombie.

That description does absolutely no justice to how colorful the setting is for Boneshaker.  But I don’t want to tell you too many details.  I listened to the audiobook edition of this novel without knowing much about it other than it had zombies, and people called it steampunk.  I would have been better even knowing less.  I had low expectations and even dreaded reading it. 

As soon as I started listening I didn’t want to stop.  Here’s the reason why it’s up for the Hugo – it’s a damn good story.  It’s just a good old fashion tale with lots of colorful characters and thrilling adventures.  Robert Louis Stevenson would have loved Boneshaker.  Ditto for Edgar Allan Poe, and maybe even Charles Dickens.  Edgar Rice Burroughs would have been jealous of its skillful twin narratives.

And I highly recommend the audiobook edition read by Kate Reading and Wil Wheaton.  Yes, that’s Wesley Crusher reading the boy’s part and he gives an impressive performance.  Of course Kate Reading is a superstar of the audiobook world.  The Boneshaker audio production is top notch and the dramatic reading brings out all the color of the novel.

Be sure and visit The Clockwork Century where Cherie Priest lays out plans for more novels set in the strange version of our 19th century America.

By the way, this effort to read all the Hugo nominee novels has paid off handsomely.  The diversity of story telling is impressive, but more than that, it’s a great snapshot of what science fiction and fantasy has become.  I shall do this again next year.  I’ve got one more novel to go, Palimpsest by Catherynne Valente, but the audio edition won’t be available until August 15th, still plenty of time to listen to before the awards are given over the labor day weekend.  So far, they’ve all deserve the Hugo.

JWH – 7/29/10

Little Brother by Cory Doctorow

Little Brother is often categorized as science fiction, like 1984, the book that inspired it, but I think that’s wrong.  Neither are science fiction.  Both books are political philosophy, and even though both books are set slightly in the future, they are about today’s politics.  Little Brother is an exciting story, well told, vividly detailed, full of technological ideas, excellently plotted, with engaging characterization of a Wi-Fi generation – a real page turner.  I highly recommend reading Little Brother.  But it’s also as serious as a terrorist attack.

littlebrother

Cory Doctorow campaigns hard for his beliefs, standing on Little Brother like a soapbox.  I’m sorry Little Brother didn’t get more widespread public attention, because it deserves it, but I’m guessing that outside of the ghetto of science fiction and the geek world of Slashdot, it’s was pretty much ignored.  This is unfortunate, because the ideas it brings up for debate need universal attention.

Now, that’s not to say I completely agree with Doctorow.  I have some fundamental differences in philosophy.  Marcus Yallow, the seventeen year old hero of this novel, and his three friends have a nightmare encounter with the Department of Homeland Security (DHS) and from then on the story diverges philosophically with my thinking.  Doctorow believes in fighting fire with fire, and Marcus and his friends use high tech to battle the high tech of the DHS.

If we lived in Iran I would agree with that, but we don’t.  We live in an open society, and if we want to keep it free and open, we need to fight for civil liberties on a battlefield where everyone can watch.  Doctorow invents a special distribution of Linux called Paranoid Linux which allows for an underground youth rebellion to assemble in privacy.  And he compares this new revolution to the radical yippies of the 1960s. 

But there’s a huge difference.  Back then the rallying cry was “The Whole World is Watching.”  The way to fight big brother oppression is to make everything public.  Doctorow has his revolutionaries encrypt everything.  That’s bad.

I want to live in a society where I can write anything I want in this blog.  I don’t want to live in a society where I must encrypt my thoughts and secretly share them with my friends with public and private keys.

More than that I want the government to use all the technology in its power to find the enemies of society, but I also want our government to prosecute terrorists in the full light of day, and not hide them in secret prisons around the world.  None of this bullshit about civil rights being different in war times.

Doctorow is right, innocent people do suffer when fighting terrorism, but turning them into underground freedom fighters isn’t the answer.  The book eventually does come to my way of thinking and investigative reporting saves the day.  But there are many smaller issues that need to be discussed by a wider audience.

For example, should there be video cameras in classrooms, and do our children need 24×7 surveillance.  I grew up in the 1950s and 1960s where I ran wild and unobserved.  I loved that freedom and I’d hate to think the kids today don’t have it.  But we live in a much different world. 

Education is failing many children.  The failure of education is creating a widening class divide. Education is the tax straw that’s breaking many a local and state financial back.  There is a tremendous sense of failure regarding education.  If we applied the “Whole World is Watching” to the K-12 landscape, where anyone could tune into any classroom and see what’s going on for themselves, would that revolutionize the problem?  Would people really claim urban schools get equal quality education as suburban schools? 

Doctorow had a classroom scene which caused a teacher to be fired.  If it had been on video would that have happened?  Would kids act up or tune out if they knew their parents were watching?  I’d vote for more cameras in the school, but also want to find ways to give kids more privacy from adults after school.  We live in the era of watching video cameras, and we’ve yet to explore the impact of that philosophically.

We also live in a world of too many secrets.  I don’t want or need Paranoid Linux.  If parents could observe their darling young ones in their classes would it help education in our nation?  If parents had to spend one day a month going to school with their children, would our educational system get the improvements it needed?  That would mean on average there would always be one parent observer in every classroom every day.

In Little Brother the DHS conduct very secret processing of suspects.  Would not cameras or citizen observers have solved the central problems of this story?

Doctorow tries to make it clear that he thinks the computer techniques the DHS and other police systems use to sift out the bad guys are silly because they produce too many false positives, and that might be true, but we’re fighting a war on individuals, not nations, and we have to use such statistical techniques.  When a few people can kill thousands, we have to find new criminal detection tools. 

Little Brother is a novel about privacy, civil liberty and freedom during an era when people are willing to sacrifice all of those rights for more security.  I’m surprised that rabid conservatives haven’t made a call to ban Little Brother because the Department of Homeland Security is the villain of the story.  But they haven’t because we live in America, not North Korea.

While reading Little Brother, I often felt on the side of the bad guys (the government), but then, in this story the rallying cry of the young is, “Don’t trust anyone over 25” and I’m 58.  It also makes me wonder how I would react if I could meet my younger self who used to believe “don’t trust anyone over thirty.” 

Little Brother does more to capture the feeling of the radical sixties than any book I’ve ever read set in the sixties.  But I’m not sure if Doctorow isn’t idolizing the wrong people.  Abbie Hoffman was an asshole.  The yippies were a joke.

It’s very hard to be anti-government and not sound anti-American, but I think this book pulls it off.  Everyone wants to be free and secure, but some people are willing to give up a lot of freedoms to feel more secure.  What Doctorow illustrates is sometimes that’s an illusion, but what he doesn’t explore is the real value of security.  Freedom and security are entwined like Yin and Yang.

A society of billions is unbelievably complex and there are no easy answers.  Most of us want to live our lives in peace and pursue happiness.  There are a few, and by population standards, an extremely tiny portion, who want to hurt other people, or bring down society.  It would be great if we could put all of these people on an island and let them have the freedom to hurt each other, but that’s not possible.  We have to find these few and neutralize them.  That will require police techniques that might hurt or inconvenience the normal citizen.  I don’t see any way out of that, but Doctorow brings up the topic for debate.

JWH – 7/17/10

Will Science Fictional Reality Ever Change People?

Life in the 21st century seems all about change.  Back in 1970 Alvin Toffler wrote the bestseller Future Shock predicting the rapid pace of change would overwhelm society and cause future shock.  This book sold six million copies and it seemed everyone knew about it, if not read it.  Toffler didn’t even come close to predicting the changes we went through, and oddly enough no one seems to be suffering from future shock.  It’s almost as if everyone read the book and exclaimed, “Bring it on baby, I’m ready.”

I would think almost the opposite of future shock is happening.  We can’t get enough change.  And we get jaded so easily.  The promise of the final frontier was over before we knew it.  We went to the Moon, been there, done that, checked it off the list.  No need to go further, space is all rocks and no air.  We turned the World Wide Web into Facebook.  Supersonic airlines turned out to be too noisy.  Cloning, ho-hum.  Robots, let them clean floors and gutters.  Artificial life, lost on the back pages.  Global warming which has impeccable science and Biblical size prophecies is easily ignored.

What’s really going to shake us up and make us take notice?  What can science discover that the public can’t fail to divert their lives.  Evolution is a mind blowing concept but most people find it easy enough to write off.  Our knowledge of cosmology and the size and shape of the universe is so stunningly magnificent you think everyone on Earth would be stoned on the idea for years, but no.  More attention is paid to Lady Gaga’s showing off various parts of her skinny bod in outrageous costumes.

So what would knock us on the head with a mind blowing mallet?  What if SETI started receiving HD video from outer space?   What if AI singularities started popping up around the globe?  What if we really did run out of oil and other vital resources?  What if the oceans did start rising dramatically, or all the ice slid off Greenland?  What if Sony and Samsung started selling robots smarter than people?  A lot smarter.

The reason why global warming and evolution can be ignored is they are invisible concepts that require a good deal of knowledge to see.  But video from outer space on ABC World News Tonight is harder to ignore.  A one foot rise in oceans is hard to ignore.  Gasoline selling for $15 a gallon is hard to ignore.  Having robots take over all the university and K-12 teaching jobs would be hard to ignore.

Or would it?  The public got used to atomic bombs, cloned animals and space travel.  Space travel was quite real but not fun like Star Trek or Star Wars.  It was just boring.

I tend to think the change that will really slap humanity in the face is when we meet someone smarter than us.  Either aliens or AI minds.  When we take over the chimpanzee’s role as second banana as the #2 brain power, how will that change society?  Science fiction is full of scary stories about AI brains and aliens exterminating humanity, but what happens if they don’t? 

What if they treat us nice, nicer than we treat our fellow species now?  What if they give us freedom to be whatever we want, and they don’t try to rule us, but what if these great minds just coexist in the universe with us peacefully?  With SETI, they would be out there, too far to meet.  With AI minds, they could go live on the Moon to stay out of our way.  But these minds are willing to communicate with us, and it’s obvious they are so much smarter than us, that the mental distance between us and them is the distance between us and hamsters?  How will that feel?  Hamsters don’t know we’re smarter, but we’re not hamsters, we will know.

It’s not like humanity didn’t live under such conditions before, or assumed to.  When we believed in gods and angels, it was essentially the same relationship and we eventually tuned them out.  We love being #1.

I figure no matter how much change happens most people will still think about what’s to eat, who can I connect genitals with, when can I get the new iPhone, what do I need to get to the next level in Farmville, how can I make more money, and so on.  We are selfish creatures with a narrow focus on our personal needs and desires.

I think it’s a certainty that the oceans will rise within our lifetimes.  The odds are good we’ll have artificial minds.  Robots will grow ever more sophisticated.  SETI is a very long shot, but astronomy might get good enough to detect artificial molecules in atmospheres on distant planets, so we will know other minds are out there. 

But will people change?  I don’t think so.  We can absorb change.  We can change our opinions, but we don’t seem to change our core personalities.  I know I’ve tried hard enough.

JWH – 7/11/10

Out of the Silent Planet by C. S. Lewis

Out of the Silent Planet by C. S. Lewis should not be considered a science fiction novel, it follows more in the footsteps of The Devine Comedy and Paradise Lost than it does with H. G. Wells and Jules Verne.  I would go so far and say Out of the Silent Planet is an anti-science fiction novel, although it reads much like Stanley G. Weinbaum and other pulp writers of the 1930s, and was inspired by the 1920 fantasy novel, A Voyage to Arcturus.  Strangely enough, it reminds me of the recent film Avatar.

Please do not read any further if you haven’t read the book and want to avoid spoilers.  What I have to say is a reply to the philosophical implications of the novel and that indirectly gives away plot elements.

Out-of-the-Silent-Planet

The reason why I claim Out of the Silent Planet is anti-science fiction is because the story wants to convince its readers that outer space is the supernatural heavens of religious myths and is full of spiritual beings, even beings who live in the void between planets.  Essentially Lewis does this for religious reasons, and not scientific, and the story feels like medieval philosophy.  Now, this isn’t to say the story isn’t a ripping good yarn, nor does it imply a lack of old fashion sense of wonder about alien life on Mars, like most SF fans love from science fiction from the 1920s and 1930s.

What C. S. Lewis attempts is to claim outer space for Christianity, which is pretty interesting since most Christians focus heavily on Earth and ignore cosmology.  The ending to Out of the Silent Planet reminds me of the ending in Have Space Suit-Will Travel, where in both, humanity and Earth come under the judgment of higher life forms on other planets.  Strangely, the bad guy in Out of the Silent Planet makes the same case as the good guys in Have Space Suit-Will Travel.

Now this is a very essential difference in philosophy, and why I’m making a case that C. S. Lewis is writing anti-science fiction.  Heinlein and most of science fiction is pro mankind, even to the point of taking Satan’s attitude in Paradise Lost, “Better to reign in hell than serve in Heaven.”  Weston, a pathetic, spiritually blind, scientist in Out of the Silent Planet wants mankind to conquer the heavens and spread humanity to all the planets.  Oyarsa, the archangel like ruler of Mars, or Malacandra, has godlike powers and considers Weston bent, or evil.

I am reminded of Lester del Rey’s “For I am a Jealous People” where God takes the side of aliens and mankind declares war on God.  Science fiction is the ultimate hubris.  Of course all of this assumes there are spiritual beings and dimensions we cannot see with our science.  If you believe in those dimensions and beings, you will take the side of C. S. Lewis, but if you don’t, I expect most science fiction fans prefer to follow Heinlein and believe mankind is the most dangerous creature in the universe.

I think a new philosophy is emerging, that’s post-Lewis and post-Heinlein.  There are no spiritual beings, but then we’re not going to be rulers of the universe either.  I think in a few decades Heinlein will feel as archaic as Lewis in his philosophy, and Heinlein is my favorite writer.  I grew up believing in the manifest destiny of space but the relentless reality of science is convincing me otherwise.

Out of the Silent Planet is a throwback and could easily have been written in 1838 instead of 1938.  It’s the last of its kind, rather than being an early novel of future directed science fiction that dominates the twentieth century.  Out of the Silent Planet wants to incorporate the spiritual world into the physical world – to weld them together.  If you accept science there is no room in reality for angels, and the only hope of the spiritual world existing lies on the other side of the doorway of death.

JWH – 7/9/10