Wednesday, October 12, 2011

From mountaineering to setting up a laptop

How do you untangle a rope? When the knots are few and loose, it is very easy, and just about any way will work. But climbers are as obsessed with runtime optimization as algorithms researchers. I learned this summer that the fastest way is to shake it.

How do you uncoil your power cord as you set up your laptop for class? Last year I used to do it by quickly undoing the loops one by one. This year, inspired by my mountaineering vacation, I have realized that the fastest way is to shake it. It works! I am saving at least a couple of seconds of preparation time at every lecture.

3 comments:

  1. This is nice evidence that randomized algorithms are good in everyday life as well as computer programming!

    ReplyDelete
  2. Nice connection!

    Experienced climbers/guides would typically want to make sure the rope plays out well when using it the next time after untangling it. As such, just "shaking it" may not describe the full picture. Simply shaking a randomly coiled rope would help untangle it quickly most of the time. But if there are knots that require more work to untangle, it's best to start from one end and pull the rope through to untangle. In other words, this procedure works just like any randomized algorithm - it might not do well on the worst case instance :-).

    Also, Some people prefer to keep the climbing rope "randomly coiled" rather than coiling it in a systematic way (e.g., butterfly coil). The argument is that this method of random storage could avoid creating (semi)permanent kinks as the rope gets bent at the same place by repeated systematic coiling. But even when storing the rope in such a "random" heap, one would want to make sure it'll play out nicely when using it the next time. But then, one is really insisting that there is some "sorted order" in the random heap - so, it's not completely random after all.

    The difference in the lengths of a power cord (~2m) and a 60m climbing rope could also be a factor here. After shaking your cord, even if you have to do some extra work to untangle it, it would not be too much work. So, you might as well shake it first.

    On a related note, I usually store my power cords in random heaps - in order to avoid kinks/loose connections in spots resulting from repeated bending.

    ReplyDelete

Note: Only a member of this blog may post a comment.