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 5 of 5: Restore the free doors to finish
Detailed analysis
Each of the achievable choices of locks on the edges of may be freely combined with any of the ways of locking the doors internal to the first and last rows (Step 1), since those doors do not affect whether and are connected. This gives total ways to lock doors so that some room of the first row reaches some room of the last row.