The GAP instruction

Zebra puzzles: Glossary of Programming Instructions

Create a gap between two items a and b using a regular ordered series.

To use it, you therefore need at least one regular ordered series.

To make solving easier, Booleans are recommended. This is one of the most complex instructions in zebra puzzles.

Ordered series: A series containing values ​​that are all increasing or all decreasing.
Regular ordered series: An increasing or decreasing series whose values ​​are separated by the same interval.

Land Yacht Riddle

There’s a three-year age gap between Lucas and the teenager driving the green yacht.
There’s a 20-minute age gap between the person driving the blue yacht and the 17-year-old.

The red and blue lines represent the relationships between the boxes across the grids, materialized by the Booleans.

Red line

If Lucas is 13, the green yacht driver is 16, and vice versa.
If Lucas is 14, the green yacht driver is 17, and vice versa.
If Lucas is 16, the green yacht driver is 13, and vice versa.
If Lucas is 17, the green yacht driver is 14, and vice versa.
Where we see that neither Lucas nor the green yacht driver can be 15, because 15-3=12, which is out of bounds, and 15+3=18, which is also out of bounds.

Blue line

Using the alternatives grid is essential to avoid losing information. It indicates that the 6 Booleans b1…b6 form an alternative.

If the driver of the blue yacht drives for 30 minutes, the 17-year-old drives for 50 minutes, and vice versa.
If the driver of the blue yacht drives for 50 minutes, the 17-year-old drives for 30 minutes, and vice versa.

Using the central space in both rows and the booleans b1, b6 and b3, b4:

If the driver of the blue yacht drives for 20 minutes or for 1 hour, the 17-year-old drives for 40 minutes, and vice versa.
If the 17-year-old drives for 20 minutes or for 1 hour, the driver of the blue yacht drives for 40 minutes, and vice versa.

False signs

Those present in the Boolean rows indicate positions that are outside the limit. We also discover false
signs at the intersection of the rows: Lucas cannot drive the green yacht, and the 17-year-old teenager cannot drive the blue yacht.

Designer

Randomly chooses a regular ordered series D, two items a and b that refer to it, and a gap |i| between the two items. This gap is an absolute value: it goes in both directions (+i, -i).

The jump is the distance that must be specified in number of boxes that separate two items in each row. The jump will be converted to series-specific units (years, minutes, etc.) when generating formal propositions. The value of 0 gives a random choice. If n is the number of boxes per row, for a jump to be calculable, the minimum must be ⌊n/2⌋  and the maximum n-2. That is, a value between 2 and 3 for a row of 5 boxes.

⌊n/2⌋ means: integer part of n/2

Isolated: If the instruction operates in isolated mode, the designer does not select rows that already contain signs, including Booleans.

Maximum number of executions of this instruction.

Formal proposal generated

D: Δ(a,b) = ± i
the gap in D between a and b is i
Age: Δ (Lucas, Green) = ± 3
Duration: Δ (Blue, 17 years) = ± 20

D: header of the shared series containing a regular ordering relationship.
a,b,: items using D
± i,: value of the intervals, in units of D; i is applied in positive and negative because it is a gap.