"I have held many things in my hands, and I have lost them all; but whatever I have placed in God's hands, that I still possess." -Martin Luther

Tuesday, November 27, 2007

How To Compute Logarithm Errors

I'm rather proud of my choice of title. You are all probably thinking I called it something boring and scientific so that you would be surprised when it turned out to be light and entertaining. If these are your thoughts, you have been deceived. It's going to be just as boring as it sounds. But I wonder if this paragraph isn't going to make you believe even more that there's something interesting in this post.

Maybe you only think that way if you are me. Eternal optimism and such. But why tarry with rivulets of self-awareness? On to the boring reality at hand.

I'm working on my physics lab write-up, or at least I was until I started writing this. These write-ups occur, naturally, after the lab is completed. They are very useful. For instance, when I pick up my notes from lab, I find that I am in dire need of recalling, first, exactly what we were doing in the lab, second, why we were doing it, and, if I feel particularly important, third, why it worked. It's a good thing the third part is optional, because sometimes we break all the rules. Compile all the laws of nature that we've broken in Physics lab, and you'd probably vaporize due to a lack of intermolecular forces.

That said, the past few days of working on my write-up have been very productive. I've definitely made recollection one (singing Christmas carols). Step two is in progress (because we wanted to drown out the guys who were rapping). And step three is a no-brainer (because our prof. sang with us).

In fact, I've been so productive that I've actually made The Graph twice. The Graph is where I put all sorts of numbers into boxes in particular orders, then realize I put the wrong numbers in the wrong boxes, and try to fix it, only to make a different mistake. Finally, I get all the numbers in the right boxes, save the file to text and to j-peg, close it, realize I forgot to label my axis, and find that my simple graphing program, whose name is Linefit, cannot read the text file. Thus, I am working on the graph for the second time today. For various reasons which I prefer not to go into right now (Translation: I'm embarrassingly inefficient) I have computed nine different logarithms six times each. Any math major can tell you that's fifty-four computations. My calculator is groaning about the mundanity of life.

My calculator, however, has it easy. All it needs to run are four triple-As and a few of those natural laws that we break in lab every week. Its purpose is predetermined. It never had to go to school, and all I have to do is press the right buttons to teach it something new. It has cool circuitry, is a "silver edition," and was apparently born in Texas.

In contrast, I need things like internet and pizza just to exist; despite what some of my non-Reformed friends think, my purpose is predetermined, but I am not yet aware of the specifics; I most certainly do have to go to school; learning requires things like long study breaks to write blog entries; I have amazing circuitry but it's too small to see; there's no such thing as a silver edition of me; and I was born in Alabama.

All this about the superiority of life as a calculator and repetitious graphing aside, my real problem, until I started writing this blog, was how in the world I was supposed to propagate errors through a logarithm (now, it's how I'm ever going to stop writing and get back to work).

See, there's errors in everything. Ask a mathematician what he ate for breakfast, and he'll tell you 2-and-1-third strips of bacon, 1-and-3-eigths cups of grits, 1 cup of factory rejects cereal, and 1-thirds cup 2% milk. Ask a physicist (we do not respond well to 'physician'), and he'll tell you 2 plus-or-minus 1 cups of lucky charms (Factory rejects? Please!) and 1.67 plus-or-minus 0.05 cups of whole milk. As you can see, physicists have far too much on their plate to eat a lot for breakfast. In fact, I saw one eat his cereal standing up this morning because he had no time to sit down. I'm not kidding! In addition, physicists have much better taste in milk. But aside from this, the astute reader will notice, because I am about to point out to him or her, that the physicist included error bars. We use these all the time, plus or minus 5% of the time.

Getting measurement errors is easy. You simply turn to your lab partner and say "what error will be big enough to cover our mistakes, but small enough to make it look like we didn't really break all the laws of nature today?" I'm just kidding, of course. Really, what you do is estimate the largest possible error you could have made in carrying out the measurement, and then double it for good measure, because there's no way you can cover up that you just broke all the laws of nature, so you might as well not try.

Propagating error gets more difficult. First, the word "propagating" is easy to trip over, like a gate that's been propped open, or a propane tank you left out while tail-gating. Second, you forget how and, when you figure it out, you are so excited that you blog about it for an hour and get very sleepy.

Thankfully, I have written the rules in the beginning of my Physics notebook from last semester. As a faithful nerd, I have it with me in the computer lab, and so I can share with you the propagation rules.

When adding or subtracting values, simply add the errors. Subtracting errors may seem like a good idea at the time, but trust me, in the end you will regret it.

When multiplying or dividing, use a very large formula that you would have memorized by now if you were in Physics II, and which I do not know how to code in html, and so will not try! (If you are interested, I can whip it up on TeXnicCenter and send it to you in Adobe. And yes, TeXnicCenter is supposed to be spelled like that. To computer programmers and their strange typing ways I say, "w00t!").

These were the rules I remembered. Unfortunately, I couldn't recall what to do when taking a logarithmic function of something. But then I found it. Yes, dear readers, it's the moment you have all been waiting for:

In order to propagate the error through a log function, simply divide the error of the original value by the value itself.


Now, if I can just get gravity turned back on, I'll try to finish my graph so that Linefit can eat it again. Life as a computer program must be so easy...


  1. I'm willing to believe physicists are truly overworked... or perhaps I'm just imagining how tired I would have to be in order to start comparing myself with my calculator.
    (On that note, it should be made known that my calculator and my brain have finally reached common ground now that the calculator has stopped working.)

    I am very thankful for the wonderfully smart people (like you and your roommates) who decide they are called to one of the impossibly difficult college majors. People like this reassure me merely by their existence that I am right where I need to be, for they show me where I am most certainly not meant to be. :)

    And shame be upon your head for writing when you're supposed to be working. I personally have never done such a thing. Ever. (I do, however, fully condone the singing of Christmas carols, especially if they are used to drown out rap music.)

  2. I'm going to be perfectly honest and say that most of this post went straight over my head. Maybe it's just because it's almost midnight, or maybe it's because this post had a lot of math in it. Oh well.

    I think your calculator and mine must be brothers... or sisters... or brother and sister... I've never been very good at determining the gender of calculators. Either way, yours is the smarter sibling, as mine doesn't get used enough to learn anything new.

    One last random comment: for a biology major describing their breakfast, they would explain all of the organic compounds found within the food, though they would probably leave out measurements. An example: fried muscle tissue of a Sus scrofa domestica (bacon), Triticum aestivum covered in a layer of sucrose (cereal), and Coffea canephora mixed with water, the mammary gland excretions of a Bos taurus, and sucrose (coffee).
    If you can understand that, you should be a biology major.

  3. First of all, you really need to be a novelist. Only a born novelist could make me laugh that hard when I have that little idea what they're talking about! (plus or minus appoximately 10% of people :))

    Second of all, I don't think my calculator exists... aka, I don't have one. Does that say something about me???

    Third of all... um, let's see, what can I say now... Oh! Yes! Go Christmas caroling against rapping!

    Elizabeth, judging from the way you write, I would have to say that at least the creative part of your brain is working quite well. Of course, the creative part of my brain works best at night when the intelligent part of my brain is shutting down... I suppose, however, that it also takes a working intelligent part of the brain to write well...

    I'm beginning to confuse myself.

    Come to think of it, I feel rather sorry for calculators. All they ever do is math... poor things. :)

  4. Many thanks!!! You've saved my lab report, me and my lab partners had no idea how to propagate errors in ln, we was trying all sorts of complicated nonsense, then I stumbled across your post and tada! lol, can't believe a BLOG taught me something - isn't the internet wonderful? :)


A soft answer turns away wrath,
but a harsh word stirs up anger.
The tongue of the wise commends knowledge,
but the mouths of fools pour out folly.