Tag: english

Flag diacritics

Posted by – May 11, 2009

As some readers will be aware, I’ve been “implementing flag diacritics” at my new job. This post is all about what that means.

We have a reader program which reads in morphological transducers and uses them to analyse words. A morphological transducer is a (representation of a) collection of rules about a language’s inflection. For example, if you give the French morphology transducer we have the word déclare it will output:

déclarer+verb+singular+imperative+present+secondPerson
déclarer+verb+singular+indicative+present+firstPerson
déclarer+verb+singular+indicative+present+thirdPerson
déclarer+verb+singular+subjunctive+present+firstPerson
déclarer+verb+singular+subjunctive+present+thirdPerson

From morphology alone we don’t know which of those is right (that’s a matter for another blog post), but those are the only possibilities. For example “déclarer+verb+singular+indicative+present+secondPerson” doesn’t appear because that would be (tu) declares.

Flag diacritics are a way to express long-distance morphological rules. For example, let’s say you have a language with productive compounding (one in which lots of words can form compounds with each other, like Finnish) and in which grammatical suffixes vary according to whether another word is going to be compounded onto them. A simple way to express this is to add a marker to one class of suffixes saying “another noun must be compounded onto this” and not to have it in the other class. In the Sámi morphology there’s something like this going on (but with noun-verb-compounding) and it’s controlled with the following flag diacritics:

@P.NeedNoun.ON@
@D.NeedNoun.ON@
@C.NeedNoun@

As you might have guessed, flag diacritics are always delimited by @-signs. @P.NeedNoun.ON@ means “set the NeedNoun feature to have the value ON”, @D.NeedNoun.ON@ means “if the NeedNoun feature has the value ON, this combination is disallowed” and @C.NeedNoun@ means “clear the value of the NeedNoun feature”. Before support for this was added, the Sámi transducer gave ten analyses for the word láhkaásahus, two of which were:

láhkka+N+SgGenCmp#@P.NeedNoun.ON@ásahit+V+TV+Imprt+Prs+Sg3@D.NeedNoun.ON@#
láhkka+N+SgGenCmp#ásahus@C.NeedNoun@+N+Sg+Nom@D.NeedNoun.ON@#
(# means “word boundary”)

The first one shouldn’t appear at all because first we set NeedNoun to ON (because we’re trying to interpret the ásahus part as a compounding verb which should be followed by a noun) and then disallow it (because we’ve reached the end of the word so we’re not going be compounding any more nouns). The second, however, is ok: first we clear NeedNoun (which changes nothing since it hadn’t been set in the first place), then @D.NeedNoun.ON@ says “NeedNoun must not be set to ON”, which it isn’t. Also we of course shouldn’t be outputting the flag diacritics themselves. The desired output out of those two is therefore

láhkka+N+SgGenCmp#ásahus+N+Sg+Nom#

Out of the ten possible analyses of láhkaásahus six are disallowed by the flag diacritics, so in this case it’s a pretty important rule. For any Sámi enthusiasts out there, the four currently produced analyses are

láhkka+N+SgGenCmp#ásahus+N+Sg+Nom#
láhka#ásahus+N+Sg+Nom#
láhka+N+SgCmp#ásahus+N+Sg+Nom#
láhka+N+SgNomCmp#ásahus+N+Sg+Nom#

The Stasi test

Posted by – May 10, 2009

Grudgingly I have come to accept that family is important. It’s nicer to think that the people you choose to associate with are way more important than a group of people you’re born into, but it’s just not true. There are ways in which friends matter more: they will often have similar interests so you have more to talk about, they’re more likely to understand and accept you as an individual because they’re probably similar to you anyway, they won’t try to control you or make you feel guilty because they don’t think they have any particular authority over you etc. But there’s another important sense in which family seems to win hands down. I call it the Stasi test.

I remember asking my mother as a child about how she’d react if I were suspected of murder, in particular if the evidence seemed to overwhelmingly suggest that I was guilty but I nevertheless claimed to be innocent. In other words, I wanted to know whether she would be biased towards me. She said she guessed she would “have to believe” me. This is the essence of the Stasi test.

In the Stasi test I imagine that I’m living in a “thought control” state in which certain beliefs are punishable and generally considered to be reprehensible and disgusting (or that I’m living in a society that’s even more like that than this one). Let’s say I hold those immoral beliefs and assume that everyone else sincerely considers my beliefs to be evil just like the secret police does. Think 1984. The question is this: which people could I safely reveal those beliefs to, ie. which ones wouldn’t turn me in to the secret police?

I’d like to think that some of my friends wouldn’t, although it’s hard to say which ones. Not necessarily some top slice of closest friends, because there are some pretty morally conscious people among them. They would be able to rise above their affections towards me as a friend in order to fulfil the greater good. But some close friends who generally care more about practicality, immediacy and loyalty than abstract moral values would pass the Stasi test (I am thinking of three people in particular, I wonder if they guess who they are).

But for some reason family doesn’t work like this. No matter what they thought, I just can’t see my immediate family throwing me to the wolves because of my immorality in this situation. Not only does family have this “ultimate bond” characteristic, but it’s very long-lasting and enduring: even when people have been apart for decades they will often recognise each other as family and therefore bonded. The knowledge that you share lots of genetic material with someone overrides a lot of preferences in your brain and makes you care about them and protect them.

I recognise this in myself too: hurt to people I’m genetically invested or vice-versa feels a lot like hurt to me personally. This is about as intrinsic a part of human nature as you can get.

Norm normativity #2

Posted by – May 10, 2009

Previously:
-a prejudice is a particular kind of belief
-some prejudices are valuable to have
-beliefs have variable accuracy and effects

Humans have a tendency to develop prejudices that are especially valuable. People who fail to develop such prejudices are constantly at greater risk from various threats and fail to identify good opportunities.

The most common prejudices about people concern age and gender. Everyone cares about them because those two things typically tell you a lot about a person. If you’re walking down the street alone at night it’s a very different sensation to notice you’re being followed by a 25-year old man than a 10-year old girl (or a 70-year old woman).

How should we evaluate these prejudices about age and gender? To people who have them they are useful. It makes you safer to be a little wary of people you don’t know who are in the age/gender group that commits almost all of the violent crime in our society (of course it’s even better to tune your prejudices more finely; eg. muscularity, drunkedness, tattoos and loudness adjust the threat estimation up). This has the consequence that people in the group in question are seen as threatening even if they’re really no more of a threat than the average person. Nevertheless, most people would probably say we’re better off with the prejudice than without it.

On the opportunity side, most businesses and individuals assume in their dealings that everyone is heterosexual. As opposed to the previous example, this prejudice has a name: heteronormativity. Why do businesses do this? Instead of printing an ad saying “buy your wife this necklace and she will have more sex with you” they could cover other possibilities too, like women who want to extract sex from men by buying them stuff, gay couples and people who like to buy nice things for themselves. They don’t do those things because they think they’re making more money by doing what they’re doing now.

Their underlying assumptions are that most people are heterosexual and that men mostly buy things for women instead of the other way around. As far as I can tell, those assumptions are actually true. This and other practices have the consequence that non-heterosexuals are made to feel weird, and it’s very unpleasant to feel that your sexuality is weird. That’s why some people think this prejudice is wrong and that you shouldn’t make assumptions about anyone’s sexuality. I sympathise with this and try to avoid making gay people feel weird (then again, I feel pretty weird myself), but I can’t make myself not know that nine out of ten people are heterosexual. Or if I can, I don’t really want to. I don’t want to make my map any worse. If I were in the jewellery business I would have to balance the goal of making money with the goal of not making people feel excluded.

In the previous cases prejudice is generally considered to be acceptable, but there are others in which it isn’t. For example, I’m pretty sure racial prejudice is a de facto part of being streetwise in many parts of the world. In the United States, black people commit more violent crime than white people (in the case of homicides by a factor of about six). That is a statistical fact that doesn’t provide any explanations as to why this should be so, but it’s true enough to make most people racists in the sense the word is widely used today. Whether they want to or not, people can’t get this out of their minds and will often react accordingly even if they intellectually believe they shouldn’t be racist. Unlike with sex/age/sexuality, many people believe it’s wrong to even know (or express) this fact because it stigmatises blacks and perpetuates the situation.

I agree that it’s not desirable to stigmatise innocent black people, just like it’s not desirable to stigmatise innocent young males in general. In general the rational thing is to judge people as individuals when you get to know them as individuals. But I don’t make it my goal not to know these things, nor do I make an effort to approach a rowdy gang of Somali youths as if it weren’t a rowdy gang of Somali youths. I don’t believe that would be so much “fighting racism” as “fighting reality”.

The greater fools

Posted by – April 1, 2009


A protester at the G20 summit is too caught up in
changing the world to notice the cameramen

photo: bbc.co.uk

Norm normativity #1.5

Posted by – April 1, 2009

Before I go to #2 I want to briefly discuss belief.

What you believe about the world controls what you do in the world. Therefore, commonly held beliefs shape the way society works. In a sense you could even say that beliefs shape reality, although this can obviously be taken too far. On the other hand, your beliefs are your map of reality. Now, when choosing your beliefs, is it better to choose the best reality or the best map?

I used to think the choice was obvious: you should unconditionally choose the best map. One problem with choosing the best reality is that the less your map corresponds to reality, the more difficult it becomes to alter reality by choosing your beliefs. But that’s not the real reason I chose the map. In fact, there was no real reason, I just thought the truth is important and damn the consequences. I hoped I could learn to control my actions independently of my beliefs and get some of the reality-changing benefits that way.

I have a personal guru. Call this person “Sai”. It has often happened that Sai adopts some belief that seems totally stupid to me, only for me to adopt it as well some time later. Some time ago Sai started talking about choosing beliefs with the aim of getting results in reality. I was quite shocked by this, and in some senses I still think it’s misguided. But Sai’s goals have shown me that sometimes the map is tangled together with reality. This is especially true concerning beliefs about yourself.

A simple example: if you can really believe you’re feeling happy, then you really are happy.

A less simple example: what is the main (or most common) difference between someone who is good at picking up girls and someone who isn’t? Confidence. Believing that you can get the girls doesn’t automatically make it so, but it makes it a bit more so. More importantly, it opens up new ways for your mind to perceive yourself and other people, allowing you to learn and actually become the thing you’re trying to believe you are. Many so-called pick-up artists (PUAs) have taken this approach, and although they end up deluding themselves for a while and frequently losing faith (because that’s what it is), it seems that this is actually a somewhat reliable way to achieve the goal of picking up girls. When that happens, the map is again reconciled with reality.

A less pleasant example: if you don’t believe your personal god has power in the world, he doesn’t. But if you do believe he does and start converting people and making the world conform to your idea of the god, then even after you’re dead people will talk about the god and think about what he wants and continue conforming to the idea of the god. Then, in some twisted sense, the god has come into being in reality.

At some point before the last example the reasonable idea of the map having something to do with the reality (after all, the map exists in reality) becomes a bad guide for behaviour (I would rather be an evil religion-inventor, one who doesn’t even believe in the god himself and just gets everyone else to worship him). In the earlier examples there are tangling effects between the map and reality. There is not that much discrepancy between the two because we’re talking about a part of reality that partly is the map. At the other end of the spectrum we have causal effects between the map and reality. This is where you falsely believe something and trigger some behaviour in yourself that affects reality.

In the case of norm normativity (heteronormativity, white normativity, right-hand-normativity, what have you), tangling effects aren’t very important because we’re primarily talking about society as a whole. When you decide whether to conform to a norm, the tangling effects only affect you but the causal effects affect everyone around you. So in this case beliefs can be simplified to two aspects:

  1. Truth, ie. whether the belief conforms to reality
  2. Consequences, ie. the causal effects of beliefs on society

(As an aside, there are also people who want good maps for their own use but want other people to have beliefs that will make their lives or the world better. For example, many lies are told to modify the social reality to the liar’s benefit. I have also often heard people who don’t believe in God say that it’s still good for “the masses” to believe in God because it makes them behave better and gives them a sense of purpose. They will sometimes tell me I’m arrogant for arguing against people’s well-meaning faith in God because I am trying to take control of “their reality”.)

Further reading:

The end remains in the hand of the puller

Posted by – March 31, 2009

Some time ago I linked to a contentious blog post hosted by Psychology Today regarding height, intelligence and sex. The blogger in question, The Scientific Fundamentalist, seems to like hate mail: here’s another one about the possible innateness of strictly mental sex differences.

Alexander and Hines gave two stereotypically masculine toys (a ball and a police car), two stereotypically feminine toys (a soft doll and a cooking pot), and two neutral toys (a picture book and a stuffed dog) to 44 male and 44 female vervet monkeys. They then assessed the monkeys’ preference for each toy by measuring how much time they spent with each. Their data demonstrated that male vervet monkeys showed significantly greater interest in the masculine toys, and the female vervet monkeys showed significantly greater interest in the feminine toys. The two sexes did not differ in their preference for the neutral toys.

I mentioned a theory about the biology of homosexuality I’d heard about to my sister the biologist a while ago (she was very sceptical). It seems pretty crazy to me too, but I’m still interested because I don’t know of any really satisfying way to explain homosexuality. The basic idea is that a part of homosexuality could be explained by the (surprisingly common) chimerism between mothers and fetuses & multiple fetuses of which some often terminate before birth.

A fun visualisation of the languages people consider incomprehensible, as in “that’s Greek to me” or “täyttä hepreaa”.

For programmers: if you have people telling you whether they like something, what’s the best way to measure overall likedness? Apparently it’s the lower bound of the Wilson score confidence interval for a Bernoulli parameter.

Free facials

Posted by – March 31, 2009

I mentioned previously that “dat ass” had become my favourite facial expression:

I have recently been persuaded of the value of sturgeon face. Witness its power and versatility:




Norm normativity #1

Posted by – March 31, 2009

I am a big fan of accurate preconceptions, stereotypes and the social norms that make use of them. Example: merchants of skin care products in shopping centres don’t try to sell me anything because I’m a man. In other words, they make an assumption about me based on my sex. What are the overall effects of this prejudice? Let’s break it down by customer groups.

  1. Women who are interested in skin care products. They get approached and don’t mind it. The merchants make money out of these people.
  2. Women who aren’t interested in skin care products. They get approached but are bothered by it. The merchants are wasting their time here.
  3. Men who are interested in skin care products. They don’t get approached, but they can always go talk to the salespeople themselves so presumably they don’t mind. The merchants lose money by not targetting this group more aggressively.
  4. Men who aren’t interested in skin care products. They don’t get approached and are happy about it. The merchants save money by not targetting them.

The sizes of these groups and various other variables determine the overall profitability of the prejudice, but it’s probably positive since the skin care people do utilise it. So for them, there is a tangible benefit to having this prejudice. What about the customers? Trivially, if aggressive selling were banned altogether, nobody would be bothered by it. But barring that, this prejudice is also a net positive for the customers because it takes away the bother to group 4 and doesn’t provide bother to anyone extra.

There are those who would say of this and similar situations that the prejudice still shouldn’t exist because making assumptions based on gender is wrong. According to them it’s unfair that women who don’t want to be bothered can’t get the same deal men get. These people are essentially saying that they don’t care about efficiency for anyone else, but only about their needlessly hurt feelings. I can’t support such antisocial views.

Of course, this was a rather simple instance of a useful prejudice. An entry-level prejudice, if you like. If you still find yourself thinking “you shouldn’t be prejudiced”, there is probably no hope for you.

I’ll explain in two words: we intend to marry your daughters

Posted by – February 12, 2009

Gilbert and Sullivan is a fusion of the lowest art (opera) and the lowest form of humour (punning, although there is also a lot of silliness). So why is it so charming?

GENERAL: Tell me, have you ever known what it is to be an orphan?
PIRATES: Oh, dash it all! Here we are again!
GENERAL: I ask you, have you ever known what it is to be an orphan?
PIRATE: Often.
GENERAL: Yes, orphan! Have you ever known what it is to be one?
PIRATE: I say, often!
GENERAL: I don’t think we quite understand one another. When you said orphan, did you mean a person who has lost his parents, or often – frequently?
PIRATE: Hah hah hah! I beg pardon, I see what you mean! Frequently.
GENERAL: Ah hah! You said “often”, frequently.
PIRATE: No, only once.
GENERAL: Exactly. You said “often”, frequently, only once.

I mean, it doesn’t even really make sense.

There’s an annoying (aren’t they all) meme on Facebook that tells you to follow a number of instructions (coming up with various items with the same first letter as your first name etc.). One of the instructions is “you must disobey one of these instructions”. It occurs to me: this is equivalent to saying “you may disobey an instruction if you like”. Perhaps I could get a job as a writer of minimal sets of instructions.

Here’s every swear word from every Sopranos episode ever. It’s about half an hour long. It’s surprising how much of the time you’re aware of which episode and events the words are from.

No more tricks

Posted by – February 11, 2009

Programming used to have a lot to do with little puzzles and tricks; pointer arithmetic, bitmasks and logical operators, writing to video memory etc. Someone once asked me how do you swap the contents of two (numerical) variables without using a third one in between (of course you’d never want to do this anyway, but it’s a “fun” question). The answer is something like this:

a = a+b
b = b-a
a = a+b
b = -1*b

This is how you do it in Python:

a, b = b, a

New-fangled programming languages, eh? (Ok, Python was first released in 1991 which was a long time before I programmed anything, but anyway.)

Apropos of that last notation, this is how you write Euclid’s algorithm in Python (% is the modulo operator):

def euclid(a,b):
        while b:
                a, b = b, a%b
        return a

It’s sickeningly succinct, really. I kind of quite like it, but it kind of feels not very hardcore (comparing to, say, The Story of Mel which I’ve linked to before). Although really it’s just normality by now. Meh, meh.

What makes a man turn neutral? Lust for gold? Power? Or were you just born with a heart full of neutrality?

Wholeheartedly in support

Posted by – February 11, 2009

Chris Lamb writes:

Michael Steinberg writes of the above section (from the Vivace [of Beethoven’s String Quartet in F, Op. 135]):
Then it is time for Beethoven to turn to one of his favourite tricks, the one where he simply picks up an idea boldly and puts it down again on another pitch the way you might pick up your cat and move it from your favourite chair to another.

I am fully in favour of this feline-oriented musical interpretation.

Previously:

Whenever a programmer thinks, “Hey, skins, what a cool idea”, their computer’s speakers should create some sort of cock-shaped soundwave and plunge it repeatedly through their skulls.

I am fully in support of this proposed audio-cock technology.

Computer philosophy

Posted by – February 10, 2009

>>> True or False
True
>>> True and False
False
>>> True = False
>>> not True or False
True
>>> not not not not not not False
False
>>> True/False
Traceback (most recent call last):
File “<stdin>”, line 1, in
ZeroDivisionError: integer division or modulo by zero

It’s like that

Posted by – February 5, 2009

As we enter week 31 of grey skies, icy pavements and frozen bicycle cables I am starting to appreciate some of the upsides of, say, Jamaica, where England’s tour of the West Indies has just started (England are 241 for 5). Here’s some white man reggae about cricket and getting mugged to get in the mood:


But really, I kind of like the miserable parts of the year. As someone told me on the Internet, you can build discipline the same way you build muscle: go out of your way to do things you don’t want to. So winter is kind of like discipline training, and heaven knows I want more of that.

What I’d also want is a trainee position in a good company or research project involved with language technology. Unfortunately I’ve been studying it for too short a time for the official university-sponsored ones, but maybe I can find a way to insinuate myself anyway.

A perhaps even worse cultural assault than white man reggae: the Russian roots of breakdance.

Poetry club: Portrait of a Lady

Posted by – February 4, 2009


More…

Diagram of the day

Posted by – February 2, 2009

This is from a game I just played. White has an open h-file to attack black’s king, but there’s a crushing quiet move for black who has the move. What is it?


Solution

Tomorrow come trouble

Posted by – January 31, 2009

Evolutionary explanations for human biodiversity are creeping into the mainstream: Why are taller people more intelligent than shorter people?

In our paper, Reyniers and I propose a second possible explanation […]
1. Assortative mating of tall men and beautiful women. […]
2. Assortative mating of intelligent men and beautiful women. […]
3. Extrinsic correlation between height and physical attractiveness (produced by Mechanism 1 above) and extrinsic correlation between intelligence and physical attractiveness (produced by Mechanism 2 above) will create a second-order extrinsic correlation between height and intelligence.

We believe that this may be why taller people are more intelligent than shorter people. Another factor contributing to the seeming male advantage in intelligence is that taller parents are more likely to have sons than shorter parents. So, over many generations, more sons will inherit their parents’ genes inclining them to be taller and more intelligent, and more daughters will inherit their parents’ genes inclining them to be shorter and less intelligent. But, once again, the crucial factor is height, not sex.

In our paper, we present evidence for all of the crucial mechanisms: Taller people are on average physically more attractive than shorter people; physically more attractive people are on average more intelligent than physically less attractive people; taller people are on average more intelligent than shorter people; and taller parents are more likely to have sons than shorter parents.

I have no idea whether this particular hypothesis will turn out to be correct, but in general I suppose there must be numerous human selection mechanisms of this kind waiting to be discovered. I expect they will explain some surprising things, confirm some unpopular but well-known truths and raise much ire. As danimal, that steely fist of Internet logic, put it:

Theodosius Dobzhansky famously wrote: “Nothing in Biology Makes Sense Except in the Light of Evolution.” This includes relationships between men and women.

It surprises me that the obvious extensions of this haven’t been researched much, at least as far as I know.

If you’re into science, you’ve probably heard people complaining about scientific information and contemporary results being too proprietary and hard to discover, especially considering they’re mostly funded by the public. The Science Commons is looking to change that; let’s hope it takes off.

For math geeks: a series of Project Euler puzzles revealed something shocking to me:
– once you’ve solved problem 64 and have a good way of handling continued fractions (it’s not feasible to do this with floating point approximations)
– gone on to 65 and learned about convergents
– you run into 66 which seems to be completely unrelated and again too slow for naive bruteforce methods, so after banging your head for a while you google quadratic diophantine equations and find out that the way to solve these equations is to find the right convergents for the square roots – and this is guaranteed to find the minimal solution for every equation of this type! Check it out.

There’s a program called Microsoft Songsmith that’s supposed to allow users to sing over a backing track that follows their singing. It doesn’t really work. Except for hilarity: