Monday, September 24, 2007

College years: learning some math

In order to get into a college or university in Hungary, one had to pass an entrance exam. (I did also apply to some U.S. colleges. Lawrence University, a small liberal arts college in Canton, New York, did accept me, and even offered a scholarship, but I was still $10,000 short per semester, so I couldn't enroll.)

There was a complicated points system: you could get half of your score from certain high-school grades (up to 60), you had to get the second half at the entrance exam (also up to 60), and you could get some extra credits for any state-accredited language examinations (up to 3, I think). If your exam was so good, you could choose to double its score instead of using your high-school grades.

I applied for a computer science program at a respected university in Budapest. The entrance exam consisted of two parts: a written math test, and an oral test in programming. Each was worth 15 points, which needed to be doubled for a total maximum score of 60. (See above.)

The three-hour math part consisted of eight questions (as it had for decades). The first three questions were dead easy: math entrance exam tacticians recommended that you spend half an hour on them in total. The next three were a bit more difficult, it was good practice to do them in an hour or so. Finally, the last two questions (worth the most points, obviously) would take about one and a half hour, or half of your total allocated time.

We had practiced this a lot. We were professionals, almost. The advanced math class we took in the last year focused on these exams. We did a lot of the tests from the previous years. We almost always scored a respectable 12, 13, later 14 or even 15.

So did I.

But I couldn't sleep on the night before the test. And I was nervous. And I screwed up big time. I got stuck with some stupid typos I made on my second or third question. I wasted a lot of time. As a direct result, my score sucked: 10 points out of 15.

I added up my score quickly. I had 58 points from high school and languages. If I want to meet the previous year's score limit of 103, I need at least 13 points on the oral exam: a new subject for me, of which I'd never had any formal training.

I almost gave up.

But in the end I did go to the exam, though. They asked me what language I chose. I said none: I chose "pseudocode." I insisted (perhaps mistakenly) that it was allowed. They gave me a strange look, but conceded.

I drew a question from the pile. I remember it to this day:
An aircraft flies over a territory in a straight line, taking elevation measurements. A measurement of 0 means sea, anything higher than that is ground. Find the highest peak on an island.

An island was defined as ground surrounded by water on both ends. A peak was defined as a point higher than both of its neighbors.

So I was standing by a blackboard, chalking up pseudocode that iterated over an array, and the examiners' helpful questions made me realize that I iterated over it one time too many. I streamlined my procedure, it looked fine in the end. Then I had to answer some question on integer representation. I was pretty clueless about it. Then I had to represent the number of rice grains in the famous Legend of the Ambalappuzha Paal Payasam. I struggled a lot, even though I should have just written out the binary digit "1" sixty-four times. I did arrive at a solution, though, but repeatedly toyed with the thought of giving up the whole exam.

To my shock, my examiners awarded me a near-perfect score of 14, as there seemed to be "order in my head." They stopped short of welcoming me on board, though my final score of 106 would have granted me entry in any previous year since the existence of the program.

Well, except that year. The score was raised to 108. I desperately looked for any program that would take me, and it turned out that I was able to start my studies at a different, much less competitive branch of the same university: the college branch for training primary school teachers. I already had the necessary score before completing my oral math exam, I had to be careful not to score below -8. (Actually, I did need some minimum score, like 5, because of other rules, but you get my point about the less-than-competitive entrance process to that place.) My majors were math and English. I wanted to transfer to the computer science program, but wasn't allowed to.

Primary school, eh? I thought we'd learn addition in the first year, maybe subtraction in the second.

Wrong.

We had four semesters of some surprisingly tough real calculus. We also had university-level geometry, with an infamous professor who would reduce the class of 120 to about 30 by the end of the first year.

But what I learned was this: one needs to study math. Do the homework. Practice. And be sure to understand everything. Ask questions. Don't be ashamed. Not everyone is a natural.

I remember when I asked one of my classmates, back in high school, that okay, this looks like the equation for a circle, but how do I know that it really is the equation of a circle? He said that I should be more like an artist, and not concern myself with problems like these, as they clearly go over my head. Gee, thanks.

Except that at college, we learned a theorem (complete with proof, naturally) that this is the case: such an equation describes a real circle if the radius is positive; a "point circle" (i.e. a circle consisting of one point only) is the radius is zero; and an imaginary circle if the radius is negative.

I prefer explicitly understanding things.

My favorite math subject was elementary math. It dealt with tricky, sometimes extremely difficult problems that could be solved by elementary means. That is, a very, very, very smart sixth grader could solve them, and thus so should his or her teacher. Makes sense.

I remember a trick question I was really proud of solving:
Point A is 100 miles from Point B.
A train starts from A to B, traveling at 15 miles per hour.
A train starts, at the same moment, from B to A, at 35 miles per hour.

At the same moment, a fly starts flying from the nose of the train from Point A at 50 miles per hour, to the nose of the other train. As soon as it reaches it, it starts back, at the same speed. And so on.

The two trains meet (crash?) somewhere between A and B. The fly keeps flying between them up to that point. How much distance does the fly cover in total?

At universities, students would use infinite sequences and the like. We used the four basic operations.

So I ended up actually liking math. Better late than never!

My parents got me a 386 when I started college. It had 4 megabytes or RAM, ran Windows 3.1, and had trouble running most games that I wanted to run. I spent about as much time fixing it as using it: getting Windows to recognize its sound and video cards, dealing with infected floppies, squeezing apps into the memory available, and so on.

I don't remember exactly why and how, but I got a copy of Borland's Turbo Pascal IDE. I don't even remember the terminology used by the system, but what I remember is this: I decided to use the coordinate geometry knowlegde I'd gained after the first year of college, and do something with it.

I came up with a library of functions that could describe points and vectors in 3D space, as well as simple polyhedrons (basically, just a collection of corners, and the edges connecting those). The main goal was to project these on a 2D surface (represented by the monitor screen), using a perspective vector, and try to mimic human vision by calculating the images captured by both eyes (with the help of blue-red goggles).

I had a summer job, and carried a little checkered notebook with me at all times, thinking about this problem. I did eventually solve all the questions I hoped I would, and I did code up the Pascal library I wanted to.

However, I stopped short of tackling invisible edges or filled polygons. My interest wasn't strong enough to lead me down those difficult paths.