Little Trouble in Big China

In the last six months, I’ve spent about twenty days in China — twenty-five if you count Hong Kong and Macau.  I would not consider myself an expert in any regard (at 26, I’m hard pressed to think it’s possible for me to be an expert about anything, really), but I find the place fascinating, and I’ve tried to unravel what goes on behind the scenes there many, many times in my head.  I don’t think I’ve been successful, but it at least means I have some stories.





There’s light everywhere in China.  Not just the blinding fluorescent light that douses any airport in any country — there to help you forget what godforsaken hour it is in this part of the world — but lights of every color, every shape, a colorful panoply of illumination that pulls your eyes in every direction at once.  Giant Chinese characters burning with lambent neon fire, colossal LCD billboards shining like squat searchlights in the night, scrolling LED signs playing message after message written by some calligraphic pointillist.  If territorial holdings were what ensured the sun never set on the British empire, it’s technological holdings that make certain the sun will never truly set on the Chinese empire.


Back to the Future

It’s been one hell of a week in American politics.

This country, which is normally so glacially slow to change its mind about, well, anything, executed two U-turns of portentous moment and neck-breaking alacrity: it suddenly seems the Confederate flag is no longer welcome in many parts of the South, and it suddenly seems that same-sex marriage is here to stay.  If I haven’t made it overwhelmingly evident elsewhere in this blog, let me just say here that I applaud both these decisions.  They are progressive steps in the right direction for our country, for our people, and for our national morals.  I could sit here and extol them, laud and congratulate, and I am happy to do that in person — but here, now, I want to get out what still worries me, before those worries fade into the fog.

This is not to take away from the week’s victories, and I don’t want to insult their power by whining that we have more left to do.  It should go unsaid that there is always more to do.  But — moral objections aside — I’ve seen some frightening arguments against the two decisions, and I feel the need to reinforce the point that moving forward requires taking an inventory of our past.

* * *

The Southern Cross flag (“Confederate flag” is really a misnomer, since the flag you’re thinking of was used only as a battle flag, though like most people I use the terms interchangeably) is a symbol of at best insurrection and at worst vicious hate.  That it’s used proudly, as a symbol of ancestry and regional pride, has always left me incredulous — and I think belies a dangerous misrepresentation of history.  The Civil War was not that long ago, and if its roots and lessons are already being distorted, I worry for how it will be presented ten, fifty, a hundred years from now.  Yes, it’s fine to be proud of where you come from.  I have nothing against nationalism (state-ism?), but the Southern Cross has a legacy that is drenched in hatred and racism, not in pride and independence.  The only defenses of using the Confederate flag that I’ve heard go something like this: the flag’s not about slavery, it’s about standing up for your ideals and small government and mom-and-pop shops and freedom! Or, the flag’s not about the Confederacy, it’s about the Army of Northern Virginia standing up for their ideals and small government and mom-and-pop shops and freedom!

Okay, I’m not going to dance around this — those arguments are bullshit and I’m going to demolish them.  I’ve been reading a lot about the Civil War the last couple of weeks, which I credit to watching “Lincoln” on a long trans-Pacific flight and listening to some great podcasts on a drive from the Bay Area to LA.  This by no means makes me an expert, but I feel at least as qualified to make assertions about 19th century American history as I did at the end of my AP US History class in high school.  I think that you could make an argument that the North did not enter the Civil War to end slavery, did not enter for liberty in any sense, but fought for the abstract idea of “Union.”  Fine.

But you absolutely cannot say that the South seceded and went to war for anything other than to preserve slavery.  The Vice President of the Confederacy, Alexander Stephens, gave a speech in March of 1861, just a few weeks before the South really kicked off the Civil War by shelling Fort Sumter.  In the speech, Stephens lays out all the ways the progressive constitution of the CSA is far superior to that of the backwards-thinking nation to the north.  I’m going to quote a sizable swath of it, because it’s so repulsive I think everyone should be required to read it.  The emphasis is mine:

The new constitution has put at rest, forever, all the agitating questions relating to our peculiar institution, African slavery as it exists amongst us, the proper status of the negro in our form of civilization.  This was the immediate cause of the late rupture and present revolution.  Jefferson in his forecast, had anticipated this, as the “rock upon which the old Union would split.”  He was right.  What was conjecture with him, is now a realized fact. … The prevailing ideas entertained by him and most of the leading statesmen at the time of the formation of the old constitution, were that the enslavement of the African was in violation of the laws of nature; that it was wrong in principle, socially, morally, and politically.  It was an evil they knew not well how to deal with, but the general opinion of the men of that day was that, somehow or other in the order of Providence, the institution would be evanescent and pass away. … Those ideas, however, were fundamentally wrong.  They rested upon the assumption of the equality of races.  This was an error.  It was a sandy foundation, and the government built upon it fell when the storm came and the wind blew.

Our new government is founded upon exactly the opposite idea; its foundations are laid, its cornerstone rests, upon the great truth that the negro is not equal to the white man; that slavery, subordination to the superior race, is his natural and normal condition.  This, our new government, is the first, in the history of the world, based upon this great physical, philosophical, and moral truth.  This truth has been slow in the process of its development, like all other truths in the various departments of science. … The errors of the past generation still clung to many as late as twenty years ago.  Those at the North, who still cling to these errors, with a zeal above knowledge, we justly denominate fanatics.  All fanaticism springs from an aberration of the mind from a defect in reasoning.  It is a species of insanity.  One of the most striking characteristics of insanity, in many instances, is forming correct conclusions from fancied or erroneous premises; so with the anti-slavery fanatics.  Their conclusions are right if their premises were.  They assume that the negro is equal, and hence conclude that he is entitled to equal privileges and rights with the white man.  If their premises were correct, their conclusions would be logical and just but their premise being wrong, their whole argument fails.

In summary: what the actual fuck.

So, once and for all: yes, the Confederate States of America was built on slavery.  Yes, the armies that flew the battle flags were fighting for slavery.  And so yes, the Southern Cross, that battle flag of the Confederate army, is — by its leaders’ own admission — not merely a pro-slavery banner, but in fact a total proclamation of white supremacy.

To say otherwise is to whitewash (sorry) history.  This is something that I think is incredibly dangerous — a nation should be made to face its sins and remember its misdeeds, and the United States has plenty of both.  Willfully or ignorantly ignoring one of our most blatant sins by arguing the Confederate flag only shows some sort of home team pride makes me worry not only for our citizens’ knowledge of their country’s past, but for their willingness to lead that country in the right direction in the future.

* * *

If misrepresenting our past is dangerous, it is possibly no more so than clinging to it doggedly.  This is what I saw in the dissenting opinions from the Supreme Court’s decision for legalizing same-sex marriage.  I’m going to ignore Clarence “Slaves Did Not Lose Their Dignity” Thomas, but between Scalia and Roberts, there was plenty of confusing logic to go around.

Here’s Roberts:

The majority purports to identify four “principles and traditions” in this Court’s due process precedents that support a fundamental right for same-sex couples to marry.  Ante, at 12.  In reality, however, the majority’s approach has no basis in principle or tradition, except for the unprincipled tradition of judicial policymaking that characterized discredited decisions such as Lochner v. New York, 198 U. S. 45.  Stripped of its shiny rhetorical gloss, the majority’s argument is that the Due Process Clause gives same-sex couples a fundamental right to marry because it will be good for them and for society.  If I were a legislator, I would certainly consider that view as a matter of social policy.  But as a judge, I find the majority’s position indefensible as a matter of constitutional law.

Scalia is more, um, Scalia-esque:

This is a naked judicial claim to legislative — indeed, super-legislative — power; a claim fundamentally at odds with our system of government.  Except as limited by a constitutional prohibition agreed to by the People, the States are free to adopt whatever laws they like, even those that offend the esteemed Justices’ “reasoned judgment.”  A system of government that makes the People subordinate to a committee of nine unelected lawyers does not deserve to be called a democracy.

Here’s the thing: normally I’d probably agree with these statements.  Roberts and Scalia are right; it is not the Supreme Court’s place to legislate from the bench, and doing so unbalances all those checks America’s founders fought so hard to set up.  But the fact remains that something like marriage is a fundamental human right that was being ignored, or in the worst cases banned, by local governments.  This is absolutely a case where the court can and should step in to prevent injustice and inequality.

I know citing a previous case may be dangerous, because you can always throw the Dred Scott decision or Plessy v. Ferguson back in my face, but I don’t understand how you can look at Obergefell v. Hodges, which restores a fundamental right to a group of people state governments had been discriminating against, and not see Brown v. Board of Education 2: Electric Boogaloo.  Yes, normally the court should not interfere in the legislative process.  But I think in extraordinary cases, the court has an obligation — both moral and legal — to wield its power to right iniquity.  The justices cannot sit by as states trample their citizens’ rights.

Kennedy realizes this in his majority decision, and makes a fantastic point about how we cannot foresee the morality of the future:

The nature of injustice is that we may not always see it in our own times.  The generations that wrote and ratified the Bill of Rights and the Fourteenth Amendment did not presume to know the extent of freedom in all of its dimensions, and so they entrusted to future generations a charter protecting the right of all persons to enjoy liberty as we learn its meaning.  When new insight reveals discord between the Constitution’s central protections and a received legal stricture, a claim to liberty must be addressed.

I deeply respect Kennedy’s willingness to say the Founding Fathers may have not been omniscient.  While I believe these titans of American history — Washington, Jefferson, Hamilton, et al — were visionary, I worry that our current commentators and leaders elevate them to almost infallible status, when they are merely men, and so almost by definition fallible.  Our veneration of the Founders, capital F, borders on blind hero worship.  These men were brilliant, yes, and their invention (American democracy!) equally so, but we have to remember not to apotheosize them — because they were, occasionally, wrong.

My point here is that just because the Founding Fathers said or believed something doesn’t necessarily mean the country has to go on saying or believing that more than two centuries later.  It is important to cleave to the ideals of our country’s Founders not out of some dogmatic loyalty to them, but because they are, on the whole, right.  Every generation must think critically about this statement — like Justice Kennedy.

We cannot rely on past ideals just because we idealize the past.

* * *

I guess I don’t know how meaningful this is to say after writing a thousand words or so of what is more or less diatribe, but I really am happy with this week’s results.  Removing the Confederate flag and legalizing same-sex marriage are major coups for love, equality, humanity.  I’m proud to live in a country where these events came to pass, and I just don’t want the past to cloud that.  I want us to always recall and acknowledge, as a nation, the mistakes of our history — so that we can move forward together: respectful of our history but unburdened by its beliefs, aware of our failings but unshackled from their causes, nostalgic about our past but unbounded in our future.


A man stands clad in chrome and gold
And goes to war with ink and verse,
Lest history remain untold

With blackened eyes and heart accursed,
His foe is censored doom and spite
And goes to war with ink and verse—

The verse perverse, redacted blight
Entombs in sable pools his home
His foe is censored doom and spite

Two swift swords flash, red-splattered chrome
A child turns around to flee
Entombed in sable pools his home

A broken mouth coughs out the plea:
Take up your sword, your past recall
A child turns around to flee.

The sun will rise, the sun will fall
A son stands clad in chrome and gold.
Take up your sword, your past recall
Lest history remain untold.

Personal Dictionaries

One of my favorite features on my smartphone — and this is on a device that gives me unlimited access to YouTube, Wikipedia, and a Gameboy Advance emulator, so that’s saying something — is my personal dictionary.  As I use the phone, I add words that I use commonly to this digital repository of my own personal vernacular, and it’s always a kick to read through it and see what I’ve been talking about.  The dictionary usually ends up being a mix of the profane, the really profane, the incredibly profane, and some uncommon first names.

It’s also wiped every time I get a new phone, which is a shame, since I’ve glided through a few different argots since entering the smartphone age: college, grad school, real world.  For posterity’s sake, I think I’m going to make a conscious effort to track this dictionary from now on, so I have a record of what was (linguistically) important to me over two-year, phone-contract-length periods of my life.

Here’s where I’m at on my current phone, purchased July 2014:


There’s something magical, in the Arthur C. Clarke sense of the word, about compression algorithms — take something that’s too big for a box, and squeeze it into that box regardless.

But, of course, not everything can simply be squeezed smaller.  Some coworkers and I were talking this week about needing to extract the information in an image from a range of wavelengths about a nanometer wide, and how that wouldn’t really just work by filtering an optical image repeatedly (the range of light visible to humans is about 300 nm).  Encoding enough information in the original image so that filtering it down is actually useful — and so that the original image doesn’t take up a server farm worth of digital storage — would probably take a huge amount of compression, ratios of 1000 or 10,000 to 1.  To put that in a little bit of perspective, an uncompressed song file would be maybe 50 MB, while an .mp3 of the same song could be as little as 3.5 MB — a 14:1 ratio.  So thousands-to-one is a lot.

This is when one of the PhDs who started this conversation compared this task to trying to represent The Iliad as a limerick.

Well, challenge accepted.

It varies by translation, but The Iliad is about 150,000 words long.  A limerick, in its classic form, is two lines of two anapests (those are the ones that go “da-da-DUM”) sandwiched between three lines of three anapests for a total of 39 syllables.  It was surprisingly hard to find a good answer for the average number of syllables in an English word, but 1.3 seems to be a good guess.  (If you’re interested, you can look at this paper or use this online calculator, which I dropped some public domain works into: The Time Machine, Huckleberry Finn, and The Picture of Dorian Gray.  You can also look at this Wikipedia list, which is mostly unrelated but fantastic.)  That means 39 syllables is approximately 30 words, and turning Homer’s epic poem into a form more widely know for New Englander autofellatio jokes is about a 5000:1 compression — an impressively accurate off-the-cuff analogy for what we were talking about.

Here’s my shot at The Iliad in limerick form:

With abduction of Helen the source,
Menelaus responded with force
So the Greeks sailed for Troy
Set to burn and destroy
But just eked out a win with a horse

And why stop there?

How about the Old Testament in haiku, or taking 600,000 words down to 17 syllables (13 words-ish)?

Birth of light, then man
Wandered until given rules:
Be nice, no bacon

I’m open to suggestions for future compression here.  Will update this post as I have more ideas.

They See Me Rollin’

Whenever I talk about math in this blog, you know it’s going to be something that is simultaneously incredibly important and incredibly useless.  Today is no exception — I want to tackle one of the most important (but no worries, also useless) examples of polar coordinates and path-length integrals around, even if you don’t realize it yet:

When you have a roll of stuff — think paper towels, aluminum foil, Saran wrap, use your imagination — how much of that stuff is left, based on the diameter of the roll?  How many more chicken dinners can you cover and stick in the fridge?  How many more spilled beers can you wipe off of the table?

(This question, for the record, came up at work, albeit with some industrial polymer examples instead of household chores.  The times I do real math as a mechanical engineer are surprisingly few and far between, so apologies if I come off as over-excited.)

On one level, this question isn’t that tricky. Your roll of stuff — I’ll stick with aluminum foil in these examples — is wound around a core, and you can measure the core diameter, measure the roll diameter, measure the thickness of the foil and chug-chug-chug along until a number comes out.

Which is, of course, exactly what we’re going to do first.  (Spoiler alert: there’s a massive shortcut and a cool arithmetic trick at the end, but we’re going to slog through some calculus because I learned all this shit and never get to use it, goddammit.)

The foil is wound around the core in a spiral — an Archimedean spiral, to be precise.  Each layer sits directly on top of the last layer, around and around and around, until it reaches the point you pull.

In polar coordinates, the equation for an Archimedean spiral is r = cθ.  (Polar coordinate recap: angle, θ, and distance from the origin, r, are just as valid a way to define a point’s location as x and y, and the bears are white instead of brown.)  The constant c defines how much space is between each turn of the spiral; in our case this is directly related to the thickness of the foil, which I’ll call t.  Every winding around the core, a distance of 2π radians, increase the roll’s radius by t, so we have:

c = t / (2π)

Therefore the equation of our aluminum foil spiral is:

r = tθ / (2π)

Without deriving it here (I let Stephen derive it here instead), the length of a curve — any curve — in polar coordinates is given by:

Screen Shot 2015-01-29 at 9.12.38 PM

Our starting and ending coordinates, θ0 and θ1, are given by the radius of the core the foil is wound around (r0) and the outer radius of the roll (r1), as well as our Archimedean spiral equation.  We get:

θ0 = 2πr0 / t

θ1 = 2πr1 / t

Putting this all together, we get:

Screen Shot 2015-01-29 at 9.13.56 PM

This is, uh, not a nice integral to solve.  But we’re really good at calculus (and by “we” I mean “Wolfram|Alpha”), and so we know this evaluates to:

Screen Shot 2015-01-29 at 9.15.15 PM

Holy dammit Christmas, we’ve gone hyperbolic.  If it makes you feel better, we can write the inverse sinh function as a logarithm, and so this soup of advanced math classes reduces down to:

Screen Shot 2015-01-29 at 9.15.58 PM

Okay, fine, it’s still not pretty.  But it is precise.

Standard household aluminum foil is about 0.016 mm thick.  If it’s wrapped around a 12 mm radius core to a final outer radius of 16 mm, this formula tells us that it should have a total overall length of 21.99 m — enough for a whole lot of Chipotle burrito swaddling, and just about exactly what we’d expect.  Two points calculus.

•    •  • • •  •    •

The engineer-graduate-degree half of my brain is done at this point (we have, after all, the most exact answer possible, though it took a decent amount of computation to get there).  But the undergraduate-physics-degree half of my brain, which was at one point instructed that pi is “approximately 1” and prides itself on Fermi estimation, doesn’t love all the work we had to go through to pull it off.  I mean — path integrals?  Hyperbolic trig functions?  Really?

What if we assume the foil is wound in concentric circles instead of a spiral?  This way simpler geometrically (ignore the fact that it’s physically impossible, please — this is a physics approximation after all), and since aluminum foil or paper towels or whatever are so thin the answer should be very similar.  In this case, the radius of each subsequent winding increases by exactly the thickness of the foil.

So if we add up the circumferences of all the concentric circles from the first to the Nth, we get the overall length of the foil:

s = 2πr0 + 2π(r0 + t) + 2π(r0 + 2t) + 2π(r0 + 3t) + … + 2π(r0 + (N – 1)t)

Or, rearranging:

s = 2π(r0 + r0 + tr0 + 2t + r0 + 3t + … + r0 + (N – 1)t)
s = 2π(Nr0 + (1 + 2 + 3 + … + (N – 1))t)

Lurking in here is a really neat arithmetic identity — the sum of every number between 1 and x (here, x is played by N – 1).  There’s an apocryphal story about a young Carl Friedrich Gauss, whose 18th century elementary school teacher tasked his class with summing every number from 1 to 100 — presumably to shut the little bastards up while the teacher nursed a massive Oktoberfest hangover.  While every other student began to assiduously add numbers up, our wunderkind Gauss thought about it and came up with a much more elegant solution: each pair of numbers — 1 and 100, 2 and 99, 3 and 98, etc. adds up to exactly the same value, and there are exactly 100/2 = 50 of those pairs.  Therefore the sum of all numbers from 1 to 100 is:

(100 / 2)(1 + 100) = 5050

That Gauss guy was a smart dude.  There’s a reason literally everything in mathematics is named after him (well, him and Euler).  In algebraic form, the sum of all numbers from 1 to x is:

(x / 2)(1 + x)

And for us, where x = N – 1:

(1 + 2 + 3 + … + (N – 1)) = ((N – 1)/2)(1 + (N – 1)) = (N2N) / 2

So that means the length of our roll is approximately:

s = 2π(Nr0 + ((N2 – N) / 2)t) = πN(2r0 + (N – 1)t)

We still need to figure out how many turns are in our foil coil, but that’s just based on the inner and outer radius:

N = (r1 – r0) / t

Putting everything together, we have:

s = π((r1 – r0) / t) (2r0 + (((r1 – r0) / t) – 1)t)

s = (π / t)(r12 – r02r0t – r1t)

Somehow this just looks much nicer than the solution with a hyperbolic trig function in it.  And when you plug the same numbers in, you get — wait for it — 21.98 m.  That’s a 0.01 m difference over more than 20 m of length… or a discrepancy of less than 0.05%.

So yeah, I’ll stick with Gauss on this one.  You can call it intelligence or you can call it indolence, but either way I know how many dinners I can wrap up and shove in the fridge.