# Campy Bear Heuristics

Here's a puzzle for you: I am out camping. One day I mark my spot and then walk one mile due south, at which point I turn ninety degrees to my left and walk one mile due east. I pause to admire the scenery, am startled by a bear, and run one mile due north. At this point I am back to my starting place, seem to have lost the bear, and have lunch.

Where am I camping? What color was the bear?

One answer is "obvious". There are many other correct answers as well. How many can you find? Answers below.

I ask this question because I recently I read two books. Both are titled How To Solve It. Both are encyclopedias of heuristics for solving problems. Both are chock full of examples which demonstrate how to apply the plethoras of heuristics they contain to specific hurdles you may or may not find yourself facing in your daily life. Neither is what I consider light reading. Both made my brain hurt. Both have ideas you can apply to your testing. (Even if you aren't inclined to wade through the math!)

The first How To Solve It was written by George Polya decades ago. The first few pages present his oh-so-simple problem-solving algorithm:

1. Understand the problem.
2. Devise a plan.
3. Carry out the plan.

The remaining pages use a series of math problems to explain how to apply this procedure. Regardless of whether you work through the problems or skip them, be sure you understand why George takes the approaches he takes, and consider how to apply them to your testing.

The second How To Solve It was written by Zbigniew Michalewicz and David B. Fogel a few years ago. Their version is effectively a sequel to Polya, presenting and explaining a variety of often-used-today algorithms and heuristics. They note that, despite the massive computing power we now have at our disposal, solving real-world problems is as difficult today as it was when Polya wrote his tome. Solution spaces are still often too large to exhaustively search, and the person solving the problem may still be inadequately prepared to do so.

I won't attempt to summarize the many problem-solving algorithms Zbigniew and David present. I do however want to highlight two points they stress:

• Most problems have more than one solution. Furthermore, the first solution you find isn't necessarily the best answer.
• Thinking about your problem is important; actually working on the problem is important too. The best testers I know often seem to spend more time pondering how to test their product than they do actually testing it. Once they start testing, however, they find flurries of important issues fast. As they do so they use the information they learn to change their approach and triangulate in on a more effective process. (One reason I like Session Based Test Management is that it institutionalizes this think-do-think-do cycle.)

If you find math fun, these books are stuffed to bursting with interesting problems for your puzzle-solving pleasure. If balancing your checkbook is math enough for you, you can skip the gory details and still learn bunches. If you'd rather bypass even the task of searching out pearls of wisdom from masses of math, both George and Z+D summarize the important bits (George first thing, Z+D last thing).

So, d'ya have a solution to my riddle yet? The canonical answer is that I must be camping at the North Pole, because that is the only location where walking one mile south, one mile east, and one mile north would return me to my starting point. Thus the bear must have been a polar bear, thus it must have been white.

This is not however the only solution. I could be camping one mile north of a parallel on the Southern Hemisphere which happens to have a circumference of exactly one mile. So I could walk one mile south, walk one mile east (completely around the globe), and follow my footsteps one mile north back to my campsite.

I could also be camping one mile north of a parallel on the Southern Hemisphere which happens to have a circumference of exactly one-half mile. So I could walk one mile south, walk one mile east (circumnavigating the Earth twice), and follow my footsteps one mile north back to my campsite.

Do you see how there are an infinite number of possible locations for my tent?

The bear could be any color imaginable as well - as there aren't any bears in Antarctica, I must have hallucinated it!

*** Want a fun job on a great team? I need a tester! Interested? Let's talk: Michael dot J dot Hunter at microsoft dot com. Great testing and coding skills required.

1. Zach Fisher says:

Loved this one as well. I’m afraid I read too far in and you revealed some of the answers, so I feel kinda ruined on this one.

I was going to be pedantic and answer:

Q: Where are you camping?

A: Outside, not ‘In’ ( "I am _out_ camping" )

A: On land ( "I walk…, I run…" )

A: On Earth ( I, walking, running, bears, etc. )

Q: What color is the bear?

A: Not the exact same color as the scenery ( "…I pause to admire the scenery, am startled by a bear")

2. m_i_m says:

Hi there!

Interesting riddle indeed!

My thoughts were:

You could have been camping in some snowy place and marked your spot with something, like a stick or so in the ice. You walked 1 mile south then 1 mile east and then after being scared by a polar bear, 1 mile north again! There is no mention of how long the walking took! It could have been that the snow/ice moved pretty much by 1 mile towards the east to give you the illusion that you back at the same spot!

What do you think?

Great blogs, keep it up, i enjoy it.

3. Jim Lang says:

Now, I went a little farther afield and had you on an asteroid, camping in a pressure-tent.  The bear was wearing a spacesuit, so the color is indeterminate. One mile "south" of the camp has a circumference of one whole-fraction of a mile.  South could be the solar-south, or the south magnetic pole of the ‘roid.  Given this, the asteroid must be egg-shaped if you are NOT at the north pole of the asteroid.

There’s always hyperspace, as well.

The problem is defining the solution-set.  Constraints can be as informative and as important as the conditions.  Head-aches.  Yes, the headaches.

4. Zach, m_i_m, Jim: I like the way you think! Thanks for proving my thesis that multiple correct answers always exist!

5. Jeroen says:

Impresive how you turn a riddle into something making us think about it and combine it with our daily job.

Here another throw with the stick.

Your saying you were out camping. Only you didn’t say that that was the starting point. And you walked a few miles and then you came to the position you started. This also could be the place you started before you camping to your camping place.

Imagine that you started from you home, then your camping place would be 1 mile south, 1 mile west, turn 90 degrees and walked 1 mile north. (referce walking ? đź™‚ ) And you camping site is just about a mile away.

Perhaps bear was a typo in specs and you ment beer. Only beer for lunch is a bit early.

regards,

Jeroen

6. Simon says:

I wonder if any developers were reading this and thinking "why were you walking a mile south!? everyone knows there are bears there!"

Another cracking blog, they’re always guaranteed to get me thinking.