Question 7
Alice and Bob play the following game using an array of integers:
- Players take turns, Alice moves first.
- Each turn a player chooses any element and removes it from the array.
- If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
- Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.
If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.
For example, if and , then the game could go as follows (there are other options):
- On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array is now .
- On the second move, Bob chooses 5 and get five points. His score is now 5. The array is now [7,3].
- On the third move, Alice chooses 7 and get no points. Her score is now 2. The array is now [3].
- On the last move, Bob chooses 3 and get three points. His score is now 8 . The array is empty now.
- Since Bob has more points at the end of the game, he is the winner.
You want to find out who will win if both players play optimally.
Note that there may be duplicate numbers in the array.
To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.
Alice
Bob
Draw