Tuesday, December 31, 2013

Herbivore men and national gender imbalance


There's a growing phenomenon in Japan. A large fraction of Japanese men have no interest in sex. I wouldn't care to speculate why right now, but there's one particular consequence I'm interested in: there are a lot of Japanese women who will never have a husband.

Other countries, notably China and India, have more men than women due to selective abortions. That's a lot of men who will never have a wife.


Japan and China don't get along well for... historical reasons. But Japan and India seem to do fine. Maybe we should hook them up?

That would be an interesting world.

Thursday, December 26, 2013

Polio eradication

Humans change the world. Sometimes on purpose, sometimes not. Sometimes good, sometimes bad. One change is extinction of a species, a change that cannot be undone.

Think about what it means for an animal to go extinct. Say, elephants. If elephants went extinct today, your children or grandchildren will grow up in a world without elephants. They will never see one, ever, no matter where they go or what they do. A significant experience will be denied them; a choice will be denied them. So even if you don't care about elephants in themselves, won't you please think of the children?

Disease eradication is the opposite. By eradicating a disease, mankind makes a mark on the planet for the rest of time. Most things people do will eventually crumble. But as bad as the extinction of an animal is, extinction of a disease is the antithesis. It is a permanent, unalterable improvement in the state of the world. Disease eradication is one of the greatest achievements of man. And it only happens because of vaccines. If anyone ever tells you vaccines aren't safe, point out the alternative.

Only two diseases have ever been eradicated, and of the two, only smallpox affects humans. But we're making progress on several others, and polio is at the top of that list. Forty years ago there were 50,000 reported cases of polio in the world. The last few years, there have been under 500. There are only three countries with endemic polio (meaning it's transmitted within the country, not imported), and the number of endemic cases is down to under 150. Now, the game isn't over; as long as there are endemic populations and large groups of unvaccinated people, there can still be outbreaks, like happened this year in Somalia. But the vaccination will continue. Within the next decade, polio will be dead.

And then nobody, anywhere, will have polio again. Ever. This will never happen again:
 

Think about that.

In the same period of time, you can expect to see an end to guinea worm, and yaws may not be far behind. Then malaria and the measles.

Tuesday, December 24, 2013

Quackcast

I've been really enjoying listening to the Quackcast. It's a dry, sarcastic analysis of alternative medicine, complete with explanations of the available medical literature on each subject. Full of great references and in-jokes. It's not "fair and balanced". It's science, and it's all about data. If that's how you prefer your medicine to be done, this is a great podcast. The guiding quote sums it up nicely:

“Ridicule is the only weapon that can be used against unintelligible propositions. Ideas must be distinct before reason can act upon them.”
-- Thomas Jefferson (on a different topic)

Here's the summary of my listening so far. If you don't want to take my word for it (and you shouldn't), please, listen to the podcast! The data is quite convincing. Unless, of course, you don't make decisions based on data, in which case, why are you reading this blog?
  • Acupuncture (without electricity) is ineffective and dangerous.
  • Chiropractic is sometimes ineffective and dangerous. Now, chiropractors are a varied lot. Some are perfectly reasonable and helpful. I'm not saying you shouldn't see a chiropractor. But if you're going to, make sure you find a sane one. The more reality-challenged ones think that manipulating your spine can cure your allergies. Some reject germ theory, of all things, which means they may not clean tables or equipment. Equipment used to give colinics. You may now run screaming in terror.
  • Homeopathy is hysterically ineffective.
  • Vitamin C megadoses do not prevent colds, or reduce their intensity or length to any useful degree.
  • Probiotics might do something, but not as typically sold.
  • The anti-vaccine movement doesn't have a leg to stand on with any argument they've ever made. All they accomplish is getting children maimed and killed.
  • Things sold as an "immune system booster" really just provokes an immune response, like inflammation. This does not make you more likely to fight off infection, and it may actually contribute to cardiovascular disease.
The Science-Based Medicine blog, often referenced in the Quackcast, also looks great, but I haven't gotten into it in depth yet.

Thursday, December 19, 2013

Gut bacteria


In the news recently has been a lot of talk about gut flora. We all have a lot of different kinds of microorganisms living in our intestinal tracts, naturally and normally. Without them, we don't process food like we should. Now, if the populations of one bacteria or another are reduced, they might grow back. But what if every last one of some kind is dead?

What happens if your body gets so out of whack (technical term!) that some of your bacteria populations die out entirely? Like by taking a lot of antibiotics to deal with another problem? Or maybe by a really horrible diet? (Maybe?) Your digestive system would start behaving differently, and those bacteria would never return. Maybe this would explain why it's harder to lose weight than it was to put it on!

Obviously I'm just making stuff up. But it's an interesting concept.

Tuesday, December 17, 2013

Harmonizing Genesis with a very old universe


I'm going to throw an odd proposal out there. Please note that I'm not saying I believe this. Neither am I saying I don't. I'm throwing it out there as an idea for people to chew on, because I find this manufactured fight between science and the Bible to be tiresome, unnecessary, and destructive, and I want to find a way past it. Consider it an amusing idea. If it bothers you, for either religious or areligious reasons, feel free to forget you ever saw it. (Because, hey, you are.) This is intended to help, not to cause difficulty.

The Book of Genesis describes the creation of the world. It describes the first man and woman and their descendents. Genesis presents an unbroken genealogy from the creation until the time of Joseph, complete with the ages of each individual. From that point, further books of the Bible give a sequence of later events, some of which can be correlated to outside historical references. Taking all those things together, we can build a timeline that shows about six thousand years have passed since the creation of the world, give or take a minute.

So why does the world look so much older than that?

Now, let's not start with any prejudice. Momentarily forget you have beliefs on this matter, and break the problem down as if you were seeing it for the first time. As I see it, there are three main possibilities, each with two sub-possibilities. In no particular order:

1) Deceptively old Earth. The world just looks old, and really isn't. God made the world six thousand years ago, in such a way that it looks old.
1a) God was unable to make the world any way he wanted. Limited God.
1b) God made the world exactly as he wanted; God wanted us to think the world older than it is. Deceptive God.

2) Young Earth creation science. The world doesn't look old at all, we're just modeling it wrong.
2a) Our observations are in error, so our model of them is incorrect. Bad data.
2b) Our observations are correct, but our model is incorrect. Bad interpretation.

3) Standard scientific model. The world really is much, much older than 6,000 years.
3a) We're misunderstanding the Bible, and it is not telling us that the world is 6,000 years old. Flawed reading.
3b) We understand the Bible correctly, it is telling us that the world is 6,000 years old, and the Bible is simply wrong. Flawed text.

Possibility 1 is, definitionally, outside the realm of science. Science deals with patterns in nature, identifying them and extrapolating from them. Miracles break those patterns, so science can't speak about them one way or another. If God made the world look old, presumably he did a good job and we wouldn't find any evidence. It's no different than the idea that you were created five minutes ago with a few decades worth of memories; it's possible, but it's also untestable, so you may as well not worry about it and move on.

Possibility 2 is a fine place to start. Science is all about checking your work and challenging theory. Anybody who tells you otherwise is doing it wrong! But that same principle requires us to admit when the weight of data is against the challenge. Given all the evidence, any model that allows for the universe as we observe it to be only six thousand years old becomes unnecessarily (and more important, untestably) complex.

For example: if the universe is that young, why can we see stars more than six thousand light years away? That light shouldn't have gotten here yet. What does that imply? Either the speed of light is variable under circumstances we haven't observed, or the universe is a millionth the size we think it is. The former, since it's unobservable, is not science. For the latter to be true, all our models of how stars work has to also be thrown out, and we don't have a good replacement model for that either. Either way, we're making a model more complex than it needs to be to explain observations, just to make it fit an unobserved data point.

(Note that I'm not saying you can't believe this, or anything else. I'm just saying it's not science at that point.)

So if we want to stay in the realm of science, we're left with possibility 3. And if we want to maintain a belief in Biblical inerrancy (which is my preference), we're left with 3a. So now we're not talking about science; we're talking about altering our understanding of a text in order to keep it consistent with observed fact. This has been called "spin" before, in a derogatory fashion, or an exercise in rationalization. Call it what you will (as long as you don't call it science). We're talking about complicating our model of a text to maintain its consistency with our scientific model of the universe, and there is nothing wrong about that endeavor.

Because a model of the text is what we have, right? What the text actually says, and what we understand it to mean, are two different things. The Bible never says "The earth was created 3528 years before the deportation to Babylon" or anything like that. That's just a conclusion we can reach if we start with the text and make certain assumptions. What I'm asking is, what are those assumptions? And are there any we can do without?

The primary assumption is that there's no gap in the timeline between creation and some other correlated event. Our first actual datable event is the age of Adam when Seth was born (130 years). But is Adam's age actually dated from the creation of Earth? Or is it perhaps dated from the expulsion from the Garden of Eden, when death entered the world, at which point age has meaning? If the latter, we have some discontinuity. That gap is where I'll insert my imagined harmonization.

Consider how Genesis describes creation after the Fall: pain, a battle to survive, and eventually, death. The world is cursed, and everything in the world will eventually die. In other words, the world as we know it.

Before the Fall? None of that. No death. No pain in childbirth. A world utterly unlike this one in every way.

So what if it wasn't this world?

Here's the idea: God creates, exactly as described in Genesis. He creates Eden, a perfect place without death or disease. Maybe it's not unlike Earth; maybe it's a place with different physical laws; maybe it's all completely aphysical and indescribable in any terms we have. All that is beside the point. God creates Man, somewhere not here, and Man exists in Eden in harmony with God for some interval.

Eventually, Man sins, and can no longer live in that world. Man dies; life as he has known it is over. But rather than eternally and completely terminate Man, God gives Man another place to live. God creates an entirely new universe, this new one based on death and decay ("the ground is cursed for your sake"), and inserts Man into it. God, being outside time, sees the entirety of this new creation, from beginning to end, and finds what He judges to be the best place and time to insert Man: a planet covered with water orbiting a yellow star, filled with all sorts of life, about fifteen billion years after the start of the new creation. Why there? Because on this life-filled planet has evolved a group of particularly smart tool-using hominids. Man, as he was created, is no more. But what he was, his soul, is now inspired into these creatures, to live and die here in this decaying universe.

This is obviously unorthodox, but is there anything about it that's problematic? It can't have scientific issues, because it's not talking about patterns in nature at any point. We're talking about something totally unobservable. And all of this is clearly within the power of God. The only change to the typical scriptural interpretation is the idea that Eden didn't exist somewhere on Earth, but was some other domain of existence. Which, frankly, makes a lot of things more sensible anyway. (Also, as a bonus, all that implied incest in early generations is done away with.)

Now, this proposition has interesting consequences. First, it implies there's something interesting about humans biologically that makes us unique for God's purposes. Presumably our intelligence, since we're not good at much else compared to other animals. This implies that the ability to think is, for whatever reason, a trait God finds desirable for us to have. God gave us big brains, and intends for us to use them! (Maybe just because there are billions of us, and without intelligence there's no way to feed that many? But that's way into speculative territory.)

Second, it implies an answer to the Fermi Paradox. Why do we see no other intelligent communicating races out there in the big vasty nothing? Because the universe was created for us. Maybe we're the first, or the only there will ever be. Or maybe not. But it's a possible answer.

Third, Man died. God told man that on the day he touched the tree, he would die, which is a common point of criticism leveled at Genesis; clearly Adam survived after that day. Under this model, that death is very literal. Man died, his life ended, and this is his afterlife. (In fact, the world bears a striking resemblance to some ideas of purgatory.) Which itself raises an interesting question: if Adam and Eve had a pre-life with God which ended because of their sin, were they the only ones? Or did the same thing happen with every single one of us? Is the story of Eden not a story of us collectively, but of every individual human to ever live? Is it a story that has played out billions of times? Did I, personally, live in the presence of God, and sin? Was I thus expelled from the presence of God into this thinking piece of animate meat?

I have no evidence, but at first glance I find that idea comforting. Because that would mean I'm not being punished for the sin of my remote ancestor. I'm being punished for my own sin. The concept of original sin becomes quite specific. If I hadn't sinned, I wouldn't be alive on Earth. But again, way into speculative territory.

This is all just one idea. Like I said, I'm not sure I believe it. But I'm reasonably sure it works as an idea. And if I can come up with one way to keep the Bible literally true and inerrant, while maintaining a scientific worldview, there have to be others. If I can come up with one way, God can come up with many, many more. I'm only interested in demonstrating that it's possible.

So can we get past the science vs. Bible arguments? Please?

Thursday, December 12, 2013

Structuring code: setting vs. evaluating

A while back I was explaining my code to a coworker, so as to reduce our bus factor. We got into a discussion about the way I structured my code. My code tends to be more like this:

while(1){
     //read the inputs
     input1 = pin4
     input2 = pin5

     //define the mode
     if (input1) mode = CHARGE;
     else if (input2) mode = BOOST;
     else mode = STANDBY;

     //define outputs
     if (mode == CHARGE) output1 = 1;
     else output1 = 0;

     if (mode == BOOST) output2 = 1;
     else output2 = 0;
}

His code tends to be more like this:


//handle first mode
if (input 1){
     mode = CHARGE;

     output1 = 1;
     output2 = 0;
}
//handle second mode
else if (input 2){
     mode = BOOST;
     output1 = 0;
     output2 = 1;
}

The two are semantically identical, but the way you get from A to B is totally different.

In essence, mine is structured around making sure that any given variable is only set in exactly one place in the code wherever possible. Obviously there are some cases where that can't be, like the results of long strings of sequential calculations. But in general, I find that this makes my code much easier to debug. If something is wrong with the value of one particular variable, that problem can only exist in exactly one place. And if I need to insert intermediate flags between one variable and another, it's much easier if there's only one place to do that.

I'm not sure how I got to this point. I didn't used to program this way. I think I learned it from lots of VHDL pain, back in the day. I wonder if there are names for these two approaches to structuring one's program. I'd be interested in reading more about the subject.

Tuesday, December 10, 2013

Review: Man of Steel


The short version: Man of Steel is an excellent attempt at a Superman movie.

First, the world-building. Krypton is more fully realized here than I've ever seen it. The series of events leading to Kal's departure for Earth is coherent, and efficiently tells us how Krypton came to its final state. The fights at the beginning give us a clear sense that this is a world that's dying, not just eight guys standing around in a crystal chamber. And the history Jor-El gives us later tells us something of why Krypton, the best of Krypton, was worth saving. Krypton as a world makes Jor-El's motivations believable.

Krypton as a world also makes Zod's motivations believable. This is not a moustache-twirling characature out for world domination because powah!!! Zod is a man who has lost his home, and is desperate, not for revenge, but to save what he can. Zod's motivations here are not self-serving, and if his priorities were just a little different he'd be a hero. This is a man with no choice; this is the kind of man that results when you take away choice. Zod is, essentially, a machine. But you'd never know it from the acting, which is top-notch all the way through.

Earth is also built as a believable world, particularly by Clark's interactions with humans. Through him we see people, all of them, as a mixture of good and bad. From the military to Pete Ross, nobody's a generic obstacle, nobody's a cheerleader. Everyone we see is a person, with hope and fear, not really that different from Clark.

There's more realism here than one would expect from a Superman movie, and it works nicely. The use of a crashed colony ship as a sort of Fortress of Solitude is a nice touch, neatly eliminating the unbelievable magic tech used to create it. Lois meeting Kal-El and figuring out he's Clark by backtracking him is a good introduction to the character of Lois, and her relationship to Clark. Having her know his secret from the start is also good. And the addition of the Codex in particular is a creative touch. It gives Zod reason to come to Earth, and gives Kal-El himself additional weight.

Now what's wrong with this movie? The entire last act! We have this excellent setup, great conflict for Superman against a worthy opponent, and what's the resolution? Superman just has to punch something hard enough. A machine, Kryptonians, something. During none of the fight to save the world did Superman have to show any intelligence at all. And neither did his enemies! His opponents were as un-injurable as he was, but did either ever try something creative? No! "Well, throwing you through a massive exploding silo and into the road at the speed of sound didn't so much as scratch you. Maybe if I punch you through another half-dozen buildings I'll slow you down!" I mean, really, people. Try the heat vision, try threatening a valuable asset, try something besides "punch harder"!

So after all that backstory, all that world-building, all we ended up with was a fake-looking inconsequential fight scene. That battle would have killed literally hundreds of thousands of people! And there's not a hint that anyone cared.

Hollywood has become a strange place lately. (Moreso.) We have these wonderfully-written movies that really care about the source material, and take creative risks with it. We have the special effects technology and budgets necessary to put on the screen literally anything you want. Yet somehow these seem to fight each other. We saw the same thing in Star Trek Into Darkness, where the mostly-excellent story fell completely apart when it was time for the big fight. But that's another review.

There are other minor flaws with Man of Steel. For their attempts to handle it well, the "secret identity" front is a mess. The General is actively trying to figure out who he is, and Superman outright tells him he's from Kansas and is 33 years old! How many 33-year-old white males of approximately this height and build, presumably lacking a birth certificate, can there be in a state of less than three million people? Maybe 50,000? I bet you the military would go through every one of those by hand to find this guy.

That little joke at the end where the female Captain tells the general that Superman is "kinda hot"? Yeah, that should have been dropped from the final edit. Insultingly unprofessional.

I won't be buying this movie, and I won't be watching it again. I'm glad I saw it, but I won't recommend it to others. I wish we lived in a world where recuts, serious all-out modifications of movies like this, were a thing. This movie could be a great film, on par with Nolan's Batman movies, if only they'd come up with a good resolution. As it is, it's a mish-mash, and the end ruins the start.

Thursday, December 5, 2013

Fixing government contracting

There's been a lot of attention lately on the process of winning government contracts. A few observations I've heard in particular:

1) Contracts go to the lowest bidder who can "do the job"
2) To be able to "do the job" involves jumping through a huge number of hoops, and knowing where those hoops are is an expertise in itself
3) From the perspective of the bidders, it's better to get the contract by underbidding the actual cost than it is to lose the contract

The third is the real problem. The companies doing the bidding have an incentive to underbid; if it's "win this contract on false pretenses or go out of business", then obviously they'll underbid! And if they win the contract by underbidding, it might be ten years before anyone realizes they can't actually do the job for that amount of money; there may be consequences for underbidding, but the feedback path is entirely too slow. And then who's screwed? The government, meaning the people, meaning you and me. Cost estimates are being provided by someone who has an incentive to lie! That incentive structure is entirely backwards.


Costs should be estimated by an entity that has an incentive to estimate cost accurately, someone who gets paid solely based on their history of accurate bid evaluation. This entity would be responsible for selecting the company who does the actual work, based on their evaluation of the proposal and the company's quality of work. It would make sense for that entity to also be able to navigate the byzantine regulations; they would be an interface between the government and the contractors. That way, the companies that can do the work effectively don't have to also worry about understanding government rules and regulations.

Now, how is this different from what we have? Doesn't the government act as the evaluator I'm describing? The difference is that the government is singular. I'm suggesting that there should be multiple companies, say at least four, that perform these evaluations in parallel. Every project that gets bid, all the evaluator entities produce cost estimates. The government synthesizes the data from the estimators, and picks the direction to go. The evaluator entities are continually judged on their continually-updating estimates of the project's progress, completion date, and cost. The entities that do better are paid more, and get more weight next project evaluation.

Incentivize the behavior you want to see. Otherwise people will just tell you what you want to hear.

Tuesday, December 3, 2013

Republican Heath Care Proposal

For years now, I and many others have been asking the Republican Party one question: if you successfully repeal the ACA, what then? I mean, it's not like the ACA created the health care crisis in this country. It's been growing for decades. And regardless of what one might think of the ACA as a solution, if you repeal it, we're back to the original problems.

So say the Republicans have their way and repeal the ACA. What will they replace it with? Nothing? Are we back to the unsolved crisis, or do they have some other solution?

(Given that the ACA is a Republican idea to start with, it's kind of a funny question to ask. But ask it we must.)

Behold, we finally have an answer!

Most of the proposed ideas don't actually accomplish anything. Health savings accounts are only useful to people who have money to begin with; most people who can't afford insurance won't be helped by that at all. Tort reform is a relatively small driver of health care costs; it's been done in some states, and had minimal effect on overall cost. And the ACA very specifically and expressly doesn't fund abortions.

Now, purchasing insurance across state lines sounds good, but it's a practical nightmare.What happens if I buy insurance from a company in Alaska, and that company screws me? Do I have to drive to Juneau to file a complaint with their regulatory agency? Now, if we had a universal set of federal insurance regulations, that might work, and would probably reduce the overhead costs of running an insurance company. (Can you imagine having to keep track of fifty different sets of laws? There are a huge number of employees just for that, and that cost comes out of your premiums!) But then, that would be expanding the power of the federal government, which any good Republican will tell you is evil in all cases. Except when it's convenient for it to not be evil.

But what's most entertaining about this is that they want to "Ensure Access for Patients with Pre-Existing Conditions". And they want to do that without the individual mandate, requiring everyone to carry insurance at all times.

Think about that for a minute. If you can just sign up for insurance at any time, no matter what you may already have, why on earth would you carry insurance before getting sick? Just wait until you get sick, and then sign up! Under the Republican plan, they have to take you and pay your medical bills!

Except that everyone will do that. Which means the insurance companies get essentially no income, and have massive outlays. So the Republican plan destroys the entire concept of health insurance, and all insurance companies go out of business.
Good job, guys.