On the Complexities of Preparing Dinner

21 08 2011

During a coffee break I mentioned that “even though the kids prefer schnitzel I’d rather prepare baked chicken”

When asked why I explained that “Chicken is O(1) and schnitzel is O(N)“.

This is a case in which the joy of using jargon colloquially overrides strict correctness. Obviously making chicken isn’t O(1) even if you do  have an infinitely large oven.

Image stolen from gas-grill-review.com

Then again the complexity of finding an element in an unsorted sequence isn’t really O(N) either, it’s O(N * Max(Cmp(a, b))). Comparing objects can often be considered O(1)  (e.g. 32 bit integers) but if you want to compare books by the number of the times the letter e show up in them, well then, comparing War and Peace to Les Misérables is far from constant speed (you could use A Void as the null book</aside>)

The real[1] reasons I prefer making chicken to schnitzel are twofold.

  1. The constants are much bigger for schnitzel
  2. Schnitzel making is synchronous while baking chicken is asynchronous

And don’t get me started about the space dirty dishes complexity.


  1. Of course how healthy the food is doesn’t count as a consideration, we are geeks here after all.
About these ads

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: