Star-Strolling

After working much too late last night, I sat out on my newly-laid patio in my new Adirondack made from freshly-chopped-down, endangered, rain-forest hardwood wrapped in a scarcely-needed blanket with my daughter on my lap sipping rum and milk respectively.

We gazed up at the heavens – something we do all too rarely – looking for planets. I confidently pointed out Mars and my daughter asked me what that other fuzzy clump was.

Trusty iPad to the rescue!

If you point an iPad (or iPhone) filled with Star Walk at a star, it tells you its name. Turns out that the fuzzy clump was M5 and that Mars was actually Arcturus. I had been lying about Mars for years!

It also draws in all the constellations as you wave your iPad across the sky. It’s like Orion has OnMouseOver.

Star Walk – it’s what iPad was invented for. That sound you hear is Matt, clicking on the Apple Store right now.

Solar Flexus

I’ve wanted to write a physics engine for years and messing with Squeak made me want to try it in Flex. It wasn’t quite as easy as Squeak but it wasn’t too hard.

(It probably needs flash 10 to work)

So far I have gravity and collisions for circular objects. Up next: drag.

Here’s the main loop:

[sourcecode language='js']
public function tick() :void {
for each(var body :Body in bodies) {
var force :Point = calculateForceOn(body);
body.apply(force);
body.move(1);

checkForCollision(body);
}
}
[/sourcecode]

Inverse Square Law to calculate gravity:

[sourcecode language='js']
public function calculateForceOn(body :Body) :Point {
var force :Point= new Point(0, 0);

for each(var other :Body in bodies) {
if(body != other) {
var distance :Number = Point.distance(body.position,other.position);

var magnitude :Number = (body.mass+other.mass) /(distance*distance);

var direction :Point = other.position.subtract(body.position);

var additionalForce :Point = new Point(direction.x*magnitude/distance, direction.y*magnitude/distance);

force = force.add(additionalForce);
}
}

return force;
}
[/sourcecode]

Look for collisions and calculate the impulsive forces:

[sourcecode language='js']
public function checkForCollision(body :Body) :void {
for each(var other :Body in bodies) {
if(body != other && body.intersects(other)) {
var normal :Point = body.findCollisionNormalTo(other);

var relativeVelocity :Point= body.findVelocityRelativeTo(other);

var relativeNormalVelocity :Number = dotProduct(relativeVelocity, normal);

if(relativeNormalVelocity < 0) { var impulse :Number = -dotProduct(normal,relativeVelocity) *(coefficientOfRestitution+1) /(1/body.mass+1/other.mass); body.applyImpulse(impulse, normal); other.applyImpulse(-impulse, normal); } } } } [/sourcecode]

And some heavenly bodies:

[sourcecode language='js']
var sun :Body = new Body("Sun", World.Origin);
sun.radius = 60;
sun.mass = 50000;
sun.color = 0x26393D;

var earth :Body = new Body("Earth", new Point(0,500));
earth.radius = 40;
earth.mass = 4;
earth.velocity = new Point(5,0);
earth.color = 0xE8E595;

world.add(sun);
world.add(earth);
world.add(moon);
world.add(mars);
[/sourcecode]

I am still not sure whether I like Flex. The libraries are fantastic but the language - ActionScript - is super-annoying. It makes me wish for C#. It's allegedly a dynamic language but the compiler makes you declare every type anyway in that wacky syntax that I can never quite remember. Simulating solar systems is fun though.

My Drawing Table Squeaks

Took the kids to the Exploratorium today. It’s currently my favourite museum. Better even than OMSI (although they don’t serve beer at The Exploratorium. How come that hasn’t caught on outside Portland?)  I wish San Jose had a decent museum. The Tech sucks worse than possibly any museum in the world except Morwelham Quay.

I couldn’t find my favourite exhibit – Ladle Rat Rotten Hut. There are so many great exhibits that I have never actually seen them all.

Wan moaning, Rat Rotten Hut’s murder colder inset, “Ladle Rat Rotten Hut, heresy ladle basking winsome burden barter an shirker cockles. Tick disk ladle basking tutor cordage offer groin-murder hoe lifts honor udder site offer florist. Shaker lake! Dun stopper laundry wrote! An yonder nor sorghum-stenches, dun stopper torque wet strainers!”

Jazz fell in love with the drawing board and watched it for about 90 minutes. It’s basically a table hung from four ropes like a pendulum and a pen that draws patterns on a piece of paper as the table swings and twists.  There is a weight that makes it swing eccentrically to make the patterns more interesting.

I promised to make her a real one but I wanted to see if I could do it in Alan Kay’s excellent Squeak first. It was pretty easy and quite effective.

Here’s the program. I messed around with the constants to get different effects.

squeak program

and here’s a picture I made with it:

drawingtable

Today: simulation. Tomorrow: the real thing.

Wish us luck!

UPDATE:

I just downloaded the latest version of Squeak (now called etoys). It’s MUCH better than it used to be. All the bugs are gone and it doesn’t look like it was made in 1983 any more. Go get it from http://www.squeakland.org/ then you can play with my project – Squeak: Drawing Table

etoys

Maybe you could add damping for me.

Teach Your Kids to Argue

They teach way too much english and history in school and not nearly enough physics (but that’s the topic of my next blog).

But the one subject that they really need to teach more of is rhetoric. Jay Heinrich believes that every parent should teach their children to argue and I agree.

To disagree reasonably, a child must learn the three basic tools of argument. I got them straight from Aristotle, hence the Greek labels: logos, ethos, and pathos.

Heinrich goes through each of the elements of rhetoric in turn and illustrates it with examples from arguments with his children.

Logos is argument by logic. If arguments were children, logos would be the brainy one, the big sister who gets top grades in high school. Forcing my kids to be logical forced them to connect what they wanted with the reasons they gave.

Mary won’t let me play with the car.

Why should she?

Because she’s a pig.

So Mary should give you the car because she’s a pig?

Repeat the kid’s premise (she’s being a pig) with her conclusion (therefore she should let me play with the car), and she has to think logically.

Logos is the one that gets technical people in trouble with their non-technical wives. Ethos is what gets them out of trouble. Sometimes.

Ethos, or argument by character, employs the persuader’s personality, reputation, and ability to look trustworthy. (While logos sweats over its GPA, ethos gets elected class president.) My kids learned early on that a sterling reputation is more than just good; it’s persuasive. In rhetoric, lying isn’t just a foul because it’s wrong, it’s a foul because it’s unpersuasive. A parent is more likely to believe a trustworthy kid and to accept her argument. For example, if both children – the entire list of suspects – deny having eaten the last cookie, ethos becomes important.

Me: One of you took the cookie.

Dorothy: Have I ever stolen cookies before?

Me: Good point. George?

Careful with pathos. Especially if you have a daughter.

Then there’s pathos, argument by emotion. It’s the sibling who gets away with everything by skillfully playing on heartstrings. When a kid learns to read your emotions and play them like an instrument, you’re raising a good persuader.

Dorothy: Dad, you look tired. Want to sit down?

Me: Thanks. Where did you have in mind?

Dorothy: Ben & Jerry’s.

The article was even better the second time I read it. You should read it too.

Integration is just a better multiplication

Regular readers know that I am a big fan of Better Explained in which Kalid makes mathematical ideas accessible.

Today’s installment:

Integration is just multiplication when one of the operands is changing.

Most people grok integration as area under a curve but, as Kalid explains, area is just one convenient way of visualizing multiplication…but we don’t need to visualize multiplication as multiplication is already pretty straightforward – in the simplest case, it’s just repeated addition.

Many ideas in maths start out simple like that and then gradually generalize to a more complex idea. In Kalid’s words:

Our understanding of multiplication changed over time:

  • With integers (3 × 4), multiplication is repeated addition
  • With real numbers (3.12 x sqrt(2)), multiplication is scaling
  • With negative numbers (-2.3 * 4.3), multiplication is flipping and scaling
  • With complex numbers (3 * 3i), multiplication is rotating and scaling

We’re evolving towards a general notion of “applying” one number to another, and the properties we apply (repeated counting, scaling, flipping or rotating) can vary. Integration is another step along this path.

In other words,

Integration is just a better multiplication

or, conversely,

Multiplication is a special case of integration when the values are static.

You say Cwawfee, I say…

One problem with bringing up kids in countries where they speak funny is when you get homework like this:

Underline the words that have a schwa sound and circle the vowel that makes the sound.

A schwa sound? What the bloody hell is a schwa sound?

Luckily they gave us …erm…the kids…some clues:

  • (A)bout
  • Less(o)n

I doubt there are two words in the English words that have less vowel sounds in common except maybe orange and Aardvark. Neither of those words, as best as I can tell, have a schwa sound. An oo sound maybe, if you are Canadian, but no schwa sound.

Luckily, we have an older child – he talks funny too – to help. Eldest rattled off the first few words:

  • Again – Ok, I can see that. If About has schwa then maybe again has one too.
  • We argued about silent. It seemed to have something in common with Lesson but, ultimately, we decided against.
  • Problem – Wait! What?

If I squint my ears I can be persuaded that the em syllable vaguely resembles a schwa but both my oddly-spoken offspring assured me that the schwa-like syllable was the first one.

We went through a whole verbal dance.

Funny-speaking son: prwaaablem

Normal-speaking father: problem. It’s a short o. Like pot.

Funny-speaking son: Not pr’bliiim….prwaaaawblem!

Funny-speaking daughter: prwwwaaaaaawwblem!!

Eventually, I was dismissed and the funny-speaking ones decided among themselves.

Need a parent to derive the quadratic formula for you? I am there! Got a theorem that needs proving? I can do that! Need help locating the fallacies in America’s founding mythology? That’s my strong point…but locating schwa sounds…?….

You’ll need to find a different parent or a funny-speaking sibling.

What is education for?

I just got through reading Charles Murray Real Education so I was perfectly primed to be alarmed by this passage

Teachers can’t prepare for the content of the tests and so they substitute practice exams and countless hours of instruction in comprehension strategies like “finding the main idea.” Yet despite this intensive test preparation, reading scores have paradoxically stagnated or declined in the later grades.

This is because the schools have imagined that reading is merely a “kill” that can be transferred from one passage to another, and that reading scores can be raised by having young students endlessly practice strategies on trivial stories. Tragic amounts of time have been wasted that could have been devoted to enhancing knowledge and vocabulary, which would actually raise reading comprehension scores.

in today’s New York Times.

Murray covers this idea at length and before I even picked up the book I was already predisposed to accept its four simple truths

  1. Ability varies
  2. Half of the children are below average.
  3. Too many people are going to college.
  4. America’s future depends on how we educate the academically gifted.

and its central thesis – that a liberal arts education is inappropriate for most kids – so it was quite a feat for the author to persuade me that he is an out-of-touch reactionary.

I still agree with the author’s basic premise that the students on the left of the bell curve are ill served by the education system because it optimizes for an outcome that they don’t desire and cannot achieve. The system is also not optimized for students on the right of the bell curve because it has to accommodate those on the left of it. The result is mediocrity.

Those are unfashionable views, but I share them.

More controversially, Murray claims that much of the investment in the education system since the early sixties has been intended to narrow the gap between the high achievers and the low achievers and that all of the programs intended to achieve this aim – from Head Start to No Child Left Behind – have utterly failed. More than that, Murray claims that they could not possibly have succeeded because there are some ideas that some kids are not smart enough to learn. Shocking, but I agree with that too.

I was still with him when he repeated his claim from The Bell Curve, that society has conspired to turn a college degree as a simple marker for ‘sufficiently intelligent’ for most jobs – a marker that would be reliably visible after a third grade IQ test.

I have long believed that most kids would have a more successful outcome if they were steered towards a vocational curriculum. It would be kinder, sneers one reviewer,  to teach them to fix cars rather than ask them to read novels. I do believe – with Murray – that some kids would thrive if they were allowed to succeed at subjects that they enjoy rather than fail at subjects that they resent. But it doesn’t have to be fixing cars. I am thinking of my brother who is a successful carpenter, my father who was a successful butcher and my nephew who was a bank manager at age 21. A liberal arts degree would not have made any of them more successful and designing the whole system of education around the idea that most kids should shoot for one helps neither the kids nor the system.

But he lost me in his prescription for the syllabus for a degree. While he concedes that scientists, engineers and architects might also benefit from a rigorous tertiary education, according to Murray the main purpose of a Batchelor’s degree is to provide a well-rounded education for the future leaders of America. This well-rounded education would cover Aristotle, Decartes, Kant, Dante, Milton, Mozart, Beethoven, Michelangelo – not a single scientist among them. Meanwhile, those not smart enough to complete a four year degree can take vocational courses in software design or accounting.

While I agree with Murray that a Batchelor’s degree should be sufficiently difficult to deter all but the brightest of kids, I’d rather students got to specialize early so that a student with a talent and a desire for, say, maths can get to the interesting stuff more quickly rather than taking required courses in music or art. We probably also disagree about which knowledge is academically challenging to acquire and which is relevant to the 21st century.

Teacher Relations

I hope it’s not bad taste to post a story about good versus bad teachers on a day when Santa Clara laid off 1000 teachers.

Brooks:

We’ve spent years working on ways to restructure schools, but what matters most is the relationship between one student and one teacher. You ask a kid who has graduated from high school to list the teachers who mattered in his life, and he will reel off names. You ask a kid who dropped out, and he will not even understand the question. Relationships like that are beyond his experience.

On a day when my work colleagues and I were discussing appropriate metrics to track, I wonder…

….if you asked all school kids to list the teachers who mattered, what would be the coorelation between that list and the teachers that do well/badly on more traditional metrics (test scores)?

My Deepest Shame

Roger Ebert has written a powerful, meandering essay about shame.

The essay takes many twists and turns and each one of them is fascinating journey in its own right.

It starts out as a review of the movie The Reader

I was watching Tony Scott on the Charlie Rose program, and he said, in connection with “The Reader,” that he was getting tired of so many movies about the Holocaust. I didn’t agree or disagree. What I thought was, “The Reader” isn’t about the Holocaust. It’s about not speaking when you know you should.

[It’s great that The Reader is not about the holocaust because I’d like to see it and my wife wouldn’t watch it with me if it were about the holocaust.]

In his first meander, Ebert uses Twain

That wise man Mark Twain told us: “In religion and politics people’s beliefs and convictions are in almost every case gotten at second-hand, and without examination, from authorities who have not themselves examined the questions at issue but have taken them at second-hand from others.”

as an excuse to reel off a laundry list of Things He Believes

This is true. It is even sometimes true of me. Perhaps of you. However, there are certain areas in which I consider myself an authority, like the movies. I have devoted years to learning about the Theory of Evolution. I think Creationism is superstitious poppycock. I believe the problem with the literal interpretation of the Bible is that anyone can easily discover its support for the opinions they already hold. I believe Conservatism has proven itself disastrous every time it has been implemented in this country.

After meandering past speaking engagements, dinner parties, segregation and atheism – with every meander a gem – he ends up back at The Reader.

The Reader, Ebert says, [Spoiler Alert!] is about a woman’s wrongful conviction that she could have easily avoided if only she could overcome her shame about her inability to read. A key witness realizes this but fails to speak up because of his own shame that he had an affair with her.

This is where his essay gets interesting because it leads Ebert into a riff on the power of shame

We learn of young mothers who put their babies in dumpsters because they are ashamed of their pregnancy. Young fathers who murder their girlfriends, simply because of the universal human reality of pregnancy. We hear of prison guards who follow orders to torture, orders they know are illegal and immoral. And leaders who issue the orders. We learn of terrorists who die and kill others rather than face the shame of being frightened to. We hear of gang members who kill people unknown to them, not because they want to, but because they have been shamed into “proving” themselves as men. We hear of Wall Street executives who lead their firms into what they know are dangerous and unsound practices, because they would be shamed to be outdone by rival executives. They steal the savings from millions of victims, so they can win a pissing contest.

and ultimately triggers Ebert’s memory of a shameful episode in his own past. Ebert’s shame story is about cheating in a game of chess with a blind man who was his very good friend.

More than 40 years have passed since that game, but I have not forgotten it. I can never even think of the University of Cape Town without it coming to mind. My cheating itself was shameful. When I denied it, that was despicable. Herb, I hope someone reads this and tells you about it. You were right. Of course, you always knew you were right, and we both knew that I had lied.

Just reading that makes me feel that familiar burning sensation that heralds the unbidden return of my least favourite memory. Suddenly I am transported back to my fourth year Latin exam in Room 41 and

David Samuel is handing me his exercise book under the desk.

We are halfway through our end of year exams.

Our exams are kind of a big deal because, unlike America in 2009, in England circa 1981 the only thing we will have to show for all our years of schooling is a certificate that said how we performed in a bunch of exams that we’ll take at the end of the fifth year [maps to 10th grade – ed].

We do one of these six hour exams – an ‘O’ Level – for each subject we take (plus an oral for languages). I’m taking 9: English, English, Maths, Maths, Chemistry, Physics, Biology, French and Latin.

Every year until now has ended with a solid battery of  two weeks of exams with 8 hours a day under exam conditions. Our grades throughout the year are based on classwork and homework but all that was tossed aside after the exams. Only the exam counts. The fourth year exams are special because they are a dress rehearsal for the real thing at the end of the fifth year.

For me, exams are a godsend. The laziest student ever (at least until I have children of my own), I have made avoiding work into an art-form. In the last two years of chemistry, I have written a total of three and a half pages of notes and have done no homework at all. I read computer magazines in Latin class and I am teaching myself BASIC in French. I am bottom of my class. In two weeks I will be top. Again. They stopped giving me ‘most improved student awards’ after four years of improving from worst to best every exam time.

Best of all, I genuinely enjoy exam time. We have no homework assigned and I have no need to study. The fact that I have no notes to study from is irrelevant. I will not open a book. Last Christmas, Miss Mills said that we should be studying about 6 hours a day by now. I have studied for less than 6 hours total in my whole life and Not At All for these exams.

Each subject has an essay-based exam and a quiz-based (occasionally multi-choice) exam. In Latin, it’s translations.

In class, we have translated Caesar’s Gallic Wars, Tacitus’ Histories, umpteen poems by each of Ovid, Horace and Catullus and the complete works of Pliny the Younger. In the exam, we’ll have to translate some 10 or 12 of these.

And now I’m sitting in the back row of room 41, next to David Samuel and, when I open the exam paper, I realize that I don’t know anything.

It’s easy to fake your way through translating French. It’s all “Ou est la place de la Concorde” but Latin is much more precise, more distant. More foreign… And you certainly can’t fake your way through poetry. They expect us to understand it.

David Samuel leans over, opens his bag and shows me that he has a book with all the translations. “Give it to me”, I signal. He smiles and hands it over. I copy just enough to save me from being booted out of Latin class because Mr Hickey doesn’t want bad students sullying his record.

That feeling of dread when I opened the exam paper inspired me to study for an exam for the first time in my life.

I still didn’t study for Maths or any of the sciences (all As, in case you are wondering) because they were easy. Nor did I study for English Lit as I had never got better than 8% and studying wasn’t going to make much difference. [I didn’t even read one of the assigned books – Brighton Rock – until I was 23. When I did finally read it, I fell in love with Graham Greene and have now read all of his books. If I had read it at 15 like I was supposed to, I might’ve gotten a better grade at ‘O’ Level but I might’ve hated Greene and never read him again.]

But I did study Latin.

caecilius

I memorized the translations of every single one of those histories, poems, legal documents and letters to the Emperor Trajan [except Pliny X.96 – the one about the Christians, but that’s a story for a different day].

I still remember many of them now

That Suffenus, whom we know well Varus,
Is a charming, witty and sophisticated man.
Yet at the same time he writes more verse that anyone else.

Not, as usually happens, on second class papyrus.
He uses new papyrus, all ruled with lead and smoothed with pumice…

But, more than the poems, I remember the shame because it eats into my conception of who I am. I have barely spoken with David Samuel since that day but I don’t think I could even look him in the eye if I saw him again.

Worse still, he was the boyfriend (and may have married?) of my girlfriend’s best friend. I imagine him telling Sarah who tells Jo, remember Kevin? The kid who was good at exams? He was a cheat. I saw him. He used to take books into all the exams.

David Samuel’s mum used to work with my mum. They were very competitive about their offspring as mothers often are. What if David’s mum knows I am a cheat?

I never cheated again but that once was enough to give me a lifetime of shame.

The common element of all these shame stories leads me to propose the following thesis:

Our greatest shame arises when we do something that is not just bad but that conflicts with our image of ourselves.

Ebert’s is bleaker:

I believe the movie may be demonstrating a fact of human nature: Most people, most of the time, all over the world, choose to go along. We vote with the tribe. What would we have done during the rise of Hitler? If we had been Jews, we would have fled or been killed. But what if we were one of the rest of the Germans?

It’s a shame that the move is about the holocaust because I’d really like to go see it but my normal movie going companion won’t take me so it will be condemmed to my Netflix queue where it will fester until it finally arrives and sits on the shelf for three weeks because I can only watch those movies after everyone else has gone to bed which seems to get later and later as the years go by.

It’s a shame, I tell you.

caecilius2