October 16, 2023
October 16, 2023
October 16, 2023
###### Data-Structures
October 16, 2023
 Question 646
There are 7 switches on a switchboard, some of which are on and some of which are off. In one move, you pick any 2 switches and toggle each of them—if the switch you pick is currently off, you turn it on, if it is on, you turn it off. Your aim is to execute a sequence of moves and turn all 7 switches on. For which of the following initial configurations is this not possible? Each configuration lists the initial positions of the 7 switches in sequence, from switch 1 to switch 7.
 A (off,on,off,on,off,off,on) B (off,on,on,on,on,on,off) C (on,off,on,on,on,on,on) D (off,off,off,off,off,on,off)
Question 646 Explanation:
The parity of switches in each position is unchanged after each move. If all 7 switches are on at the end, the final parity of ”off” is even and of ”on” is odd. So we can only achieve this if we start with a configuration where the number of ”off” switches is even and the number of ”on” switches is odd. The exact order does not matter since we can pick any two to toggle at each step.
Question 646 Explanation:
The parity of switches in each position is unchanged after each move. If all 7 switches are on at the end, the final parity of ”off” is even and of ”on” is odd. So we can only achieve this if we start with a configuration where the number of ”off” switches is even and the number of ”on” switches is odd. The exact order does not matter since we can pick any two to toggle at each step.