Sunday, July 12, 2015

Whose baby is it?


Scenario:
Girl "G" has a brother "Br" who is married to a pregnant girl "PG". G's boyfriend "BF" hypothesizes that G's baby "Ba" was not produced by communion with Br, but rather with an unknown 3rd party, "P". To prove Ba's origin, BF would like to compare Ba's DNA with G's. What can we deduce?

 
Assumptions  **:
1. PG is not related to G, meaning they are no nearer than 6th cousins and can therefore be expected to share less DNA than, say, 4th cousins (chosen because there's a range of sharing published). Thus, PG and G have at most 0.5% common DNA
2. Br is related to G as full sibling and is therefore expected to share 50% DNA. The exact amount may vary significantly, but he should certainly be no further in sharing than a 1st cousin, whose low end of sharing is 7%.
** - reference: 23andme.com's table. Also pasted at the end of the entry.

 
So, what's in the baby?
If the baby is a product of Br and PG, we'd expect to see half each of 50% and less than 0.5%, which should yield something around 25% (also called out in the niece/nephew section). A lower bound can be established by using the 1st cousin range, from that we should see half each of 7% and 0.5%, for a total of ~4% shared DNA. Using the 1st cousin as a crosscheck (because they also have half a family tree that is totally unrelated) we should see no lower than 7% aggregate. The latter is the more correct number, really, because it's already tested for realistic distributions of gene passing.
 
If the baby is a product of P and PG, we'd expect to see half each of less than 0.5% each, for a total of less than 0.5% DNA sharing.

Interpreting the results:
If the sharing is:
1. Greater than 7%, it is highly probable that Br is the father. I think in practice this number would be quite a bit higher (we'd expect it to be around 25%, typically). The edge-case is if P is significantly related to Br, such as Br's parent, uncle, or even grandparent.
2. Less than 0.5%, it is highly probably that Br is not the father.
3. Between 0.5% and 7%, we have a curious case on our hands. Either P or PG are more related to Br than expected. Choice of options depends highly on state of residence.
 
 
 
 
 

Friday, July 3, 2015

Solar-powered flight

I just found out about the Solar Impulse project. It's a solar-powered plane, essentially the Tesla's brethren for the sky. Pretty cool stuff! The goal of the project is to demonstrate the viability of solar.

The last leg of the flight traveled from Japan to Hawaii, a distance of about 5000 miles. No stops, no fuel. Just sun. The plane has batteries to store energy for night flights. This is quite practical because the Japan-Hawaii leg took 5 days. Non-stop.

I think there are two major sets of reactions to this:
1. Holy shit, the future is here, and yeah it's slow now but tech gets better!!!
2. 5 days? Fuck that. Is Honey Boo Boo back on?

There's not much sense in talking to set 2 because they won't care about any of this until it's a real product they can buy. Group 1, however, is interesting to me because we can actually quantify what the concrete technical challenges are and assess the viability of overcoming them.

For viability purposes, let's say that a solar-powered craft would need to reach the same customer scenario as a current fuel-powered plane. That is, a cruising speed in the 530-580mph range and the ability to carry hundreds of passengers. How much energy does that take? I'll use the Boeing 787 as my example since it's the most modern fuel-efficient passenger plane. Looking at the 787-9 specifications, we see that it can transport 408 passengers a distance of 9550 miles using 33384 gallons of fuel at a speed of 567mph. We also should know how much energy is stored in a gallon of fuel. Using the two listed options for "jet fuel", I've opted to just call it 120kBTU per gallon.

Time of travel = 9550 miles / 567 mph = 16.8 hours = ~6E4 seconds.
Energy used = 33384 gallons * 120kBTU per gallon * 1055 J per BTU = ~4.2E12 J
Power = 4.2E12 J / 6E4 s = 7E7 J/s = 70 MW.

How much surface area is needed to collect 70MW? In a sunny place like Tucson, AZ, peak solar energy (mid-day) reaches 1000-1100 watts per square meter. A more realistic average over the Earth, over 24 hours, is 164 watts. We can adjust this for daytime averages by doubling it since the night portion contributes practically zero to this aggregate. So, let's say a typical daytime produces 325 watts, with shorter term highs around 1000W. This gives us a factor of 3 bounding, which should be adequate for this study. It's also important to point out that, per the same source, only 8% of solar energy is reflected back to space by the atmosphere, meaning that going higher up doesn't appreciably increase the available solar power.

Based on the range of incoming solar rates and the power requirements, it would take about 70,000 - 200,000 square meters of cells, operating at perfect efficiency. To put this in perspective, a football field is just shy of 5000 square meters. In other words, even on a bright bright day, it would take wings the size of 7 football fields. And for the average day we're looking at about 20 fields each. This seems intractable, even with "improving tech". The biggest improvement is probably the efficiency of the solar cells, and we've already allowed for that.

The other way to slice this is to look at the per-pound requirements and see how much we win by reducing airplane weight.

Power per pound = 70MW / 557k lbs ~= 125 W per pound.

In other words, I could, in an ideal world, attach a newborn to a square meter cell and send them flying around Arizona. Scaling this up to a typical adult requires some assumptions about their size and luggage and stuff, but let's call it 200 pounds. I'm being optimistic about human sizes by the time this hypothetical solar future arrives. The incremental solar area to carry a human is therefore 25-70 square meters. That's about the size of a one-bedroom apartment. The real lesson here is that we can potentially gain a lot by reducing airplane weight. First, we no longer need to carry 25000 lbs of fuel. However, we do need to carry batteries. Let's say, for the sake of the optimistic argument, that we can make the batteries arbitrarily small. We may also be able to make the wings lighter since they no longer need to support all that fuel. Not sure what kinds of savings that gets us. I'm also not sure if we can significantly reduce the weight of the fuselage. So, not much savings there on a 500,000 pound plane.

For the sake of the absolutely optimistic argument, suppose we can make the weight of the airplane zero. To transport 400 typical adults and bags, we'd need around 10-30,000 square meters of wing. That's 1-3 football fields each. And remember, they have to be perfectly efficient. And weigh nothing. And the passengers are sitting inside an ideal, weightless bubble.

Overall, the idea of solar for mass air travel seems far-fetched, simply because the energy density of solar is not high enough.






 

Monday, June 29, 2015

Hypocrisy, right?

The law gives me the right to deny the right given to them by law.

In the wake of the marriage equality ruling, a number of cases are popping up where Christians are insisting they can continue denying this right. For example, the Attorney General of Texas is stating that licenses can be denied if the state worker disagrees with gay marriage. First off, this is bullshit. You are an employee of the state and you shall give access to state benefits/rights equally. Second, the freedom you claim to be exercising is coming from the exact same set of laws. Therefore, your stance is not more justified. Third, the religious freedom you are using the justify your dissent has no place in official business, because that same law said so.

That is all. There's nothing more to say here.

Saturday, June 20, 2015

Focus on the edge-case

I find at work that people often get really worried about the super uncommon scenarios and how we'll address those. While it's fine to think about those things, they should not supplant addressing the common scenarios. Let's apply this same approach to a topic at the top of mind for many: gun violence.

For the purposes of this discussion, I'll look just at gun deaths (somewhat arbitrary: easier to get stats, and let's assume it's a reasonable proxy for injuries as well). In a given year, roughly 30-35,000 people are killed by a gun in the USA. This breaks down in some perhaps unexpected ways:

More than 20,000 are suicides.
Around 9-11,000 of those are murders.
There are about 500 accidental deaths.
And of the murders, between 100 and 200 are the result of mass shooting.

While it's understandable that mass shootings get all the press (especially when the gun debate is so prominent in popular culture and mass shootings will generate media clicks), they make up the absolute edge-case of the gun scenarios. However, it seems to be used as the basis for the "good guys with guns" and "more guns" narrative. We should first solve the bigger buckets before we worry about the mass shootings. While no one wants to be a statistic, at a population level we must focus on statistics to drive broader policy.

The biggest bucket, by a factor of two, is suicides. It's also a hard one to address. Guns account for right about half of all suicides. Would removing guns actually eliminate those suicides, or would people just find other ways? The two next most common methods are suffocation (~25%) and poisoning (~15%). I don't know the mentality of someone who is considering taking their life, but I suspect that a meaningful subset of suicide by gun are people making rash decisions in desperate situations. In other words, I'd expect that eliminating guns would cut down on this number, but certainly would not eliminate all the suicides that are currently committed using guns. Anecdotally, we should not expect to see a major difference by simply eliminating guns since other comparable countries (ex: European) with heavily restricted guns have similar suicide rates per population. However, even a moderate drop of, say, 1-2 per 100,000 (out of ~13 now) would eliminate 3-6000 deaths. I use this number as an example because a number of "similar" countries are about that much lower. It appears that mental health support and cultural changes would be the best candidates here, though again, I'm not an expert other than to say access to guns is likely not the biggest way to address this.

The next largest bucket, of course, is murders. I've speculated at the effect of the presence of lots of guns (that it leads to lots of murders), and absolutely believe that removing them from the equation will have a profound downward effect in murder rate. The short of it is that, using Australia and UK as controls, removing guns from the population does not lead to murders being replaced with other implements, it simply leads to those murders not happening. Since roughly 3 out of every 4 murders in the USA are committed with a firearm, that's roughly 3 out of 4 murders that could be eliminated.

Eliminating guns from the general population would also lead to a sharp decline (realistically not complete, but pretty close) in accidental gun deaths. Pretty simple.

And last, come the mass shootings. We're now down to a cause of death whose frequency is within a factor of two of lightning strike deaths. We're having a national policy debate centered around a scenario that's, as far as people conceive, an absolute rarity. This does not make sense. The argument tends to go something like "The bad people will get guns. They know to go to places where guns aren't allowed. Easy targets. Let's take away those targets by adding more guns!". Again, let's add guns EVERYWHERE because lightning strikes.

I would also suggest that eliminating general access to guns would serve to reduce the number of guns in clearly unstable people's hands, simply because not all of them will be capable of navigating a black market for a weapon (they're usually mentally off, remember). But sure, some (maybe most) will still get a weapon. In a world where a citizen can't openly own a gun, they also can't effectively train with that gun. Their proficiency in killing people can only go down for when they do snap and attack a school. Making guns illegal gives law enforcement more time to catch up to illegal weapons because simply owning one is now illegal. It could be discovered in some other way before it's put to bad use, and removed from the system. While guns are so broadly legal, the only place where law enforcement can interject is in the last stage when the mass shooter starts actually shooting. In other words, it is currently totally legal to perform all the preparations for a mass shooting. In my opinion, there's absolutely no way more damage could be done by mass shooters if guns were broadly illegal. I'd even suggest that the simple act of holding the gun and firing it at the range could fuel the mass shooting fantasy for someone who'd be prone to actually going through with it. If we remove some of those factors, a shooter may never even develop the clear desire to go on a shooting rampage.

In other words, the main scenarios clearly point to reducing guns. And as icing, even the edge-case justifies no other choice than reducing access to guns.



 

Guns are bad, mmkay?

After Sandy Hook I started reading up on gun and murder stats and one very interesting thing jumped out at me while looking at 3 countries that I'd otherwise consider culturally similar. The murder rate in the USA is far higher than in the UK or Australia. The latter two have heavily regulated (minimal) gun ownership, have significantly fewer murders, and the number of murders with guns is almost exactly the difference. In other words, remove the guns, remove the murders. Furthermore, Australia was once very loose with guns (similar to the USA) and then moved to heavy regulation.

Let's start with the intentional homicide rate by country per 100,000 population:
United States: 4.7
Australia: 1.1
United Kingdom: 1.0

Now, let's look at the intentional homicide rate by gun in each country:
United States: 3.6
Australia: 0.1
United Kingdom: 0.04

If we combine these and make a little table, we get:
CountryOverall murder rateGun murder rateNon-gun murder rate
United States4.73.61.1
Australia1.10.11.0
United Kingdom1.00.041.0

The difference disappears, like magic!

A quick search on the effect of Australia's tightening and gun buyback in 1996-7 seem debated (though even basic facts are "debated" on the internet), but per official records, the percent of murders committed by guns is dropping at a decent rate. Granted, it had started dropping well before 1996 (from a peak around 1980). Probably need to do more careful analysis here, but the bottom line is that introducing gun legislation did not lead to a collapse of society or out-of-control murders against the unprotected populace.

Sunday, June 14, 2015

Some number of reasons to go to The Palouse

The Palouse, eh? What is that?

You know when you first installed Windows XP and your background had these nice green hills? That's the Palouse. It's a place where crappy photographers ("tourists", really) fail to capture their experiences and good ones find amazing pictures.

So yeah, lots of great pics to be had. Be ready to sleep weird schedules as you become like a predator, chasing your shots at sunrise and sunset. And since you'll want to do this in the summer, that's like 5am and 9pm. You can stay in places like Colfax, population 2800. There's a Zip's, a Subway, a Papa Joe's ... Eddy's Chinese Kitchen, and Westside Pizza operates out of someone's living room. You might think this list goes on, but no, that's it. Evidently the flood of photographers and weddings in June, July and August completely fill and sustain a Best Western.

Being just an hour south of Spokane, I'll be coming back again. No doubt. If I'm bringing anyone with me, I'll just set them loose tracking wildlife. So far on this trip we've seen:
  • A crow being divebombed by a smaller bird
  • Two small birds escorting an owl
  • Deer, everywhere
  • Hawks galore
  • Wild turkeys
  • Marmot
  • Magpie
  • Quail
  • Coyote
  • And Rowan says he saw a fox!
We've even heard rumor of the local karaoke bar.

 

Friday, June 5, 2015

So, what's good here?

While discussing running into "Grandmother Lovers" on TLC, a friend noted that Bridalplasty was the worst show they had ever seen. IMDB corroborates this: it's rated 2.9 out of 10. But, where does that stack up?

To compare, I looked at a the most popular reality shows and a few more that I've watched and found patterns:

Good Eats - 9.1
Most Extreme Elimination Challenge - 8.8
Survivorman - 8.4
Deadliest Catch - 8.2
Amazing Race - 7.6
Top Chef - 7.6
Chopped - 7.5
Pawn Stars - 7.4
Project Runway - 7.3
Property Brothers - 7.3
House Hunters - 7.1
Hell's Kitchen - 7.0
Duck Dynasty - 6.6
The Voice - 6.6
My 600 Pound Life - 6.2
America's Next Top Model - 5.5
The Biggest Loser - 5.5
Million Dollar Listing - 5.3
Say Yes to the Dress - 5.2
Dancing with the Stars - 4.7
Dance Moms - 4.6
Finding Bigfoot - 4.3
American Idol - 4.1
The Real Housewives of {whatever} - [3.6 - 4.3]
19 Kids and Counting - 3.8
Toddlers & Tiaras - 3.2
Bridalplasty - 2.9
The Bachelor - 2.8
Here Comes Honey Boo Boo - 2.7
Keeping Up with the Kardashians - 2.5
** - Grandmother Lovers is not yet rated

There seems to be a strong correlation with the content of the show and its ratings. For example, educational and legitimate-ish competition shows rank near the top. Shows where we just watch people make choices score in the middle, and shows about dysfunctional families pretty uniformly score low. Production value and major network status seems to have little to do with ratings.

So are shows featuring competitions fundamentally better? This can't possibly be the case.
Do audiences prefer to get excited about competition more than getting frustrated at what some brainless housewife does? Is an opportunity to learn inherently associated with higher quality? This last point gives me hope, and it seems that ratings do indeed correlate with the primary emotion they invoke:

Success and education are positives and frustration is a negative. The bulk of the shows in the middle kinda invoke none of the above. In this sense, we can say that all these shows at the tail end are worse than nothing. We're worse off for having seen them. And the Kardashians are the worst of all. Kudos.