I have been going in circles for a few days now with this word-search puzzle and I still cannot find a clever solution to the problem. Is there a systematic approach that doesn't involve guessing? The problem is as follows:

At a kindergarten's playroom in Taichung a teacher assembled the following configuration using alphabet cubes forming a stack (see the figure as a reference) where it can be read the word DOS BANDOS (the Spanish word for two sides). Calculate the number of different ways joining neighboring letters can be read the phrase DOS BANDOS.

sketch of the problem

The possible solutions in my book are:

$\begin{array}{ll} 1.&1536\\ 2.&1280\\ 3.&256\\ 4.&768\\ 5.&1024\\ \end{array}$

In my initial attempt what I tried to do is to draw a circle over each time I could identify the word being asked but in the end, I got very confused and I felt that I counted a possibility twice, hence I couldn't even understand if my attempt was right. During this process I could identify immediately that the word could be read from the top to bottom, there I counted four cubes, going from left to right, hence $4$ ways and from right to the left $2$ ways which together would account for $6$. This is summarized in the drawing from below where the circles are painted with blue color.

Sketch of the solution

In the end that how far I went. As the more I looked at the stack I started to get confused on which zig zag lines are allowed and which do are already counted.

Therefore can somebody help me with this riddle?. To be honest I have little experience with these kinds of problems so I'd like somebody could be as much as detailed possible and include some drawing (perhaps using mine as a reference) and justify a method for solution.

It is very important for me to get a visual aid, because I really don't feel that solely a paragraph alone would be enough to understand, even as hard as I could. So really please if you can help me with this, include some sort of drawing or schematic so I can understand how to calculate the number of ways.

Again, I am looking for an answer which can solve this problem and that it can be extended to similar problems. Does it exist a way? I've been told a hint which mentions that I should consider turns to the left or right. But I don't know how to use this information.

There is also, in the bottom of the truncated pyramid it can be read the word DOS. Would this count if going from bottom to the top?.

Overall I hope somebody can take time and answer these questions. Because I really need help with this one and I'm confused.

  • 2
    $\begingroup$ Hey! This is a lovely question that has been answered by both ppgdev and myself below, but really belongs on Math.SE. I've flagged the question as such. $\endgroup$ – Hugh Feb 23 '19 at 16:50
  • 1
    $\begingroup$ I disagree. It's such a famous puzzle that we should have it here $\endgroup$ – Dr Xorile Feb 23 '19 at 17:14
  • 2
    $\begingroup$ @DrXorile I understand, but I disagree. The discussion on meta highlights some points that I'd like to bring up. This question does not have a "clever or elegant solution/aha moment", or an "unexpected or counterintuitive result". In addition, the meta claims that: "[problems that use] standard, staightforward methods than anyone familiar with the subject is expected to know [are textbook-style and thus off-topic]. They can be difficult, but their goal is to test comprehension ..., not ingenuity" $\endgroup$ – Hugh Feb 23 '19 at 22:13
  • 2
    $\begingroup$ In addition, based of Chris's phrasing in the question ("the given alternatives in my book are", later rephrased to "the possible solutions in my book are") makes it seem like this is a homework question (or something along those lines). If that is truly the case, the meta highlights its own reasoning on this and thus I see no reason to spare the question; it's already been answered perfectly well by myself and two other people. In general, this question has nothing puzzling to it, it's just combinatorics. $\endgroup$ – Hugh Feb 23 '19 at 22:21
  • 2
    $\begingroup$ @Hugh It may be a homework question, or may be simply in a recreational reading of a textbook, but nonetheless interesting. $\endgroup$ – Riddler Feb 23 '19 at 22:55

The solution to this problem is...


From any given circle that is not in the bottom row, you can either go down and to the left or down and to the right. Because there are four starting points and eight rows in which we make a turn, the solution is $4 \times 2^{8} = 1024$.

  • $\begingroup$ Precisely this is what I wanted to avoid. Can you explain why is it a power of $2$?. In my question what I felt was needed for me to understand the rationale behind this question was to accompany some drawing to justify an answer. Because I'm still stuck on how to get the answer. $\endgroup$ – Chris Steinbeck Bell Feb 23 '19 at 16:54
  • $\begingroup$ @ChrisSteinbeckBell think about it this way: say you have one coin; it can be either "heads" or "tails" — that's $2$ possibilities. Now, add a second coin; now you can have "heads-heads", "heads-tails", "tails-heads", or "tails-tails" — that's $4$ possibilities. Now, add a third coin; now, you can have "heads-heads-heads", "heads-heads-tails", "heads-tails-heads", .... etc. for a total of $8$ possible arrangements. Notice that each time we add a new coin, the number of possibilities doubles [cont'd] $\endgroup$ – Hugh Feb 23 '19 at 16:57
  • $\begingroup$ that's a more logical way!. But why each time a coin is added the result is multiplied and not a sum?. I mean why the possibilities do not just sum?. $\endgroup$ – Chris Steinbeck Bell Feb 23 '19 at 17:00
  • $\begingroup$ @ChrisSteinbeckBell [cont'd] this is because the new coin introduces another combination. Let me do an example. We already know that $3$ coins = $8$ possibilities, so let's try and mathematically calculate the number of combinations for $4$ coins. For each of the $8$ combinations with $3$ coins, we can add a "heads" to the end, or a "tails" to the end. That means that the number of possibilities doubles. $\endgroup$ – Hugh Feb 23 '19 at 17:00
  • $\begingroup$ To reference your comment as to why we multiply and not add, let me put it this way. Say that we're trying to calculate the number of possibilities for $10$ coins. Now, take a look at this picture, or this picture $\endgroup$ – Hugh Feb 23 '19 at 17:03

The answer is - the number of different ways joining neighboring letters to get the phrase DOS BANDOS is 1024.

You can record your path down as a sequence of 1s and 0s - left turn 0, right turn 1. Your record from any of the 4 D's at the top could be any combination of 8 ones/zeros. It gives you a total of 256 paths. Multiply it by 4 possible Ds to start with and you get the answer. Below is an example of a path record:

               /                            left 0 
              O   O 
               \                           right 1
            S   S   S 
                 \                         right 1 
          B   B   B   B
                 /                          left 0 
        A   A   A   A   A 
                 \                         right 1 
      N   N   N   N   N   N 
                   \                       right 1 
    D   D   D   D   D   D   D
                   /                        left 0
  O   O   O   O   O   O   O   O
                 /                          left 0 
S   S   S   S   S   S   S   S   S
  • $\begingroup$ Can you include a drawing in your answer so I could understand what were you referring with the $1$ and $0$ ?. Because I'm not getting the idea very clear. I believe there are zig zag options but I don't know how to account for them. Can you help with this part please?. :) $\endgroup$ – Chris Steinbeck Bell Feb 23 '19 at 16:56
  • $\begingroup$ @ChrisSteinbeckBell, I added an example of a recorded path, as you asked. I noticed Hugh has already helped you with understanding the answer. I hope the picture will also help clarifying it. $\endgroup$ – ppgdev Feb 23 '19 at 18:00
  • $\begingroup$ Yes, @Riddler. The drawing is a partial view of the original puzzle, just to illustrate how path recording from one of the top Ds is done. $\endgroup$ – ppgdev Feb 23 '19 at 21:39
  • $\begingroup$ Thanks now I can see what you wanted to say about adding those numbers to identify paths. Out of curiosity how do I jump from $8$ to $256$ paths?. So far the only method I could come up with was $4\times 4\times 4\times 4$. How did you calculated? $\endgroup$ – Chris Steinbeck Bell Feb 24 '19 at 18:20
  • $\begingroup$ @ChrisSteinbeckBell, a path record from one of the Ds could be any combination of eight 0/1. The way I count all of them is 2 possibilities for the first digit, for each of the two there are 2 possibilities for the second digit, etc. With each new digit the number of possibilities doubles. So the total (for one of the Ds) is 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 2^8 = 256. $\endgroup$ – ppgdev Feb 24 '19 at 21:49

Here is the answer as well as clear illustrations to help you understand.


first triangle only
1 starting point, 2 directions, 8 rows


taking just the first triangle, as you will see in the illustration below, we can go LEFT or RIGHT (2 directions) when going down.

See this illustration I made:

enter image description here


this becomes an exponential function in which the number of directions is put to the power of the number of rows.

See this illustration I made so you can visualize it:

enter image description here


x = starting points
y = total rows
z = number of directions
x * z^y
= 1 * 2^8

See this illustration I made:

enter image description here

Please note that

This is only the first of four triangles.

See this illustration I made:

enter image description here


there are four of these triangles starting with D. So, we multiply by 4.

See this illustration I made:

enter image description here


4 starting points, 2 directions, 8 rows:


x = starting points
y = total rows
z = number of directions
x * z^y
= 4 * 2^8


4 * 256
= 1024


Once you consider that

it could be read in any directions - downwards, upwards, left-to-right, or right-to-left,


it multiplies the number of ways that we can read it.

However, if you also include

multi-directional (e.g. in circles), then it increases the possible results exponentially, which we aren't even going to bother with.

In any case, to reiterate as per above, the answer to DOS BANDOS is

1024, and you can see the above pictures for reference.


If you add one more row, it DOUBLES the results!


x = starting points
y = total rows (9 in this case if 1 more row)
z = number of directions
x * z^y
= 4 * 2^9
= 2048

In fact,

with every additional row, your results double, since it is an exponential function! :D
e.g. 4 * 2^10 = 4096

  • 1
    $\begingroup$ Thank you very much riddler!. This was exactly the kind of aid that I needed to get that aha moment. Funny though that some hours before your answer was posted I did an attempt by my own using pen and paper and found the same as you. It took me time but using the guidelines mentioned by other posters did helped me a lot. $\endgroup$ – Chris Steinbeck Bell Feb 24 '19 at 18:12
  • $\begingroup$ Btw out of curiosity what software did you used to draw those diagrams?. I'm using inkscape and while I'm modestly some sufficient command of it, still takes me time to draw these illustrations. $\endgroup$ – Chris Steinbeck Bell Feb 24 '19 at 18:14
  • $\begingroup$ Photoshop, although I am an expert at photoshop. Although I didn't spend much time on the illustrations, just enough to get the point across. $\endgroup$ – Riddler Feb 24 '19 at 19:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.