math question!! 10 POINTS FOR THE BEST ANSWER?
Our favorite king has decided that he is tired of having his platinum stolen. He is about to leave on a vacation, so he has called slomins and installed the alarm system to prevent intruders from getting into his royal vault while he is gone.
The alarm system is activated by the use of five switches. The only way to deactivate the system is to turn off all five switches.
You might think that a their could simply turn off the switches, but that isnt so easy to do. The system is set up so that the switches can only be changed according to the following rules:
1)The switch on the far left may be changed( turned on or off) no matter how the other switches are set.
2)Any other switch may be changed only if the switch to its immediate left is on and all other switches to its left are off.
Problem:
1) When the king leaves, all five switches are turned off. what is the minimum numbmer of moves required to deactivate the alarm?
Suppose you have n switches, all turned on, and you want to turn them all off. Assume that you can only change a switch according to the rules in the king’s alarm system.
2) Find the minimum number of moves required for the cases n = 1, 2, 3, 4 and prove your results. Also prove the result you got in questions 1 for the case of n = 5.
3) Describe a pattern you see in your results or a procedure for finding new results based on results for smaller values of n. You might also make a guess about a general formula. You can get more data by considering cases where n is more than 5 and then use this information either to make guesses or to test ideas.
4) Based on your pattern, procedure, or formula, find the numberr of moves that would be required for n = 10.
5) Try to prove that your pattern, procedure, or general formula works in all cases.

in #1, you said “the king leaves, all five switches are turned off” but the alarm system is deactivated when all the switches are turned off, so there is no need to deactivate it (it’s already deactivated)
1) 21 moves are required. According to the table I constructed referenced by the link below, there are 21 changes of state required to alter the switches from all off to all on (U5 in the table).
2) The table has been constructed for code sets up to six switches. I have counted the number of changes of state, thus, e.g., D5 (down with 5 switches) = 21, or one less than the number of states listed in the table. Note that Un = rDn (up with n switches = the reverse of down with n switches).
The heading of each code set (except for the first two, e.g., D6 = D4+1+U4+D5 = 42) suggests the recurrence relation for the general formula: Dn = Dn-2 + 1 + Un-2 + Dn-1 = 2 * Dn-2 + 1 + Dn-1. The reason for this formula, and an outline of the proof of its validity can be seen when it is observed that by reseting every switch to the left of the last two switches you are guaranteed to be able to reset the last switch in the next step. Thus to do this you need Dn-2 changes of switch states. The +1 in the formula is the count of the switching of the last switch to off. Following this state you need to bring up all of the reset switches to the left of the last two in order to be able to reset the penultimate switch and following that to reset all switches. Finally, the Dn-1 takes care of the reset of all switches after all of them have been set to on except for the last.
3) Already discussed.
4) U10 = D10 = 682.
5) Details…details.