- Problem 5 2 In The Game Of Cookies There Are Two Piles Left Starts With L Cookies And Right Starts With R Cookies 1 (157.61 KiB) Viewed 49 times
Problem 5 2 In the game of “Cookies,” there are two piles: Left starts with L cookies, and Right starts with R cookies.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Problem 5 2 In the game of “Cookies,” there are two piles: Left starts with L cookies, and Right starts with R cookies.
Problem 5 2 In the game of “Cookies,” there are two piles: Left starts with L cookies, and Right starts with R cookies. Players 1 and 2 alternate making moves in this game; whoever moves last wins! A move consists of removing one or two cookies from Left, or one, two or five cookies from Right. All removed cookies are immediately eaten. If either of the piles becomes empty, the game ends immediately. Let V(L, R) be 1 if this game will be won by Player 1, and 0 if by Player 2. Assume both players are perfect strategists and always play to win. Write a recurrence for V(L, R). Use this to compute V(100, 100) using dynamic programming. Warning: do not play this game with real cookies! 2