subject

The Cookie Game Riley and Morgan play the following cookie game. Given is one set of n red cookies and another set of m green cookies. At every turn, a player must eat two cookies from one set and one cookie from the other set (i. e., either (i) two green cookies and one red cookie, or (ii) two red cookie sand one green cookie). The player who cannot move loses. Assuming Riley will begin the game, which player will win?
Write an efficient dynamic programming algorithm in pseudo-code that decides whether a winning strategy for one of the players exists, give a brief justification of the correctness of your algorithm, and analyze its runtime.
Your algorithm’s input parameters should include n, m∈N0 representing the given numbers of green and red cookies, respectively. As output, the algorithm should state whether Riley or Moran will win, or if there is no winning strategy for either player.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
What type of computer network ensures high security ?
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
You know the right answer?
The Cookie Game Riley and Morgan play the following cookie game. Given is one set of n red cookies...
Questions
question
Social Studies, 20.04.2020 00:35
question
French, 20.04.2020 00:36