Thursday, May 26, 2011

The Number ...

... 8128

I have an affinity for the number 8128. Sometimes people ask me why. I apologize in advance for the self-aggrandizing nature of this post.

Back when I was a skinny, sports-averse lad of 12 or 13 years old, I read a lot of books. Reading was a lot more fun than standing out in left field praying that nobody would hit a softball in my direction, and then when it happened, acting like I was trying to catch it when, in fact, I really just wanted to get out of the way and avoid getting beaned or worse.

I read a lot of science fiction. I mean, a lot of it. I also read other things, including books about math. Not math textbooks, but things like George Gamow's One Two Three ... Infinity and the like. I don't remember which book specifically brought up the concept of "Perfect Numbers", but the concept resonated with me. For whatever reason, any book I found only listed the first 3 numbers in the series: 6, 28, 496, ... . I found this maddening -- what's the 4th number?!

You have to recall that this was circa 1973: we had a rotary phone, there was no internet or WWW, I was too young to drive so getting to the library took some effort, I lived in podunk where there were no bookstores, much less bookstores that had a "Computers" section, etc. I was pretty much on my own.

But at about this time I also got interested in computer programming. My family lived near a branch of Southern Illinois University, which had recently acquired a Control Data Corp Cyber mainframe, and was using it as a timeshare system. Through a friend I got access -- actually, people were extremely casual about usernames and passwords and you could find them written on abandoned punch-cards etc, I eventually had quite a collection. I realize that nowadays this is frowned upon, even illegal, but back then it was considered "cute". Before you condemn me, know that I had certain ethics about it, and I never deleted people's files or caused any kind of trouble. Mostly what I did at first was play games -- things like the old BASIC Star Trek game.

But eventually I wanted to know more, so I asked the wonderful lady (Mrs. Whelan) at the public library if she could find me some books on "basic computer programming". And in about a week she had a couple of books for me with titles like "Learning BASIC". I ate 'em up.

Yes, I was a serious geek as a boy. Geekitude was not popular in the small midwestern town in which I lived; the other kids gave me hell, I was "weird" and so forth. Today, it seems like "geek" is simply one of many accepted sub-cultures (like "jock", "goth", "rocker", "preppie", "skater", etc) that kids may identify with. I'm happy about this -- I think of myself as an "early adopter". But back in 1973, reading science fiction and writing computer programs just got you sucker-punched.

Anyway, long story short (and you can probably see where this is heading), one of the first things I did when I learned to program was write a program to generate the 4th Perfect Number. It was not especially efficient, but it chugged along and popped out 6, then 28, then 496, and then ... after a pregnant pause ... 8128!

Natch, first thing I did was rewrite the program to spit out the factors so that I could check the answer -- hey, it was an early effort! -- but 8128 checked out.

I went on to learn a whole bunch of different languages like FORTRAN and SNOBOL and LISP and APL (where, since I didn't have APL keyboards, the operators were all represented as escaped digraph "symbols" like $UP$ -- some things are too tedious even for an obsessed 13yo), and wrote a number of programs to play Conway's Life and several Turing Machine emulators and other nerdy delights. And this led to going to college and getting a couple of degrees in Computer Science, which have been "beddy beddy good" to me.

But at the beginning of it all was that 4th Perfect Number, 8128. Which, lest I sound too impressed with myself, I note that the Wikipedia article on Perfect Numbers says:

These first four perfect numbers were the only ones known to early Greek mathematics, and the mathematician Nicomachus had noted 8,128 as early as 100 AD.

Then, in 1456, an unknown mathematician recorded the earliest reference to a fifth perfect number, with 33,550,336 being correctly identified for the first time.

So it's not like I was blazing new trails on the frontiers of mathematics. But still, I've sort've 'adopted' the number and tend to use it in places where I need a handy integer. Like, for instance, a blog name. Although for obvious reasons I never use it for passwords or pin-codes or anything like that.

Anyhow, love it or hate it, that's the story.

Monday, May 23, 2011

Asshole Crime

So, the trial of Dharun Ravi is moving along. Ravi, you'll recall, is accused of driving his college roommate, Tyler Clementi, to suicide after he used a webcam to spy on Clementi having a homosexual encounter. Ravi also twittered about it and allegedly live-streamed a portion of the encounter out to his twitter followers (who must be a real classy group, I'm sure). So now as a result he's being charged with 15 counts including bias intimidation, invasion of privacy, witness and evidence tampering, and other stuff that nobody seems to want to list. The "bias intimidation" charges carries a maximum penalty of 10 years in prison.

The entire situation sucks. Even as a parent myself, I can only imagine the nightmare that Clementi's parents are living in. I'm sure Dharin Ravi's family is going through some tough times, too (I really know nothing about them, maybe they're rich and it's no big deal -- or maybe not, and they're mortgaging the house / tapping into their retirement nest-egg to pay legal expenses). It seems like many in the gay community want to see Ravi hang.

This is just me, but, having carefully considered all of the facts available to me, I've concluded that Ravi is guilty of being a Big Asshole. Additionally, while I don't have perfect knowledge of the events, it seems unlikely to me that Ravi could have predicted that Clementi would commit suicide.

Keeping that in mind, 10 years in prison seems excessive. I mean, here's a guy in New Jersey who got 4.5 to eight years for driving drunk and killing a 13yo girl. And apparently this is considered a tougher-than-average sentence for such a crime. Don't get me wrong, I'm not shrugging it off as "oh, kids do that stuff", I believe Ravi deserves some kind of punishment. But -- 10 years? What kind of justice is being done here?

This kind of thing comes up again and again and again in the news: Asshole Crime. Some asshole -- okay, let's be polite and call them a "Jerk" -- some Jerk gets somebody else hurt or killed, and DA goes through the statutes with a magnifying glass to come up with a set of charges that a jury might buy. I mean, "bias intimidation"? I'm not sure I even know what that means, much less that there's apparently a law against it (in NJ, at least). I think this is a waste of the justice system and taxpayer money. Perhaps it's the engineer in me, but I don't see any value in locking a jerk in prison (save "punishment for punishment's sake"), but I think society would be better served if the jerk could learn to change their ways and become a non-jerk. And for this, I have two suggestions, one "real", the other "imaginative". I'll use the Ravi / Clemente case as an example, but I'm sure you can think of any number of other examples that qualify.

First up is the Civil Suit. Ie, the Clementi family sues Dharin Ravi for driving Tyler to suicide. The jury awards damages as they feel appropriate. It's neat and simple, and even the worst of jerks hates getting hit in the wallet. Getting sued and paying damages can be a serious "learning experience".

Second, and more fun: what I really think this country needs is a Federal Asshole Registry (sorry, "Federal Jerk Registry"). The idea is, somebody does something jerk-ish, they get their name etc in the Registry for a given amount of time. And during that time, they have to go around and introduce themselves as a Registered Jerk to their neighbors (just like sex offenders). Potential employers would use it for background checks, etc.

Actually, we more-or-less sort've have a de-facto version of that right now, with Google: Search on someone's name and if they've committed any serious jerkery they'll often come up. But a genuine government-sponsored Jerk Registry would be better: it'd be harder to "game", plus it'd contain info on jerks who are deserving of the name, but somehow managed to avoid local or national news coverage, or are buried so deep in the search results list that nobody ever notices them.

Admittedly, this still leaves the problem of just how do decide who deserves a place in the Jerk Registry, and for how long. That'll take some pondering, and so I'll leave it for a future entry.

Friday, May 20, 2011

From Agents To Apps

"According to IDC, smartphone manufacturers shipped 100.9 million devices in the fourth quarter of 2010, while PC manufacturers shipped 92.1 million units worldwide. Or, more simply put, smartphones just outsold PCs for the first time ever." (source: New York Times, 8 February 2011)

And also:

"Amazon ... is claiming that Kindle e-books are outselling hardcover and paperback print books on its Website." (source:, 19 May 2011)

So, call me Captain Obvious, but this mobile computing stuff really seems to have caught on. And hey, I'm a fan. For all of its deficiencies (dropped calls, poor reception, yaddayadda) the cellphone has made the world a safer, more efficient place. 15 years ago, if your car crapped out on you at 3am in some strange place, you had a "situation". Nowadays help is literally a phone call away. Which is why I get irate when my wife and kids go out and don't take their cellphones with them -- I mean, why are we paying for these things anyway?!

One of my favorite writers put it thus:

Stories set in the Culture in which Things Went Wrong tended to start with humans losing or forgetting or deliberately leaving behind their terminal. It was a conventional opening, the equivalent of straying off the path in the wild woods in one age, or a car breaking down at night on a lonely road in another. A terminal ... was your link with everybody and everything else in the Culture. With a terminal, you were never more than a question or a shout away from almost anything you wanted to know, or almost any help you could possibly need.

There were (true) stories of people falling off cliffs and the terminal relaying their scream in time for a Hub unit to switch to that terminal's camera, realize what was happening and displace a drone to catch the faller in midair; there were other stories about terminals recording the severing of their owner's head from their body in an accident, and summoning a medical drone in time to save the brain, leaving the de-bodied person with no more a problem than finding ways to pass the months it took to grow a new body.

A terminal was safety.
--- The Player Of Games by Iain M Banks

But I digress. The real reason I'm writing this is to comment on how personal computing today varies from how people thought it would be twenty-odd years ago.

Once upon a time, everyone thought The Future was going to be "agent technology" -- that is, we'd all have one or more personal 'software entities' (ie 'agents') that would go out and do things for us. You'd say "I need to meet with Steve Jobs -- set up a meeting, book a flight and a hotel room and a car, and oh yeah Billy's birthday is next week so buy him that home chemistry set he's been wanting". And your Agent would go do all that stuff for you.

You can see how this hasn't exactly worked out. For one thing, the idea of buying a home chemistry set scares the bejeezus out of people for fear of getting flagged by Homeland Security or the DEA. But more to the point -- think about how someone today would go about executing on the tasks given above:

First off you'd pull out your smartphone and look up Steve Job's phone number in your smartphone's Contacts list. Then you'd give him a call and set up the meeting, and then put the meeting into your smartphone's Calendar, then you'd set up the flight, hotel, and car, either by using your smartphone's web browser or, more likely, "there's an app for that". That settled, you'd use the Amazon app to browse for chemistry sets, select one, buy it and arrange to have it shipped. And you can do all this while you're sitting in the waiting room at the doctor's office.

The point I'm trying to make is that apps have supplanted agents as the future's way of getting things done. Or, to look at it another way, instead of telling an agent what we want, we interact with a smartphone plus apps to get things done. Which, if you think about it, is probably a superior way to do most things: given the current state of the art in artificial intelligence, it's unlikely that anyone would trust a piece of software to set up a business trip for them. Smartphone apps hit the "sweet spot": they allow people to perform tasks both trivial and difficult, but they keep the human in the loop just enough to ensure desired results. AI deficiencies aside, this probably also makes people feel more secure, knowing that they've supervised the job enough that they're confident they'll achieve the results they want and expect. It's a "trust thing": you had no idea that some chemistry sets are priced at over $200, and so you're pleased that you were involved in the purchase and picked the one that cost $35.

For sure, agent technology might someday arrive. But I think there's going to be a significant "human factor" that will need to be surmounted. I guess if I were a rich fart or a corporate executive who was comfortable with handing out short, imprecise orders to my staff or my secretary, an agent would be a natural, easy thing to work with. When and if we ever get usable agents, I suspect that they will be highly personalized to 'fit' the person they work with -- sort've like how a travel agency keeps track of whether a client prefers smoking or non-smoking, window / middle / aisle seating, etc -- but in a lot more detail. And these personal databases, full of random and extremely personal trivia about an individual, will need to be very, very secure. I mean, imagine that business trip above except the command ends with "and book me some entertainment while I'm out there" and the agent helpfully sets up an appointment with a call-girl, knowing that you prefer short blondes with a C-cup. Now imagine that a newspaper reporter or your wife gets hold of that database.

So what does the future hold for smartphone / app technology? My guess for the relative near future is that smartphone devices will be given more latitude to wake up and notify us of events of interest. An example I like to use is: you're at your hotel, resting up for the big meeting with Steve Jobs the next morning, when you're jarred awake by alarms -- the hotel is on fire! You're on the 10th floor, and you need to get out, fast. So you grab your smart phone and turn it on and bring up your Hotel Fire Escape App, which uses GPS and other techniques to guide you to the exit.

Well, okay, not quite -- most people are going to at most grab their pants and head out the door. But imagine that instead your smartphone wakes up with the alarm, sounding it's own alarm to make it easier for you to locate it, and runs the Escape App automatically. You grab the phone and it's got big green flashing arrow directing you out the door, down the hall, and to the stairs. This is example is admittedly contrived, but I think we'll be seeing more and more of this kind of thing in the next few years: our smartphones will become more "context-aware" and will initiate user interaction when appropriate.

(You may think the hotel fire rescue app is silly, but I'm told that navigating dark, smoke-filled rooms and hallways is not easy. A number of hotels are moving emergency exit signs down to near floor level, where they can be more easily seen if (God forbid) the smoke is so thick you find yourself crawling on your hands and knees to keep out of the smoke. If a smartphone app can help people survive that kind of dangerous situation, more power to it!).

Friday, May 13, 2011

My Talented Kids

You may want to skip this one if you're not a relative of mine -- this is just Dad taking a moment to crow about his talented kids.

For his final art project, my son Aidan took one of his guitars apart and sanded down the body and "swirl-painted" it. His first attempt, so it's not a perfect "swirl" but the result is still pretty gosh-darn cool. Yes, he got an A.

(oil paints on wood)

These are a couple of freehand drawings by my daughter Miranda:

(pencil on paper)
(ink on paper)

(Alas, not the best digitization of those past two images; I'm a bit loathe to run them through our scanner for fear of destroying the original).

I'm pretty happy that both of them are very creative (although in very different ways). I hope it's something that stays with them their entire life.