Wednesday, October 05, 2005

Get Technical

At the University of Maryland, the computer science department and the math department are part of the same college. It's interesting that that has come about.

Computer science is a weird mishmash of disciplines that share one thing in common. The computer. No other major I can think of ties itself that closely to a technological device.

In most universities, computer science evolved out of one of two deparments. Either it came out of the math department, or it came from electrical engineering. It doesn't fit well with either.

The fundamentals of computer science lies in mathematics. At the turn of the century, mathematicians were running into paradoxes. There's the famous barber paradox by Betrand Russell. In a city, there are two kinds of barbers: those who cut their own hair, and those who don't. A barber declares that he shall cut exactly the barbers that don't but their own hair.

Then, he wonders, should he cut his own hair or not? After all, he is a barber. If he doesn't cut his own hair, then he would miss one barber who doesn't cut his own hair, namely, himself. If he does cut his own hair, then he would be a barber that cuts his own hair, and would have cut someone he said whose hair he said he wasn't going to cut. That's the dilemma.

This lead to mathematicians trying to shore up the fundamentals of mathematics. Georg Cantor, among others, wanted to formalize mathematics so precisely, that all paradoxes would go away. Betrand Russell, himself, worked with Alfred North Whitehead to co-author Principia Mathematica, which spent over a hundred pages before proving that one plus one was two.

These formalists believed that one could automatically prove any theorem. These were the precursors to automated theorem proving, the idea that you could write a computer program that could tell you if a statement was true or false. Of course, in those days, there were no computers, but they imagined that you could follow a recipe, really, an algorithm, to crank through mathematical symbols, whose final result was a proof.

Kurt Godel, an Austrian logician, blew a hole in this theory. He proved the incompleteness theorem which basically said that given a suitably powerful set of axioms, you could construct statements like "This statement is true", and be unable to prove it.

Later on, Alan Turing came up with the idea of a Turing machine, a mathematical model for a computer, and came up with the Turing hypothesis: anything that can be computed can be computed on a Turing machine. It may not be fast, but it can be done. It's a statement that can't really be considered true or false. It effectively defines computation.

What he says is true of mathematical computations. Some have suggested that quantum computing might be able to compute what a Turing machine can not. However, this has yet to be shown. It leads to questions of whether a human brain can be described by a computer program or not.

Johnny Von Neumann came up with the idea of the modern computer. He basically said that we could write programs using 0's and 1's. Thus, numbers could not only represent data, but also programs. It's a plenty powerful idea. Before that, computers were considered specialized. You built the computer to do a specific kind of computation, like a calculator. Thus, the smarts were effectively built in hardware.

By the 60s, people began worrying about how to measure the speed of an algorithm. Once upon a time, algorithms were measured by using the equivalent of a stopwatch. You ran the algorithm, timed it, and reported it.

To the budding computer scientists of the time, this was considered an abomination. If you used the stopwatch to measure time of an algorithm, then running it on a faster computer would work out better. You might, for example, have taken advantage of assembly instructions, yet have written generally horrible code.

Robert Tarjan and John Hopcroft decided that this was not the right way to measure algorithmic speed. They came up with the idea of big O notation, which described how the algorithm would run if you doubled the size of the input, or tripled the size of the input.

For example, suppose you want to print out the elements of an array. The array has 10 elements. If you double the size to 20, you'd expect it to take twice as long to print.

Some algorithms quadruple in time when you double the size of input. Some do even worse than that. Some do remarkably better. If you had to ask someone to guess a number between 1 and 1000, where each guess met with a response of "higher" or "lower", then it would only take ten guesses to get the right number. If you double the range from 1 to 2000, it would take one more guess (11 in the worst case). Every time you double it, it only adds one more.

This is called binary search, and it's remarkably efficient. The idea makes looking things up in a dictionary with several hundred thousand words extremely quick. If the words weren't in alphabetical order, good luck! You'd never use the dictionary. OK, maybe you don't.

There's a whole study of algorithms in computer science, as people try to discover what's the best way to solve certain problems, and even that there may be limits to the best way to solve certain problems. For example, suppose you had to alphabetize a list of names using a program. Theory shows that you can't do any better than O(n lg n) if you're forced to do comparisons. There are even problems that take effectively forever, and those you can't even figure out if you had the most powerful computers for all of time. People try to figure out where problems fit in this range of ease of solution.

After this entire discussion, you might think computer science is all math. While the foundations of computer science does come from math, the real world use of computers encompasses far more than math.

For example, have you used Word? Who decided what menu options there would be? Who decided on automatic capitalization of the first letter of a sentence? Or to auto-correct some words? Who decided on templates?

The answers to these questions are not at all math-based, but based on what some programmers and designers thought people wanted in order to be productive using a word processor. There's no right or wrong answers, at least, in a math sense. Instead, the answers are based on what people want, and what people think people want. And there lies a problem.

Microsoft wants you to buy Word, each and every version, if possible. But in order to do that, they need to offer new things for each release. There's an economic incentive for a software company to keep adding features, even as you're pretty satisfied with the way things work in say Word 2001. Admittedly, Microsoft hasn't done anything with Word since 2003.

Point is, once you have a means to create programs and add features, then people add them. Over time, they might decide the solution they came up with is bad for reasons that weren't obvious right away. Over time, they decide to come up with alternate ways to solve the problem. And since companies compete, everyone puts out their own version out there.

To give you a sense of how bad this could get, think about a car. You know the steering wheel, the gear shift, the speedometer, the brakes, the gas pedal. Most cars vary little with respect to this. No one has strayed that far from the steering wheel. This means that, for the most part, a person can drive any car. The biggest issue is manual or automatic, but except for that, the controls are nearly the same. This hasn't changed in years.

Software is not this way. There's no consistency on what features to provide or how to provide them, other than the general menu layout that was borrowed from Apple Macs (you know, File, Edit, etc). This means you're having to learn software over and over again, and with hundreds or thousands of features, it can take a great deal of time to get any good.

I've noticed that people fall into two categories when it comes to technology. Those who love it and those who don't. Most people fall into the second. Learning technology means to have to figure something out. It's not like biking where, once you learn it, that's it (unless you're into extreme sports). Everyone adds tons of features, things you didn't think you had to know, then a year later, they change it up on you, and then a year later, they're out of business.

Some people, even those that work in technology (like me), don't like having to learn more and more. They like what they know. Others are always looking to learn new stuff, even if what they're really learning isn't substantive learning. It's learning more bells and whistles in many different forms and wondering why they need to learn a gizmo and how a gizmo is important to what they do. And then doing it again and again and again.

One day I hope that technology will be far less complex, far easier to learn. So it goes.

No comments: