Tuesday, July 28, 2009

The Chinese Script Is, or Is Not, Phonetic

A new post to satisfy the likes of the most evil being...in the universe.

My favorite Chinese app (whose continued absence from the iTunes Store is delaying my inevitable purchase of an iPhone) is headlined by a dictionary edited by the recently departed John DeFrancis, who taught Chinese for years at the University of Hawai'i. Aside from his 12-volume Chinese language textbook series, he's probably best known for The Chinese Language: Fact and Fantasy, an accessible deconstruction of several myths regarding the Chinese language: that the Chinese script is ideographic, for instance, or that it is specially tailored to facilitate communication between speakers of mutually unintelligible dialects.

At one point, DeFrancis goes even further and suggests that the Chinese script is not even logographic, with each character signifying a morpheme, but simply phonetic, with each character signifying a phoneme—albeit a tremendously inefficient phonetic script, since in many cases it has dozens of characters representing a single phoneme. He's talking here about what most people would consider homophones: characters like 出 to exit, and 初 the first or opening of a series, both of which are pronounced chū in Mandarin (the most widely spoken dialect). This idea is prelude to a discussion of various proposals to do away with Chinese characters entirely, using in their place a properly designed phonetic script.

DeFrancis's interpretation isn't as crazy as it might sound at first. In at least one limited case—the transliteration of foreign terms—the Chinese script is exactly an inefficient phonetic script. Lacking an official alphabet or syllabary, Chinese represents foreign terms using a sequence of characters, such as 巴巴多斯 bābāduōsī for Barbados. The inefficiency lies in that unless you've previously looked this term up, you'd have no good idea which four characters ought to be used to write out Barbados. There are lots of equally effective ways to write out Barbados using Chinese characters...but only one way that is considered "correct."

More generally, even though the distinction between the written forms 出 and 初 might seem vital to Chinese readers, since they mean different things, the morphemes represented by those characters are used all the time in speech, where there is nothing but context to distinguish them. Apparently, "nothing but context" works pretty darned well. There are written passages that consist of nothing but a long string of homophones—a sort of extended pun—but the fact that these are elaborately conceived literary jokes is actually an indication that the semantic disambiguation the different characters provide isn't strictly speaking necessary.

But I think that last point is an indication of why the Chinese script is not a phonetic script, or at least not only a phonetic script. Because even though the semantic disambiguation isn't necessary, I think it's pretty hard to argue that it doesn't help. One can read a passage in Chinese that is rendered only phonetically, but to someone who's literate, it's a lot faster with ordinary characters. Whether we're talking about an alphabetic language like English or a logographic one like Chinese, people typically read a lot faster than they can speak. To me, that indicates that there's something going on in the reading process other than just reproducing the sounds of speech. Robert Ramsey wrote in his book The Languages of China that there's still a lot we don't understand about the way Chinese people read. Without understanding more about that, it's premature to conclude that Chinese characters are a poor stand-in for a syllabary.

Saturday, June 27, 2009

Do Not Pass Text Design, Do Not Collect $200

A long time ago (I won't say just how long, but it'll soon become fairly obvious), I worked my first summer job at a computer-controlled font engraving place in Mountain View called Xybergraphics. Lots of stories from that summer, which I'll eventually get to when I want to talk about what happens when a 95-pounder drinks 42 ounces of caffeine-laden soda pop, or the beginnings of my fascination with the Police, or what a cubic spline is.

At any rate, my job, which paid me the princely sum of $2.85 each hour (workers under 16 could be paid somewhat under minimum wage), required me to encode fonts for the aforementioned computer-controlled engraver. Typically, the engraved letters would be in the neighborhood of an inch or two in height, but for better precision, the letterforms I worked from, designed by my immediate supervisor, were about 14 inches tall and drafted in pencil on vellum. My job was to take a mouse (this was before the Mac, mind you), and trace along the letterforms, clicking at appropriately spaced points, until the letter was entirely traced. A simple letter, like a capital I, might require 50 points; a more involved letter, such as lower-case m, might require as many as 150. This was a tedious and time-consuming job, you could well imagine.

But I'm nothing if not efficient at boring tasks, especially if I've got my tunes in the background, and in the meantime, I learned quite a lot about fonts—what they should look like, how features are shared in common by various letters, what design rules not to break, and so forth. All this that I learned is both fascinating (to me) and almost entirely useless, which means that it has lodged tight in my memory banks and won't budge.

As a result, I'm exceptionally sensitive to bad typography. For example, I was walking one day in the Denver airport, waiting for my next flight, when a store sign caught my eye. Bad Typography Alert! The capital A in the sign was reversed; its broad stroke went down to the left, rather than to the right, as it should in traditional serifed fonts. And this on the sign for a stationery store! I think you will properly apprehend the depth of my mania when I tell you that I actually reported it to the clerk. She seemed quite receptive to my complaint, although she probably promptly forgot about/rejected it as soon as I turned my head.

There's a similar problem with one of the signs where I work—the name of the building has a capital V in it, with its broad stroke, again, going down to the left. Alas, this is welded on and probably unmulliganable.

But my encounter with the very bottom, the absolute worst, came when I began frequenting a supermarket that opened near our house. There was little wrong with the typography at the supermarket, but across the street was this abomination:


This signage is simply staggering in its wrongness. It's hard for me to convey just how staggering, but the fact that you're reading this post is some indication. Click on the image to see an enlarged version and look at this tangle of thorns.

Practically any letter that could have been misplaced, was, and those that weren't, seem to have been correctly placed to highlight how wrong their identical partners were. To wit: The E in GERMAN is upside-down. The M and A in the same word are backwards. Unbelievably, the N is correctly placed. A mistake must have been made.

In CAR, the C is upside-down. The A is backwards. After the bad E in GERMAN, the E's in SERVICE are right, but the S and the C (again!) are upside-down, and the V is backwards.

The M in BMW is backwards. The W is very strange, it seems to have been made with a pair of leftover V's, both with one stroke broken in half. If so, they should have broken the other stroke on the right half, but I'll give them credit for showing some resourcefulness.

The horror continues in Volkswagen. This V is correct (what happened to the V in SERVICE?), but the l is backwards, the s is upside-down, and the w and even the g (!) are backwards again. How do you screw up the g? The lower-case s is upside-down again in Porsche, and the lower-case c joins its capital brethren in being inverted also.

The Audi is correct, but is set in a narrower font. Must have been added on later.

Considering that many of the letters couldn't have been placed incorrectly (either because they're totally symmetrical or totally unsymmetrical), the percentage of letters placed incorrectly runs at about 15/22 = 68 percent, by my reckoning. A dolphin without opposable thumbs flinging letters up randomly with its tail could have done better.

OK, I realize that I'm probably clinically unhinged on this point, but can we agree that someone screwed up royally here? I mean, please.

Tuesday, June 23, 2009

Game Theory and the Wing-Block Dynamic

In 2004, when the Lakers played the Pistons in the NBA Finals, a lot was made of Kobe Bryant continually jacking up outside jumper after outside jumper—none too efficiently, most of the time—while monster center Shaquille O'Neal was taking fewer shots, but making them much more efficiently. On the surface, it sure seemed as though Shaq should have been getting more shots, and of course Shaq, never a wallflower at the quietest of times, was not loathe to point this out.

In 2009, when the Lakers played the Magic in the NBA Finals, a lot was made of Kobe Bryant continually taking jumper after jumper—somewhat more efficiently than before—while his "newly tough" post player Pau Gasol was taking far fewer shots, but making them more efficiently. On the surface, it sure seemed as though Pau should have been getting more shots, and surprisingly Pau, generally a quiet fellow, pointed this out with a certain degree of mordacity.

Obviously, in retrospect, the two series turned out rather differently for the Lakers, which is why the former case was judged by many as the reason the Lakers lost the series, and the latter is just a footnote. Bryant's reputation as a ballhog, already in force before the 2004 Finals, was substantially bolstered by that series, and has only just faded within the last year or two. But is that fair? Is that the only possible interpretation for Kobe's shot-taking? Or could ballhoggery conceivably help a team?

Let me be clear here. There's no question in my mind that Kobe could stand to take fewer shots than he does (unless he's just red hot). The question isn't whether he should take as many shots as he does, but whether he should take shots even when he's shooting them at a lower percentage than the post players. And this really goes for any wing player who dominates the ball (e.g., LeBron, Wade, etc.). I just mention Kobe because I watch all the Lakers games.

I'm going to look at this from a game theory standpoint. Put into elementary game theory terms, Kobe and the Lakers have a set of tactical options, and the defenders have a set of tactical options. If each side optimizes its strategy with respect to the other side, then in the end, the game will reach what's called a Nash equilibrium: Neither side can improve its result by changing its strategy unless its opponent changes it too. (The equilibrium is not named after award-winning point guard Steve Nash of the Phoenix Suns, but John Nash, award-winning mathematician and subject of the award-winning book/movie, A Beautiful Mind.)

Suppose we simplify matters by assuming that the Lakers have just two options: Kobe shoots, or Kobe passes to the post, which then shoots. And the opponents likewise have just two options: double Kobe, or play man-to-man. And naturally, we assume that Kobe shoots a better percentage over man defense than over a double team, and the post shoots better when Kobe draws a double team than when the defense plays man-to-man.

The conditions of the game do not require either side to do the same thing each time. Strategies can be mixed. So Kobe can shoot 60 percent of the time, and pass 40 percent of the time. The defense can double 70 percent of the time, and play man 30 percent of the time. The defense can even have partial strategies like a weak double versus a strong double. Under these simple assumptions, it's fairly straightforward to find the Nash equilibrium, where neither side can unilaterally improve their result. What's interesting about this Nash equilibrium is that both Kobe and the post should shoot exactly the same percentage.

Plainly, that doesn't happen very often. Very often, Kobe shoots a lower percentage than the post (even when factors such as free throws and the three-point line are taken into account); by comparison, it's relatively rare that it happens the other way around. Ostensibly, with Kobe shooting the ball so much, he's not adequately punishing the defense for doubling him. He should instead pass the ball into the post more, gradually causing the defense to double less and play more man defense, up to the point where his shooting percentage rises to match that of the post.

[EDIT: The rest of this post is largely different from what it used to be, because what follows totally swamps in significance what used to be here.]

Having said all that, I'm going to go back and suggest that that strategy actually isn't optimal. How can it be sub-optimal, if it's at the Nash equilibrium? Because the game doesn't stop when the ball hits the rim, so the game theory shouldn't, either.

When players shoot the ball against straight-up defense, the defense has the advantage on rebounding any misses, because they're usually between their man and the basket. However, when a perimeter player shoots against a double team, the rest of the players have a man advantage. In our scenario, this advantage plays out in the post, which means that (a) the chances are much improved for an offensive rebound, and (b) if an offensive rebound is gained, it usually leads to a high-percentage shot.

What effect does that have? Suppose that the man advantage on rebounding leads to an increase of 15 percent in the offensive rebound rate; for example, if the offensive used to get 20 percent of the rebounds, they now get 35 percent. And suppose also that this leads to a successful shot 60 percent of the time. If the wing player misses, let's say, 60 percent of his shots against a double team, and he faces a double team 50 percent of the time, the offensive rebounds effectively amount to an increase in shooting percentage of 0.5 × 0.6 × 0.6 × 0.15, or 2.7 percent. That doesn't sound like much, perhaps, but it's about a standard deviation's worth, the difference between a top-10 guard and a middle-of-the-road guard. And it's how much worse the wing should shoot than the post at the true optimal strategy.

Again, I'm not suggesting that this is how Kobe thinks (although I'm pretty sure he does think that his misses can lead to easy baskets for his team), or that Kobe shoots exactly as much as he ought to. But it might explain why, even if he's shooting a lower (true) percentage than his post players are, he shouldn't necessarily shoot it less.

Thursday, June 18, 2009

Inconsistent Bracketology and Non-Transitivity

Does anyone who routinely does NCAA playoff brackets know the answer to this one? Can you fill in a bracket inconsistently, so that you have (let's say) team A beating team B and team C beating team D in the first round, and yet you have either team B or team D coming out of the second round?

Because it's not hard for the probabilities to come out that way. One simple way is for A and C to be mild favorites over B and D, respectively, but for B and D to be prohibitive favorites over C and A respectively. (Matchups between A and C, or between B and D, can be pick-ems.) So you fill out your bracket to have A and C come out of the first round, but either B or D to come out of the second round. This requires a certain amount of non-transitivity in the teams: For instance, A edges B, which trounces C, which edges D, which trounces A again. But that's hardly unknown in the basketball world, and is usually trotted out as the inevitable "matchup issue" between two teams.

Somewhat more surprising is that it's possible for the same inconsistency to happen without any non-transitivity. Suppose A is a huge favorite over B in the first round, while C is a mild favorite over D in the second round. So you have A and C come out of the first round. But suppose C is also a mild favorite over A, but D is a huge favorite over A. There's no non-transitivity—you can place the teams in the total ordering C > D > A > B—but D is nevertheless the favorite to come out of the second round, despite not being the favorite to come out of the first.

Even though there's no non-transitivity in the second example, it's vaguely unsatisfying because it doesn't match our intuition. We'd like to think that since C beats D, C should be a bigger favorite over A than D is. But the inconsistent bracket result only comes about here because that intuition is violated. So, the semi-open question ("semi-open" because I suspect it won't be that difficult to resolve): Is it possible for a set of tournament contestants to fall under a total ordering in the intuitive way suggested above, and still yield an inconsistent playoff bracket in a binary, single-elimination tournament? It need not be limited to a four-team bracket, but it does have to be 2n for some n.

Sunday, June 14, 2009

Kobe, Once More Unto the Light

The bare facts: The Los Angeles Lakers dominated the Orlando Magic over the last three quarters to take Game 5 and clinch the NBA title, winning going away, 99-86. After a 16-0 run (capped by a nifty Lamar Odom reverse lay-up) took the Lakers from a 40-36 deficit to a 52-40 lead, the Magic never seriously threatened to take the game back, getting no closer than five points the rest of the way and spending most of the second half down by double digits.

Bryant was, I felt, the clear-cut MVP of this series, and of the playoffs, and even when his game was somewhat off in the middle three games of the series, he cast his enormous shadow over how the games were contested. Whether or not you thought he was over-dominating the ball, whenever he was on the floor, he set the tone for the other nine players.

In some sense, for most of his career, he has cast that same shadow on the NBA. For better or for worse (and there have been no shortage of those who see it for the worse), he has been the top talking point of the league. From his unbelievable moves on the court to his embarrassing personal problems in Colorado, his life trajectory thus far has been an eventful one. His triumphs and travails have galvanized public opinion like no other player, possibly in the history of the league. To Kobe haters, Kobe fans are as thin-skinned as their hero, reacting to any perceived slight as though it were heresy; to Kobe fans, Kobe haters seize any opportunity, twist any circumstance, and trample any logic to put the target of their envy in a negative light. Each group sees the other as the yin to its yang, a state of affairs that would be ludicrous with respect to any other player. But apparently it's de rigeur in Kobe's World.

Through it all, Bryant was insouciant, an outwardly joyous 18-year-old rookie; then a driven talent, rising with center Shaquille O'Neal to dominate a trembling league; and then a fallen hero, commonly considered to have forced O'Neal and then coach Phil Jackson off the team. The haters had a field day watching Kobe try, and fail, to lead a ragtag crew to even the lower echelons of the playoffs, pride going before the fall. Jackson returned the following season, but the next two years were barely an improvement, with the Lakers falling to the Phoenix Suns each year in the first round. His undeniable skills on the court were only further testament, it seemed, to his failure to lead his team off it. Bryant himself appeared to adopt the demeanor of a flawed, secretive superhero with a dark past and a darker future, Batman to O'Neal's Superman. The 2007 off-season was the darkest yet, with Bryant railing to all within hearing range about the front office's inability to provide him with a sufficient supporting cast.

The next season brought a pleasant surprise, however, in the unexpected form of a contending team. And when rising young center Andrew Bynum went down with what turned out to be a season-ending knee injury, the beleaguered Lakers' front office obtained multi-talented Pau Gasol from the Memphis Grizzlies for a song, and the Lakers barely missed a beat. Bryant seemed readier than ever to share the ball with his teammates, making the team less predictable, more formidable. There was a regular season MVP for Bryant, his first, matching O'Neal's award from 2000. Even with Bynum out, the Lakers manhandled the rest of the Western Conference on the way to the NBA Finals. The Batsuit was ready to crack. But the Celtics sunk the Lakers in six games, trouncing L.A. by 39 in the clincher.

Back to the cave. Not alone, not to sulk, but this time with all his teammates, forging something of a defensive identity. Bryant and the Lakers were determined that this time would not be the monstrous disappointment of the previous season. There would be no MVP award this year. That would go to LeBron James, the new King. Bryant had no time for regular season plaudits anyway. He wasn't looking for redemption, either; he never felt he had anything he had to redeem himself for. What he was looking for, I like to imagine, was a lighter Kobe Bryant...

Saturday, June 13, 2009

The Power of Flexibility

With 10.8 seconds left in regulation in Game 4 of the NBA Finals between the Lakers and the Magic, the Lakers had the ball out of a timeout after Dwight Howard had just missed two free throws to leave the Lakers down three, 87-84. Lakers coach Phil Jackson decided to take the ball near their own baseline (where the timeout had been called), rather than advance it to halfcourt. Trevor Ariza inbounded the ball to Kobe Bryant, who was immediately double-teamed. Bryant advanced the ball near halfcourt back to Ariza, who then cross-courted the ball to Derek Fisher. Fisher dribbled the ball up toward the three-point line on the right wing. Since Jameer Nelson was playing so far off Fisher, Fisher decided to hoist up the trey at that point and sank it to tie the game with 4.6 seconds remaining. The Magic failed to score in their final possession of regulation and the Lakers would go on to win the game in overtime to take a 3-1 lead in the series.

Tim Legler of ESPN later suggested that Jackson's decision made it easier on the Magic, because of the extra time that bringing the ball the length of the court would consume. I think this takes a narrow and unnecessarily time-centric view of the play.

In the first place, 10.8 seconds is a lot of time for a "last-second" play. It's nearly half of a full shot clock. The Phoenix Suns could probably run three whole plays in that amount of time. It's unlikely the Magic could delay the Lakers long enough to avoid giving them a decent look. Indeed, Fisher sank the three-pointer with 4.6 seconds left, but he actually released it with 6.2 seconds; the whole play took less than five seconds to execute.

Secondly, Legler underestimates the pressure that having to play full-court defense places on the Magic. If the Lakers had inbounded the ball at halfcourt, they would have had to set their offensive positions for the most part, showing their hand on the playcall and allowing the Magic to set their defense. Whether or not the decision to bring the ball up surprised the Magic, it concealed the Lakers' play from them and required them to cover a multitude of options.

As it happens, the Magic decided to double Kobe, and the Lakers took advantage by quickly advancing the ball out of the double-team to give the Lakers a 4-3 man advantage on the rest of the court. The Lakers had used this ploy, a kind of basketball aikido, several times in the second half of Game 5 of the Western Conference Finals against the Denver Nuggets. In that game, the Nuggets decided to double team Kobe aggressively, pushing him all the way toward the halfcourt line. Kobe obliged them, drawing his two defenders so far away from the basket that by the time Kobe passed out of the double team, they were effectively out of the play, giving the Lakers a man advantage for long enough to get an easy shot. In hindsight, this strategic decision by the Nuggets was a main reason they lost the game and the series.

But even had the Magic chosen not to double Kobe, the Lakers still had a multitude of options to run, starting from the backcourt, and the Magic would have had to anticipate them all. Most options put the Lakers in a kind of semi-transition game, placing the Magic defense in jeopardy. Normally, teams run very unimaginative sets at the end of a period, and the Lakers are no different in this regard, typically putting the ball in Kobe's hands and letting him go 1-on-N. The fantastic play run by the Magic at the end of Game 2, freeing up Courtney Lee for an alley-oop attempt, was very much the exception rather than the rule. And in this game, Fisher still had to make the jumper. But Jackson's decision to bring the ball up the length of the court broke the usual mold and gave the Lakers their best chance at tying the game.

Wednesday, June 10, 2009

See, Why Would You Do This?

Look everybody: It's pet peeve time! (I'm writing this because it's against my beliefs to blog about basketball after a Lakers loss, heh. Or, rather, I'm copying this—it's originally from another site of mine. But it's recent.)

I like to bicycle. Not like some friends, who like to bicycle like they like to breathe. (Credit goes to Sandra Boynton for that delectable quote, adapted for the nonce.) But I still like to pedal here and there. So I take it personally when a cyclist every now and then decides they wish to flout one of the basic rules of bicycle behavior—even more that they do it in the name of safety.

They prefer, they say, to ride on the left side of the road.

Note that I'm not talking about people who ride briefly on the left side of the road because their home is on that side, and they're about to make a left turn at the corner, but about people who speak of riding on the left side as though it's some sort of closely guarded Success Secret® of the cycling guild. The justification, apparently, is that it allows them to see oncoming traffic, the better to avoid it. This is wrongheaded on so many levels that it's mindboggling to comprehend. Don't be one of those mindbogglers. Ride on the right side of the road. (Unless you ride in the U.K., or some other of those countries where they drive on the left side of the road.) The reasons are legion:
  • First of all, the most important: Collisions will happen from time to time, whether you can see them coming or not. But riding toward cars means that your velocity is added to theirs, not subtracted, not to mention the prone-to-flipping head-on collision rather than the more stable rear-ender. Drivers will suffer a somewhat higher repair cost. You will suffer a substantially higher chance of dying, and if not that, of serious injury.
  • The higher relative velocity has another penalty: Cars are much larger than you, are moving much faster than you, and take much longer (both in distance and in time) to stop than you. As a result, the car has by far the greater part of control over whether there's an accident. Your ability to see oncoming traffic is as nothing, in terms of importance, when compared to the drivers' ability to see you. And by riding toward cars, you give drivers correspondingly less time to see you and avoid an accident.
  • What's more, most cyclists ride on the right side of the road. Drivers know this, whether they know that they know it, and scan the road accordingly, especially when they're making a right turn onto a major road: At such times, they look back down the road to their left for traffic to avoid. Not traffic to the right, which is where you will be coming if you ride down the left (i.e., wrong) side of the road. A similar comment applies to cars parked on the side of the road pulling out into traffic.
  • The one time when a car is relatively maneuverable on the road is when it is stopped to make an unprotected left turn (i.e., yielding to oncoming traffic). Drivers are then looking into oncoming traffic, where they will see all potential hazards, except—you guessed it—cyclists riding down the left side of the road.
  • Pedestrians are advised to walk down the left side of the road, because they can stop on a dime, unlike bicycles. If you ride down the left side of the road, you will be coming up behind such pedestrians, who may chose that moment to turn on a dime and smack right into you (potentially throwing both of you into oncoming traffic).
I hear this less and less, fortunately, but it still crops up from time to time, from people who should know better. (That's approximately everybody, in my opinion.) I think it stems from the natural inclination to think that if you only have all the information you want, you'll be in complete control over your destiny, but whatever the reason, it's just a vastly inferior decision.

EDIT: Since I first wrote this, I've been informed that there is a specific term for this: salmoning. So don't salmon. You know what happens to salmon after they make their way upstream, right? It's not exactly an unalloyed happy ending.