"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...

Wednesday, November 21, 2007

In The King's Court

Dear Readers,
Below you will find the next in my series of self-plagiarisms. Written, again, for my introductory English composition course in the spring of 2006, this is probably my favorite paper of the semester simply due to its personal significance to me. Enjoy.

I have not seen an abundance of "turning points" and epiphanies in the course of my life. For the most part, I have lived in happy monotony, working and playing, thinking and sleeping; even the occasional surprise or crisis has been picayune -- a flat tire, a surprise party, a lost paper, or a broken bone. It took God Himself to drive home the idea of a turning point to me, at the age of nine, as I sat in tears at the end of a sermon, wondering why I had not understood how amazing God was before. Even this event had a string of mundane occurrences leading up to it. So can say I was surprised when two hours spent pecking away at the keyboard in our den changed how I wrote, dramatically and permanently; however, I cannot say I was surprised that there was a lifetime of experience and instruction behind this event.

It began with my parents reading me bedtime stories when I was but a little tyke, buried under the covers in body but journeying to far away places and adventures in spirit. If I sound like the advertisement on a Pizza Hut box to read to your children, so be it; it happened.

My parents have been reading to me since I was born -- they have not stopped yet! I grew up on Lewis, Verne, and the Bernstein's; dreamed of space voyages, unicorns, and small town mysteries; and even survived Moby Dick, lounging in my dad's study and watching my sister fall asleep. I learned words I could not yet pronounce, heard of places I was not sure existed, and packed away enough stories and characters in my head to last me a lifetime. I learned to take words listened to and turn them into ideas of people and places.

From ideas came images of the mind produced by one of my greatest pleasures: "pretending." I cannot count the times I have been surprised in my yard by a neighbor or family member, caught in the act of reliving stories I had heard, or crafting new ones. I wonder exactly what they thought I was doing, running around, waving my arms in the air, humming and talking to myself. Pretending was my method of writing stories from the time I could walk until the fall of 2003. I needed neither paper nor pen, grammar nor form. I lived the stories in real time, played all the parts, and lost myself in the adventure.

The motivation to write my first full-length story came from a writing course my parents signed me up for. Learn to Write the Novel Way was its name, and that was exactly what I did. It was nothing new for me to think up a story, but the knowledge that I would spend an entire year writing it down for all to see added nervous anticipation to my efforts. I wrote up the initial plot on half a page, entitled "A Novel Idea." It was not, actually. The story took place in seventeenth century England and the Caribbean. An aged admiral, decorated for his negotiation skills, is dispatched in command of a refitted merchant vessel to neutralize a pirate group acting under the British flag. I plotted out fourteen chapters, originated characters, and then prepared myself for the great moment -- the moment when I would actually begin to write the story.

I set apart a morning in which to write the first five pages. It was, thankfully for me, a sunny day. I think best in brilliant, unadulterated sunshine. Chapter outline in hand, I sat at the computer desk downstairs, fired up Word, and, a little giddy, began.

In some ways, it was like scuffing around on the front drive, pretending. But now I could go back after each sentence and live that moment of the story again. The story pulled me in, and the knowledge that it would receive a grade gave me caution. I described the scene carefully and thoroughly. I introduced Admiral Hambly to my imaginary reader with all dignity, yet with all the visual reality I could muster.

What I described was a scene symbolic of the turning point those two hours were to me. The admiral "strode" (I felt very proud of myself for using that word) down a corridor with his dignified fellows, soft red carpet under his feet, just as I had made the journey through stately pages and dreams in the company of my family. Soldiers at the end of the hall saluted the dignitaries and swung open the doors, revealing, to Admiral Hambly, the court of King Charles II, to me, a similar great chamber, full of great yet flawed people communicating desperately important truths. Hambly and I were there to join them, there to try our tongue and pen at their own game, and see if we could make a difference.

Ironically, what Hambly had to say was not so very important. And, by the end of the book, he almost despairs, seeing how useless his life has been. Regardless of this warning sign, I sat, at the end of my first two hours and five pages, my fingers aching and my hands quivering from excitement, knowing that my life had changed for good. I had begun to learn in those first two hours the beauty of description, the centrality of character, and the necessity of plot in a "good" story. Familiarity caused me to lose some of my excitement and caution in future chapters and books. I must fight for them now every time I write. I understand more and more that, if I am going to write, I had better have something important to say, and say it well. There are already too many cheap ideas and cheap deliveries.

But I learned something in those two hours that I hope will never leave me. I knew already how to translate words spoken into thoughts and ideas. I had discovered and refined already how to take those thoughts and ideas and make them sounds and images in my mind. Finally, that morning, I learned how to capture sounds and images in words, completing the cycle. I was equipped to begin making what had, in many ways, made me.

If I hold to the Truth I first learned in the second row at church, in my first epiphany, and work at conveying it, I can do lasting good with what I learned in The King's Court.