Some Questions About Global Climate Change

December 10th, 2009

I’ve been studying global climate change a lot lately.  I  just can’t make up my mind. It’s basically a fight between my rational/logical brain, and my intuition.

My rational, logical mind understands the basic physics behind the theory that all the Carbon Dioxide we’ve put into the air has altered (and will continue to alter) the climate. The theory has been around a long time and has been experimentally verified.  There are a lot of really smart people who think the earth is getting warmer due to human activity.  They couldn’t all be wrong, could they?

My intuitive mind, on the other hand, has a hard time believing that climatologists have gotten it all correct. I have a lot of questions about their methodologies and the results they have found. I figured the best way to answer these questions would be to talk to a climatologist, so that’s what I decided to do. I’ve emailed several climatologists with questions I had about global climate change. I’ll post the answers when I get them back.  Stay tuned!

Here are the questions I asked:

  1. From what I’ve read, there are a bunch of weather stations around the world, and the temperature measurements from these weather stations are mathematically combined to form the global average temperature. How can climate scientists be sure that the mathematics they are using to combine the temperature measurements together are correct? A theory which proposes an experiment can easily be validated – you simply perform the experiment and see if the theory holds up. How do you validate something that is purely a measurement, and makes no direct predictions?
  2. I have a similar question about paleo-climatology. I don’t see how ice core measurements, tree ring data, and other proxies for temperature that are used before the mid 1800’s could give any degree of accuracy. Wouldn’t you need to measure tree rings all around the world and then combine them together, again using some complicated math?  Are there statistical confidence intervals for the accuracies of historical climate reconstructions? Where can i find those?

  3. The changes in the earth’s average temperature are measured to be on the order of 1 degree Celsius over 100 years. That doesn’t seem like much to me. The only explanation that I have come up with for the reason that such a small change puts us in danger is if the climate system is a chaotic system.  Is our climate a chaotic system? If so, my understanding of chaotic systems is limited but it seems unlikely to me that a computer simulation could ever have much hope of predicting much about a chaotic system, because you’d never have an accurate understanding of the initial conditions, and even slight errors in the initial conditions would cause the climate’s actual behavior to diverge wildly from what our models predict [see question 5]. If the climate system is not chaotic, then how does such a small change in temperature cause so much damage?
  4. Mathematically, the temperature of the earth has to exist, but it seems to me that it would change so fast and fluctuate so much that talking about changes of fractions of a degree doesn’t make much sense. My understanding of atmospheric models is that they usually treat the atmosphere as having different layers, each with different thermodynamical properties. If the average surface temperature increases, but this increase is offset by a decrease in the average temperature of one layer of the atmosphere, I should think the climate would definitely change even though the ‘average global temperature’ would remain unchanged. Is it ever useful to talk about a “global average temperature”? Can we get a more complete picture by looking at the temperature distribution function over time? I’m curious to know what that function would look like, but I have been unable to find it.

  5. The best thing about science (in my humble opinion) is that it’s usually pretty easy to tell who’s right; if a theory is repeatedly verified experimentally then there’s a good bet that the theory is accurate. It’s my understanding that the theory of Carbon Dioxide trapping some radiation into space and thereby increasing the temperature of the stratosphere has been repeatedly experimentally verified. I’m very curious, however, about the historical accuracy of climate models. So far, all I have been able to find is a comparison of James Hansen’s 1988 predictions of the change in temperature anomaly and the actual observations made up to 2006. It looks like the models accurately predicted the real change in temperature, but in his paper “Global Temperature Change,” Hansen says that “Close agreement of observed temperature change with simulations for the most realistic climate forcing is accidental, given the large unforced variability in both model and real world.” Maybe I’m misreading him, but it sounds like he’s saying ‘the models were right, but that was a fluke.’    How statistically accurate were climate models from the 90’s in predicting the climate variability we experienced over the past decade?

  6. I have heard many different predictions about the effects of anthropogenic global warming, ranging from incredibly bad (the demise of many species, potentially including the human race) to mildly good (improved crop yields in the northern hemisphere, fewer deaths due to extreme cold.) How much danger do you believe global warming poses for the human race? Is it true that some countries might actually benefit from global warming?

  7. I read that even if we stopped all CO2 emissions immediately, the earth’s temperature would still rise at the same rate (~1 Degree Celcius / Century) for some time, because it would take a long time to remove those gases from our atmosphere. Some people have proposed geoengineering as the solution to the problem of global warming, arguing that cutting emissions would be “too little, too late.”  Do you think any geoengineering approaches are a viable solution to the problem?

Life Lessons From Poker

October 12th, 2009

I first started playing Texas Hold ‘Em poker at Harvey Mudd College, in Claremont, California, while working for the NSF. I have many fond memories of staying up until 3:00 AM playing poker, drinking, and just having fun being a young person with few responsibilities in the world.   When I moved to Chapel Hill, North Carolina, in May 2007, I quickly found a poker game and that’s how I’ve made most of my friends here.  I’m still more or less a beginner;  by my estimate I’ve played maybe 10,000 hands of poker.   I’ve learned a decent amount about the game, and I think a lot of the lessons I’ve learned from playing poker are transferable to life in general. I thought I’d share those lessons for those interested.

  • In the long run, ‘lucky’ players make their own luck

    This lesson is by far the most important lesson I’ve learned, both in Poker and Life in general.   Over the course of a single night a player may get incredibly lucky or incredibly unlucky. In the long run, though, players who consistently make intelligent moves create their own luck by increasing the probability that they will be in situations to make money.  The key to understanding this lesson is to repeat the phrase ‘in the long run’ over and over. Players can go on months-long ‘bad’ streaks, but good players will eventually make more money than bad players.  Life works the same way.  In my experience, I’ve had streaks of terrible luck at some times, and I’ve had runs of awesome luck at other times.  I believe the reason I’ve done well  in life (at least thus far) is largely the fact that I try to shrug off the bad things that happen to me as mere bad luck, and I try to capitalize on the good things that happen.

    Consider this Example:  At the end of College, I planned on getting a Ph.D. in Computer Science.  At a time when I was living on on about a thousand dollars of income each month, I spent over a thousand dollars applying to some of the best schools in the country: Stanford, Berkeley, MIT, Carnegie Mellon, Illinois, and Georgia Tech. I chose two safety schools: UC San Diego, and Univeristy of North Carolina. I was rejected outright from every program except UCSD (who put me on a wait list and then rejected me) and UNC.   It  definitely hurt to be rejected from so many places, but I realized that coming from a practically unheard of liberal arts college in Cincinnati, and lacking any real research experience, it would be a crapshoot for any school to admit me.  You could definitely say that I was ‘unlucky’ because I only got into my safety school.  I could have taken the job offer I had in Cincinnati, but I knew my career opportunities would be better if I went to grad school, even if it wasn’t MIT.  I took what I saw as one of the worst possible outcomes of the grad school application process and turned it into an opportunity to improve my career.  Blue Capital Group, my current employer, just happened to be located in Chapel Hill, and they just happened to email my algorithms professor looking for new recruits at a time when I was looking for a job.  I took what I saw as a chance for some good luck, and capitalized on it. I now work at a  job I absolutely love, at a time when many people are struggling to find any job at all.  I could go on and on, because my life has been full of both good luck and bad, and the main lesson I’ve learned can be summed up as follows:

    • Recognize and accept that sometimes you’ll have good luck, and sometimes you’ll have bad luck.
      Chances are, if you’re reading this, you’ve had way more good luck than bad because you have access to the internet, the ability to read,  and knowledge of someone as awesome as myself :-p
    • When you’re unlucky, try to way to turn your bad luck into an opportunity. If that fails, shrug it off as bad luck.
    • When you’re lucky, realize that you’ve been granted an opportunity and do everything you can to take advantage of it.
  • Know when to hold and when to fold

    That pair of red aces you were dealt just doesn’t look so good when there are four spades showing on the board, even if one of them is the Ace. Sometimes you have something really good going in life, but you have to let it go because it’s starting to fail. If you hold on to things that were good and have gone bad, you’ll be doing yourself a huge disservice.

    This lesson is especially true in romantic relationships – the longer you hold on to a doomed relationship, the more pain you’re going to cause the both of you, and the harder the breakup will be. Once you realize a relationship isn’t going to work, you need to inform your partner and leave that relationship – it’s the best thing for both parties involved.  On the flip side, when you have the nuts (poker lingo for the best possible hand), you have to do whatever you can to increase the pot size, without scaring other players out by revealing what you’ve got.  When you meet someone that you connect with on every level, someone you love to spend time with, someone who understands you better than you understand yourself, you have to realize what you’ve got and hang on to it.

  • Have confidence in yourself, but not too much

    Having too little confidence in your hand will hurt you because you’ll get pushed around by bigger stacks. Having too much confidence will hurt you becuase you’ll call bets you shouldn’t. There’s a fine line you have to walk with confidence, and the ability to determine when you’re being confident enough is an important skill to hone.

    If you think you’re the smartest man whoever lived (as I once did), that confidence will help you out at times because it’ll allow you to tackle problems that might scare away mere mortals.  It can cost you, though, if you overextend yourself or try something that is beyond your level.  My confidence was shattered when I reached grad school and realized there were people who could think circles around me; people who have thought up and then forgotten things I’ll never begin to understand.  I went from having too much confidence in myself to having too little. I thought I couldn’t accomplish anything and that I’d never amount to much more than an unhappy burnt-out developer.  As I suffered through grad school and started to figure out what was going on, my confidence grew a little bit. I got the nerve to apply for an internship at Microsoft, and being hired for that internship gave me a huge boost in confidence. I started doing better in everything I did.

  • It’s all about discipline

    I know I’m bad at poker, at least compared to my friends. My main problem is that when I’m not getting cards, I don’t find the game very fun, so I do things that I know I shouldn’t.  I know not to play trash hands like Ace-Seven off suit, but I get bored and put money into the pot when I shouldn’t because I’d rather have fun than make money. I don’t have a problem doing this in low limit games, because the amount of money involved in doing so is usually very minimal, i.e. 30 cents.  In higher stakes games, this sort of behavior can cost you a lot of money. I stay away from high stakes games because I know that I don’t have enough discipline to play real solid poker. All the theory in the world won’t help you if you don’t follow sound logic and fold when there’s four to a straight on the board, you’ve got two pair, and your opponent has pushed you all in.

    Life in general works on the same principle. You can read all the diet books you want, and you can understand body chemistry all day long, but if you don’t go to the gym and lift regularly, you’re never going to be able to reach your fitness goals.  You can dream of being a millionaire all day long, but if you don’t work hard, save your money, invest wisely and avoid splurging on things you don’t need, you’ll never make it.  Going to the gym, working hard and saving money all require discipline.

I’ll end this already too-long post with a caveat: Not every lesson learned at the poker table applies to real life. Probably the most important exception is the fact that  poker is a Zero-Sum game. That means every player who succeeds does so to another player’s detriment. Real life is most certainly not zero sum – there are plenty of ways that two people can interact with each other such that both people benefit. This sort of mutually beneficial interaction is the cornerstone of civilization and, I would argue, the basis for all just governments.  But that’s a post for another day.

Investing in Happiness

October 6th, 2009

I think a lot about investing.  I learned in high school that investing while you’re young is one of the best moves you can make from a financial perspective.  The earlier you start investing, the more time your money has to grow.  For a while I thought it made sense to live as frugally as possible, and to save as much as possible, in order to maximize my financial payoff in life.   I had a realization, though, that changed this attitude.

Think about a really good memory. Maybe it’s a memory of your family gathered for thanksgiving dinner, or maybe its of a fun date you went on. Maybe it’s a memory of the time you found five dollars on the sidewalk. Who knows.  Doesn’t thinking about good memories make you feel good inside? I would say that in my experience, remembering a good time that I had is almost as enjoyable as having the good time itself.

This year, I threw a birthday party for myself, and invited a bunch of friends from out of town. I rented a house on a lake for a weekend, and even sprung for a Jet Ski for the day on saturday.  Five of my 8 siblings were able to make it out, as were a substantial number of my friends, from grad school, college, and high school.  I saw some people I literally thought I’d never see again, and we had a great time.  I will probably remember that weekend on the lake for the rest of my life.  When I think of it, I can’t help but smile and feel good inside. It’s not just a fleeting happiness, like the feeling you get from eating a good filet mignon, It’s a feeling of contentment and metaphysical satisfaction with life.

That weekend cost me money; around $1,000 after all was said and done.  A slightly younger me would have argued that spending $1,000 on a birthday party for yourself is a waste of money and irresponsible. An older (and I’d argue wiser) me would respond that the weekend was not just a way of having fun in the present, but an investment in the future because of the value of the memories it creates.

Let’s suppose that I remember my birthday party 4 times a year for the rest of my life.  They say you can’t put a price on memories, but they say a lot of things that aren’t true, so I’m going to put a price on the memory and say that the good feelings I get from remembering that weekend are comparable to the good feelings I’d get if I found $20 on the sidewalk. That means my $1000 investment pays me $80 a year for the rest of my life.  If I live another 50 years (which seems like a reasonable bet), the memory will pay me $4,000 over the course of my lifetime. Not bad. Is it possible to do better?  If I had put that $1,000 into the stock market, it would not be unreasonable to assume that my return would average close to 8% annually.  That works out to … $80 a year.  It’s true that if I invested that $80 back into the market, my annual return would increase beyond $80, but I’d be giving up the momentary satisfaction of having that $80 now.

I’m not arguing against savings – I think it’s important to prepare for large future expenses like retirement and your childrens’ education – but I think there are diminishing returns to having large amounts of money, and that spending even non-trivial amounts of money now in order to create great memories that will last your entire life is also a great idea.

A Mathematical Case For Optimism

September 22nd, 2009

Given the choice, does it make more sense to be  pessimistic or optimistic?  I was thinking about this one night, and, as usual, I decided to explore the question mathematically, using the tools of game theory. Credit goes to Megan for helping me figure this one out.  The basic problem I had was this: Everyone says you should be optimistic, but my objection to this claim has always been “what if the universe is really a terrible place where mostly bad things happen – why should you be optimistic then?” Megan insisted that it made sense to be optimistic, and I thought I could prove her wrong mathematically. I did some thinking, though, and concluded that it actually does make sense to be optimistic, regardless of the nature of the universe.

Let’s use a simple model of reality: events happen, and they’re either good or bad, to varying degrees.

In this model, one of three things is true:

  1. Reality is fundamentally a good place:  the sum of the good experiences is greater than the sum of the bad experiences
  2. Reality is fundamentally a neutral place: the sum of the bad experiences is roughly equal to the sum of the good experiences
  3. Reality is fundamentally a bad place:  the sum of the bad experiences is greater than the sum of the good experiences

    You might object to my model of reality and claim that it’s too simple to be useful.  Just for you, I’ll add another possibility:

  4. Reality is too complex to be characterized by simple good/ bad models.

As you experience life, you’ll try to build a model of the universe, and part of this model is how or bad the universe is.  Ideally your model is perfect, but invariably you’re going to get things wrong.  If you’re going to model how good or bad the universe is, is it better to err on the side of  good or bad? We’ll say that optimism means believing the universe is better than it really is, while pessimism means believing the universe is worse than it really is. I claim that, regardless of the true nature of the universe, an optimistic strategy is the best strategy to pursue.

To prove my claim, I have constructed a ‘truth table’ which describes the outcomes of optimistic and pessimistic strategies in the four cases listed above. In each case, the Optimistic strategy pays off more than the pessimistic strategy.

Nature of the Universe vs. Life Strategy
Nature of Universe Optimism Result
Pessimism Result
Winner
Good Life is good, and you enjoy it to its fullest. Life is good, but you don’t enjoy it to its fullest because you’re worrying about things that are unlikely to happen. Optimism.
Neutral Life is OK, but you put a positive spin on things and as a result enjoy them more. You spend less time worrying about bad things that might happen, and more time anticipating and enjoying the good things. When bad things happen, you get over them quicker because you’re convinced more good things are in store for you. Life is OK, but you put a negative spin on things, and as a result, you enjoy them less. You spend more time worrying about bad things that might happen,  and less time anticipating and enjoying the good things. When bad things happen, you take longer to get over them because you’re convinced they’re going to keep happening to you. Optimism.
Bad Life is tough, but you’re oblivious to the fact. Bad things happen often, but you don’t linger on them. On the rare occasion good things happen, you enjoy them to their fullest. Life is tough, but you think it’s worse than it really is. When bad things happen, you reflect upon how miserable life is. When good things happen, you tell yourself that they won’t last. Optimism.
Undefined Bad things and good things both happen. When the good things happen, you enjoy them. When the bad things happen, you don’t dwell on them because you know they’re temporary. When nothing good or bad is happening, you stay positive and think good things are ahead in your future. Bad things and good things both happen. When the good things happen, you enjoy them. When bad things happen, you dwell on them because you think you have more of the same to suffer through. When nothing good or bad is happening, you’re in a negative mood because you’re overestimating the probability of bad things happening in your future Optimism.

If you find yourself worrying about the future or fretting about the past, just remember – Optimism is always an intelligence choice that will make you happier in the long run.

On Homosexuality

August 31st, 2009

The BBC is reporting that thousands of Britons are now calling upon their government to posthumously pardon and knight Alan Turing. If you don’t know his story, you should.

Alan Turing is one of the founders of the field of Computer Science, which is the study of the mathematical laws underlying computation.   He proved, among other things, that there are some problems that cannot be solved by a computational device. Not only was Turing’s work theoretically impressive and groundbreaking, it was also of incredible importance to the allied effort during the second world war.  The British intelligence ran an outfit called Bletchley Park, whose sole purpose was to intercept German and Japaneses messages, break open the encryption schemes, and use the gleaned secrets to help the Allies.  The Germans had a complicated encryption computer called ‘Enigma,’ which they believed to be unbreakable.  There was a herculean effort on the part of the allies  to break open this encryption system, and it succeeded.  Alan Turing devised a machine called ‘the Bombe’ which could reverse engineer the settings on the enigma machine, to help decode its messages. It is entirely possible that without the efforts at Bletchley Park,  the war might have lasted a long longer or ended on an entirely different note.

Alan Turing was not only a genius who worked tirelessly to save the free world, he was a homosexual living in an age when homosexuality was illegal. In 1952 he was charged with having a homosexual relationship, and he accepted a sentence of chemical castration via estrogen injection.  His security clearance was stripped, he was forbidden form working at Bletchley Park, and a year later, he killed himself. Now, I suppose an apology on behalf of the British government would be nice, but it wouldn’t accomplish much.  After reading the story of Alan Turing, I realized that there is an entire class of people who live as second class citizens. If we would like to honor the memory of Alan Turing, the best response is to end the “Don’t Ask, Don’t Tell” policy and to stop treating a group of our fellow citizens as if there were something wrong with them. I am not homosexual and I do not really understand what causes some people to be so, but to me the reason is irrelevant -  there’s simply no excuse for discriminating against someone because of whom they happen to be attracted to.

Visual Studio Macro: Set ‘CopyLocal’ To False For All C# Project References

August 24th, 2009

I wrote this macro for work and thought other people might be able to use it.

Public Sub MakeAllRefsCopyLocal()
    For Each aproj As Project In DTE.Solution.Projects
        If (aproj.Kind = PrjKind.prjKindCSharpProject) Then
            Dim vsProj As VSProject = CType(aproj.Object, VSProject)
            For Each ref As Reference In vsProj.References
                Try
                    ref.CopyLocal = False
                Catch ex As Exception
                End Try
            Next
        End If
    Next
    MsgBox("All References Made To Copy Local")
End Sub

On the Failure of One Mathematical Strategy for Happiness

August 20th, 2009

In my last post, I discussed a simple mathematical model of happiness. I made quite a few assumptions in building the model, and I thought I’d revisit one of them. In my model, people traveled through a world with one spatial dimension, and were either happy or sad depending upon their location and the time. It was quite a simple model, but it still yielded what I believe to be reasonable advice – listen to other people’s experiences and try to use that information to form a more complete picture of the world, in order to make yourself happier.

The strategy I proposed in the last post was to simply maximize the sum of the happiness you experience at each individual moment.  Let’s call this the SumOfHappinesses strategy. Is that a reasonable strategy? Despite my last post, I argue that it actually is not a good strategy to pursue.   My reasoning follows.

Suppose you live in a universe where you have 100 coins, and you have a device which flips them all at the same time. You’ll be very happy if they all come up ‘heads’. As happy as you possibly could be.  That happiness will last you for the rest of your life, too. In this universe, What do you do?  The SumOfHappinesses strategy says to keep on flipping as often as you can, in order to maximize your happiness.

Think about this for a second, though.  You spend your life doing nothing but flipping coins? I don’t care how happy it makes you, waiting your whole life for one extremely unlikely event to occur can’t be worth it.  Every time the event doesn’t occur, you’ll get upset, and most likely you’ll never reach the event.  The odds of all coins coming up heads are 1 in 2100, which is about one in 1.26 x 1030 . If you flipped the coins ten times a second, nonstop, for the age of the entire universe you’d still be very very unlikely to ever reach that ultimate happiness event.

You might argue that I’ve created an absurd universe – who would really be that happy if they flipped 100 heads in a row? It turns out that there are plenty of things that happen in the real world that are similar to my coin-flipping example.  The lottery is one thing that comes to mind – even if you could get one free lottery ticket each day, it wouldn’t be worth it to go out and pick the thing up, because your probability of winning is so small.

What are some other examples?  Becoming famous works perfectly here.  Let’s suppose your goal is to become the next rock superstar. You’d have to practice really hard, meet the right people, and be extraordinarily lucky.  If you put all your life’s effort and energy into becoming a rock star, the overwhelming probability is that you’ll end your life no more famous than you began.   The same is true in any other field that has ’super stars’  which is pretty much every field I can think of.

Does this mean you shouldn’t “shoot for the top?” Absolutely not – it just means you shouldn’t make “getting to the top”  your only source of happiness. If you like playing guitar, then by all means shoot for stardom, but make sure you don’t forget to derive happiness from your daily practicing.  If you focus only on the goal and not the process of getting there, you’re going to be unhappy. No matter how happy extremely unlikely events could make you, the fact that they’re extremely unlikely means that they’re really not worth pursuing unless you enjoy the act of pursuing them.

A Mathematical Model of Happiness

August 13th, 2009

What if we could use mathematics to figure out how to make ourselves happier? I submit for your consideration that it is, in fact, possible.  In this post, I construct a simple mathematical model of experiencing the world, and then derive some principles from the model which I believe are applicable to real life. Let’s begin! Consider the following graph of my happiness over the course of a day:

[Happiness on a Typical Day]

The day starts off well, and reaches a peak when I eat my breakfast of eggs and turkey bacon. Yum. I get into my car, and there’s a wreck on 15-501, so I’m late getting to work. My mood goes down, but it’s still positive. Upon arriving at work, I realize that I’ve fallen seriously behind in a big important project, so my mood falls. As I work harder and harder, I keep realizing how much more work I have to do. My mood plummets, until lunch time. A dozen buffalo wings provide a brief respite and put me in a better mood, but I’m still frustrated about work. I have time to think at lunch, though, and I realize  I can save myself some time if I take a new approach that I hadn’t though of.  My mood improves, and by the end of the work day I’m happy again.   After I get home from work, I relax by playing a game of Left 4 Dead with some friends, and my mood improves back to where it was.

The above graph was generated using a type of randomized noise function called Perlin noise. In other words, I modeled happiness as simply the summation of random waves. What better models can we use to describe and predict how people can become more happy? If happiness is a function of time, the simplest model says that we just choose to be happy all of the time. I would argue that the ‘choose to be happy’ model is too simple to be very useful.  Happiness isn’t a simple binary choice: It’s hard to choose to be happy when it’s cold and dark outside, and you feel tired, lonely, and hopeless about the future. Conversely, It’s easy to choose to be happy when it’s sunny outside, you’ve just enjoyed a nice meal with friends, and now you’re playing a sweet designer German board game, like Dominion.  These  examples are taken from points in my life. Your mileage may vary. The examples demonstrate that, very often, external factors in your life play a huge role in how happy you are. I believe it is possible to influence those external factors, but influencing them Isn’t as simple as just saying “I choose the happy path.”

A more predictive model of happiness must therefore take into account external factors as well as personal choices.   After giving this idea a lot of  thought, I came up with a model, based upon the concept of ‘Experience-Space.’  Experience-Space is the set of all possible experiences that an individual could have. Points in Experience-Space are points in both time-space and sensation-space.  In other words, a single point in experience space describes the exact feelings you feel at a given time.   To make things as easy to understand as possible, we will say that the only sensation one can experience is happiness, and that, at any given instant in life, one can make one of three choices. Why three? When there is only one sensation, Experience-Space becomes two dimensional: time is one dimension, and the experience you have is the other dimension. We can represent life with an image. Your experience of life is a path traced by a pixel through that that image from left to right.  At each step in time, the pixel can either go straight forward, diagonally up, or diagonally down.  We will label these choices straight, up, and down.

Look at this example:

Choice of a Single Dot

In this example, the person is currently happy. They have a choice to make: in the next time tick, they will be happy if they choose straight or down, unhappy if they choose up.  This is a very simple model, but it proves surprisingly powerful in generating useful predictions about how we can make ourselves happier.

Suppose you know everything about the universe, and your goal is to be as happy as you possibly can.  You start out at some initial point in experience-space, and your goal is to maximize the sum of the happiness of the experiences you have over the course of your entire life.  (Is that a reasonable goal? A question for another blog post!). Suppose that experience space looks like this:

Gradient Model Of Happiness

If this is your universe, wherever you start out, your most logical move is to always choose to go down (when possible) and then go straight along the bottom edge of the graph, when (if) you ever reach it.  That’s easy enough. Let’s consider a more complicated model of the world:

Happiness as Perfect Moments

In this model, most experiences are either slightly positive or slightly neutral. There are quite a few “great” experiences, and a small number of “terrible” experiences. These big experiences are so big that they affect you for some time after you experience them.   How would you navigate this graph, in order to maximize your happiness? The problem begins to look like an artificial intelligence.  I’m not going to go into artificial intelligence algorithms such as A* search (as much as I’d like to.) Instead, I’m going to draw to draw some conclusions from this model.

In the real world, we don’t know the entire universe ahead of time: we only know the choices that we have made, and their ramifications. In other words, our graphs look like this:

A Single Path

That’s not a lot to go on. It would be hard to take that information and build a model of the world and use it to predict where to go next.  While walking like this, you’d probably notice that some areas were nicer than others, and that the really nice areas and really bad areas tended to clump together, but you’d still have a hard time determining which areas to go towards. Suppose there are 50 people in the universe, and you all share information about the choices you have made and the results those choices have brought you. Then, your picture of the universe looks like this:

More Paths Means More Knowledge

This picture is much more complete than the picture you were able to generate by yourself.  By using information you glean from asking others about the choices they make, you can make yourself happier.

Conclusion: Talk to as many people as you can, and learn about their experiences.  Doing this talking will allow you to gain a much more accurate model of the world as a whole, in order to determine what will make you happy. Ask people about their history, and specifically about choices they have made that made them happy or unhappy.

I hope to write more on this subject in the future. Stay tuned!

Mathematically Modeling Health Care

August 3rd, 2009

With the Obama administration pushing a massive reform of our Health Care system, I figured I would share my opinion on the subject, for all of those interested.  I firmly believe that if you want to solve a problem, the best approach is to come up with mathematical models for your problem, analyze them, and do what the models suggest.  In this post, I will gradually build a mathematical model that describes health care, asking questions about the model and proposing policies reflecting the outcomes of the model.  Let’s begin!

Model Version 1: There is a universe of N individuals with two states: healthy and sick.  Let the variable t represent time, with t =  0 being some arbitrary date, say January 1, 2009. In this model, t is discrete – that is, it takes on the values -3,-2,-1,0,1,2… &c.  In other words, there are no fractional times.  At each time t , there is a certain probability p_sick that an individual will become sick. It costs c_cure dollars for a sick become healthy.

How much does Health Care cost in version 1 of the model? If we have N people, then at teach time tick, p_sick * N become sick, then the total cost of keeping everyone health is

c_total  = N *p_sick *c_cure.

In this simple model, we have only one question to ask: who pays the cost of health care? Should the individual who becomes sick pay for his own cure, or should the government foot the bill?  I contend that this this question is entirely a value judgment.   Everyone has a different opinion on what’s fair or just. We could argue about constitutionality, but that wouldn’t get us anywhere either – everyone interprets the constitution differently and different people will just claim that the constitution backs their case.  Thus, the first conclusion:

Conclusion 1: The question of “who should pay for health care” is entirely a personal value judgement.

Model Version 2:  In version 2 of the model, we add in different diseases, and choices.  Let D = {d_0, d_1, d_2….} be different diseases that people could acquire.   Note that we could consider things like  broken legs and concussions to be ‘diseases’ because people do suffer from them, and they do cost money to cure. For each d_i, there is a cost c_i to cure that disease. Note that for some i, c_i is infinite. In other words, for some ailments, there are no known cures.  Additionally, let A = {a_o, a_1, …} be a set of actions that an individual could perform.   The actions a person takes affect the probability that they catch certain diseases. For example, if you choose to drive a car to work, you increase the probability of getting any number of bodily ailments. If you eat a bag of Cheetos for lunch, you increase your probability of getting a heart attack.  Let risk be a function that takes an action a_i and a disease d_j as input, and returns p_j. In other words, risk(a_i,d_j) is the probability that you will suffer from disease d_j if you perform action a_i.
How much does health care cost in this model? It’s almost impossible to answer. You’d have to know risk(a_i,d_j) for each possible combination of i and j.   As the models get more and more complex, we see that we can’t really predict from logical principles how much health care is going to cost unless we can predict what kind of actions people are likely to take.  What we can observe, though, is that the question of ‘who pays’ becomes more interesting. If the government pays for all health care, then people have no incentive to minimize the risks they take.   If individuals pay for their healthcare, however, they have every incentive to minmize the risks that they take, reducing the total cost of healthcare.  Model 2 suggests that the best solution is to have individuals pay for their own health care, so that they minimize the amount of risk that they take.

Suppose one of the actions is ‘going to the doctor for a routine checkup.’ Clearly, this action reduces the risk of many diseases.  If individuals are forced to pay for their own health care, and rational individuals wish to minimize the cost they spend on health care, then rational individuals would go to doctors for routine checkups.  In reality, this often doesn’t happen – so something is wrong with the model. Let’s expand it.

Model 3: Same as Model 2, except the concepts of “cost” and “cure” change. Now, instead of cost being associated only with disease, each action a_i has an associated cost given by cost(a_i) Sometimes the cost of an action is positive (going to the doctor, going to see a movie, buying gas) and sometimes the cost of an action is negative (i.e. selling a house, going to work.) For each disease d_i,  there is an action that cures the disease. Let this action be called cure_i. Additionally,  the function risk now takes a third argument as input: the state of the individual at time t. In other words, if you’ve currently got a cold, then your risk of sinus infection might go up.

How does Model 3 differ from Model 2? We have removed cures as some abstract thing that happens to people, and transformed them into actions that people take. As a result, the incentive structure of the system changes.  When some diseases increase the risk of other diseases, rational people are more willing to pay to treat the first disease, in order to prevent themselves from getting the second.   We can also explain why a lot of people people don’t go to the doctor under our current health care system -  the cost of going to the doctor is positive, but the benefits are small, becuase insurance is more likely to cover catastrophic illnesses than it is to cover minor ones.

I could go on and continue to expand the model, but I won’t (although I’d find it very interesting to do so.)  The conclusion I’ve drawn from the modelling process is that healthcare is really complex, invovling many value judgments. Answering questions such as ‘who should pay for what’ and ‘how much will it cost’ is not easy to do.  In light of that conclusion, the question you should ask yourself is: “What is the best way of answering complex questions involving the value judgements of many individuals?” Economists have been studying this question for centuries, and, empirically, the answer is pretty clear – governments are notoriously bad at answering these questions satisfactorily. Markets, while far from perfect, are the best solution anyone has ever devised.

The primary problem with a Market-oriented solution to health care is that it excludes those who are unable to afford health care. I believe that the best way to handle those who are unable to afford health care is to supply them with vouchers that they can use to purchase health insurance of their own choice.  This would create competition and reduce costs. The Obama administration seems to belive  not only that the government is entitled to answer all of these questions for us, but the government is actually capable of doing so, in a fair and just manner. Believing that requires a hurculanean leap of faith in government.  If you think the government is capable of solving the healthcare problem better than markets, you must certainly believe that the government can solve the question of ‘who should produce what, and who should consume what’ even better.   Communism died for a reason: governments are not as efficient or responsive as markets. Listen to the empircal evidence of history, and make up your mind accordingly. I welcome your comments.

Simplicity vs Speed

July 9th, 2009

This is a post about programming practices and design in general. Even if you’re not a programmer, you should read this and let me know what you think.

Consider these two C++ classes:

class SimpleFrobulotron
{
  public:
 
	SimpleFrobulotron(const string &name);
	string getName();
 
  private:
	string m_Name;
};  
 
class FastFrobulotron
{
  public:
 
	FastFrobulotron(const string &name);
	void getName(string * outName);
 
  private:
    string m_Name;
 
};

The main difference between the two designs is simple: The SimpleFrobulotron is easier to understand and use, but somewhat slower than the FastFrobulotron. For example:

void printFrobulotronNames()
{
	SimpleFrobulotron simple("tweedle dee");
	FastFrobulotron fast("tweedle dum");
 
	//display the simple frobulotron's name
	cout << simple.getName() << endl;
 
	//display the fast frobulotron's name
	string fastName;
	fast.getName(&fastName);
	cout << fastName << endl;
 
}

Is FastFrobulotron really that much faster than SimpleFrobulotron? A test on my machine shows that FastFrobulotron runs in 27% of the time that SimpleFrobulotron runs in. So it is clear that there’s a trade off here: Simplicity versus Speed. Code that squeezes every last bit of performance out of the machine is harder to understand. What side of this trade off do you favor, and why?

In this case, I think the answer is obvious: returning a string from a function is much slower than assigning it through a pointer. This is a simple enough optimization that most good programmers should be able to look at the code and understand what’s going on. Therefore it’s best to make use of it. Things can get much more complicated than this simple example, though.

Writing code that does what it’s supposed to do is something most programmers can do (unless you give them the halting problem.) Writing code that’s easy to understand, however, is not. Neither is writing code that is as efficient as possible. The problem is that these two goals (simplicity and efficiency) seem to be at odds with each other. How do you balance between the two?