Enigmatics

Enigma 1475

Posted on: Monday 7/1, 2008;  9:11 PM

This Enigma led me to attempt a solution using large Boolean expressions to express the legality of the state of the whole 6×4 grid of cards, but it turned out that the size of these Boolean expressions choked Mathematica because I had not told it about the high degree of structure in these expressions. As a partial solution, I tried various manual simplifications to reduce the maximum size of Boolean expression that appeared, but I eventually gave up this approach in favour of one described below in which I explicitly impose my knowledge of the structure of the problem.

Define a function for displaying a card with one or more red lines drawn on it.

"BE3408729093_1.gif"

Display the 6 possible states (i.e. location of the red line) of the card. States 1 and 2 are the two distinct orientations of the first type of card, and states 3 to 6 are the four distinct orientations of the second type of card.

"BE3408729093_2.gif"

"BE3408729093_3.gif"

Display a 6×4 grid of 24 randomly selected cards, overlaying the grid coordinate and state of each card. Note that these cards almost certainly do not form a legal pattern of red lines, because the proportion of cases that form a legal pattern is minuscule.

"BE3408729093_4.gif"

"BE3408729093_5.gif"

Define the legal combinations of neighbouring cards. For each of the 6 possible card states there are constraints on the cards to its left/right/top/bottom.

"BE3408729093_6.gif"

Display all of the legally valid neighbours. Each of the 6 states is placed at the centre of a 3×3 grid, and red lines are drawn in each of the surrounding 8 locations to indicate which red lines are legal. Note that all red lines are allowed in the diagonally adjacent neighbouring locations.

"BE3408729093_7.gif"

"BE3408729093_8.gif"

The strategy is to draw red lines starting at the left hand side of the 6×4 grid, and then work across column by column to the right hand side of the grid accumulating results along the way, so that eventually all of the legal states of the whole 6×4 grid are generated.

Define the 2 states that each of the lefthand and the righthand columns of the 6×4 grid can have. These will be used as initial and final conditions as we propagate across the grid.

"BE3408729093_9.gif"

Define a function for displaying a single column of the grid.

"BE3408729093_10.gif"

Define a function for displaying a multiple column grid.

"BE3408729093_11.gif"

Display the initial and final conditions defined above.

"BE3408729093_12.gif"

"BE3408729093_13.gif"

Define a function for determining whether a pair of adjacent grid columns is legal. There are 4 tests that must be applied:
1. Intra-column legality.
2. Inter-column legality.
3. Top edge legality.
4. Bottom edge legality.

"BE3408729093_14.gif"

Define a function for generating the set of legal states of only the next column across the grid.

"BE3408729093_15.gif"

Define a function for generating the set of legal states of the grid including the next column across the grid.

"BE3408729093_16.gif"

Define the initial states of the grid, which are each a 1×4 grid.

"BE3408729093_17.gif"

"BE3408729093_18.gif"

Propagate each of these 2 initial states by 1 step across the grid, and then display the results. Each of the 2 1×4 states leads to 5 legal 2×4 states.

"BE3408729093_19.gif"

"BE3408729093_20.gif"

Propagate each of the 2 initial states by 4 steps across the grid. This generates fairly large number of 5×4 states, which then needs to be filtered to extract the ones that are consistent with the final condition(s), thus forming a smaller set of 6×4 states.

"BE3408729093_21.gif"

"BE3408729093_22.gif"

Generate the legal 6×4 states.

"BE3408729093_23.gif"

"BE3408729093_24.gif"

Display a random sample of 6 6×4 states.

"BE3408729093_25.gif"

"BE3408729093_26.gif"

Count up how many times each of the 2 types of card appear in each 6×4 grid, and create a list of which combinations occur.

"BE3408729093_27.gif"

The length of this list is the solution required.

"BE3408729093_28.gif"

Permalink   Notebook

Recent Posts
7/1, 2008; 9:11 PM:
Enigma 1475
21/12, 2007; 4:40 PM:
Enigma 1474
14/12, 2007; 1:36 PM:
Enigma 1473
9/12, 2007; 12:40 PM:
Enigma 1472
2/12, 2007; 11:55 AM:
Enigma 1471
1/12, 2007; 5:33 PM:
Enigma 1467
29/11, 2007; 3:27 PM:
Enigma 1469
29/11, 2007; 2:12 PM:
Enigma 1468
29/11, 2007; 1:09 PM:
Enigma 1465
27/11, 2007; 8:39 PM:
Enigma 1462
27/11, 2007; 8:38 PM:
Enigma 1464
27/11, 2007; 8:35 PM:
Enigma 1463
27/11, 2007; 8:23 PM:
Enigma 1461
27/11, 2007; 8:19 PM:
Enigma 1460
27/11, 2007; 8:14 PM:
Enigma 1459
27/11, 2007; 8:09 PM:
Enigma 1458
27/11, 2007; 7:42 PM:
Welcome

Archive


Links
COMMENTS

 

Blogged from
A WorkLife FrameWork by
Scientific Arts

All material on this website Copyright © 2008, Stephen Luttrell.