Nicholas Zakas' Personal Blog A deviation from my usual tech writing

21Jun/07Off

Sometimes, I’m good at math

At one point in my life (namely college), I was really good at math. I breezed through calculus courses left and right and left discrete mathematics in my dust. Simple geometry was beneath me and looking back at the SATs, I laughed at how I struggled. A few years ago when I set out to go to graduate school, I had to take the GMAT and realized that my level of math understanding had regressed since I had graduated. I just couldn't figure out things that had been simple just a few years prior. Nowadays, I congratulate myself when I figure something out, thus my writing today.

I came across a need to create an algorithm that dynamically computed averages as new data came in. It would be inefficient to add up all the data each time a new datum appeared, so I wanted to have a rolling average calculation. I'm sure this has been solved before, but a few quick searches didn't turn up anything useful for me. What is this thing called? A rolling average? A dynamic average? A moving average? After pouring through all kinds of sites without any further idea I decided I'd try to figure it out myself. I do not claim to have created this technique, I only claim that for the first time in many years I figured out something mathematical without any outside help. I'm almost embarrassed by the simplicity of the solution but given that I don't do much complex math on a daily basis, I was still quite happy with myself.

Okay, how to recompute the average every time a new piece of data comes in:

  1. Take the previous average and multiply it by the previous number of data points (for instance, if you have 5 values and a new value just arrived, multiply the previous average by 5).
  2. Add the new value.
  3. Divide by the number of data points including the new one (if you have 5 values and a new value just arrived, then divide by 6).
  4. Done!

Go on, tell me how you learned this in high school, but I'm having a little happy moment right now. It's fun figuring out JavaScript issues on a daily basis, but sometimes figuring out and old-fashioned puzzle really makes you feel good. :)

Tagged as: , Comments Off
7Jun/07Off

“I want this so bad”

Those who know me understand that I'm really into social dynamics, how people interact with one another, how relationships work (both romantic and not), how groups interact and so forth. I've always found social interaction to be incredibly interesting with all of the hidden signals behind things are both spoken and left unsaid. Today I had a little realization about a phrase I hear too often, so I wanted to share.

The phrase is, "I want this so bad" (also sometimes said as, "I really want this"). I heard it numerous times tonight while watching the show, So you think you can dance? Yes, I watch these types of reality shows if for no other reason than I applaud entertainment that makes the arts cool. In any event, there comes a point where someone either didn't make the cut or isn't sure if they did when they inevitably utter this phrase, "I want this so bad."

This phrase is usually preceded by "but" or "because", meaning that something negative was said first or a question was asked. I've seen this a lot on reality shows during cuts but also at the auditions I've been at. Another place I've experienced it is during breakups, when one person wants to stay in the relationship and the other does not. These are emotionally-charged words, typically uttered in desperation as a final plea.

After thinking long and hard about it, I came to the conclusion that this phrase, "I want this so bad," should be a clear indicator of a deficit in previous action. If you get to the point where this is said, it means that there was a prior point at which action was required, but you were either unable or unwilling to take it.

I had a wonderful creative writing teacher in college who used to say, "don't tell me, show me," as a way of critiquing our writing. By saying, "I want this so bad," I believe it means that you didn't do that. It means that there was a time when you could have shown, a time when you could have taken action, a time when you could have done something to prove your worth or fit. There was a time when you could have done something to prevent yourself from ever using this phrase. But you chose not to. By uttering this phrase, you are gasping your last breath, trying desperately to hold on to something that perhaps you didn't give enough attention to.

Once you have uttered this phrase, you may as well pack up your things and leave, because you are verbalizing something that shouldn't require words. Your actions failed and now you are trying to use words to mend something that required much more effort. No, you are not going on in the competition; yes, you are being cut; I'm sorry, I don't want you back.