Archive for the ‘Uncategorized’ Category

On Homosexuality

Monday, 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

Monday, 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

Thursday, 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.

Mathematically Modeling Health Care

Monday, 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.

On Creationism

Friday, April 3rd, 2009

I know this isn’t exactly a popular opinion these days, but I don’t see what the big deal is in teaching children that some scientists disagree with the idea that species evolve into other species over time.  It is a true statement.  As long as there remains one scientist who disagrees (and you can always find one guy who believes just about anything), it will be a true statement.

Here’s where I think the crux of the problem lies: Science does not deal with reality, but Scientists like to believe that it does. Science cannot describe reality because nothing can. Scientists can only construct mathematical models of reality, and test those models in their predictive capabtility by running experiments.  Why can’t science tell us about realitiy? Simply put, there’s no experiment anyone can perform which would tell us that we are not living in a video game, a movie, a book, or some child’s dream.

Evolution is a scientific theory because it makes predictions ranging from the nature of the fossils to the behavior of bacteria.  Evolution, as a theory, is an abstract model of reality that happens to make very accurate and useful predictions.  Creationism, on the other hand, makes no predictions.  It is a theory dealing purely with metaphysical truth, with the nature of the reality in which we live. This difference doesn’t imply that Creationism is somehow  objectively worse than Evolution;  you simply can’t compare the two.  One is a set of statements that attempts to describe an objective reality, and the other is a mathematical model used to make predictions about the nature of the sensations we experience. They both have their places.

My main point here is that Creationist theories cant’ be ‘wrong’ becuase they can never be tested.  Evolutionary theories, however, can be tested, and they have continually passed those tests.  That doesn’t mean evolution is ‘true’ because science can never prove anything true.  If the scientific and educated american communities would stop insisting that Science is Truth, perhaps they’d find less opposition from more faith-oriented americans.

Haidinger’s Brush

Friday, April 20th, 2007

In addition to wavelength, which we percieve as color, light is also characterized by something called polarity. Unlike many other animals, most humans cannot detect the polarity of light with their eyes, unless they know what they’re doing.  There’s a phenomenon called Haidinger’s Brush whereby humans can detect polarized light with their eyes.  It works in different ways for different people, but for me, if i jerk my head to the right or to the left while looking at polarized light, I see a pale-yellow bow tie shape.

My comptuer monitor at work uses polarized light because it’s an LED display. Any time I have black text on a white background – which is to say, a quite frequently – if I move my head quickly, I see those brushes. Sometimes I forget I’m at work and waggle my head back and forth to see the brushes. I hope nobody’s watching…

I accomplished something tonight

Sunday, February 25th, 2007

I implemented the random number generator and interpolation functions to produce my own perlin-noise-generated terrain.  I put a new picture here.

I switched over to developing in Microsoft Visual Studio Express instead of dev-cpp. Things weren’t going right, and I wanted to be able to use the debugger. It’s amazing how much faster you can program when you’re using the proper tools. I’m not sure what was going on with my computer earlier, but something wasn’t right. Whatever the issue was, it’s no longer a problem, because everything is working fine for me now.

I do so love to program.

Hah! I am Victorious!

Saturday, February 17th, 2007

I switched over to a new host for MarkPNeyer.com, for several reasons. My friend had been hosting the website for free, which I greatly appreciated.  He didn’t have a lot of time to work on a free hosting service, though, so when I wanted to install askismet to filter spam out of the blog, I realized I had to upgrade wordpress and that would have been a huge hassle.

I was able to get a sql dump out of the old blog, but the database format for the blog changed between whatever version I was using then, and whatever version it is that I’m using now. (How do I check that?)  So, after a lot of database finagling, with PhpMyAdmin and such, I finally have all the old posts and comments restored. The only problem at this point is that the WordPress people decided to cache the value of ‘comments’ for each post, which means that my default value of ‘0′ makes it look like all of the old pages have no comments on them, which isn’t true. If I really cared, I  could write a SQL script to figure out how comments there were and fix this egregious error. Heck, maybe I will.  Maybe.

Last night, Xavier had a ‘WorldQuest International Trivia Contest.’ My team, Math/Computer Science Team, came in second out of 30 or so teams. Not bad, I had a few decent guesses myself.

I am working on an awesome senior project for computer science, and waiting to hear back from graduate programs. So far, only stanford has replied, with a big fat ‘NO’. Those jerks.

I should get back to doing my homework and such, but I’m quite giddy with excitement over having my blog back up again.  Hopefully, everyone who read it didn’t just run off after it stopped working.

Site Has Been Fixed

Monday, January 16th, 2006

I didn’t know that internet explorer was stupid and not shrinking images to fit in the frames. I went back and made changes so that everything would show up correctly even to people using IE.

Under Construction

Friday, September 16th, 2005

I’m trying to personalize this site a bit, and in the process I’m learning that I’m real out of date on this css buisness. When I learned to make webpages, you did it with notepad and wrote all your HTML by yourself. I did learn PHP but never learned the idea or concept of a style sheet.

So it may look goofy for a bit.