Thursday, August 1, 2013

Singularities happen all the time

We will soon create intelligences greater than our own. When this happens, human history will have reached a kind of singularity, an intellectual transition as impenetrable as the knotted space-time at the center of a black hole, and the world will pass far beyond our understanding. -- Vernor Vinge, 1983
 The technological singularity is supposed to occur when we develop "true" or "strong" AI.  Beyond that point, we are told, everything will be different, in the most conveniently vague ways.  Perhaps society will run on communism, or anarcho-capitalism, or something we don't have a name for (in other words, whatever the author happens to think would be ideal).  We are told that the resulting society will be totally incomprehensible to those of us still living in the present day.

My reaction to all this can be summed up in two words: "So what?"

Tuesday, July 16, 2013

Races and names in Mass Effect

I'm a pretty big fan of Mass Effect.  One thing I really like about it is the wide variety of races, differentiated in culture as well as appearance.  Turians, for instance, rarely commit crimes and will, we're told by the all-knowing codex, readily confess to any crimes which they may have committed.  Contrast this with Star Trek, whose Klingons, despite their reputation for "honor" and such, engage in back-room politicking in practically every episode featuring them.

But this isn't about Mass Effect vs Star Trek.  One of the more subtle differences between the Mass Effect races is naming.  Asari names are quite different from turian names, reflecting their greatly differing philosophies on life.  I thought I'd try to collect some rules for constructing these names.

I'm going to be using some rather technical terminology here, which I only know because I've spent some time browsing the relevant Wikipedia articles.  But, since you probably have better things to do, here's a quick reference:
t (but not th), d, k (and "hard" c), "hard" g, b, and p (there's also another stop which we don't have much in English called the glottal stop; it may be represented as an apostrophe or hyphen but there's no hard-and-fast rule).
Lots of things; almost anything that isn't a stop or a sonorant.
Some phonemes (specifically ch and j) begin as stops and end as fricatives. 
All vowels including y, m, n, r (not trilled), l, and w.
These are in alphabetical order, with council races first.
  • Asari: I see lots of sonorants and some fricatives, but very few stops, and most of those are at the beginning or end of names, while the vowels often form diphthongs; this gives the words an elvish feel, which is apropos since the asari are basically space elves.  The names also have a Greek feel; the Asari Republics strongly resemble Ancient Greece, so this is hardly shocking.
  • Drell: We don't meet very many of these, so it's hard to tell.  There do appear to be relatively few fricatives, but I can't really be sure.
  • Elcor: Again, there really aren't a lot of them, but I will note that every stop is voiceless (t, k, and p) rather than voiced (g, d, and b).
  • Hanar: "Blasto" is fictional and looks out of place.  The other names seem to have few fricatives and voiceless stops.
  • Human: Basically modern names, no fancy "smash two names together to make a futuristic-sounding one" shenanigans here.
  • Keeper: Keepers don't have names.
  • Salarian: According to the Mass Effect wiki, salarian names consist of "the name of a salarian's homeworld, nation, city, district, clan name and given name," in that order.  They have a lot of fricatives and some stops.
  • Turian: A lot of turian names end in "[i]us."  Stops and fricatives are relatively plentiful, and stops tend to be voiceless rather than voiced, though this is far from universal.  The "[i]us" thing, combined with what I know of turian culture, makes it apparent that their names are meant to sound Roman.
  • Batarian: These resemble the turians, but with a more even balance of voiced and voiceless stops.
  • Collector: Collectors don't have names.
  • Geth: Geth usually take designations rather than names as-such.  The easiest way to do that is something like "Unit 1234" (side-note: 1025's assertion that the number 1025 is meaningful is bullshit; the significant numbers in that neighborhood are 1024 and 1023.  The explanation it gives is even more wrong since 210 = 1024 has 11 digits in binary, much like 1010 has 11 digits in decimal.).
  • Krogan: Krogan names are composed of a clan name (such as "Urdnot") and a personal name (such as "Wrex").  Mass Effect 3 says that krogan personal names are selected via males having belching contests.  "Bakara" doesn't sound like a belch, so I'm guessing this is only for male names.  A belch-name should consist of an optional stop followed by a series of sonorants and fricatives, possibly terminated with another stop; moreover, it will probably be monosyllabic or nearly so.  This is based on the assumption that a belch consists of a single continuous expulsion of breath; if there are stops in the middle, it isn't continuous (air stopped coming out, hence the name "stop").  "Fortack," "Okeer," and "Skarr" clearly break this rule, but the other names mostly seem consistent with it.  The latter two can be explained as someone cheating, starting to make sounds before the real belch began, but "Fortack" just doesn't seem like it could possibly occur as a belch.  Maybe someone stuck the t in afterwards.
  • Leviathan: We don't really have enough information.
  • Quarian: FirstName'LastName nar/vas ShipName.  The names tend to be monosyllabic, which makes a kind of sense since the population of any given ship is small and the ship's name can be used to disambiguate; there's no need for elaborate names.  Diphthongs are rare; the only one I can see is "Rael."
  • Raoli: We don't see any of them and I only know of them through the wiki.
  • Reaper: "Nazara" and possibly "Harbinger."  That's not enough names to generalize.
  • Virtual Alien: Uh... who are these guys?
  • Vorcha: It's hard to generalize.  Most of the galaxy regards vorcha as vermin, and pays relatively little attention to their individual names.
  • Yahg: We don't know anything about yahg names.

Wednesday, June 26, 2013

DOMA is alive... for now

Earlier today, the Supreme Court struck down the Defense of Marriage Act.

Well, actually, that's not technically true.  SCOTUS struck down section 3 of DOMA, which prevents the federal government from giving marriage benefits to same-sex couples.  Section 2 of DOMA, which permits a state without same-sex marriage to deny recognition of same-sex marriages from other states, is still in force, at least for the moment.  But section 2 is a legal nightmare.

Ordinarily, when you sign a contract, its validity is a federal matter.  Either it is valid in every state, or it is valid in no state.  Marriage no longer works that way.  Suppose two men are married in New York.  Under Windsor, the federal government now recognizes that marriage, and extends tax and other benefits to them.  But then they travel to Texas, which does not recognize same-sex marriage.  Suddenly, they are single.  Or are they?  It's unclear whether the federal government should apply New York or Texas law in determining benefits.  But clearly, as far as the state of Texas is concerned, the men are single.

Next, they go to California, where (it would seem, given the outcome of Perry) same-sex marriage is recognized.  Are they married again?  Did their original marriage contract from New York survive this transition?  Or did it vanish at the Texas border?  If it did, then that suggests a contract has been dissolved without any legal process, which seems troubling to me.  If it didn't, then why wasn't it in force in Texas?  Was it in abeyance somehow?

If the contract was in some kind of legal limbo, but not actually dead, this suggests a rather interesting situation.  A contract is valid but unenforceable thanks to a provision of Texas's state laws.  State laws aren't allowed to impair contracts under the Contract Clause.  But maybe Congress can authorize them to do so via DOMA.  Let's consider that.

Section 2 of DOMA is as follows:
No State, territory, or possession of the United States, or Indian tribe, shall be required to give effect to any public act, record, or judicial proceeding of any other State, territory, possession, or tribe respecting a relationship between persons of the same sex that is treated as a marriage under the laws of such other State, territory, possession, or tribe, or a right or claim arising from such relationship.

I find the term "required" rather interesting in this context.  Required by whom, exactly?  If it means "required by the courts," then this seems an entirely inappropriate attempt to dictate the outcomes of court cases.  Under the doctrine of separation of powers, Congress isn't supposed to be doing that.

On the other hand, if it refers to constitutional requirement (i.e. "required by the constitution"), that really isn't much better.  If the constitution says one thing, and the law says something else, generally the constitution wins.  Laws aren't allowed to dictate how the constitution is interpreted; again, that's a matter for the judiciary.

Just about the only "required" that I believe Congress could refer to here would be "required by federal law."  But if that's what the statute means, I don't think it will have any effect whatsoever.  I'm not aware of any attempts by federal law to require Texas to recognize a same-sex marriage.

In conclusion, it's not at all clear to me that DOMA section 2 even needs to be challenged on due process and equal protection grounds.  It could fall to separation of powers.

Updated: It's been brought to my attention that the contract clause is inapplicable to marriage contracts under longstanding precedent.  This is why I'm not a lawyer.  All the same, there are quite a few interesting questions raised above, so I'm leaving this post up.

Thursday, June 13, 2013

Why I am not recommending GeoNode

For the past few weeks, I've been working for a professor on a project involving geographical data.  As part of this project, I was asked to evaluate GeoNode.  So I looked at the website, and after wandering around for a while trying to get past the usual marketing bullshit (side note: Can anyone explain to me why so many open source projects these days have such enormous quantities of marketing bullshit?), I eventually found some real documentation.  It was in the form of a developer "workshop," however, so I was a bit leery of it.

Tuesday, May 21, 2013

"Studies have shown..."

We've all been told that "studies have shown" something at one time or another.  Sometimes, our interlocutor is kind enough to give us a citation (and sometimes they aren't).  Well, let's do a thought experiment (if you're already familiar with significance testing, feel free to skim the next paragraph).

Suppose you give 20 labs a drug and a placebo, and tell them to test one against the other in clinical trials.  But instead of actually giving them a drug and a placebo, you give them two identical placebos (originally, I was going to use a homeopathic remedy vs. a placebo, but I didn't want to get sidetracked).  Assume the labs all use large sample sizes, statistical normalization, double blinding, and various other best practices.  None of them make any mistakes (or outright fraud, for that matter) and they all conduct proper, well-designed experiments.  Even under these ideal conditions, one of those labs (on average, and for pedants, we're assuming they all use α=5%) will tell you there's a statistically significant difference between the placebo and itself.

Thursday, April 25, 2013

Nihilism and optimism

n. the end, purpose, or significance of something
NB: Emphasis added.
Consider the definition given above by We're told the meaning of something is its purpose.  If a thing has a purpose, that purpose must have been intended by someone.  If we're told something has "inherent meaning," we must ask from whence this intent comes.  There doesn't seem to be an obvious answer to this question.

Monday, April 15, 2013

The tragedy of music: part three

In part one, we discussed some issues with Pythagorean tuning, and in part two we continued to quarter-comma meantone.  The logical conclusion is equal temperament, a widely used (though not quite universal) modern system.

Equal temperament is, in a way, simpler than any of the earlier systems.  Instead of building an octave out of some fixed ratio, we start with an octave and subdivide it.  The most natural way to do this is to make a semitone the twelfth root of two.  Note that this is simply "a semitone" rather than a chromatic or diatonic semitone; in equal temperament, those are the same thing.  Everything else can be built rather easily out of this fundamental unit, and we don't have overlapping or separated octaves.  This, in turn, means no wolf fifth.

Still, this fundamental unit can be unwieldy.  Writing out "the twelfth root of two" all the time is annoying, and the mathematical notation for it is rather ugly.  For this purpose, the so-called cent was invented.  There are 1200 cents in an octave; 100 make up a semitone.  It is a logarithmic unit.  Increasing a tone by 1200 cents means doubling its frequency.  700 cents make up a perfect fifth, and 400 cents are a major third.  The cent is a unit of relative measure; it is not meaningful to equate a single note to a given number of cents, except in relation to another note.  That "other note" is often middle A, which, for convenience, is typically tuned to 440 Hz.

This system is very practical, which accounts for its widespread use.  However, this is not a happy story with a happy ending; there is a problem.  The twelfth root of two is an ugly, irrational number, and all of the other intervals are powers of it.  There are no simple integer ratios at all.  While the cent may make the system look nice and clean, it is an artificial unit created to hide the irrational semitone.  In effect, we've taken the sourness of the wolf fifth and extended it over the whole octave, spreading thinly to mask the dissonance.  Practical this may be, but ideal it is not.

This leads me to a stark realization: the Platonist's ideal of "perfect yet unattainable" forms is inapplicable to music.  These problems are not of a physical nature.  Any musical system will suffer from them, except for the trivial system which has one note per octave.  There is a fundamental disconnect between equal temperament and just intonation.  We cannot have both, even in theory.  And that is the tragedy I've been talking about.

Monday, April 8, 2013

The tragedy of music, part two

In part one, we discussed Pythagorean tuning and its failings.  Despite this crucial issue, Pythagorean tuning was highly influential on musical theory.

In the 1500's, a variant of Pythagorean tuning called quarter-comma meantone became popular.  The "comma" in this name is not the Pythagorean comma we saw last time, but an entirely different comma.

A major third is an interval spanning three staff positions and four semitones.  It is not considered "perfect" in the same way as the perfect fifth, but is still regarded as a consonant interval, at least in theory.  Under Pythagorean tuning, the major third was a rather dissonant 81:64.  Quarter-comma meantone flattened this to a nicer 5:4, at the expense of a more dissonant perfect fifth.

Interestingly, we now have irrational intervals: the perfect fifth is the fourth root of 5.  This way, if we move up by four perfect fifths, and down by two octaves, we end up at 5:4, the justly-intoned major third.

This sort of trade-off is debatable, of course, but it was an explicit design goal of quarter-comma meantone; the flatter fifth was viewed as an acceptable price for a just third.

Now, suppose we start at middle C, as we did last time, and move up a major third.  We arrive at middle E at a ratio of 5:4.  Next we move up again to G♯, at a ratio of 25:16.  Finally, we get to C5, at a ratio of 125:64.  This is not an octave, but unlike in Pythagorean tuning, the interval is too flat rather than too sharp.  This means there's a gap between the octaves, unlike the overlapping octaves of Pythagorean tuning.

Like in Pythagorean tuning, one of the fifths must span this gap.  That fifth is sharpened by 128:125, a much larger interval than the Pythagorean comma.  It sounds extremely dissonant, to the point that it became known as the "wolf fifth" because it sounds like a wolf howling at the moon.  This moniker is sometimes also applied to the diminished sixth produced by Pythagorean tuning under the equivalent problem, but note that quarter-comma meantone is much worse in this regard.

Updated: In part three, we discuss modern equal temperament.

Saturday, April 6, 2013

The tragedy of music, part one

Once upon a time, people noticed that certain sounds are pleasant to hear, while others are not.  They began to experiment with it.  The most important early discovery in this vein was the notion that sound is vibration.  This is the fundamental principle of all musical theory, modern or ancient.  The next discovery was that of the octave: If you make two vibrations, one at double the frequency of the other, they sound... the same, in some way.  The faster one is clearly higher pitched, but they're harmonically equivalent.

The Ancient Greeks built upon this discovery, and eventually produced what we now call Pythagorean tuning.  Pythagorean tuning is built around simple frequency ratios; systems like this are called "just intonations."  The most important ratio other than the octave is the so-called "perfect fifth," which describes a gap of five staff positions in modern musical notation.  It spans a gap of seven semitones; there are a total of twelve semitones per octave in "conventional" systems such as Pythagorean tuning.  In Pythagorean tuning, a perfect fifth is a ratio of 3:2, meaning the faster vibration oscillates thrice for every two oscillations of the slower vibration.  So far, this is all very nice, and fits in well with the Pythagorean mathematical ideals of rationality.  But there's a problem.  I told you that a perfect fifth has a ratio of 3:2, is composed of seven semitones, twelve of which make up an octave, and the octave is 2:1.  Suppose we start at middle C (or C4), and move a perfect fifth up.  We arrive at G4, at 3:2 times our original frequency.  We continue to D5, at 9:4.  Next comes A6, at 27:8.  Then E6, at 81:16, B7, at 243:32, F♯7, at 729:64, C♯8, at 2187:128, and finally G♯8 at 6561:256.  Now suppose we go down from C4.  We find ourselves at F3 at 2:3, B♭3 at 4:9, E♭2 at 8:27, and A♭1 at 16:81.  The ratio from C4 to A♭1 is 81:16, and the ratio from G♯8 to C4 is 6561:256.  Multiplying, we see that the ratio from G♯8 to A♭1 is 531441:4096.  But A♭ and G♯ are supposed to be the same note.  Going by octaves, we should get 128:1.  The other ratio is rather large and unwieldy, because we have seven octaves of space, so if we divide those out, we get a ratio from G♯ to A♭ of precisely 531441:524288.  This interval is called the Pythagorean comma.  It's the difference (remember, in music, we never add or subtract frequencies, so this is actually the ratio) between a chromatic and a diatonic semitone, among other things.

So what does this actually mean?  It means Pythagorean octaves overlap, if only a little, since G♯ is a little sharper than A♭.  That's a problem for perfect fifths.  One of the twelve "perfect" fifths is ruined by spanning this overlap, being flattened to a rather dissonant diminished sixth.  So Pythagorean tuning, for all its beauty and simplicity, is not perfect.

Updated: In part two, we discuss quarter-comma meantone, a derivative of Pythagorean tuning.

Friday, January 18, 2013

One-time pads with Python

A one-time pad is a kind of unbreakable encryption.  For most encryption, breaking it is a matter of throwing a lot of computational resources at the problem.  Typically, the amount of resources needed greatly exceeds the amount that is practical to obtain, so most modern cryptography is secure enough.  There are, however, some downsides to modern cryptography, the biggest of which is its complexity.  If we want to use crypto for something like bank transactions, complexity is not that big of a deal, because centralization can hide most of the complexity from end-users.  But if, for instance, you need to implement secure communications without a centralized certificate authority, effectively implementing secure communications becomes a lot harder.