Thursday, November 5, 2015

Terminal betrayal velocity

A friend posted a story from the internet that goes:

A couple decided to commit suicide. They'd had some rough times and chose to jump from a building. When they got to the top, they counted to 3 and the woman jumps. The man watches her fall for about 8 seconds when a parachute opens. Who betrayed whom?

Her comment? "Must be a tall building!"

Of course I took it upon myself to figure out just how tall that building is. This is more interesting than a basic equations of motion problem because the use of a parachute necessitates allowing for variable forces, both during the initial freefall and then during the slowing down process after the chute opens. To frame up the initial fall, we can write, generally:

[1] d/dt D(t) = v(t)
[2] d/dt v(t) = a(t)
[3] a(t) = F(t)/m

These are our base, non-specific equations. The force diagram on the woman has 2 components: mg down (which we'll define as the positive direction), and kv up, where k is some constant aerodynamic coefficient; air resistance can be crudely modeled as proportional to velocity. We have additional data as well. We know that a person in freefall will reach a terminal velocity, Tv, and that value is generally stated as being about 50m/s. I'll use this value for the calculations, but if you feel they aren't right, you're welcome to use alternate values in the final equations. So, at the point of terminal velocity we know that kTv = mg, and thus k = mg/Tv.

[3.1] a(t) = (mg-kv(t))/m
[3.2] a(t) = (mg-mgv(t)/Tv)/m
[3.3] a(t) = g - gv(t)/Tv

We can do a quick sanity check here: as v(t) -> Tv, acceleration indeed goes to zero as expected. The next step involves solving the differential equations [2] and [1]. While this could be a fun exercise in math process, I'll defer to Wolfram Alpha diff eq solver. Known boundary conditions (notably that velocity and distance are both zero at time=0) will be used to solve for constants that appear as a result of integration steps.

[2.1] d/dt v(t) = g - gv(t)/Tv
[2.solved] v(t) = c1 exp(-gt/Tv) + Tv
[2.boundary] v(0) = 0 = c1 + Tv, thus c1 = -Tv
[2.final] v(t) = Tv - Tv exp(-gt/Tv)

[1.1] d/dt D(t) = Tv - Tv exp(-gt/Tv)
[1.solved] D(t) = c2 + Tv t + Tv Tv exp(-gt/Tv) / g
[1.boundary] D(0) = 0 = c2 + Tv Tv / g, thus c2 = -Tv Tv / g
[1.final] D(t) = Tv Tv exp(-gt/Tv) / g + Tv t - Tv Tv /g

Solving for distance fallen and speed after 8 seconds yields her status as:
D(8) = 196 meters down
v(8) = 40 m/s

We're now at the stage where her parachute is opening. Based on a combination of movie scenes and the shortest base jump I could find, it appears it takes about 2 seconds for the chute to open. During this time I'll assume it has negligible braking force, and I'll simplify and assume the woman would continue to fall at v(8) = 40 m/s and thus finish this stage at 276 meters down and still going 40 m/s. Clearly I've simplified here, but due to the short duration of the stage, the effects are not terribly material on the final calculations. Others suggest the time could be as low as 1.2 seconds (derived by dividing the claimed 200 feet distance to open by terminal velocity of 50 m/s). That would put a lower-bound on her fall at 244 meters.

The final stage is to figure out how long it takes for the chute drag to slow her down to a speed she'll survive. We can reuse equations [1.solved] and [2.solved] with new boundary conditions. Tv in this case is the descent speed with the chute open, which I'll call about 5 m/s.

[2.boundary.stage3] v(0) = 40 = c1 exp(-gt/Tv) + Tv = c1 + Tv, thus c1 = 35
[2.final.stage3] v(t) = 35 exp(-gt/Tv) + Tv
[1.boundary.stage3] D(0) = 0 ** = c2 + Tv t - 35 Tv exp(-gt/Tv) / g = c2 - 35 Tv / g, thus c2 = 35 Tv / g
** - I'm re-referencing her position here as zero, this can be trivially added/shifted to the previous stages.
[1.final.stage3] D(t) = 35 Tv / g - 35 Tv exp(-gt/Tv) / g + Tv t

The last thing to figure out is how long it takes her to slow down to a speed she can still land reasonably safely. I'm not sure what the number is, but let's say 2 Tv = 10 m/s. That's the equivalent of jumping from about 15 feet. It'd hurt, but she'd survive. Using [2.final.stage3] and solving for t:

[2.final.stage3.survival1] v(t) = 2 Tv = 35 exp(-gt/Tv) + Tv
[2.final.stage3.survival1.1] Tv = 35 exp(-gt/Tv)
[2.final.stage3.survival1.2] Tv ln (Tv / 35) / -g = t
[2.final.stage3.survival1.3] t ~= 1 second

As an alternative, suppose we want to get to 1.2 Tv for a practically terminal velocity landing
[2.final.stage3.survival2] v(t) = 1.2 Tv = 35 exp(-gt/Tv) + Tv
[2.final.stage3.survival1.1] Tv = 175 exp(-gt/Tv)
[2.final.stage3.survival1.2] Tv ln (Tv / 175) / -g = t
[2.final.stage3.survival1.3] t ~= 1.8 seconds

Plugging in our two values will give us a reasonable upper and lower bound for how much distance she needs after the chute opens.
[1.final.stage3.survival1] D(1) = 20.3 m
[1.final.stage3.survival2] D(1.8) = 26.3 m

The final stage is quite rapid, and slowing down considerably more only costs an extra 6 meters. Let's assume for comfort, she'd want to get to the slower speed. Adding up the 3 stages yields 196 in freefall, 48 to 80 while the chute is opening, and another 26 to slow down. To be on the safe-ish side, let's take the max of each stage and say the building needs to be at least 196 + 80 + 26 = 302 meters (991 feet) tall. In essence, this could be done off, with rounding, any building over 1000 feet (or nominally 100 stories) tall.

There are only a few buildings in America that this story could plausibly have happened on. There are only 17 that are formally tall enough, and a few of those are coming within feet of the exact minimum height. However, a number of those don't qualify because they don't have a platform that's high enough. For example, it's doubtful that anyone could jump outwards enough from high enough on the Empire State Building or Bank of America Tower to avoid significantly outcropping lower layers. The New York Times and Chrysler buildings definitely fall into this category, and judging from other photos, the Bank of America Plaza and US Bank Tower are similarly problematic. The bottom end of the tall-enough buildings all seem to be box-shaped enough that they would support our scenario. All in all, this could happen in maybe 10 or 11 specific places, but would have to be in New York, Chicago or Houston.

What's fun to note is that even from full terminal velocity, the distance needed to open a chute and slow down to safe landing speed is under 150 meters. Scaling this up to the tallest building in the world, Using [1.final] and D(t) = 680 allows for 18 seconds of free-fall! Intense!
 

Tuesday, November 3, 2015

Up or down? A toilet story

"Why can't the guys put the seat down?" says every cliché woman, ever.
"What's the big deal?" is the standard response. And I agree. But let's be more scientific about it, shall we?

Assumptions: a healthy adult pees about 6-8 times per day (counted as 7 from here on) and poops once. Women perform all activities sitting, requiring the seat to be down. Men always stand to pee and sit to poo. All subsequent results can be adjusted if these assumptions are invalid in your household. For base calculations I'll assume that there are an equal number of men and women in a household. This should generally hold true for couples and families, for generalities' sake. Single people have no one complaining to them, so they are uninteresting for this scenario. We'll also call out adjustments for families with more men than women and vice versa. The math is really household-per-toilet, for example if only mom and dad use the master bath (and they only use the master bath), that toilet's usage is by 1 man and 1 woman regardless of the rest of the family composition.

As a practicality:
Flipping a toilet seat up or down is no one's idea of a good time. Naturally we'd like to do this as few times as possible. The seat will have to be flipped if the previous use required the opposite state. In an evenly mixed household, this means that 7 of 16 (P(up)) times the seat will be up and 9 of 16 (P(down)) times the seat will be down. Assuming the events are totally random (which seems reasonable enough), we don't need to flip the seat P(up)*P(up) + P(down)*P(down) = 130/256 ~= 51% of the time if it's just left in the previous user's required state. This means that ~49% of the time we need to flip it.

Simply leaving the seat alone gets the right next state 51% of the time. Always putting the seat down will get the right answer P(down) = 56% of the time. Not a huge win, really. In terms of number of seat flips, it means we average 0.49 flips per use. Always putting the seat down incurs 1 flip in P(up) and 0 flips in P(down) immediately after. Then there's another 1 flip in P(up) and 0 flips in P(down) for the next user, which comes out to P(up) + P(up) =  0.88 flips per use. This is much higher, nearly doubling the number of expected flips. Always putting the seat down is a worse strategy.

The numbers do change as family composition deviates from half-and-half. Suppose a family with 2 men and 1 woman. P(up) changes to 14/24 and P(down) becomes 10/24. Reworking the equations above for leave-as-is yields a don't flip, still, just barely over 51% of the time. The number grows slowly as men outnumber women. 3-to-1 is at 55% and even 4-1 is only at 58%. Conversely, it means that even in a household with a vast male majority, the percent chance that the woman will need to flip the seat stays safely in the 40s. However, the average number of flips climbs to 1.17 for 2-to-1, 1.31 for 3-to-1 and 1.4 for 4-to-1.

Supposing a family has 2 women and 1 man, P(up) falls to 7/24 and P(down) becomes 17/24. Now leaving the seat as-is will work out 59% of the time. The odds climb to 66% for 3-to-1 and 71% for 4-to-1. In other words, a female-heavy household will tend to work out in women's preference favor anyways. Employing the leave-as-is strategy means the average flips falls to 0.41, 0.34 and 0.29, respectively. Always putting the seat down averages 0.58, 0.44 and 0.35 flips, respectively. As women outnumber men more and more, the two strategies converge. However, it is important to note that leave-as-is will never be worse**, and is therefore the statistically correct strategy.

As a courtesy:
If we consider this altruistically, we should look at how often the next person finds the seat in the right state (which is really P(down)). We've done the math above. P(down) is greater than 50% for even households or those with more women. More men cause it to fall below 50%, though a family of 7 could hit a 50/50.
2 men, 1 woman: 43%
3 men, 2 women: 48%
4 men, 3 women: 50%
The takeaway from this is that family composition might dictate that the women leave the toilet seat up! In cases with more men than women, this would generally be the outcome. However, keep in mind that the misses are going to significantly unfairly affect either the men or the women, externalizing a greater cost onto that subset of the family. Is that really being considerate?

In case someone doesn't check and falls in:
I'm just going to laugh.

Conclusion:
Choosing leave-as-is vs always-down strategies is dictated by the philosophy behind the action. If trying to minimize the number of seat flips, leave-as-is is entirely superior. If being considerate to the next person regardless of cost, the choice is dictated by family composition. Families with more men than women should actually opt for an always-up strategy, while others should opt for always-down. The choice is yours. Now you know what you're fighting for!




** Appendix:
[1] Average flips always leaving the seat down = 2 * P(up)
[2] Average flips always leaving the seat as-is = 1 - (P(up)*P(up) + P(down)*P(down)).
Since P(up) + P(down) = 1 always, we can substitute P(down) = 1-P(up) into [2]:
[3] Average flips always leaving the seat as-is = 1 - (P(up)*P(up) + (1-P(up))*(1-P(up)))
[3.expanded] = 1 - (P(up)*P(up) + 1 - 2*P(up) + P(up)*P(up))
[3.collected] = 1 - (1 + 2*P(up) + P(up)*P(up))
[3.simplified] = 2*P(up) + P(up)*P(up).

Since P(up) >= 0, [1] <= [2]. If there are any men in the house, [1] < [2] since P(up) > 0

Wednesday, October 7, 2015

Don't we want the bottom to be fired?

I was reading this article discussing the nuances of the illegal batted ball in the Seahawks-Lions game. When talking about referee performance, it calls out that a section of the refs will be graded as tier three. Two consecutive years in tier three makes a ref a candidate to be fired.

Companies routinely get flak for cycling out their poorest performers. However, wouldn't you, as a consumer of a product, want that company to strive for stronger and stronger employees? We accept (even demand!) this in sports. Poor players need to go. Bad refs need to go. Bad coaches need to go. Why? Because we feel the resulting product is diminished.

If I'm going to buy a car from GM or ride a plane made by Boeing or use software made by Microsoft, shouldn't I want them to use the best people they can find to make those things? Shouldn't I accept (even demand!) that they do so?

The counterargument is usually of the form "what if everyone is an all-star?" or at least "what if everyone is really good?". I counter that there's rarely an absolute definition of good. Being able to, say, assemble 10 cars in a day is objective, but meaningless. Can anyone do that? Can more people than I would ever hire do 20 cars in a day? Hiring guidelines such as these come about by observing relative skill levels. If we hire better and better people, maybe we don't need to make more cars but we can put more effort into other related aspects of assembly. Overall, better workers should create a better product.

Going back to the NFL example, these players, coaches and refs are amongst the absolutely very best in the world, but we still say they suck, they should be fired, etc. Why do we suddenly believe that these same rules don't or shouldn't apply in "real life"?
 

If my parents had guns

My parents were born in 1944 and 1952, in Hungary. For those not familiar, Hungary was emerging, destroyed, out of WW2 and was pretty much immediately taken under Soviet control. The population was progressively subdued and thrust into a communist system. Frustrations peaked in 1956 when a brief revolution was attempted. Predictably, the overpowering might of the Soviet occupying forces crushed it in short order. People who were protesting peacefully were shot. Anyone attributed with leadership roles was executed. One can argue that the revolution was short and relatively few people died only because the population did not have guns. The spirit to fight was there. The weaponry did not.

So what if my parents (or really, my grandparents) and their friends had guns? Lots and lots of guns? I'm pretty sure I wouldn't be here right now. In case it's not clear, because they wouldn't have lived through 1956. While Freddie Mercury wondered out loud if he'd have preferred not to have been born at all, I prefer existing.

The point here is that supporting guns because the 2nd amendment says so seems an outdated stance. First, we made that rule for ourselves and it can be changed. It's not a commandment to Moses. Second, it was written to allow states to defend themselves from a tyrannical government. At the time of writing, the weapons playing field was relatively level. The army came with guns and some cannons. The population defended itself with similar guns (though probably no cannons). Today the population has guns whereas the army has grenades, bombs, tanks, cannons, airplanes, night-vision,  body armor, ... Defending ourselves from an organized, modern army is just not a thing that will happen.  

Wednesday, September 30, 2015

The not-so-ideal candidate

I spent the last few days at UofA, recruiting. Overall it was great, as usual. However, there is a segment of candidates that can get really annoying.

Critical listening:
We have a thing called a program manager. Most people think it's the same as a project manager, or some kind of manager at least. I go out of my way to explain that it is neither of those things. Following it up with "well, I think I'm a good candidate and I have a lot of experience so I'm ready for a management role" will not endear you to me.

Or just not listening:
Many people come prepared with their sales pitch about how great they are. We like to ask questions and have a conversation. It's really hard to do that when unverifiable information is streamed non-stop at my face.

Hygiene:
Onions are delicious. So are other foods. Please clean them out of your mouth before you go talk to a bunch of people in tight quarters.

Compliments:
"You work for Microsoft? You should work for a modeling company" is ... awkward.

Clinginess:
Our process is simple: you talk to us and apply. Coming back day after day just to remind us who you are is, at best, going to do nothing for you.

Connecting:
Use your face-to-face time to make a connection and make me remember you. Don't come back to ask me for a business card because you couldn't find me on LinkedIn. First, I'm not on there. Second, I either already think well of you or I probably don't want to be inundated by the inevitable future followups.

Demands:
Has anyone else gotten back to you about that resume you dropped off yesterday? Yeah, neither have we. Please hold. Even worse is being confronted about "will I be hearing back from you?" or "am I the right fit?" Expect something non-committal.

Just plain out there:
Coming up to our booth and collecting swag while avoiding eye contact and reciting a manifesto about our oppressive ways and your eternal loyalty to Linux is ... I'm not even sure what to call that.

 

Monday, September 21, 2015

The police death epidemic

The general media has certainly left us with a narrative that police are at horribly increased risk; that it's much more dangerous to be a cop now than ever before.

In the vein of "things usually are getting better", I've compiled the number of police deaths over time, as well as adjusted for population. The charts show what I expected: Not only are police deaths steadily decreasing on an absolute scale, they're at their lowest rates ever when scaled for population. I've charted numbers over trailing 5 year windows to smooth out the some inevitable amount of year-to-year volatility.

Looking at the trends shows two eras of particularly bad casualty rates: prohibition (1920 to 1933) and the rise of cocaine/crack (late 70s and early 80s). Both of these eras came with, essentially, wars on the streets. And, of course, the 50s and 60s were just swell! The current rate is roughly 2/3 of the more recent peak.

Of course, comparing absolute numbers over the course of history does not account for the rising population. If things were the same, we'd expect the rate to scale with population. The second trendline shows office deaths per year, per 100million population (again over a trailing 5-year window). This chart shows a similar trend, but even more so. Prohibition and crack still jump out, but now prohibition looks twice as bad. And, the current rate is the lowest, ever, with rates falling to around 1/3 of the more recent spike.

While being a cop clearly has serious risks, there's never been a safer time to be one.  

Saturday, August 29, 2015

The SUV phenomenon

A lot of people buy SUVs. They explain that they need it for the size, or the all-wheel drive, or the safety, or ...
Problem is, a lot of the rationalizations don't really bear out. I'll leave this highly anecdotal since the point is not to pick on or do a deep dive into SUVs. The point is that people feel the need to rationalize their choices. Probably they want to be able to justify their purchase to others.

None of this is necessary. Just say you got an SUV because you wanted to feel cool. Or you like how it looks. Whatever. Be honest about your motivations. Be honest with yourself and others.

This concept is highly visible in the world of guns. I saw a great quote the other day, something like:

Birth control? Ban it.
Abortions? Ban it.
Gay marriage? Ban it.
Guns? Well, see, people will still get guns so ...

And to all the escalationists who justify more guns in order to stop the bad guys, here's the epitome of a good guy with a gun. And now he's dead. And he never had a chance.

Gun nuts: please just admit that you like your toys because they make you feel cool. At least that's something we can't argue with.