Monday, September 2, 2013

Downpour

     As I was walking out of the drugstore a few days ago, the atmosphere erupted in rain. There I stood, bathtub cleaner and a box of hair colour in hand, as fat raindrops drove toward the ground like missiles, the skim of water on the sidewalk exploding from the impact. Catastrophe and renewal hung like the mist in the air around me. I love a good downpour.

     When I was young, my family and I would go for regular walks in the forest, rain or shine. During one particularly powerful squall, my dad held my younger sister and I under the cover of a cedar tree. "Look," he said, "at how the raindrops strike the wooden railing on that bridge. Look at how the water sprays."

Rail Top Rain Drop by Robert Case


     We watched as the wooden plank transformed into a bombing range for two or three minutes. As each drop made contact, it was annihilated into a cone of water an inch or two in height. The rain was so intense that I almost expected craters to be etched into the wood.

     That was the day I learned that my dad was the kind of man who could find the beauty in a raindrop. It would take a decade to realize that he had devoted thirty years of his life to raising children who can appreciate those raindrops. My siblings and I grew up in a west coast town that had on average 167 rainy days per year. By learning to find joy wet weather, we could fall in love over and over with this funny place called home. By learning to see the grace in everyday, we could make a new home wherever the wind would blow us.

     On the way home from the drug store, I left my hood down. It was so easy to feel as excited and dramatic as the weather that washed over me. The rain only lasted a few minutes, but it was long enough to remember how to feel alive. Someone told me that the key to a happy life is to learn to dance in the rain. When taken literally, I have to agree.

Monday, June 24, 2013

Codes

    I was going to write a post about how to be a good human being, but I didn't really feel like preaching to my readers from atop a cyber soapbox. Then I thought I might cleverly disguise the lesson in some cool story or anecdote, but I realized that such an act would still qualify as preaching and my audience deserves better. I scrapped my sappy musings (in case you were interested, here's the gist: try to be nice to everyone) and decided to write about something cool: codes.

    Suppose that you were talking to your friend over the phone in an area where the reception is poor. She says, "Let's meet up for beer-garitas!" but you hear "Let's meet up for deer fajitas!" Since deer fajitas is not a word in your everyday vocabulary, and the reception is bad, you assume that you have misheard her. Beer-garitas is a familiar word, and it sounds a lot like deer fajitas. You automatically correct the mistake and reply with, "Sure. My place at six. Bring limes."

    Now imagine a computer receiving a command with a small error in it. Since errors occur frequently during transmission, we expect quite a few of them. We want our computers to automatically detect and correct minor alterations in received messages. Our machines do not have the advantage of a human brain to help them sort out jumbled commands, so we accomplish our task by cleverly choosing a suitable code.

    We will design a language of codewords that our computer can understand. Our computer (let's call it MAX) only understands two symbols, 0 and 1, so all of our codewords should use 0s and 1s. There are codes with different letters and symbols, but I'll save that discussion for another day. MAX can execute four commands: standby, turn off, play music, and fire the missiles. Errors occur every now and then.

Let's consider the following code for those tasks:

00    =    standby
01    =    turn off
10    =    play music 
11    =    fire the missiles

     This code is just fine in a perfect world, but errors occur here in the real world. Let's say that you sent the message 01 (turn off) but an error occurred and the message 11 (fire the missiles) was received. Catastrophe ensues.

      We can improve our code by building in some extra digits. Consider the code:

0000    =    standby
0011    =    turn off
1100    =    play music
1111    =    fire the missiles.

    Say we want to groove to some Micheal Jackson, so we send the computer the message 1100 (play music.) A single error occurs, and the computer receives 1101. MAX knows that an error has occurred because 1101 is not a codeword in its dictionary. However, MAX cannot tell if the original codeword was 1100 or 1111, since both are only different from 1101 by one digit. Should the computer play music or fire missiles? Tough call for a machine. A single error in any codeword would produce some number outside the code. MAX would be able to detect any single error, so our second code is superior to the first. Unfortunately, if any single error occurs, MAX cannot tell which codeword was originally sent, and cannot automatically correct the command.

     We can fix this problem by making our codewords just a little longer. Consider the code:

000000    =    standby
000111    =    turn off
111000    =    play music
111111    =    fire the missiles.

    Say we want to send the message 000000 but MAX receives 001000. An error has clearly occurred since 001000 is not command that MAX recognizes. 001000 is different from 000000 at one digit, 000111 at four digits, 111000 at two digits, and 111111 at five digits. Since 000000 is the closest codeword to 001000, MAX automatically corrects the command to 000000. In fact, any single error in any codeword could be automatically detected and corrected this way! Now, as long as two errors don't occur in the same command (come on, what are the chances?) MAX won't fire the missiles by accident.

     Our CD players use similar principles to make sure that Billy Jean plays smoothly, even when the disc is scratched. The music is stored digitally as a numeric code, but imperfections on the CD surface cause errors when the laser reads the disc. The machine is able to automatically detect and correct these errors so that the music plays seamlessly. How? The numeric code that stores the information was cleverly chosen so that no two codewords were too similar.

     The holy grail of coding theory is to find codes such that the codewords are different enough to be robust against errors, short enough to facilitate quick transmission, and diverse enough to accommodate as many commands as need.

     If you've made it to the end of this very technical post, congratulations. This is the stuff of fourth year theoretical mathematics. You deserve a beer-garita, you brainiac (or a deer fajita if you are into that). Cheers!

     Many thanks to the UVic discreet math department, specifically Dr. Dukes, for teaching me about codes. The information presented here was adapted from an introductory lecture on Coding Theory.

Friday, April 19, 2013

Love set aside

When I was seven years old, my parents bought me my first guitar. It was a 3/4 size, classical style guitar with gentle nylon strings for my miniature hands. Once the basics were mastered, my teacher asked which style I wanted to pursue. Several choices were presented to me, and I opted for classical music. So every week for eight years, my dad drove me to classical guitar lessons. In eight years, I studied with four teachers at two studios, accumulated eight guitars, went through dozens of packs of strings, taught scores of students of my own, competed in several exams and festivals, and found one of my greatest passions. My parents were committed to my music, so long as I found joy in it, and gifted me with encouragement, support, strings, the occasional new instrument, and weekly rides to my lessons.

It was not always easy to learn a new piece. The fingering was unfamiliar and clumsy and it often sounded terrible. But as I studied the piece it would come alive. At some point, the music would transition from notes on a page to some living entity. I wasn't in control of the music anymore; it controlled me. That was the only time that I could be completely "in the moment," and it brought me more happiness and peace than just about anything else.

After I graduated high school, I didn't play much. I'd try and jam every now and then, but it felt forced and awkward. Every now and then I'd pull out my guitar and try a few classical pieces, but I'd grown rusty and it was frustrating to stumble on phrases that once were easy. After my dad passed away, I didn't play a note for months. I set aside a grand and joyous piece of my life, and it wasn't clear when I would pick it up again.

Recently, I woke up and I wanted to play. I wanted my old skills back. I wanted to feel as alive as I had when I played as a child. It has been a struggle to be patient with myself as I relearn old pieces and strengthen dormant muscles. I've been playing classical music almost every day, and although it's a gradual process, my passion has returned. Sometimes we don't need to look forward to find happiness, but backward.

Saturday, January 5, 2013

Planning our Wedding - A Miracle!

Last week a miracle happened.

Last week Mr. Right came home from work, and I greeted him with a big hug and a kiss and detailed information about elopement packages. Three nights accommodation in the mega-ultra-deluxe suite, wine and chocolates included, flowers included, cake included, officiant included, witnesses included, photos included, eat-your-guts-out dinner included, spa trip included. All for the low, low price of keeping my sanity. Why hadn't we thought of this before?

Mr. Right looked into my crazed eyes and said he didn't want to elope. (Had he not heard me? Mega-ultra-deluxe suite!) He convinced me that we should try to look for a venue for our family celebration one more time.

Fast forward to Saturday morning. The head chef at an Italian Restaurant was pouring us a cup of coffee and sitting down with us in his restaurant. As I looked around the space, our wedding transformed from an obscenely expensive obligation to society that had nothing to do with Mr. Right and I into the family celebration of love, commitment, and partnership that would take place in that gorgeous space. We spent about an hour discussing policies and visions with the head chef, and we discovered that he was a hard working, warmhearted, decent human being, instead of some corporate psychopath who invents wedding pricing at some resort. (Who thinks it's a great idea to surprise you on one of the biggest days of your life with a fee of $5/slice to cut a wedding cake? If resorts need to take in more revenue, they could find a less weaselly way to add it on to your bill.)

So we went home and thought about it for a few days, just in case the sparkle faded. But the fit for us was too perfect, so we booked it! For the first time since my proposal, I am genuinely excited and proud to host a big fat family wedding in a fantastic venue. Indeed, this will be a grand way to celebrate our sendoff into the grand adventure of marriage, and to thank those who have supported us in our relationship for the past 8 years.

Planning a wedding is tricky business, but Christmas miracles do exist!