MathLabs

Problem 5

Let nn be a positive integer. There are n(n+1)n(n+1) rooms arranged in an (n+1)×n(n+1)\times n grid. Between every two adjacent rooms there is a door. Find the number of ways to choose a subset of doors and lock them so that there exist two rooms SS and GG satisfying: (i) SS is in the first row and GG is in the (n+1)(n+1)-th row. (ii) GG can be reached from SS using only unlocked doors.
Step 3 of 5: HH connects A,BA,B iff f(H)f(H) does not
H achievable  ⟺  f(H) not achievableH\text{ achievable} \iff f(H)\text{ not achievable}
Detailed analysis

Call HH achievable if AA and BB are connected in HH. If HH is achievable via edges p1,…,pkp_1,\dots,p_k, then no edge of p1,…,pkp_1,\dots,p_k lies in f(H)f(H) by construction of ff, so any path from AA to BB in f(H)f(H) would have to cross one of these edges without using it, which is impossible; hence f(H)f(H) is not achievable. Conversely, if HH is not achievable, the edges leaving the component of AA in HH all lie outside HH, and transposing them under ff produces a connected chain of edges of f(H)f(H) joining AA to BB; hence f(H)f(H) is achievable. So HH is achievable exactly when f(H)f(H) is not.