Problem 5
Let be a positive integer. There are rooms arranged in an 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 and satisfying:
(i) is in the first row and is in the -th row.
(ii) can be reached from using only unlocked doors.
Step 1 of 5: Reduce to a graph-reachability count
Detailed analysis
Since may be any room of the first row and any room of the last row, whether a suitable pair exists does not depend on which of the doors joining rooms within the first row, or the within the last row, are locked; there are such free doors in total. Collapsing the first row to a single vertex and the last row to a single vertex , the remaining rooms and doors form a graph with edges, and the problem reduces to counting subsets of these edges for which and are connected in .