Case: Leap of Faith

Clue of 22

The 22-clue is one of the most impactful clues in a Skyscrapers puzzle, and it’s also an exception to many rules surrounding sequences.

[!Note] This ‘case’ could probably be split into multiple cases, but some of them are really too tiny to warrant their own page :P

From Blockade we’ve seen a simple case where we have a 22-clue and the lane peak is in the tail cell, allowing us to deduce the head cell must be N1N-1.

But what about when the lane peak isn’t at the end?

Close and Intimate

The closest the lane peak can be is in the 2nd cell:

25

Here, the head cell could be anything, because any skyscraper would be shorter than the 55.

212345

Not very helpful!

Older and Younger Sibling

Moving the lane peak one more cell away:

25

Now we have some structure. The head cell must obscure the 2nd cell:

2tallshort5

We need tall>short\text{tall} > \text{short}. That means tall\text{tall} can’t be 11, and short\text{short} can’t be 44:

22341235

Fairly straightforward.

Long-Distance

What happens when we push the lane peak further back? Now the void is really feeling large.

25

Don’t fall into the trap of thinking the head cell is still guaranteed to be N1N-1, that only happens when the lane peak is at the very end!

Notice here, there’s still space behind the lane peak where N1N-1 could go:

254

We’ll handle the head cell and the cells in between (the hideout) separately.

The Head Cell

Now it’s less certain what the head cell could be, so let’s try some candidates and see what we find.

First, could we put a 11-skyscraper there?

215

Certainly not, because any skyscraper that comes after the 11 would be visible, giving us at least 3 visible skyscrapers, not 2.

212345

Now let’s try a 22-skyscraper.

225

Since we’re hypothesising whether 22 could be possible here, we want to consider the best case – could we find a valid solution, if everything goes right?

We could start by placing a 11 after it, which would be obscured as we want.

2215

But what now? No matter what we place in the remaining unsolved cell, we’ll end up having 3 skyscrapers visible, not 2 as we want.

221345

So we can’t have 22 in the head cell either.

Does the same apply for 33?

235

If we place the 44 between the 33 and 55 it of course fails.

But we could place 11 and 22, leaving the 44 in the tail cell:

231254

Now this does work. So we could have 33 in the head cell.

44 will of course always be valid, so combining all this, we arrive at our final candidates:

2345

The Hideout

Now let’s consider the cells in the hideout.

We again need to consider the best case, because we can’t rule out solutions that might be possible. That means we’ll let the head cell be 44, since then it’s the most capable of obscuring skyscrapers after it.

245

Finding the candidates is pretty chill, since every available skyscraper is shorter than 44:

241231235

Backtracking on our hypothetical deduction, we arrive at these candidates for the half-lane:

2341231235

So the 2 cases are:

  • 33 goes in the head cell, so we get 2 | 3 [12] [12] 5\text{2 | 3 [12] [12] 5}
  • 44 goes in the head cell, so we get 2 | 4 [123] [123] 5\text{2 | 4 [123] [123] 5} (nothing happens to the hideout)

Sizing Up

Can you notice any structure in this?

This happens when the lane peak is sufficiently far away. A 5x5 skyscraper is pretty small, so let’s size up and look at a 6x6:

26

I’ll skip the details (it’ll become intuition eventually), but we get the same similar structure:

245123412346

What happens if we move the lane peak further away again?

2451234123412346

Nothing, the candidates stay the same!

We might wonder, “wait that’s strange, this can’t continue forever, because there wouldn’t be enough candidates”.

Indeed, it doesn’t continue forever – because the lane peak will hit the edge of the grid! At this point, it collapses to Blockade, with the hideout cells using all the remaining candidates between them:

2512341234123412346

So to illustrate them all in parallel, check out the different structures we obtain depending on where the lane peak lies:

2123456
2234512346
23456
26
26

What Did We Learn?

The key constraint here is that the head cell must be taller than all skyscrapers after it (until the lane peak).

Or, looking at it from the other angle, all the skyscrapers between the head cell and lane peak must be shorter than the head cell.

Illustrating abstractly, we have this structure:

2tallshortshortN

The Hideout

How can we determine what could go in the short\text{short} cells?

Well technically, we could pull out a bit of cheeky mathematical induction 😎 but that might be a bit overkill here, so we’ll just do it intuitively.

Well, we know N1N-1 is off-limits, because only NN (which is already used) could obscure it:

2< N-1N-1N

We end up with at least 3 visible skyscrapers here!

But N2N-2 is definitely fine, because we can place N1N-1 in the head cell to obscure it:

2N-1N-2N

This could be a solution, so we can’t rule out N2N-2.

The same applies for any skyscraper shorter than N2N-2, hence the possible candidates are:

1hN21 leq h leq N-2

To put it more concretely, here’s what they’d be for various puzzle sizes:

2124
21231235
21234123412346
2123451234512345123457

The Head Cell

The head cell must be able to obscure all of these 1hN21 \leq h \leq N-2 in the best case.

N1N-1 is always able to do this, but whether the others will be able to do this depends on how far away the lane peak is.

To illustrate this effectively we’ll bring out the 7x7 big guns:

2123457
212345123457
21234512345123457
2123451234512345123457

First and last possible cases are ommitted since they’re uninteresting.

The first half-lane here is straightforward:

223456123457
212345123457
21234512345123457
2123451234512345123457

Next for the last half-lane, in the best case the hideout is some permutation of 1 2 3 4\text{1 2 3 4}, so we could obscure them all with a 55-skyscraper or taller:

223456123457
212345123457
21234512345123457
256123451234512345123457

Applying the same logic to the half-lane above, we need anything that could obscure 1 2 3\text{1 2 3}, so anything 44 or taller would work:

223456123457
212345123457
24561234512345123457
256123451234512345123457

And for the last half-lane:

223456123457
2345612345123457
24561234512345123457
256123451234512345123457

Aha! There’s some obvious structure here, you love to see it. While the hideout cells remain unchanged, the head cell’s candidates change depending on how far away the lane peak is. The closer the lane peak, the more possible candidates for the head cell, and vice versa.

This should make sense – the more cells there are between the head cell and lane peak, the more skyscrapers it must obscure – hence the greater its minimum height must be.

We can now formulate a formula for the candidates by inspection (of course, you could rigorously prove it, but we’ll skip that here).

The tallest candidate is N1N-1. The shortest is given by how many cells there are in the half-lane before the lane peak – for instance in the first row above, there’s 2 since the half-lane looks like 2 | _ _ 7\text{2 | \_ \_ 7}. Hence the candidates for the head cell are:

# of unsolved cellshN1 ext{# of unsolved cells} leq h leq N-1

Whew! That was a damn lot of heavylifting. Unfortunate result of trying to abstract and generalise, but the more you do it, the more intuitive it’ll become.

And just to clarify, you don’t need to and shouldn’t memorise these formulae! The goal is to internalise the intuition behind them; the ‘offsets’ will come naturally. Everything we talked about here, and most of solving Skyscrapers, is visualising skyscrapers obscuring skyscrapers, and the interactions between the clue and lane peak.