06.09.2021 Views

Mind, Body, World- Foundations of Cognitive Science, 2013a

Mind, Body, World- Foundations of Cognitive Science, 2013a

Mind, Body, World- Foundations of Cognitive Science, 2013a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

used to solve a complex problem by reducing it to a simple version <strong>of</strong> itself. This<br />

problem-solving approach is <strong>of</strong>ten called divide and conquer (Knuth, 1997).<br />

One example <strong>of</strong> this is the famous Tower <strong>of</strong> Hanoi problem (see Figure 3-1),<br />

first presented to the world as a wooden puzzle by French mathematician Edouard<br />

Lucas in 1883. In this puzzle, there are three locations, A, B, and C. At the start<br />

<strong>of</strong> this problem there is a set <strong>of</strong> differently sized wooden discs stacked upon one<br />

another at location A. Let us number these discs 0, 1, 2, and so on, where the number<br />

assigned to a disc indicates its size. The goal for the problem is to move this entire<br />

stack to location C, under two restrictions: first, only one disc can be moved at a<br />

time; second, a larger disc can never be placed upon a smaller disc.<br />

0<br />

1<br />

2<br />

3<br />

4<br />

A<br />

(Start)<br />

C<br />

(Goal)<br />

B<br />

(Spare)<br />

Figure 3-1. The starting configuration for a five-disc version <strong>of</strong> the Tower <strong>of</strong> Hanoi problem.<br />

The simplest version <strong>of</strong> the Tower <strong>of</strong> Hanoi problem starts with only disc 0 at location<br />

A. Its solution is completely straightforward: disc 0 is moved directly to location<br />

C, and the problem is solved. The problem is only slightly more complicated if<br />

it starts with two discs stacked on location A. First, disc 0 is moved to location B.<br />

Second, disc 1 is moved to location C. Third, disc 0 is moved from A to C, stacked on<br />

top <strong>of</strong> disc 1, and the problem has been solved.<br />

What about a Tower <strong>of</strong> Hanoi problem that begins with three discs? To solve<br />

this more complicated problem, we can first define a simpler subproblem: stacking<br />

discs 0 and 1 on location B. This is accomplished by doing the actions defined<br />

in the preceding paragraph, with the exception that the goal location is B for the<br />

subproblem. Once this subtask is accomplished, disc 2 can be moved directly to the<br />

final goal, location C. Now, we solve the problem by moving discs 0 and 1, which are<br />

stacked on B, to location C, by again using a procedure like the one described in the<br />

preceding paragraph.<br />

This account <strong>of</strong> solving a more complex version <strong>of</strong> the Tower <strong>of</strong> Hanoi problem<br />

points to the recursive nature <strong>of</strong> divide and conquer: we solve the bigger problem by<br />

62 Chapter 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!