jlm-blog
~jlm

30-Dec-2010

Incentives in action: Airport tarmac delays

Filed under: econ — jlm @ 09:50

When the New York airports re-opened following the recent blizzard, there was a backlog of flights, and short-staffed airline terminal support personnel couldn’t process them as fast as they arrived. Which planes do you think got serviced, and which delayed on the tarmac for hour after hour?

It’s no surprise if you know that the rule put into effect after repeated and persistent multi-hour tarmac delays by the airlines applies only to domestic flights. Miraculously, just enough personnel were found to keep the domestic flights coming to the gates without hitting the delay lengths which would trigger fines — but not enough to service the international flights, for which there are no tarmac delay penalties.

And that’s why the flight from Vancouver, BC to Kennedy Airport sat on the tarmac for over 12 hours. Airlines had no incentive to service it, but did have an incentive to prioritize domestic flights over it. Corporations don’t feel shame or guilt for bad behavior, but they do feel the sting of fines and act to avoid them. We need to choose our incentives carefully.

25-Dec-2010

Dec. 25

Filed under: time — jlm @ 08:27

Centuries ago, we lived in ignorance, our vision dim, not even knowing what we didn’t know. Now and then some people struck sparks as we stumbled in the darkness, and saw something others had missed.
But, on this day, a man was born who was to kindle a torch and connect heaven and earth.
Though his work and teachings, he changed our worldview forever. He revealed truths and laws that mankind had had no conception of before. He turned our old notions upside-down with a new understanding of the heavenly realm, and of the world on which we live. His teachings have stood the test of time, still being taught, analyzed, and widely used in practice to this very day. The great thinkers of later ages have taken what he revealed, and built magnificently upon it, each generation using the work of the previous to go further.

Happy birthday, Isaac Newton!

22-Nov-2010

Back from Skepticon

Filed under: travel — jlm @ 10:39

I went to Skepticon 3 this weekend and it was a blast.

John Corvino had an excellent talk comparing atheist and homosexuals’ rights movements. This is a tricky topic, needing to avoid trivializing the gay rights struggles while not minimizing the issues faced by atheists in communities of believers either. John struck this balance deftly — I’m not sure someone who was not both an atheist and GLBT activist could have pulled it off.

There were interesting talks on skepticism’s relationship with feminism and sexuality, and another on diversity inside the movement. The Con had a good gender balance, but was very, very white. Part of this has to do with the location in a less-diverse part of the country, but much had to do with the white-skewed demographics of the skeptics movement. Unfortunately, the talk on diversity was lacking when it came to concrete suggestions.

The first day ended with a panel discussion on whether skepticism begat atheism. James Randi brought up that there were two types of atheists, the first who believed there was no god, and the second who didn’t believe that there was a god (ie, actual belief in nonexistence vs. lack of belief in existence). D.J. Grothe segued from this to say he found the arguments in favor and against the existence of god lacking, so he disbelieved, pending new information (so far, so good) and didn’t think there were really type 1 atheists, or maybe a very few. This statement was “WTF?” for me, so at the Q&A I pointed out that there really were people who believed there was no god, because of the problem of natural evil or other arguments. And the next day, during his talk, Grothe made this “no type 1 atheists” claim again! At Q&A Corvino called out again that plenty of atheists have real belief in god’s nonexistence. I’m disappointed in Grothe — he knows better, so claiming that “strong atheism” is a fringe of the atheist movement is simply dishonest.

Before that panel was one on accomidation vs. confrontation. This seemed to quickly settle on a consensus of “we should pick our battles wisely”, and lacking dispute consequently wasn’t that interesting.

The second day had a talk on faith healers by James Randi, which was entertaining, but was mostly video clips. Alas, Randi seems to be suffering from his age. A talk on debunking ghosts and cryptic creatures and spontaneous human combustion was interesting. Dan Barker’s story of going from faithful to faithless was touching. P.Z. Myers talked about teaching genetics by analogy with poker, but I found it unconvincing. Then there was a talk by Rebecca Watson on the so-called War on Christmas, which was hilarious.

The third day was easily the weakest. Victor Stenger’s talk used unsettled cosmology, and was weak. It’d been better if when he’d gone into elementary particles and their wave functions, talk about how the waves interfere and their particles interact. And at least gone into quantum interpretations a little. These are the bits of QM that “quantum spiritualists” misuse, and the talk gave little ammunition to combat them.

Sam Singleton was amusing for his gimmick of impersonating the affect of an evangelical preacher, but that wore thin quickly. His grandfather dying from snake handling was a sad story, another grain in the immense pile of suffering religion has caused. J.T. Eberhard’s was the best of the day, funny, and absolutely true to how talking atheism to the religious runs.

Not actually part of the conference, I spent the non-conferring parts of the weekend wandering Springfield, MO’s city center. I was struck by how utterly inactive the city was. But not like a dead city: The businesses were open, not shuttered, but there was very little traffic, pedestrian or automotive, very strange.

I had a great time talking with complete strangers also there — lots of friendly and intelligent folks. I’m overall very impressed with the conference. I’ve been to industry technical conferences that weren’t run as well. That a college freethinkers group could pull this off without even charging admission is doubly impressive.

26-Oct-2010

Kinked pipes

Filed under: math — jlm @ 12:04

Our friend Keith Devlin poses an interesting question about expanding pipes: A pipe expands by one foot over its one-mile length; how high does it arch?

Keith assumes a single sharp kink in the center and uses Pythagoras to calculate that the pipe arches slightly over 50 feet! Yet if the pipe had its sharp kink near one end, it’d arch slightly under 1 foot. This suggests a calculus of variations problem: Of all the ways a pipe can bend, which way generates the highest arch? The dual problem would be: Of all the ways to arch to a given height (let’s say 50 feet), which way uses the least length of pipe?

Our pipe path will go from one pipe endpoint up to some point with height 50’, thence to the other pipe endpoint. If either of these paths weren’t a line segment, we could shorten the path by using a line segment. The angles the segments make with the horizontal line at 50’ will be equal, otherwise we could shorten the path by equalizing them. So the shortest path is a line up to the center 50’ up, kink, then a straight line to the ground at the other end.

Because this isoceles path is the shortest path to reach a given height, it’s also the highest-reaching path of its length. Keith’s assumption that the pipe sharply kinks in the center gives the highest arch of any possible path!

Minimizing the height isn’t so interesting: By making arbitrarialy fine accordion folds, we can keep the maximum height arbitrarialy small.

What if the pipe makes a parabolic arch? Depth below the arch height at distance x from the center is kx². For our case of a mile-long pipe, we have arch height k(2640)². The curve length is ∫02640(1+(2kx)²) dx. If you’re like me, you can’t integrate this without a reference, but it gives (2kx(4k²x²+1)+sinh−1(2kx))/4k | x=2640. Numerically solving this for length 2640.5 gives k=6.385×10−6, which gives an arch height of 44.5 feet.

That was messier than I expected. I expect a catenary arch, which IIR my physics correctly is what a pipe should assume under gravity, would be much the same.

Why are the arches in the center so much higher than arches at the ends? Going back to the triangle case, if we increase our pipe length by an amount δ over a flat length x, we have height related by x²+h² = (x+δ)² from good old Pythagoras, which gives h = √(2xδ+δ²). δ will vary from near 1 at x=0 to near 0 at x=5280, δ ≈ 1−(x/5280), varies only slowly with x. So with the square root curve being steep at small values, at small x, x has a big impact on h! Toward the other end, δ ’s decrease overpowers x’s increase, and as δ gets small h is pulled steeply down.

23-Aug-2010

Permutation puzzle in Futurama

Filed under: math — jlm @ 12:26

I finally got around to watching last week’s Futurama late last night, and there’s an interesting permutations puzzle involved. The puzzle itself is a minor SPOILER, so stop now if 5 days isn’t enough time for you.

Puzzle: There’s a machine that can swap minds between bodies, but can’t swap two people if it’s already swapped that pair of bodies. A group of people use the machine to perform an arbitrary sequence of swaps among themselves. How can this group and two outsiders use the machine to restore everyone’s mind and body?

My solution is here.

I wonder if this is a recasting of a classic swapping puzzle I’m not familiar with.

19-Aug-2010

Finger multiplication

Filed under: math — jlm @ 12:39

“Finger multiplication” is an old trick for using the bottom-left (easier to memorize) quadrant of the times table to do multiplication in the top-right quadrant. It’s easy to work out why it works, but unsatisfying, but I found rederiving the technique gave more insight.

How might we do this? To go from one quadrant to the other, we subtract from 10, or generally from the base b: (b-x)(b-y) = b²-bx-by+xy
Well, there’s our xy term, to get it alone we want to subtract off b²-bx-by = b(b-x-y), which we can do by adding -b(b-x-y) = b(x+y-b). The factor of b is trivial to deal with, just use place value, so that leaves us with x+y-b. That’s easy enough to calculate on its own, but we can distribute the -b half to each number as (x-b/2)+(y-b/2). We have the numbers b-x and x-b/2 to do arithmetic on, these sum to b/2, the number of fingers on a hand, so if you hold up x-b/2 (x-5 for us pentadactyl folk) fingers on a hand, then the down fingers number b-x. And that’s how you do finger multiplication, hold up x-5 on one hand, y-5 on the other, put the sum of the up fingers in the tens place and the product of the down fingers in the units place et voilà.

Now that we’ve reverse engineered it for the existing use case, can we come up with something like it for others? How about the case where only one term is > 5 ?
We want to move this from the top-left to the bottom-left of the times table, so x∙(b-y) = bx-xy. So, put the smaller number in the tens place, and subtract off the product of it and the “down fingers” from the large number. 3×7? 7 has 3 down fingers, so 30-9 = 21. 4×8? 8 has 2 down fingers, so 40-8 = 32.

18-Aug-2010

Simpson’s paradox

Filed under: math — jlm @ 08:56

I’ve never seen Simpson’s paradox explained by showing the distributions, which I found to be very helpful in understanding what’s going on. So, take a look at these two distributions I made from calls to random():
Simpson's distribution
The cyan distribution has a larger mean than the magenta one, but anyone worth their salt should recognize them as mixtures of unimodal distributions (indeed, that’s how I made them) and look for a binary factor to separate the subpopulations. Upon separating them, in both cases the magentas’ means are higher than the cyans’, Simpson’s paradox.

15-Aug-2010

P vs. NP

Filed under: humor, math — jlm @ 14:37

So, Vinay Deolalikar has a purported proof that P ≠ NP here. But there must be some error, because I just came up with this simple proof that P = NP !
(If you think “joke proof” sounds like an oxymoron, you can stop reading here.)

Let W(m) ➙ s be a member of NP.
Let X(m; n) ➙ s be the first n symbols of W(m). X is obviously in NP.
So, X has a verifier V(m; n; s) in P.
We can find the first symbol t1 of an output of W(m) by trying V(m; 1; c1), V(m; 1; c2), … for all the symbols ci in the alphabet.
We can find the second symbol t2 by trying V(m; 2; t1c1), V(m; 2; t1c2), etc.
And so on for all the symbols t3, t4, … in the output of W(m).
Finding each symbol takes c calls to V, where c is the alphabet size, a constant. Each call of V takes polynomial time, so we can calculate each individual symbol in polynomial time.
The length of the output of W(m) is necessarily polynomial in ∥m∥, so we have a polynomial number of symbols, each calculable in polynomial time, so we can calculate the entirety of W(m) in polynomial time, so W ∈ P.
P=NP. QED

30-Jul-2010

UK recognition of the Haudenosaunee state

Filed under: politics — jlm @ 14:26

Did you read about the recent dispute about Britain refusing to admit athletes from the Nationals into the UK to play in the world lacrosse championship? (NY Times)

The Nationals represent Haudenosaunee, the Iroquois Confederation, and travel on Haudenosaunee passports, which Britain refused to recognize, saying it didn’t recognize them as a country, that land being divided between the US and Canada, while the nationalistic Nationals refuse to travel under those passports, especially with the historical mistreatment of Native Americans by those governments.

Well, this seems like a normal enough snafu, you can’t expect other countries to go along with the US and Canada’s fiction that these tribes are separate nations. We have treaties with them, after all, and other countries don’t. But then it occured to me, Canada has treaties with the Iroquois, but Canada hasn’t been independent from the UK for all that long, surely the treaties must predate Canadian independence and so it was Britain treating with Haudenosaunee as if it was indeed a state — and lo, the Treaty of Fort Stanwix was between Britain and Haudenosaunee, a few years before even the American Revolution, and I doubt it’s the only treaty between them.

Interesting wrinkle, or just a bit of trivia?

29-Jun-2010

Misuse of conditional probability

Filed under: math — jlm @ 13:27

When explaining conditional probability, the “two child” puzzle is often brought in, which is too bad because it’s a terrible example. Case in point, this recent blog post by Keith Devlin.

I tell you I have two children and that (at least) one of them is a boy, and ask you what you think is the probability that I have two boys.

(In a model where children’s sexes are independent and equiprobable,) he applies conditional probability to calculate the probability of them being the same sex at 1/3, in contrast to the “wrong” “intuitive” answer of 1/2. Let’s run with this 1/3 answer for a bit. The same analysis will show that if he tells us that one is a girl, the probability that the other is a girl is 1/3. He’s going to tell us either that he has a boy kid or he has a girl kid, and in both cases the probability of both children being the same sex is 1/3, so the unconditional probability of his children being same sex is 1/3, which is crazy. Where’d we go wrong?

The problem in the analysis is that him telling us he has a boy is not the same as conditioning the probability space on him having a boy. If you like calculating conditional probabilities, the proper condition to apply when he tells us he has a boy isn’t “he has a boy” but “he tells us he has a boy”. For the puzzle, we can assume he’ll be honest, so if he has two boys he’ll say he has a boy, and for two girls he’ll say he has a girl. The interesting case is if his children are mixed. Maybe he’ll say “boy” and “girl” half the time each in that case — but then, the probability of two boys turns out to be the intuitive 1/2 after all. Maybe he’ll always say “boy” then — this gives 1/3 for the quoted puzzle, as it “should”, but having the boy always trump the girl is unappealing and it’d give a 100% chance for two girls if he says he has a girl.

More importantly though, conditional probability is just trotted out there, with no consideration if it’s appropriate to the model. Is it appropriate? In the puzzle (“I tell you I have two children and that (at least) one of them is a boy, and ask you what you think is the probability that I have two boys.”) a reasonable model is he picks a kid of his at random and tells us its gender. He’d say he has a boy 50% of the time, and half of that time his other kid will also be a boy, as the kids’ genders are independent. Conditional probability doesn’t enter into this model. What would be the model where conditional probability was appropriate? It’s hard to come up with one which matches the wording of the puzzle, which is why I think using this puzzle for showing how conditional probability works is a mistake.

Keith Devlin’s article goes on to analyze the new “Tuesday birthday” puzzle:

I tell you I have two children, and (at least) one of them is a boy born on a Tuesday. What probability should you assign to the event that I have two boys?

once again blindly trotting out conditional probability. But let us first ask ourselves if it’s appropriate, what the proper model is. The least surprising model IMHO is that he picks one of his kids at random and tells us that child’s day-of-week and gender. In this model, independence between the children again applies and the probability of two boys is 1/2. What model could have conditional probability apply? Conditional probability applies when the other possibilities in the probability space are removed from consideration, so that’d be something like… a majordomo at a large gathering of parents of two children flips a coin to choose a gender (boy) and spins a spinner to select a day of week (Tuesday), sends away all the parents who don’t have a Tuesday-born son, and selects one of the remaining to tell you that they have a Tuesday-born son. The conditional probability of a second son is indeed 13/27, but models where conditional probability applies to the puzzle are farfetched, so applying conditional probability is an error. In this puzzle intuition is correct after all, the proper answer is 1/2.

[Update: Keith Devlin has pre-emptively addressed some of my criticism in his next post, The Problem with Word Problems, by saying that “I tell you X” is word-problem code for “the probability space is conditioned on X”. I still don’t like equating conditioning on “X” with conditioning on “he said X”: As above, if you have “One of my two kids is a boy, therefore the probability of my children being the same sex is 1/3.” then you can’t have “One of my two kids is a girl, therefore the probability of my children being the same sex is 1/3.”. I find the embrace of this asymmetry absurd.]

Powered by WordPress