12. given four coins with tails up, determine how many moves it will take to get all coins to show heads if…

12. given four coins with tails up, determine how many moves it will take to get all coins to show heads if turning three coins at a time counts as one move..
Answer
Explanation:
Step1: Represent the state
Let 0 represent tails - up and 1 represent heads - up. Initially, the state of the four coins is (0, 0, 0, 0). Each move consists of changing the state of three coins.
Step2: Analyze the parity
The number of tails - up coins changes by 3 (when we turn three tails - up coins to heads - up) or by 1 (when we turn two heads - up and one tails - up coin, since 2 new tails and 1 tail becomes a head, net change is 1 new tail). The total number of coins is 4. We want to go from a state with 4 tails (an even number) to a state with 0 tails (an even number). Let's consider the moves. Each move changes the number of tails - up coins by an odd number (either 1 or 3). We need to change the number of tails - up coins from 4 to 0. Since we change the number of tails - up coins by an odd number in each move, and we need to make an even - valued change (4 - 0=4), and we know that the sum of two odd numbers is even. We can find a sequence of moves. Let's make the moves: First move: Suppose we turn the first three coins. The state changes from (0, 0, 0, 0) to (1, 1, 1, 0). Second move: Turn the last three coins. The state changes from (1, 1, 1, 0) to (1, 0, 0, 1). Third move: Turn the first, second and fourth coins. The state changes from (1, 0, 0, 1) to (0, 1, 0, 0). Fourth move: Turn all four coins (which is equivalent to turning three coins and then turning one of them again). The state changes from (0, 1, 0, 0) to (1, 1, 1, 1).
Answer:
4