Mastermind
Surely the most brilliant sketch ever, if not the funniest:
It’s from the BBC show The Two Ronnies, by Ronnie Barker and Ronnie Corbett. It’s probably their most famous sketch after Four Candles.
Read the rest of this entry »
Portrait of the “lazy” student
[I had some thoughts, but I didn't write anything here and this turned into one of those drafts lost in time. At least it's a dump of two links for now.]
Found today Doron Zeilberger’s What About “Quarter Einsteins”?, written in 1967 (emphasis mine):
There is yet another kind of talented students, whose natural curiosity lead them, already from a young age, to read and look at more advanced material, in order to satisfy their natural curiosity.
When such a student enters high school (and in fact, already in the higher grades of elementary school) he sees that the material that he has already studied on his own presented in a different way. The learning is induced through severe disciple (all the system of examinations and grades), and the material is taught the same way as in animal training. The fascinating science of Chemistry turns into a boring list of dry formulas, that he has to learn by heart, and the threats and the incentives practiced in school badly offend him. As though out of spite, he does not listen to the commands of his teachers, but instead studies on his own material that is not included in the curriculum. Obviously, even the most talented student can not learn from just sitting in class, (and even during class he often studies other material), and so starts the “tragedy” described in your article.
[...]
[Einstein] managed somehow to find his way in life (but it wasn’t easy, even for him). But besides him there are “half and quarter Einsteins”, and just plain talented students that had the potential to contribute to society, but [...] flunked out of high school and their “genius” did not help them find their proper place in modern society [...].
Mark Traver wrote a post in 2006 called the The Bipolar Lisp Programmer, which many readers found to be a frighteningly accurate description. (Reproduced below.) Again, please ignore the remarks about “outstanding brilliance” etc. That is not the point; the point is the tragedy of talented (even if only very moderately so) students failing to cope with the system.
The Bipolar Lisp Programmer
Any lecturer who serves his time will probably graduate hundreds, if not thousands of students. Mostly they merge into a blur; like those paintings of crowd scenes where the leading faces are clearly picked out and the rest just have iconic representations. This anonymity can be embarrassing when some past student hails you by name and you really haven’t got the foggiest idea of who he or she is. It both nice to be remembered and also toe curlingly embarrassing to admit that you cannot recognise who you are talking to.
But some faces you do remember; students who did a project under you. Also two other categories – the very good and the very bad. Brilliance and abject failure both stick in the mind. And one of the oddest things, and really why I’m writing this short essay, is that there are some students who actually fall into both camps. Here’s another confession. I’ve always liked these students and had a strong sympathy for them.
Now abject failure is nothing new in life. Quite often I’ve had students who have failed miserably for no other reason than they had very little ability. This is nothing new. What is new is that in the UK, we now graduate a lot of students like that. But, hey, that’s a different story and I’m not going down that route.
No I want to look at the brilliant failures. Because brilliance amd failure are so often mixed together and our initial reaction is it shouldn’t be. But it happens and it happens a lot. Why?
Well, to understand that, we have to go back before university. Lets go back to high school and look at a brilliant failure in the making. Those of you who have seen the film “Donnie Darko” will know exactly the kind of student I’m talking about. But if you haven’t, don’t worry, because you’ll soon recognise the kind of person I’m talking about. Almost every high school has one every other year or so.
Generally what we’re talking about here is a student of outstanding brilliance. Someone who is used to acing most of his assignments; of doing things at the last minute but still doing pretty well at them. At some level he doesn’t take the whole shebang all that seriously; because, when you get down to it, a lot of the rules at school are pretty damned stupid. In fact a lot of the things in our world don’t make a lot of sense, if you really look at them with a fresh mind. And generally our man does have a fresh mind and a very sharp one.
So we have two aspects to this guy; intellectual acuteness and not taking things seriously. The not taking things seriously goes with finding it all pretty easy and a bit dull. But also it goes with realising that a lot of human activity is really pretty pointless, and when you realise that and internalise it then you become cynical and also a bit sad – because you yourself are caught up in this machine and you have to play along if you want to get on. Teenagers are really good at spotting this kind of phony nonsense. Its also the seed of an illness; a melancholia that can deepen in later life into full blown depression.
Another feature about this guy is his low threshold of boredom. He’ll pick up on a task and work frantically at it, accomplishing wonders in a short time and then get bored and drop it before its properly finished. He’ll do nothing but strum his guitar and lie around in bed for several days after. Thats also part of the pattern too; periods of frenetic activity followed by periods of melancholia, withdrawal and inactivity. This is a bipolar personality.
Alright so far? OK, well lets graduate this guy and see him go to university. What happens to him then?
Here we have two stories; a light story and a dark one.
The light story is that he’s really turned on by what he chooses and he goes on to graduate summa cum laude, vindicating his natural brilliance.
But that’s not the story I want to look at. I want to look at the dark story. The one where brilliance and failure get mixed together.
This is where this student begins by recognising that university, like school, is also fairly phony in many ways. What saves university is generally the beauty of the subject as built by great minds. But if you just look at the professors and don’t see past their narrow obsession with their pointless and largely unread (and unreadable) publications to the great invisible university of the mind, you will probably conclude its as phony as anything else. Which it is.
But lets stick to this guy’s story.
Now the big difference between school and university for the fresher is FREEDOM. Freedom from mom and dad, freedom to do your own thing. Freedom in fact to screw up in a major way. So our hero begins a new life and finds he can do all he wants. Get drunk, stumble in at 3.00 AM. So he goes to town and he relies on his natural brilliance to carry him through because, hey, it worked at school. And it does work for a time.
But brilliance is not enough. You need application too, because the material is harder at university. So pretty soon our man is getting B+, then Bs and then Cs for his assignments. He experiences alternating feelings of failure cutting through his usual self assurance. He can still stay up to 5.00AM and hand in his assignment before the 9.00AM deadline, but what he hands in is not so great. Or perhaps he doesn’t get into beer, but into some mental digression from his official studies that takes him too far away from the main syllabus.
This sort of student used to pass my way every now and then, Riding on the bottom of the class. One of them had Bored> as his UNIX prompt. If I spotted one I used to connect well with them. (In fact I rescued one and now he’s a professor and miserable because he’s surrounded by phonies – but hey, what can you do?). Generally he would come alive in the final year project when he could do his own thing and hand in something really really good. Something that would show (shock, horror) originality. And a lot of professors wouldn’t give it a fair mark for that very reason – and because the student was known to be scraping along the bottom.
Often this kind of student never makes it to the end. He flunks himself by dropping out. He ends on a soda fountain or doing yard work, but all the time reading and studying because a good mind is always hungry.
(Rest of essay follows, with the Lisp parts gratuitously excised, but you can read the original post.)
[...] the peculiar strengths and weaknesses of the brilliant bipolar mind (BBM).
[...] He can see far; further than in fact his strength allows him to travel. He conceives of brilliant ambitious projects requiring great resources, and he embarks on them only to run out of steam. Its not that he’s lazy; its just that his resources are insufficient.
[...] not just the strengths but also the weaknesses of the BBM.
One of these is the inability to finish things off properly. The phrase ‘throw-away design’ is absolutely made for the BBM [...]
[...] And he is, unlike the rank and file, unprepared to compromise. And this leads to many things.
[...]
And this brings me to the last feature of the BBM. The flip side of all that energy and intelligence – the sadness, melancholia and loss of self during a down phase. The intelligence is directed inwards in mournful contemplation of the inadequacies [...]. The problems are soluble [...], but when you’re down everything seems insoluble. [...]
[...]
So what’s the problem with Lisp? Basically, there is no problem with Lisp, because Lisp is, like life, what you make of it.
Is it important to “understand” first?
The Oxford University Press has been publishing a book series known as “Very Short Introductions”. These slim volumes are an excellent idea, and cover over 200 topics already. The volume Mathematics: A Very Short Introduction is written by Timothy Gowers.
Gowers is one of the leading mathematicians today, and a winner of the Fields Medal (in 1998). In addition to his research work, he has also done an amazing amount of service to mathematics in other ways. He edited the 1000-page Princeton Companion to Mathematics, getting the best experts to write, and writing many articles himself. He also started the Polymath project and the Tricki, the “tricks wiki”. You can watch his talk on The Importance of Mathematics (with slides) (transcript), and read his illuminating mathematical discusssions, and his blog. His great article The Two Cultures of Mathematics is on the “theory builders and problem solvers” theme, and is a paper every mathematician should read.
Needless to say, “Mathematics: A Very Short Introduction” is a very good read. Unlike many books aimed at non-mathematicians, Gowers is quite clear that he does “presuppose some interest on the part of the reader rather than trying to drum it up myself. For this reason I have done without anecdotes, cartoons, exclamation marks, jokey chapter titles, or pictures of the Mandelbrot set. I have also avoided topics such as chaos theory and Godel’s theorem, which have a hold on the public imagination out of proportion to their impact on current mathematical research”. What follows is a great book that particularly excels at describing what it is that mathematicians do. Some parts of the book, being Gowers’s personal views on the philosophy of mathematics, might not work very well when directed at laypersons, not because they require advanced knowledge, but assume a culture of mathematics. Doron Zeilberger thinks that this book “should be recommended reading to everyone and required reading to mathematicians”.
Its last chapter, “Some frequently asked questions”, carries Gowers’s thoughts on some interesting questions. With whole-hearted apologies for inserting my own misleading “summaries” of the answers in brackets, they are the following: “1.Is it true that mathematicians are past it by the time they are 30?” (no), “2. Why are there so few women mathematicians?” (puzzling and regrettable), “3. Do mathematics and music go together?” (not really), “4. Why do so many people positively dislike mathematics?” (more on this below), “5. Do mathematicians use computers in their work?” (not yet), “6. How is research in mathematics possible?” (if you have read this book you won’t ask), “7. Are famous mathematical problems ever solved by amateurs?” (not really), “8. Why do mathematicians refer to some theorems and proofs as beautiful?” (already discussed. Also, “One difference is that [...] a mathematician is more anonymous than an artist. [...] it is, in the end, the mathematics itself that delights us”.) As I said, you should read the book itself, not my summaries.
The interesting one is (4).
4. Why do so many people positively dislike mathematics?
One does not often hear people saying that they have never liked biology, or English literature. To be sure, not everybody is excited by these subjects, but those who are not tend to understand perfectly well that others are. By contrast, mathematics, and subjects with a high mathematical content such as physics, seem to provoke not just indifference but actual antipathy. What is it that causes many people to give mathematical subjects up as soon as they possibly can and remember them with dread for the rest of their lives?
Probably it is not so much mathematics itself that people find unappealing as the experience of mathematics lessons, and this is easier to understand. Because mathematics continually builds on itself, it is important to keep up when learning it. For example, if you are not reasonably adept at multiplying two-digit numbers together,then you probably won’t have a good intuitive feel for the distributive law (discussed in Chapter 2). Without this, you are unlikely to be comfortable with multiplying out the brackets in an expression such as
, and then you will not be able to understand quadratic equations properly. And if you do not understand quadratic equations, then you will not understand why the golden ratio is
.
There are many chains of this kind, but there is more to keeping up with mathematics than just maintaining technical fluency. Every so often, a new idea is introduced which is very important and markedly more sophisticated than those that have come before, and each one provides an opportunity to fall behind. An obvious example is the use of letters to stand for numbers, which many find confusing but which is fundamental to all mathematics above a certain level. Other examples are negative numbers, complex numbers, trigonometry, raising to powers, logarithms, and the beginnings of calculus. Those who are not ready to make the necessary conceptual leap when they meet one of these ideas will feel insecure about all the mathematics that builds on it. Gradually they will get used to only half understanding what their mathematics teachers say, and after a few more missed leaps they will find that even half is an overestimate. Meanwhile, they will see others in their class who are keeping up with no difficulty at all. It is no wonder that mathematics lessons become, for many people, something of an ordeal.
This seems to be exactly the right reason. No one would enjoy being put through drudgery that they were not competent at, and without the beauty at the end of the pursuit being apparent. (I hated my drawing classes in school, too.) See also Lockhart’s Lament, another article that everyone — even, or especially, non-mathematicians — should read.
As noted earlier, Gowers has some things to say about the philosophy of mathematics. As is evident from his talk “Does mathematics need a philosophy?” (also typeset as essay 10 of 18 Unconventional Essays on the Nature of Mathematics), he has rejected the Platonic philosophy (≈ mathematical truths exist, and we’re discovering them) in favour of a formalist one (≈ it’s all just manipulating expressions and symbols, just stuff we do). The argument is interesting and convincing, but I find myself unwilling to change my attitude. Yuri Manin says in a recent interview that “I am an emotional Platonist (not a rational one: there are no rational arguments in favor of Platonism)”, so it’s perhaps just as well.
Anyway, the anti-Platonist / formalist idea of Gowers is evident throughout the book, and of course it has its great side: “a mathematical object is what it does” is his slogan, and most of us can agree that “one should learn to think abstractly, because by doing so many philosophical difficulties disappear” , etc. The only controversial suggestion, perhaps, follows the excerpt quoted above (of “Why do so many people positively dislike mathematics?”):
Is this a necessary state of affairs? Are some people just doomed to dislike mathematics at school? Or might it be possible to teach the subject differently in such a way that far fewer people are excluded from it? I am convinced that any child who is given one-to-one tuition in mathematics from an early age by a good and enthusiastic teacher will grow up liking it. This, of course, does not immediately suggest a feasible educational policy, but it does at least indicate that there might be room for improvement in how mathematics is taught.
One recommendation follows from the ideas I have emphasized in this book. Above, I implicitly drew a contrast between being technically fluent and understanding difficult concepts, but it seems that almost everybody who is good at one is good at the other. And indeed, if understanding a mathematical object is largely a question of learning the rules it obeys rather than grasping its essence, then this is exactly what one would expect — the distinction between technical fluency and mathematical understanding is less clear-cut than one might imagine.
How should this observation influence classroom practice? I do not advocate any revolutionary change — mathematics has suffered from too many of them already — but a small change in emphasis could pay dividends. For example, suppose that a pupil makes the common mistake of thinking that xa+b = xa + xb. A teacher who has emphasized the intrinsic meaning of expressions such as xa will point out that xa+b means a+b xs all multiplied together, which is clearly the same as a of them multiplied together multiplied by b of them multiplied together. Unfortunately, many children find this argument too complicated to take in, and anyhow it ceases to be valid if a and b are not positive integers.
Such children might benefit from a more abstract approach. As I pointed out in Chapter 2, everything one needs to know about powers can be deduced from a few very simple rules, of which the most important is xa+b = xa xb. If this rule has been emphasized, then not only is the above mistake less likely in the first place, but it is also easier to correct: those who make the mistake can simply be told that they have forgotten to apply the right rule. Of course, it is important to be familiar with basic facts such as that x3 means x times x times x, but these can be presented as consequences of the rules rather than as justifications for them.
I do not wish to suggest that one should try to explain to children what the abstract approach is, but merely that teachers should be aware of its implications. The main one is that it is quite possible to learn to use mathematical concepts correctly without being able to say exactly what they mean. This might sound a bad idea, but the use is often easier to teach, and a deeper understanding of the meaning, if there is any meaning over and above the use, often follows of its own accord.
Of course, there is an instinctive reason to immediately reject such a proposal — as the MAA review by Fernando Q. Gouvêa observes, ‘I suspect, however, that there is far too much “that’s the rule” teaching, and far too little explaining of reasons in elementary mathematics teaching. Such a focus on rules can easily lead to students having to remember a huge list of unrelated rules. I fear Gowers’ suggestion here may in fact be counterproductive.’ Nevertheless, the idea that technical fluency may precede and lead to mathematical understanding is worth pondering.
(Unfortunately, even though true, it may not actually help with teaching: in practice, drilling-in “mere” technical fluency can be as unsuccessful as imparting understanding.)
The Decline and Fall of The Decline and Fall
(Yes, this post is written just for the title. More details would be received gratefully.)
Over a period of 17 years from 1770 to 1787, Edward Gibbon wrote The History of the Decline and Fall of the Roman Empire. It was, among other things, a mammoth history (6 volumes, 71 chapters) of the last days of Rome, which for Gibbon apparently meant several centuries. (The book covers over thirteen centuries of history; here’s an outline.)
The work received instant praise. Adam Smith’s letter to Gibbon is typical:
“I cannot express to you the pleasure it gives me to find that by the universal consent of every man of taste and learning whom I either know or correspond with, it sets you at the very head of the whole literary tribe at present existing in Europe.”
The Decline and Fall became the model for all historians that followed — including its pessimism (history as “little more than the register of the crimes, follies, and misfortunes of mankind”), its overarching narrative, and its indictment of religion.
It became a literary monument of the 18th century, and one of the works that every educated man was expected to have read, a part of every bookshelf. Churchill (“I devoured Gibbon. [...] I rode triumphantly through it from end to end and enjoyed it all”), Carlyle (“how gorgeously does it swing across the gloomy and tumultuous chasm of these barbarous centuries”), Virginia Woolf (“not merely a master of the pageant and the story; he is also the critic and the historian of the mind [...] We seem as we read him raised above the tumult and the chaos into a clear and rational air”)… everyone read The Decline and Fall and spoke of it in the highest terms. (Gandhi read it in jail, and considered it an inferior version of the Mahabharata.) It was read by doctors, politicians, lawyers, novelists, even Sanskrit professors.
But then times began to change. Education stopped being the reading of “classics“, and became the learning of “subjects”. Today, no one I know has read The Decline And Fall, nor considers it worth the time.
Testing irreducibility using prime numbers
Here’s a simple and nice test for irreducibility in that N told me about a year ago. (I just noticed this lying around while cleaning; I don’t have a year’s buffer like Raymond Chen.) Apologies for the ugly formatting; you’ll have to trust that the result (Theorem 1, or Corollary 8) is more beautiful than it looks. :-)
Actually I’m not sure why I wrote this originally, given that it’s all already well-explained in the originals and even partially on Wikipedia. Perhaps my proofs are different or simpler or I was bored or something.
1. Irreducibility test
In its simplest form, the test can be stated as follows.
Theorem 1 Given a polynomial
with integer coefficients, let
. If there exists an integer
such that
is prime, then
is irreducible.
Conscious consumption
Late-night sleepy ramblings; please do not read :p
I have been taking a break, and it has helped me gain some perspective. Or so I thought.
Like some who might be reading this, I subscribe to a large number of blogs. Google Reader says 106 subscriptions, but a few of them are aggregators which combine the updates from several blogs.
For about three months (since June 10th, I think), I have not been reading them, nor reading the news. I’m not exactly sure why… it started as a day’s break (which was a big deal), then became four days (which was an even bigger deal), then it got easier and easier. Probably, I thought I was taking a break from (parts of) the internet in order to catch up with (parts of) my life. It didn’t work, of course. I merely found other sinks in which to dump my time. (I spent more time on Wikipedia than ever before, read more actual books than I had in the last couple of years, and so on.)
I did, however, discover a couple of things.
One is that Google Reader stops updating the count of unread items at “1000+”. (It also automatically marks items more than 30 days old as read, and, as I have “only” about 1500 items a month, I don’t know if it counts to “2000+”.)
The other is some general observations about what our lives have become.
It seems that the meanings of words like “recreation” have become somewhat quaint. Now “entertainment” is not always something to indulge in because one requires relaxation, or because it is a rewarding pursuit in itself, but simply “because it’s there”.
Read the rest of this entry »
To Be or Not to Be
(Not about the excellent film or the excellent animated short.)
Bit off more than my mind could chew,
Shower or suicide, what do I do?
— Julie Brown, “Will I Make it Through the Eighties?”
If you are of the opinion that the contemplation of suicide is sufficient evidence of a poetic nature, do not forget that actions speak louder than words.
— Fran Lebowitz, “Metropolitan Life”
Razors pain you, Rivers are damp,
Acids stain you, And drugs cause cramp.
Guns aren’t lawful, Nooses give,
Gas smells awful. You might as well live.
–Dorothy Parker (several tentative suicide attempts, died of a heart attack at 73)
No one ever lacks a good reason for suicide.
– Cesare Pavese (who committed suicide, WTF?)
And of course no mention of suicide is complete without Maddox’s How to kill yourself like a man.
Smith? and other names
As I, like many South Indians, don’t have a surname, and have been forced to adopt one for my life in the US, I have some things to say about surnames, and there will be a post about them someday, probably. (There was a draft lying around which had “tyranny” in its title, but nothing much good besides.) In the meantime, someone very bored might be able to amuse themselves with related news I’ve been collecting, such as this latest one from a BBC article on zombies:
In their study, the researchers from the University of Ottawa and Carleton University (also in Ottawa) posed a question: If there was to be a battle between zombies and the living, who would win?
Professor Robert Smith? (the question mark is part of his surname and not a typographical mistake) and colleagues wrote: “We model a zombie attack using biological assumptions based on popular zombie movies. [..]
Some paragraphs later:
Professor Smith? told BBC News:
(Apparently he’s an Australian citizen and got his name changed while living in the US… quite an achievement. His major complaint seems to be that Facebook won’t let him use his name.)
Flashing the screen on Mac OS X
Here’s one way. There’s a C program to adjust the screen’s brightness written by Nicholas Riley, also available from this blog post by Matt (Danger) West. Get it. The rest is obvious. For instance, here’s a Python script, which should have probably been written in Perl:
import os, re, time
s = os.popen('./brightness -l').read()
ob = re.findall('brightness (\d.\d+)', s)[0]
w = 0.2
for i in range(10):
os.system('./brightness 0'); time.sleep(w)
os.system('./brightness 1'); time.sleep(w)
if(i==4): os.system("say beep")
os.system('./brightness ' + ob)
Tune parameters to avoid epileptic seizures.
Eugene Curtain and Max Washauer
If you came here because you were reading Peter Winkler’s “7 Puzzles You Think You Must Not Have Heard Correctly”, the names are supposed to be Eugene Curtin and Max Warshauer, and the paper is called “The locker puzzle”, published in The Mathematical Intelligencer, Volume 28, Number 1 (March 2006), pages 28–31.
[If not, you should read the amazing "7 Puzzles You Think You Must Not Have Heard Correctly", spend several days trying the first problem, read the brilliant solution, and then come back here if you're interested in learning why no other solution can do better.]
The paper is available here if your institution has access. If not, here’s a sketch of the proof that the strategy cannot be improved upon. [Update 2010-01-06: Oliver Nash has a post about the puzzle, explaining both the original solution and the proof of optimality, here. Just the original solution is also worked out by David MacKay here.]
First, let us modify the rules slightly so that each prisoner must continue looking in boxes until he finds the box containing his name. The prisoners win if no prisoner opens more than 50 (i.e., n/2) boxes. This change obviously makes no difference to the outcome. Let’s call this (modified) game Game 1.
A different game involves all the prisoners being in the room at the same time, and is played as follows. The first prisoner opens boxes until he finds his name (i.e., the number “1″). Then, the lowest-numbered prisoner whose name hasn’t been revealed starts opening boxes until he finds his name. Then the next lowest-numbered whose name hasn’t been revealed opens boxes, and so on. The prisoners win if no one opens more than 50 boxes. Call this Game 2.
Let’s say we observe the prisoners as they play Game 2, and record the order in which boxes were revealed. This completely specifies what happened. For example, (with 10 prisoners instead of 100) if we record the list 2,6,1,4,9,7,10,8,3,5, we know that the first prisoner revealed boxes containing 2, 6, 1, then the third (lowest unrevealed) prisoner opened boxes with 4,9,7,10,8,3, then prisoner 5 opened 5, and they lost because the third prisoner opened 6 > 5 boxes.
- Prove: No matter what strategy the prisoners follow, each permutation has the same probability (1/n!) of being the list recorded.
- Prove: “The classical records-to-cycles bijection”. It sends 2,6,1,4,9,7,10,8,3,5 to (2 6 1)(4 9 7 10 8 3)(5), for example.
- So the probability of the prisoners winning Game 2 (no matter what strategy they follow) is exactly the probability that a random permutation has no cycle of length greater than n/2.
- Prove: Any strategy for Game 1 corresponds to a strategy for Game 2 with the same probability. (Trivial: the only change is that you don’t have to open boxes you’ve already seen opened.)
This proves that the pointer-chasing strategy is optimal for Game 1.
Here’s the puzzle as it was originally considered, still open: suppose there are n prisoners and 2n boxes, half of them empty. The prisoners can each examine n lockers. The pointer-chasing strategy doesn’t work as empty boxes point nowhere. Does the probability of winning go to 0 as n→∞?
The procrastinator’s nature
I just started using LeechBlock yesterday, and already I know why “How can I block Google’s cached versions of sites as well?” is in the FAQ.
LeechBlock is wonderful. (Install)
There are no results on Google for “LeechBlock saved my life”, but there are testimonials like “Leech block has changed my life”, “Leechblock just saved my life”, and “This application is saving my thesis, and improving my social life”.
If LeechBlock isn’t working for you, you can try more extreme solutions like (on Mac) Freedom and SelfControl. (Found via this post.) But for me, right now, with my current level of work and self-awareness and other devices being employed, LeechBlock seems to be just about sufficient. (Although I do wish Safari were an even worse browser than it is.)
Semi-unrelatedly, also worth reading is Aaron Swartz’s experiment involving one month offline: Before/After.
Firebug “console is undefined”
If you’re using Firebug and don’t want to bother removing or commenting out all the console.log debug messages for users who aren’t, put this at the top:
if(typeof(console) === "undefined" || typeof(console.log) === "undefined")
var console = { log: function() { } };
This reminds me of the trick I use for C/C++ of putting debugging statements inside a macro:
D(cerr<<"The number is "<<n<<endl;);
where the macro D is defined as
#define D(A) A
when you want the debugging code to run, and
#define D(A)
when you don’t. :-)
(The final semicolon after the D() is for Emacs to indent it reasonably.)
Update: Of course, the above are just hacky hacks to save typing. The “right” way for conditional C code is usually to use #ifdef DEBUG and the like, and the right way around the Firebug problem is to use something more general like this code at metamalcolm.
Frederik Pohl on science fiction
Frederik Pohl is one of the important writers and editors from the “Golden Age” of science fiction. He began writing in 1937, and over the last seventy years has written, edited, agented, and done several other things besides. I read his somewhat-obscure story Shaffery Among the Immortals when I was 12 (my own Golden Age), and I have long considered it the funniest story about a scientist ever written. (Disagreements most welcome.) Of course, at that time, I imagined all scientists to be heroic characters, every one a genius—so the story was indeed all fiction. It seems less funny when I reread it as a struggling graduate student myself. :-) [Despite dropping out of school at the age of 14, Pohl has an excellent knowledge of science, and, even more amazingly, about science: he seems to write with the familiarity of an insider about the life of scientists, how science gets done, what goes on at conferences, the way papers are written... he is a bit cynical occasionally, but that's his job.]
In his introduction to the collection Day Million, Pohl offers the following pleasant description of science fiction. Writing in December 1969, he notes:
I put “science fiction” in quotes because I’m not always sure what that is, either. “Science fiction” is a poor name for a field of writing. It would be an uninspired one even if it were exact, and of course it is far from exact: there is a great deal of “science fiction” that doesn’t contain any science at all. (You will find some specimens herein.) But it is not entirely a misnomer, because just as “science” is a state of mind and a systems approach to inquiry rather than test tubes and facts, so “science fiction” is a way of writing stories. Harlow Shapley, talking of something else, once described this perspective as “the view from a distant star”. It is a look at the human race and all its affairs from outside.
One of the most popular sports at science-fiction gatherings is defining science fiction: it is that kind of story which deals with events that may happen, but as far as we know haven’t happened; it is that kind of story which takes some real event or trend and extrapolates it to its logical conclusions; it is that kind of story which would not exist if it were not for some central supposition which is based on scientific theory. Et cetera. I play this game as little as possible, because I am an inclusivist and try to avoid setting up barriers which might make me refrain from buying a story for a magazine or anthology I may be editing, or refrain from writing a story of my own, because it could be excluded by one of those barriers. But I do have a suggestion toward a definition, which seems to me attractive if only because it employs that favorite writer’s trick of standing a question on its head. It goes like this:
A science fiction story is that story which might really occur anywhere in space and time, except that stories of our own real world are a special and less imaginative kind of science fiction.
In those terms, Hamlet and War and Peace and Little Women are examples only of a subclass within the general framework of sf. For reasons of vanity as a science fiction writer, it gives me some pleasure to think that this is so. But vanity is not the only reason. Our world is but one of a very large number of planets—no one on Earth knows exactly how many there are, but a reasonably good guess puts it at 60 million or so—in our own galaxy, which in turn is but one of some hundreds of billions of galaxies in the universe. The events that Shakespeare and Tolstoi and Louisa May Alcott wrote about pertain to the history and customs of a certain kind of vertebrate, mammalian, carbon-based, two-sexed, air-breathing creature. We know a great deal about this species, and we can see how complex its societal and ecological systems are; but since they are the systems we move in, it is hard for us to see that they are the product of chance. Science fiction gives us the perspective that makes the job a little easier. Not always perfectly, in fact not always even very well, it does give us a look at our churches, politicians, addictions, morals, family relationships, vices and pleasures from the point of view of a frame of reference that takes none of them for granted.
When you think of how many millions of human beings have shot, stabbed, gassed, clubbed and burned other human beings because they thought their way of life was the uniquely best and proper one, it appears that this point of view could have saved us all a lot of heartburn over the centuries. It could save us some right now.
As I write, we are in the last days of the year in which human beings first walked on the surface of another world. It’s only the Moon. It’s really just our own back yard. There’s not much there to want, and little enough of even that worth the cost of hauling back to Earth.
But it’s a doorstep to the universe, and out there are many very wonderful things indeed, and to reach and master them we shall probably need all the wisdom and objectivity and freedom from parochial prejudice we can come by. We need them badly enough here on Earth, heaven knows, and if science fiction can help us attain these goals, it will have done more than a good many Messiahs.
Who said that?
One of my favourite pastimes obsessions is trying to find the correct attribution for quotes, phrases, stories, etc. [For example, “Premature optimization is the root of all evil” was said by Knuth, not Hoare; I haven't been able to track one Asimov quote despite a bit of looking, etc.]
Quite by coincidence, I found in the last hour three great webpages doing an impressive and thorough-looking (but alas, we’ll never know when something is thorough) job of it:
- Alan P. Scott trying to track down “Talking about music is like dancing about architecture”
- Martin Porter trying to track down “All that is necessary for the triumph of evil is that good men do nothing”. (It has so many variations so frequently quoted that A Bit of Fry and Laurie in Series 4 had “For evil to flourish, all that is required is for good men to spout clichés”.)
- Duen Hsi Yen on The Blind Men and the Elephant
There’s also a book by Ralph Keyes called The quote verifier: who said what, where, and when — looks great, must read.
If you have more examples, please let me know.
More examples:
- Jeffrey E.F. Friedl on jwz’s ‘Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.’ (thanks to Karthik below)
- William J. Rapaport on Buffalo buffalo buffalo buffalo buffalo (it’s his own sentence, so perhaps it shouldn’t count)
Partial ones:
- Rachel Loden on “Prizes are for children” by Charles Ives
Generic related:
- Prof. J Michael Steele has a page on quote variations.
Extreme image compression: the Twitter challenge
If a picture is worth a 1000 words, how much of a picture can you fit in 140 characters?
Mario Klingemann (Quasimondo on Flickr) had a fascinating — call it crazy if you like — idea: can you encode an image such that it can be sent as a single Twitter message (“tweet”)? Twitter allows 140 characters, which seems like nothing. It’s pretty much guaranteed that you’ll be able to get nothing meaningful out of so few bits, right?
Well, he came up with this, using a bunch of clever tricks: using the full Unicode range for “characters” (Chinese, etc.) to squeeze a few more bits’ worth, representing colours as blends of just 8 colours (3 bits!), and arriving at a Voronoi triangulation through a genetic algorithm:
The one on the right is the real Mona Lisa, and the left one is what fits in 140 characters, specifically the message: “圑嘌婂搒孵怤實恄幖戰怴搝愩娻屗奊唀唭嚟帧啜徠山峔巰喜圂嗊埯廇嗕患嚵幇墥彫壛嶂壋悟声喿墰廚埽崙嫖嘵奰恛嬂啷婕媸姴嚥娐嗪嫤圣峈嬻尤囮愰啴屽嶍屽嶰寂喿嶐唥帑尸庠啞彐啯廂喪帄嗆怠嗙开唅恰唦慼啥憛幮悐喆悠喚忐嗳惐唔戠啹媊婼捐啸抃岖嗅怲幀嗈拀唹坭嵄彠喺悠單囏庰抂唋岰媮岬夣宐彋媀恦啼彐壔姩宔嬀”
This is pretty impressive, you’d think, for 140 characters. But it gets better. Brian Campbell started a contest on Stack Overflow, and some brilliant approaches turned up.
Boojum wrote a nanocrunch.cpp, based on fractal compression, which can do this (on the left is the original, for comparsion):
Sam Hocevar wrote img2twit, which segments the image into square cells and tries to randomly assign points and colours to them until something is close. It can do this:


img2twit by Sam Hocevar (250 bytes?)
You can watch a movie of the image evolving; it’s pretty cool!
There were also attempts at converting the image to a vector format and encoding that instead. Needless to say, it works well for vector-like images:

(almost perfect!)
but it’s hard to even convert some images to vector form:
by autotrace (before compression!)
Finally, this is how Dennis Lee’s record-holding “optimizing general-purpose losy image codec” DLI does:
Or if you want to be fair and compare at 250 bytes, here’s img2twit and DLI:
Amazing!
For silly amusement, you can read a liberal translation of the original message, or the Reddit thread with ASCII porn.
Disclaimer: I did not participate in any of this, and I know nothing about image compression, so no doubt there are errors in the above. Please point them out. All images are copyright the respective owners, and the quote in the first line is by Brian Campbell on Stack Overflow.
Reading aloud
There’s this poem, which you can read comfortably but trying to read which aloud is torture:
I take it you already know,
Of tough and bough and cough and dough.
Others may stumble, but not you,
On hiccough, thorough, laugh and through.
Well done! And now you wish, perhaps,
To learn of less familiar traps.Beware of heard, a dreadful word,
That looks like beard and sounds like bird.
And dead: it’s said like bed, not bead —
For goodness’ sake, don’t call it ‘deed’!
Watch out for meat and great and threat,
(They rhyme with suite and straight and debt).A moth is not a moth in mother,
Nor both in bother, broth in brother.
And here is not a match for there,
Nor dear and fear for bear and pear.
And then there’s dose and rose and lose –
Just look them up – and goose and choose.
And cork and work and card and ward,
And font and front and word and sword.And do and go and thwart and cart –
Come, come, I’ve hardly made a start!A dreadful language? Why man alive!
I’d mastered it when I was five.
Alternative last verse:
A dreadful language? Why, man alive!
I’d learned to talk it when I was five.
And yet to write it, the more I tried,
I hadn’t learned it at fifty-five.
So this poem is about spelling not corresponding to pronunciation and vice-versa. Wikipedia cites it as “From a letter published in the London Sunday Times in 1965 [...] The author was only listed by T.S.W.”, but it’s at least as old as 1961, possibly much older.
The other poem is called The Chaos, and it’s by the Dutch teacher Gerard Nolst Trenité, illustrating how impossible it is to deduce pronunciation from spelling. It makes you doubt the pronunciation of many words you think you know. :-) He first published it in 1920, with 164 lines, and revised it many times until his death in 1946 (274 lines). It’s quite painful to read, so skim when it gets unbearable and save the rest for another sitting. Prof. David Madore has a version here, with the first few verses in IPA for AmE and BrE. What follows is a random excerpt only!
Dearest creature in creation
Studying English pronunciation,
I will teach you in my verse
Sounds like corpse, corps, horse and worse.
I will keep you, Susy, busy,
Make your head with heat grow dizzy;
Tear in eye, your dress you’ll tear;
Queer, fair seer, hear my prayer.
[...]
Sword and sward, retain and Britain
(Mind the latter how it’s written).
Made has not the sound of bade,
Say—said, pay—paid, laid but plaid.
Now I surely will not plague you
With such words as vague and ague,
But be careful how you speak,
Say: gush, bush, steak, streak, break, bleak,
[...]
Say, expecting fraud and trickery:
Daughter, laughter and Terpsichore,
Branch, ranch, measles, topsails, aisles,
Missiles, similes, reviles.
[...]
Billet does not end like ballet;
Bouquet, wallet, mallet, chalet.
Blood and flood are not like food,
Nor is mould like should and would.
[...]
Liberty, library, heave and heaven,
Rachel, loch, moustache, eleven.
We say hallowed, but allowed,
People, leopard, towed but vowed.
[...]
Stranger does not rhyme with anger,
Neither does devour with clangour.
Pilot, pivot, gaunt, but aunt,
Font, front, wont, want, grand and grant.
[...]
Say inveigh, neigh, but inveigle,
Make the latter rhyme with eagle.
Mind! Meandering but mean,
Valentine and magazine.
[...]
Don’t be down, my own, but rough it,
And distinguish buffet, buffet;
Brood, stood, roof, rook, school, wool, boon,
Worcester, Boleyn, to impugn.
[...]
Nor are proper names included,
Though I often heard, as you did,
Funny rhymes to unicorn,
Yes, you know them, Vaughan and Strachan.
[...]
Please don’t monkey with the geyser,
Don’t peel ‘taters with my razor,
Rather say in accents pure:
Nature, stature and mature.
[...]
Though the difference seems little,
We say actual, but victual,
Seat, sweat, chaste, caste, Leigh, eight, height,
Put, nut, granite, and unite.
[...]
Say aver, but ever, fever,
Neither, leisure, skein, receiver.
Never guess—it is not safe,
We say calves, valves, half, but Ralf.
Starry, granary, canary,
Crevice, but device, and eyrie,
Face, but preface, then grimace,
Phlegm, phlegmatic, ass, glass, bass.
[...]
Mind the O of off and often
Which may be pronounced as orphan,
With the sound of saw and sauce;
Also soft, lost, cloth and cross.
Pudding, puddle, putting. Putting?
Yes: at golf it rhymes with shutting.
Respite, spite, consent, resent.
Liable, but Parliament.
Seven is right, but so is even,
Hyphen, roughen, nephew, Stephen,
Monkey, donkey, clerk and jerk,
Asp, grasp, wasp, demesne, cork, work.
[...]
Pronunciation—think of Psyche!—
Is a paling, stout and spiky.
Won’t it make you lose your wits
Writing groats and saying ‘grits’?
It’s a dark abyss or tunnel
Strewn with stones like rowlock, gunwale,
Islington, and Isle of Wight,
Housewife, verdict and indict.
Don’t you think so, reader, rather,
Saying lather, bather, father?
Finally, which rhymes with enough,
Though, through, bough, cough, hough, sough, tough?
Hiccough has the sound of sup.
My advice is: GIVE IT UP!
There’s another version here. More poems here.
All of which reminds me of the following (true) story about reading aloud. In the 4th century, where apparently it was common practice for everyone to read aloud, St. Augustine encountered a man (Bishop Ambrose) who read silently! He didn’t even move his lips! You couldn’t hear his voice while reading even if you stood very close to him! As Augustine reports (and it’s a matter of debate whether in amazement or in distaste):
When he read, his eyes scanned the page and his heart sought out the meaning, but his voice was silent and his tongue was still.
(Might want to take a look at this chapter from Alberto Manguel’s A History of Reading.)
Finally, if I may rant again about spelling pronunciation: the character ~ is written “tilde”, but I wish people would stop calling it “till-day” or “tilled”! It is pronounced “til-duh”, as in the Australian ballad: “Waltzing Ma~, Waltzing Ma~…” or the name of the actress ~ Swinton (literally?)
TODO: Read about “the very notion of silent, individualized reading is scarcely known prior to the advent of the printing press (Goody and Watt: 42)” That’s Goody, Jack, and Watt, Ian, 1968, “The Consequences of Literacy.” In Literacy in Traditional Societies, edited by Jack Goody, pp. 27-68. Cambridge University Press. This is from Thomas Coburn, “Scripture” in India: Towards a Typology of the Word in Hindu Life, p.437. He goes on:
there has never been a happy marriage between the holy words of India, composed and transmitted orally, and the writing process. Particularly in contrast with, say, China, scribes in India have been of low social standing (Lancaster: 224-25), and the very act of writing was held to be ritually polluting: a late “Vedic text, the Aitareya Aranyaka (5.5.3) states that a pupil should not recite the Veda after he has eaten meat, seen blood or a dead body, had intercourse or engaged in writing” (Staal, 1979:122-23). The profoundly spoken character of India’s holy words is a matter on which we will reflect below, but for the moment it will suffice to note that we should not be misled by the fact that most of these words have eventually found their way onto the written or printed page. This is not their primary home, and Staal is not simply being mischievous in discerning a symbolic significance to the fact that Indian books “still tend to fall apart” (1979:123).
mplayer: changing speed without changing pitch (avoiding the chipmunk effect)
In mplayer, you can change the playback speed with [ or ], but that probably changes the pitch as well (naturally). Can be amusing the first time, but not after you realise that it is actually possible to do something sophisticated to avoid this. (Wikipedia calls it Audio timescale-pitch modification) I’ve heard Windows Media Player(?) can do this automatically (is this true?), here’s how to do it in mplayer.
Short answer:
Start mplayer as mplayer -af scaletempo
That’s it. The catch is that you need to get an mplayer which has the scaletempo filter, and we know how much the mplayer project loves making releases. (It’s not in Ubuntu at the time of writing.)
So, either
Get such an mplayer
e.g the deb from Sourceforge (here),
or
Start mplayer as mplayer -speed 1.5 -af ladspa=tap_pitch:tap_pitch:0:-33:-90:0 foo.avi
Seems even the latter might require installing the ladspa plugins.
For more on all this, see:
- blog comments (with patches) at Pitch-Correct Play Speed with MPlayer
- Change MPlayer Playback Speed
- Mplayer FAQ: “How do i change mplayer speed but keep pitch the same?”
First thoughts on Google Wave
Just saw the demo for Google Wave. It’s impressive and ambitious. It’s hard to describe, but it’s a collaborative real-time thing (think Google Docs for everything) that can work like email, IM, blogs, forums, whatever you want — and can be embedded into, or integrates with, apparently everything: Orkut, Blogger, Google Maps, Google Code (the bug tracker), Twitter, etc. (They’ve already fulfilled the annoying-word requirement, by creating “twave”.)
They say it’s a “product, platform and protocol”.
I can see myself using this. (And thinking of the privacy implications (or the having-your-data-out-there-in-the-cloud-somewhere implications), it’s bloody scary.)
They’ve got pretty amazing sync. Search results and messages get updated in real time character-by-character, and the latter seems to make people cheer as if they’ve never seen good old talk.
Finally someone had the “playback” idea I have been trying to propose for years. (I was calling it the “undo bar” or “edit history bar”, or more recently “Time Machine for Emacs”, but whatever.) You can “play back” the edit history of a document (“wave”), seeing what changes each person made and in what order, and when the “wave” is a chess game, you can play back the chess game. Perfect.
They variously say it will be open-sourced, or that “a lion’s share of the code” will be open-sourced, but let’s hold off believing that until we see it. It’s extensible, so you can add your plugins to it. It’s a protocol, so you can write your own implementations of it. It’s a platform, so you can run it on your own servers. Now someone add a LaTeX compiler to it, and collaborative work with LaTeX will finally be possible.
If you have 80 minutes to spare, here’s the video, or an article at TechCrunch.
Giving credit
V. I. Arnold, On teaching mathematics:
What is a group? Algebraists teach that this is supposedly a set with two operations that satisfy a load of easily-forgettable axioms. This definition provokes a natural protest: why would any sensible person need such pairs of operations? [...]
What is a smooth manifold? In a recent American book I read that Poincaré was not acquainted with this (introduced by himself) notion and that the “modern” definition was only given by Veblen in the late 1920s: a manifold is a topological space which satisfies a long series of axioms.
For what sins must students try and find their way through all these twists and turns? Actually, in Poincaré’s Analysis Situs there is an absolutely clear definition of a smooth manifold which is much more useful than the “abstract” one.
(Interesting talk, do read.)
Meanwhile…
Bill Poser at the Language Log:
Sir William Jones is incorrectly viewed as the discoverer of the Indo-European language family and founder of modern historical linguistics [...]
The second and more important point is that Jones cannot be considered the founder of modern historical linguistics because he did not use the comparative method, the crucial innovation that distinguishes modern historical linguistics from its predecessors.
Sigh. Let’s not forget people who actually caused us to perceive the world differently, and leave it to pedantic types to define who invented what.
Read the rest of this entry »
Music and lyrics
I attended a talk today by Adriano Garsia, which was part of the MIT combinatorics seminar. It was called “A New Recursion in the Theory of Macdonald Polynomials”, and while I didn’t know what Macdonald polynomials were, I went to the talk anyway, because I like polynomials and I like recursion and I like combinatorics (but primarily because it was a way of procrastinating). :-)
Even though I understood almost nothing of the deep mathematics in the talk (and still don’t exactly know what Macdonald polynomials are), it was a very pleasant and refreshing talk, and I felt very good after hearing it. The reason is that it had, of all the talks I’ve attended in recent memory, probably the best “music”. What does that mean? As Prof. Doron Zeilberger invented the term:
Human beings have bodies and souls. Computers have hardware and software, and math talks have lyrics and music. Most math talks have very hard-to-follow lyrics, [...]
But like a good song, and a good opera, you can still enjoy it if the music is good. The “music” in a math talk is the speaker’s enthusiasm, body-language, and off-the-cuff heuristic explanations.
Sometimes you can recognize a familiar word, and relate it to something of your own experience, whether or not the meaning that you attribute to it is what the speaker meant, and this can also enhance your enjoyment.
(read more at Zeilberger’s Opinion 78)
And so it was with this talk. Prof. Garsia clearly loved the subject, and even someone like me who had no idea what’s going on felt compelled to listen, fascinated. He told us how the problem came about (“long relationship with Jim Haglund: he makes brilliant conjectures and I prove them”), of false proofs they had had, of how their current proof was driven by heuristics and unproven conjectures, he even posed a problem and offered a $100 reward for an elementary/combinatorial proof. :-)
Far better than the talks with bad music and bad lyrics. (It also helped that although I couldn’t understand the lyrics, they sounded nice: permutations, Young tableaux, polynomials defined in terms of them…)
Edit: See also the recent research ’showing’ that gestures help students learn mathematics.


![Boojum-dec by Boojum [490 bytes]](http://shreevatsa.files.wordpress.com/2009/05/boojum-dec.png?w=227&h=343)

