Awesome is Better than Good

Awesome

I am currently reading Edward De Bono's Thinking Course (Author of Six Thinking Hats), which has an anecdote from one of his seminars; he describes a problem involving two pieces of wood, and the task of crossing a room without touching the ground. He accompanies this with a discussion of three approaches, one very inefficient, and one seemingly good. The third approach is much faster, but everyone settles on the second solution, because it seems good enough...

The 'shuffle' solution seems so obvious and so adequate that there never seems any need to set out to look for an alternative. Contentment with an 'adequate' solution or approach is the biggest block there is to any search for a better alternative... It is only through realisation of this and an act of will that we can set out to look for alternatives - knowing that in most cases we shall not find anything better, but still being willing to invest that thinking time.

I feel that this advice should be taken in reverse too. If you have a new idea for how to do something, don't dismiss it because people are already happy with the current methodology; they could be ecstatic with yours. Maybe a solution you think is too obvious isn't so clear to them.

I think many people sell their good ideas short, and become too attached to ideas that maybe aren't all that great. Regardless of the perceived value of your idea (within reason), you should test the waters. Run it by some non-friends (they don't mind hurting your feelings). It may be better, or worse, than you think.

Regularly Divisible

Media_httpwwwalexbowe_bbizv

Update: read the comments at Hacker News to see some succinct approaches to this, as discussed by gjm11, qntm and patio11. Thanks to Robin for providing this demonstration that can find a regex for testing divisibility of any number, in any base (he also made the code available, nice).

Earlier this year, at the advice (once more) of Chad Fowler, I took to the idea of practicing programming every day. Perhaps this appealed to me because it echoed the rituals of my better musician friends, and allowed me to draw parallels between programming and my fading dream of becoming a famous rockstar.

Possibly because of my failed interview at Google (hey, I wouldn't have hired the back-then me either, so no hard feelings!), I was also interested in job-interview styled problems [1]. Not FizzBuzz though, more like the computer science 'riddles' found on this page [2].

At the time I was teaching Computing Theory [3], 80% of which was formal languages: regular expressions, context free and context sensitive grammars, Turing machines and other automata, and their locations in the Chomsky Hierarchy. So, this problem appealed to me:

Construct a finite state machine (or equivalently, write a regular expression) which accepts all strings over the alphabet {0,1} which are divisible by 3 when interpreted in binary.

It is pretty interesting that languages can be defined to communicate patterns in binary sequences that are divisible by 3. Let's solve it in more detail than necessary :)...

Read the rest of this post »