Year: 2007

Why didn’t I think of that, pt. k + 7

Posted by – December 1, 2007

What would a conference built around the computer graphics industry be like? Pretty boring, right? There’d be talks on eking out another million triangles per second or whatever they do these days, with boring engineers talking about slightly larger and faster registers and pipelines so kids can play slightly more elaborate computer games or whatever. Dead wrong. That conference is SIGGRAPH (Special Interest Group on GRAPHics and Interactive Techniques) and it’s batshit insanely cool.

The most shocking thing about innovations in computer graphics (understood pretty widely, mind) is that they’re so simple and obvious once you hear about them. You really notice that as a field of study it’s actually pretty young. Example: content-aware image resizing. It was presented at SIGGRAPH 2007 and it appears to be a totally novel and simple idea about how to naturally destroy or create information in images.

It works something like this:
1) Detect edges in the image (borders between areas of colours). There are numerous algorithms to do this.
2) For each pair of pixels opposite each other at the top and bottom of the image, find a path from one to the other that crosses the least edges in the image. This is called the least-energy path and it contains “the least information”. (Everything works the same way if you want to destroy/create horizontal lines, just use pixels at the sides).
3) If you want to reduce the image horizontally, remove paths (the previously computed least-energy ones) from the image starting from the one with the least energy. To enlarge the image, take the path with the most energy, compute the average of that and its highest-energy neighbour and insert it between them.

Pretty simple, right? And does it work well? Like magic. The video has numerous interesting details I omitted here.

Now, this is more cute than really interesting, but still: what do you think this inequality describes?

(the square brackets without tops represent the floor function)

Well, the outermost modulo operation is of the form mod( f(x,y), 2 ) so perhaps it codes information from x and y into bits somehow. Almost, but not quite. Let n be an integer and graph the points for which the inequality is true in the plane-slice 0 < x < 106 and n < y < n + 17. This will draw information contained in n - in fact an arbitrary image that fits into a 105x16 grid. For n = 9609393799189588849716729621278527547150 0433966012930665150551927170280239526642 4689642842174350718121267153782770623355 9932372808741443078913259639413377234878 5773574982392662971551717371699516523289 0538221612403238855866184013235585136048 8286933379024914542292886670810961844960 9170518345406782773155170540538162738096 7602565625016981482083418783163849115590 2256100036523513703438744618483787372381 9822484986346503315941005497470059313833 9226497249461751545728366702369745461014 6559979337985374831437868418065934222278 98388722980000748404719, the inequality describes a little picture of the formula of the inequality itself:


As I say, cute. This and more is detailed in a SIGGRAPH paper here.

Puzzlin’ evidence

Posted by – November 30, 2007

Onko todellinen islam rauhanomaista? Kuuluuko naispappeus tai homouden hyväksyminen oikeasti kristinuskoon? Miksi ei-uskikset viitsivät analysoida uskisten touhuja uskisnäkökulmasta? Haastavia kysymyksiä. Paitsi että uskisten touhuissa ei ole mitään järkeä, ne eivät yleensä perustu mihinkään perustekstiin (toisin kuin luvataan) eikä niissä ole mihinkään tiettyyn tavoitteeseen suuntautuvaa johdonmukaisuutta. Esimerkiksi Suomen valtionkirkko on oleellisesti kerho tai yhdistys jonka jäsenistö päättää sen kannat (vähän kuin valtio itse, paitsi että kirkkoon ei ole pakko kuulua). Raamatulla ja perinteillä on lähinnä symboliarvoa.

Tässä kaksi laajemman yleisön mielipidettä suomalaisista kirkoista:
1) Luterilainen naispappeutta vastustava vähemmistö vihaa naisia, elää menneessä ja ansaitsee tulla karkotetuksi kirkosta.
2) Naispappeutta vastustava ortodoksikirkko on viehättävän vanhanaikainen, perinteikäs ja mystinen eikä sen naispappeuden vastustamiseen pidä puuttua.

Korostan, että tällaisia kantoja on muillakin kuin näihin asioihin varsinaisesti sitoutuneilla; niiden tyypillisin edustaja on Suomen valtionkirkon jäsen joka ei likimain ikinä käy kirkossa, lue Raamattua tai ajattele Jumalaa. Aika moni kirkkoihin kuulumatonkin on juuri tätä mieltä. No, kaikki tietysti tietävät mistä nämä kannat johtuvat. Jos joku ei tiedä, tässä apukysymys: miten sama ihminen voi toivoa parempaa sukupuolten välistä tasa-arvoa, rauhaa ja rakkautta ihmisten välille ja ymmärrystä islamille?

HS kertoo tänään että Helsingin seurakuntayhtymä aikoo lopettaa Suomen Luterilaisen Evankeliumyhdistyksen tukemisen. Tähän asti tuki on ollut noin 200 000 euroa vuodessa. Mitä SLEY tällä rahalla tekee? Saarnaa evankeliumia Suomessa ja muualla, rakentaa kirkkoja Afrikassa, opettaa evankelisissa kansanopistoissa ihmisille kristinuskosta, kustantaa uskonnollista kirjallisuutta. Kaikenlaista millä voidaan viedä kristinuskoa mahdollisimman lähelle ihmisiä mahdollisimman monessa paikassa, kuten Uusi Testamentti (kai) kehottaa. Miksi HSRKY lopettaa tuen? Koska se on tajunnut että 200 000 eurolla voisi tehdä jotain humaanimpaa, esimerkiksi järjestää kodittomille asuntoja tai mainostaa itseään NYT-liitteessä? Ei, vaan koska SLEY vastustaa naispappeutta.

Vielä yksi kysymys: Sam, idiootti, mitä valittamista tässä nyt on? Eikö sinusta ole hyvä asia että Suomen suurin kirkko on vaarattomaksi tehty keskustelukerho kun uskonnon vaikutus voisi olla niin paljon pahempi? Mitä väliä sillä on mitä mieltä joku on jonkun kirkon kannasta X? Eikö ole hienoa että kirkko ampuu itseään jalkaan evankelisoimisyrityksissään? No joo, onhan se. Mutta epäilen että kaiken uskonnon taustalla on pohjimmiltaan sama tietämättömyys tai irrationaalisuus; Suomessa lähinnä irrationaalisuus. Jotenkin toivon että jos uskonnollinen ihminen pystyy näkemään yhden uskontoon liittyvän asian irrationaalisuuden, tulee yhä helpommaksi nähdä ettei koko jutussa ole mitään järkeä. Siksi kannattaa vaatia rationaalisuutta kirkoltakin.

Circle insect meat pyramid sex

Posted by – November 29, 2007

This is a total meta-post, so just skip it unless you’re bored.

My previous post made me think of two things:

Where did that thing in the subject come from? Least pessimum? I’ve just remembered it’s an adaptation from The Story of Mel, an excellent and rather long programming anecdote. Excerpt:

Mel never wrote time-delay loops, either, even when the balky Flexowriter required a delay between output characters to work right. He just located instructions on the drum so each successive one was just *past* the read head when it was needed; the drum had to execute another complete revolution to find the next instruction. He coined an unforgettable term for this procedure. Although “optimum” is an absolute term, like “unique”, it became common verbal practice to make it relative: “not quite optimum” or “less optimum” or “not very optimum”. Mel called the maximum time-delay locations the “most pessimum”.

The other thing was that optimism bias made me think of sexual strategies, which made me think of the best spam email I ever received. It advertised, among other things, the best combination of sex drugs ever: NYMPHOMAX and SUREGASM. I mean, that could be straight out of The Simpsons.

Also: the subject “line” of this post is the subject of a spam message I received this morning.

Evolutionarily least pessimum wins?

Posted by – November 29, 2007

Half Sigma has been writing about optimism bias recently. I found a post about the tendency to overestimate one’s intelligence to be especially striking. A chart I stole from it:

Frequency Distribution
Cells contain:
-Column percent
-N of cases
Distribution
V174 1: FAR BLOW:(1) 1.1
150
2: BELOW AV:(2) 1.5
216
3: SL BELOW:(3) 4.3
597
4: AVERAGE:(4) 31.4
4,389
5: SL ABOVE:(5) 24.9
3,476
6: ABOVE AV:(6) 28.6
3,993
7: FAR ABOV:(7) 8.3
1,158
COL TOTAL 100.0
13,979

The chart tells you what amount of subjects self-assessed themselves to be in which “intelligence group”. The study was on US high school seniors who I guess might be more optimistic than Finnish kids, but still. Under seven percent of subjects considered themselves to be below average in intelligence and over sixty percent considered themselves to be above average. Almost any way you interpret this, if someone tells you they’re of above average intelligence, the best assumption you can make on that information alone is that they’re not.

An interesting question about optimism bias (like this) is its cause. My first idea was an evolutionary explanation: that optimistic males will try out more things and be more adventurous – in particular they’ll go after more females even after failure. For well-known biological reasons it would then make sense for females to have a smaller optimism bias than males, but this is not supported by evidence (in humans). Maybe it happens with other animals?

Anyway, it seems possible that the majority of optimism bias in humans is caused instead by humanness, ie. culture, society and so on. But how can this be? I’ve always assumed that it would be extra painful to have a high opinion of oneself and to be proven wrong all the time. Perhaps it’s even more painful to self-admit one’s mediocrity/suckiness.

As for the intelligence thing: I’ve always kind of assumed that I scrape into “above average”, but considering this I’m not so sure anymore. The only real way to know is to get tested, and I don’t want to. Too scary.

Niggardly Fagerström

Posted by – November 28, 2007

I recently came across someone writing that a book he was reading was “so old that it even uses the word ‘niggardly’ with no apparent shame.” I wondered why that would be a sign of age, and soon came across a Wikipedia page about how controversial the word is. Turns out that although it has absolutely nothing to do with the word “nigger”, a series of misunderstandings have now given it a “dangerous” reputation.

From the article:
On January 15, 1999, David Howard, a white aide to Anthony A. Williams, the black mayor of Washington, D.C., United States, used the word in reference to a budget. This apparently upset one of his black colleagues (identified by Howard as Marshall Brown), who incorrectly interpreted it as a racial slur and lodged a complaint. As a result, on January 25 Howard tendered his resignation, and Williams accepted it. […] another controversy erupted over the use of the word at the University of Wisconsin, Madison. At a February meeting of the Faculty Senate, a junior English major and vice chairwoman of the Black Student Union told the group how a professor teaching Chaucer had used the word […] She said the professor continued to use the word even after she told him that she was offended. “I was in tears, shaking,” she told the faculty. “It’s not up to the rest of the class to decide whether my feelings are valid.” […] In late January or early February 2002, a white fourth-grade teacher in Wilmington, North Carolina was formally reprimanded for teaching the word and told to attend sensitivity training.

Illiteracy has discovered a new way to destroy language.

After first thinking how obviously the word should be defended by all right-thinking people I realised that it’s actually not all that different from “real” racial slurs that used to be non-offensive. Dickens and Conrad used “nigger” with no pejorative intent (above from actual disdain they may have had for blacks – compare “Nazi” about Nazis), but now the word is absolutely impermissible. This kind of negative drift happens to any word that refers to things that most people dislike (“retard”, “homo”, “cripple”), so from time to time the old word is thrown out because it has become dirty and a new one is chosen. This way we can pretend everyone doesn’t actually hate people who are different.

I’ve always considered this practice to be rather pointless but I go along with it anyway, just to be polite (I still use the word “retarded” – another word that often means something else than illiterate people think and causes confusion). But if people now do start to take offense at “niggardly”, what is one to do? If non-pc words have to be discarded just because they have taken on pejorative meanings, why not this one? I don’t see how the extra idiocy damages the basic “no one is allowed to hurt anyone’s feelings” argument.

Due to these musings I’m tempted to reverse my position on political correctness in general, but it’s probably wisest to accept that these things just don’t work logically and I have to take what I can get. In the British-speaking world “niggardly” should be ok for another decade or so – then it’ll probably be time to fight for language like “kill child” when discussing processes (you know, in computers).

A kind of magic

Posted by – November 28, 2007

One of the more curious things I’ve discovered in HAKMEM:

Although not new (cf Coxeter, Introduction to Geometry, 1st ed. p393), the following coloring number (chromatic number) may be useful to have around:

N = [[(7 + sqrt(48 H + 1))/2]]

where N is the number of colors required to color any map on an object which has H holes (note: proof not valid for H = 0)

(Beeler, M., Gosper, R.W., and Schroeppel, R. HAKMEM. MIT AI Memo 239, Feb. 29, 1972)

[Note: “color” here means “colour so that no two regions that share a length of border have the same colour”. “Map” means map in the intuitive sense; a partition into sensible sorts of bits of the surface. Think countries on a map of the world. The outermost square brackets mean the floor function (the greatest integer less than the function’s argument).]

Isn’t that cool? HAKMEM is obviously not all that mathemathically sophisticated; it doesn’t tell you what kind of object. I guess in this case it’s just bounded and connected and stuff, in R^3. There’s probably also some nuance to do with the concept of “hole”. But to think that this can be found in a book called Introduction to Geometry! Further evidence that all math books have “introduction”, “elementary”, “approach” or something similar in the title just to make everyone feel small.

If you’re having difficulties picturing this, think about a torus. The hole is one extra way for each region to “come around” to meet each other (in contrast to regions in the plane), but one is “stuck in the middle” so the chromatic number is 7.

Another way of thinking about the torus: start by drawing a band of colour around the entire outer rim of the torus. The rest is now split into two “colourable planes” that can conflict through the hole, so you need 4 + 4 – 1 colours (the outer rim gets counted twice, once for each plane, so we subtract it once).

If this kind of thing is totally new to you, get some paper and try to find out how many colours you need (at most) for a map in two dimensions, ie. a plane.

Question: how would this work in R^n?

On social discomfort

Posted by – November 27, 2007

Question: do people find it easier to be around friends than non-friends? Shurely.

If you know me, you probably know that it’s difficult for me to be comfortable around other people. There are many reasons for this and it’s a pretty common characteristic. But this is odd: it’s not particularly better around friends. I even feel a kind of special pressure to make the situation function, to keep everyone from getting embarrassed or bored (by me). This is a pretty stupid way to think about one’s friends, but I do it anyway.

Does this mean that I don’t really think of my friends as friends, but as social obligations? I don’t know, maybe. Probably not. It’s not as if I feel obligated to get into many more social situations than I want to (if you know me you probably also know that I seldom go anywhere or do anything).

Probably the reason I can sometimes be oblivious to social pain around non-friends is that I care about them less, and (these days) have sufficient self-confidence to think that maybe they’re bored because they’re boring.

Bottom line: it sucks to care about people.

Anything to facilitate your velocitous extramuralisation

Posted by – November 27, 2007

Internetissä vastaantullut Shakespearepulma:

Ay, but to die, and go we know not where;
To lie in cold obstruction and to rot;
This sensible warm motion to become
A kneaded clod; and the delighted spirit
To bathe in fiery floods, or to reside
In thrilling region of thick-ribbed ice;
To be imprison’d in the viewless winds,
And blown with restless violence round about
The pendent world; or to be worse than worst
Of those that lawless and incertain thought
Imagine howling: ’tis too horrible!

(Measure For Measure)

Kysymys on parista viimeisestä säkeestä (jätin alkuosan kontekstin vuoksi). Ensilukemalta imaginen subjekti pitäisi olla those, mutta mitä siinä tapauksessa thoughtattiin lawlessiksi ja incertainiksi? Ja jos imagine-rivi on jonkinlainen irrallinen imperatiivi, mitä sitä edeltävä rivi yleensä tarkoittaa? Tavattuja ehdotuksia:

-kuinka lawlessia ja incertainia kuvitella osansa huonommaksi kuin edellä mainituissa skenaarioissa; kuvitelkaa helvettiin joutuneiden ulvontaa!

-joutua kärsimään pahempaa kuin heikko-/tylsämielisten latteana ulvontana esiintyvät kuvitelmat ovatkaan

-olisi liian kamalaa kuvitella kuinka ulvovatkaan ne jotka ovat eläessään ajatelleet lawlessisti ja incertainisti

-joutua kärsimään pahempaa kuin ne jotka ihmisten villien kuvitelmien mukaan ulvovat helvetissä, eli jotain ihan liian horriblea

Huvittavaa kyllä, viimeinen näistä on luultavasti oikein. Koko juttu selvenee jos kirjoittaa thoughts. Tällaista ei ilmeisesti tarvinnut olla Shakespearen aikaan, vaan voi ekspandoida tyyliin “lawless thought and incertain thought”. No joo.

Ja check this out:

[White “NN”]
[Black “Traubert”]
[Result “0-1”]

1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Nbd2 Bd6 7. h3

…Ng3 8. fxg3 Bxg3+ 9. Ke2 Nc6 10. Kd3 O-O 11. Kc3 Qe7 12. a3 a6 13. Qe2 Qf6 14. Nb3 h6

15. Bd2 Bf5 16. Be1 Rfe8 17. Qd1 Bd6 18. Bf2 b5 19. Bd3?? b4+ 20. Kd2 Bf4+
0-1

Kinds of goodness

Posted by – November 26, 2007

What I meant to say about Freaks and Geeks was that it is good in the way normal people who love what they’re doing come up with. It’s crafted but often flawed, opaque, meaty, mostly obvious and simple. Warm. It makes you feel good and, in this particular case, happy. If you like the people behind it you end up liking the thing, and as previously mentioned, I like Freaks and Geeks. But I can accept that plenty of people aren’t particularly impressed (it got cancelled 2/3 through the first season due to poor ratings).

Then there is a kind of goodness that is more scary than “nice”. Bach doesn’t sound good because he loved what he was doing, he sounds good because he’s on a mission from God. He was prolific to the point of nonchalance, he doesn’t seem to have made a lot of fuss about himself and he probably wasn’t much fun to be around. But there can’t be a composer, musician or serious music listener who isn’t impressed by his work. It just sounds perfect.

Of course, there’s no tv equivalent of Bach (as far as I know). A television show is too complicated a thing to make with a “perfect” touch. Maybe something like Angels in America represents a serious attempt. Sopranos is also obviously distinct from what I described earlier (I’ll call it “Tarantino-good”) – it’s too huge, organised, expensive and Shakespearian to allow a brief description of motivation or nature.

Freaks & Geeks

Posted by – November 26, 2007

My reassuringly expensive Freaks and Geeks box set arrived. The plastic case is pretty badly broken; worse luck. I’m trying to decide whether I want to live with the temporary hassle of sending it back and getting a new one or with the lifelong frustration of owning such a cruel combination of perfection and imperfection.

But what I really wanted to do here was to quote Judd Apatow (executive producer) from the enclosed booklet:

Q: Is this the end of Freaks and Geeks?
A: No. I shall use the warm feelings that this country showers on this show to prolong my career well past the point where I have stopped making quality work. I will use the credit to secure a job on a mediocre sitcom, where I will not pitch any jokes in the writers’ room. Instead I will bore everyone with stories about the making of Freaks and Geeks and make sure to mention at least twice a night that that show was much better than this show. When the show is cancelled, I will be unable to secure another job and will be forced to teach at USC, where I will make the kids listen to the commentary tracks on this DVD over and over and over and over, never listening to their screams for mercy.

Quentin Tarantino said it and I always believed it (and shall now paraphrase it): if you really love what you’re doing, you can’t help being good.

edit: I didn’t really mean “perfection”, I meant something else. I’ll try to come up with another word.