**From New Scientist #2835, 22nd October 2011** [link]

My daughter has 10 equal-sized coloured bricks. Each is cubic, and has opposite faces of the same colour. The three pairs of opposite faces on each are as follows:

Brick 1: yellow, green, red

Brick 2: blue, green, green

Brick 3: yellow, green, white

Brick 4: blue, yellow, white

Brick 5: green, red, white

Brick 6: yellow, yellow, green

Brick 7: yellow, red, white

Brick 8: blue, green, white

Brick 9: blue, yellow, green

Brick 10: blue, blue, yellow

My daughter arranged nine of the bricks in a tight 3Ã—3 square on the carpet and hid the 10th. The visible face of the centre brick was red, no white faces were visible, and the number of visible blue faces, yellow faces and green faces was the same. By studying the visible faces, but without moving the arrangement, I could deduce which was the hidden brick.

Which brick was hidden?

[enigma1669]

### Like this:

Like Loading...

This was a fun challenge.

The following Python program runs in 36ms.

Solution:The missing brick is #3 (yellow, green, white).Hi Jim, You did classify this one in the notable enigmas, but I guess there are more notable ones in the ordinary ones, to my humble. I guess this one is really easy to code, however that is an enjoyable one.

I marked this puzzle as a fun programming challenge because I found it required some thought before you start programming also it requires you construct a non-trivial program to find the possible arrangements of the cubes and then deduce the answer. Of course (as with most Enigmas) you can do a fully analytic solution on a piece of paper, so there’s a balance between how much you work out yourself and how much you let the computer work out.

I’m sorry if you didn’t find it an interesting challenge, but I’ve looked through your code and I’m not sure you’ve fully grasped the problem. For instance it seems that your program only finds one way of arranging the cubes, and declares that as the answer, and also requires that brick 5 is placed in an edge position, which I don’t see explained and also isn’t actually true. Just a couple of hints if you want to look at it again.

Ohhh Jim hi,

I did write it on the 24th June, and today is 6th August. I really do not remember the puzzle and how to construct the algorithm.

But my code finds the result satisfying the condition given in the puzzle, and I did not say that the puzzle had not been interesting, how did you derive that? I just had said that it had been easy, furthermore this is my opinion.

You may think different.. ðŸ™‚

if you wish, you can delete my code, you know.

Yes, sorry it took a while to get around to looking at your code – I had to get back into the problem myself (I put it up in 2011), and it took some time to work out what your code was doing. But I thought it was polite to try and understand your code as you’d gone to the trouble of putting it on the site.

I mark the puzzles I’ve found to be a fun programming challenge in the Notable Enigmas list, and this was one that I remember finding fun at the time (I did it before I created this site, although only a few weeks before). And as your program doesn’t really solve the problem I think it is probably more challenging than you originally thought too.

If you want me to remove your program I will.

Ok, I have to remember the problem and I can have a look at one more in my free time, I have so much time nowadays, I wish you had said your opinion when I had uploaded it on your site, as I said time has passed, and I have to remember and sure if some thing has to be changed, I will change and if that does not require any changes, I will explain my algorithm and/or approach.

“Which brick was hidden?”

The question is above. ðŸ™‚

what is the lack of the code? what did I miss? would you explain it clearly?

I have read one more, I guess You did say this, there was more paper work than what the code was supposed to do, almost it was solved on the paper,.

Then, I will code it from the scratch and you need not to delete the previous one.

If you need a hint, read on…

The first part of the problem describes the arrangement of the cubes, but the key phrase in the question is: “By studying the visible faces, but without moving the arrangement, I could deduce which was the hidden brick”. This implies that there are multiple ways of arranging the cubes to satisfy the first part of the problem, with different cubes missing from the arrangement. So finding an arrangement that satisfies the first part of the problem is only part of the solution. We need to find all possible arrangements and then eliminate those where we can’t tell which cube is missing from the arrangement by inspecting the visible faces. If the puzzle is well set this will leave us with a single possibility for the missing cube.

Although I did solve the puzzle manually, the program I present above doesn’t use any additional analysis. (Although the runtime of the program would be shorter if I only considered the two possible missing cubes). It constructs the possible arrangements that satisfy the conditions of the square and shows which arrangements have which missing cube. One of the arrangements cannot occur, because we can’t tell which cube is missing from it, but all the other arrangements have the same cube missing from them. So, although we don’t know which arrangement was made, we can say what the missing cube is.

I remember that I should correct the code for all possible combinations, almost a year has passed, anyway;

If your program is looking for possible assignments of the bricks for the centre, edge and corner positions, then it should find 10 possible arrangements, not 6.

Using the brick numbers to indicate the arrangements as “(<missing>) <centre> + <edges> + <corners>” and the colours to show the visible faces, they are as follows:

A1: (3) 5 + 10,8,4,7 + 2,9,1,6 = R + BB,BG, BY,RY + BGG,BGY,GRY,GYY [V1]

A2: (3) 5 + 8,9,4,7 + 10,2,1,6 = R + BG,BG,BY,RY + BBY,BGG,GRY,GYY [V3]

A3: (6) 5 + 8,4,3,7 + 10,2,9,1 = R + BG,BY,GY,RY + BBY,BGG,BGY,GRY [V7]

A4: (3) 5 + 8,4,1,7 + 10,2,9,6 = R + BG,BY,GR,RY + BBY,BGG,BGY,GYY [V5]

A5: (3) 5 + 8,4,7,6 + 10,2,9,1 = R + BG,BY,GY,RY + BBY,BGG,BGY,GRY [V7]

A6: (3) 1 + 8,4,5,7 + 10,2,9,6 = R + BG,BY,GR,RY + BBY,BGG,BGY,GYY [V5]

A7: (3) 7 + 2,8,4,5 + 10,9,1,6 = R + BG,BG,BY,RY + BBY,BGY,GRY,GYY [V2]

A8: (3) 7 + 8,9,4,5 + 10,2,1,6 = R + BG,BY,BY,GR + BBY,BGG, GRY,GYY [V4]

A9: (3) 7 + 8,4,5,1 + 10,2,9,6 = R + BG,BY,GR,RY + BBY,BGG,BGY,GYY [V5]

A10: (3) 7 + 8,4,5,6 + 10,2,9,1 = R + BG,BY,GR,YY + BBY,BGG,BGY,GRY [V6]

Your program seems to be missing A2, A4, A5 and A9. Which stops you being able to find a solution.

Once you find the full set of arrangements you can see that if any of the visible patterns V1, V2, V3, V4 or V6 occur, then we can immediately identify which arrangement is being used (as the visible patterns are unique), and they all correspond to brick 3 being missing (only A3 corresponds to a brick other than 3 being missing).

The remaining visible patterns, which correspond to more than one arrangement are V5 and V7.

V5 corresponds to arrangements A4, A6 and A9, each of these arrangements has brick 3 missing, so if we were to see the visible pattern V5 we would also know that brick 3 was missing.

Which leaves us with V7. This corresponds to the arrangements A3 and A5. But A3 is missing brick 6 and A5 is missing brick 3. So if we were to see V7 we would not know which brick is missing.

However the puzzle tells us that from the visible pattern we

cantell which brick is missing. So we cannot be confronted with V7.We could, however, be confronted with any of the other visible patterns (V1, V2, V3, V4, V5, V6), but all the arrangements that correspond to these patterns have brick 3 missing. So the answer to the puzzle is that brick 3 must be missing. But we don’t know what the visible pattern is (it could be any of the 6 patterns V1, V2, V3, V4, V5, V6, but

notV7), and we don’t know what the corresponding arrangement of bricks is (it could be any of the 8 arrangements A1, A2, A4, A6, A7, A8, A9, A10, butnotA3 or A5).My version gives the same answer as Jim’s above:

I agree with You.