Thursday, April 19, 2012

Walking out of class

Students sometimes walk out of the room during my lectures.

I know that it is considered not polite. Once in the room they should suffer through the lecture until the end, advocate proponents of good manners. But why? If they are bored, if they know the material already, if they are hopelessly lost, if they are suddenly taken by a bout of sleepiness, or if, for whatever reason, they are not getting anything out of attending class, why should they stick around?

In the room where I teach, it is easy for people near the side alley to leave discreetly without, I think, distracting anyone. I see out of the corner of my eye the figure of someone leaving, but it does not interrupt the lecture in any way. Of course I hope that students are benefiting from lectures, but if not, isn't it slightly hypocritical for them to stay?

I pretend to teach, they pretend to learn, and it becomes a charade.

Wednesday, April 18, 2012

The destiny of the professor's wife

Daniil Kharms wrote a story about a professor's wife. Here is the beginning.

Once a professor had something to eat, and you could not say a little something, and he began to feel sick. His wife approached him and said: "What's wrong with you?" And the professor said: "Nothing." The wife went back to the kitchen.

The professor lay down on a divan, stayed there for a while, got some rest, and went to work.

And there, a surprise awaited him: They had cut down his salary, instead of 650 rubles now he made only 500. The professor tried everything, but nothing would help. He went to the director, but the director wanted to strangle him. He went to the bookkeeper, and the bookkeeper said: "You should go see the director." The professor got on a train and went to Moscow.

On the train the professor caught the flu. When he got to Moscow, he was so sick he could not get off the train.

He was put on a stretcher and taken to a hospital.

He stayed there no longer than four days and died.

The professor was cremated, and his ashes were put in a little jar and sent off to his wife.

So here is the professor's wife, sitting and drinking coffee. Suddenly the doorbell rings. What's going on? "You got a parcel." The wife is very happy, she is smiling, tipping the mailman with 5 rubles, and quickly opens the parcel.

She looks, and inside the parcel are a little jar with the ashes and a note: "This is all that is left of your husband."

Tuesday, April 17, 2012

Reductions

Today I was teaching reductions. I found a relevant quote on wikipedia:

Q: How do you shoot a blue elephant?
A: With a blue elephant gun.
Q: How do you shoot a yellow elephant?
A: Have you ever seen a yellow elephant?
Q: How do you shoot a red elephant?
A: Hold his trunk shut until he turns blue, and then shoot him with the blue elephant gun.
Q: How do you shoot a purple elephant?
A: Paint him red, hold his trunk shut until he turns blue, and then shoot him with the blue elephant gun.

Sunday, April 1, 2012

Spring school heaven

This past week, during Brown's Spring break, I gave a couple of lectures at a Spring school in France on theoretical computer science.

It took place on an island off the Atlantic coast, in a campground about a mile from lovely beaches of fine sand. There were slightly more than 40 students, postdocs, and researchers there to learn from the lectures, and a half-dozen lecturers, a ratio of about 7 to 1. The weather was amazing, with bright sun and exceptionally high temperatures every day, and so, instead of observing the usual lecture format, the school improvised ad hoc Socrates-like discussions: every morning we split into small groups, with one instructor per group, got on our bikes and headed to the beach. On the beach, we formed small circles and had learned conversations about algorithms, graphs, and randomness. But how can one teach without a screen, one might ask? The answer has been known since Antiquity at least: wet sand and a stick are the perfect writing medium. I only got into trouble once on the first day, when, half way through the analysis of the Goemans-Williamson maxcut algorithm, a wave came in and erased my calculation, as well as accidentally getting me wet all the way to my knees. Instead of erasing the board when we needed more writing space, we simply walked along the shore to find the next fresh spot of unwritten wet sand. At lunch time, the staff from the compound brought us picnic lunches and some wine (two bottles for every 6 people, usually one of local wine from the island, and the other one from the Bordeaux region). After going through the presentation of an exciting result, we cooled off by running in and out of the water (everyone had brought a swimming suit, of course). In the early afternoon, we took a leisurely walk back to our bungalows, walking our bikes and discussing exercises and puzzles as we went, then took a pleasant nap (or tried to use the flaky internet connection) before heading back to the beach for the late afternoon work session and evening swim. On the last day, we switched roles: the students became the instructors, the instructors became the students, and we got acquainted with the tricks of riding bicycles in the sand, juggling torches of fire (if you get petrol on your clothes, dive into the sand and other will quickly cover you with sand to extinguish the flames), getting into cold water without effort, body-surfing the waves, and biking in the woods by night without a light. At one point Ronald de Wolf commented: "We look like a bunch of hippies!", but I could not tell whether his tone was one of approval or of disapproval.

I taught a bit of optimization, and we practiced steepest descent by rolling down the sand dunes. Someone else presented an analysis of the dynamics of the famous sandpile model, and we had a lab session testing the fit of the model with reality (it's a poor fit). But the main theme of the week was randomness and probability in algorithms, and we used waves as our random coin flips, checking how long it took to get wet as a practical instance of geometric distributions. We studied random walks by biking into the confusing salt marshes area, where an unhappy landowner once threatened to keep me as a hostage for intruding on private property. We learned the similarity between having a creative idea and seeing a shooting star: both require much patience, skill in knowing where to look, and a little bit of luck. In both cases, two persons can both be star gazing at the exact same time with the same dedication, and one will see the shooting star but the other one won't. We tested our students' ability to greet new ideas with an open mind, by giving them oysters for dinner. We suffered the predictable consequences of our hard work all week: sun burns, sore muscles, and a big pile of unread emails. But all in all, I would not complain.

Thursday, March 15, 2012

Email and dirty dishes

The ever-repeated quandary: is time better spent dealing with emails or actually doing work? When email exceeds my bandwidth I have a depressing accumulation mounting in my inbox, making the start of each day an ordeal. When I give priority to email, the day is spent doing small routine tasks and there is no sense of doing anything of actual value. It's a recurring problem. The problem that will not go away and that only gets worse with delays! It's like dirty dishes piling up in the sink.

It's all about notation

When designing an algorithm, one often critical step is to find a good representation for the problem input and output, that will help us think about it clearly.

When writing a proof, one often critical step is to find the right notation. Once you have decided what objects are worth having an independent notation, that will direct (or mislead) the proof.

Tuesday, March 6, 2012

The morale of today's lecture

Before designing an algorithm: find a good visual representation for the input and output helps you think about the problem.

Case in point: Viterbi's algorithm. Input includes so much data that it's messy to think about, until the right graph is drawn (with colors, too.)

For when the input is a permutation: represent it as a collection of points (i,sigma(i)), and hope that the output of the problem can be interpreted visually.

Monday, March 5, 2012

James Q. Wilson on liberal education

James Q. Wilson, whose existence I just learned about upon the event of his death, authored a thought-provoking essay about liberalism and liberal education. He writes:

A liberal education is at its best when it strikes this balance: when it makes one aware that principles must ultimately be justified by something more than mere utility, that liberty is as worth preserving when it is attacked by a group one admires as it is when assaulted by a group one detests, and that the bonds of civility upon which the maintenance of society depends are more fragile than we often admit.

This reminded me of the unsightly celebrations in the US a few years ago, when Saddam Hussein was executed. Sure, many people are against the death penalty... except for loathsome criminals like Saddam Hussein!

Currently, it brings to mind the preparation of the presidential campaign in France, where putative candidates must obtain the "signature" of 500 mayors before they can officially pose their candidacy (there are about 35000 mayors in the country and each mayor can give their signature to exactly one candidate.) One current question is whether the candidate for the extreme right party (the party of all prejudices) will get 500 signatures. There may be some lobbying to pressure mayors not to give her their signature, even though, in the upcoming election, it appears that she would get the votes of roughly 20 percent of the population. What is more important: to preserve the liberty of presenting candidates for all significant political parties, or to prevent the development of ideas that one detests? That is close to the dilemma presented by Wilson.

Sunday, March 4, 2012

Lecturing on meta-topics

One primary goal of the Algorithms course that I am currently teaching is to teach problem-solving. That is normally done by example, going through a diverse array of algorithmic problems that come up in computer science. However, my way of teaching that has changed a little bit in recent years, with a shift to the meta-level.

Many methods I use to attack problem come without thinking. Through taking courses, reading papers, and collaborating with other researchers, I have absorbed certain ways of going about solving problems, and now I reproduce them in the hope that students will absorb them in turn. However, one of my former PhD students, Warren Schudy, systematically tried to bring out the meta-principle behind our discussions. He would be very explicit about it, reflecting aloud: "So, to no longer be stuck on this question, you are suggesting to try out some small concrete examples; that's your guiding principle" - and I would think: "Yes, of course he's right, that's what I'm doing!" Eventually I started to see the value of making explicit the guidelines that guide how we try to solve problems.

That adds a new element to my teaching: in class, I now try to not only solve the problem of the day, but also add a parenthetical comment to be more explicit about the path we took to problem-solving, the "guiding principle". It does not come naturally, since it can feel like pontificating, but it seems to have some value. Perhaps it helps demystify the "creative" steps and show that much can be achieved simply by systematically following a natural path of exploration - natural, once you have acquired enough experience to know what you're doing. I do not always remember to do it, but, following Warren's example, I try, at the end of each piece of algorithmic design or analysis, to reflect back on how we achieved it, and on the meta-tools that led us to the solution.

Saturday, March 3, 2012

The New York review of books on absolute versus relative error

We usually evaluate approximation algorithms by the ratio of the output value to the unknown optimal value. Although it is almost a dogma at this point that this is the most reliable way to evaluate an algorithm, the last issue of the New York Review of Books gives an outstanding counterexample.

The article is debunking a disinformation piece published by 16 scientists in the Wall Street Journal on January 27. The WSJ misleading article was a piece of global warming skepticism.William Nordhaus establishes the fallacy of their arguments one by one. The point that caught my attention was the one about economic analysis. Nordhaus writes: The sixteen scientists argue, citing my research, that economics does not support policies to slow climate change in the next half-century, then moves on to offer the following, which can be interpreted as a beautifully clear argument against making a dogma out of approximation ratios.

The authors cite the “benefit-to-cost ratio” to support their argument. Elementary cost-benefit and business economics teach that this is an incorrect criterion for selecting investments or policies. The appropriate criterion for decisions in this context is net benefits (that is, the difference between, and not the ratio of, benefits and costs).

This point can be seen in a simple example, which would apply in the case of investments to slow climate change. Suppose we were thinking about two policies. Policy A has a small investment in abatement of CO2 emissions. It costs relatively little (say $1 billion) but has substantial benefits (say $10 billion), for a net benefit of $9 billion. Now compare this with a very effective and larger investment, Policy B. This second investment costs more (say $10 billion) but has substantial benefits (say $50 billion), for a net benefit of $40 billion. B is preferable because it has higher net benefits ($40 billion for B as compared with $9 for A), but A has a higher benefit-cost ratio (a ratio of 10 for A as compared with 5 for B). This example shows why we should, in designing the most effective policies, look at benefits minus costs, not benefits divided by costs.