Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2, which is in three parts, centers around a two-player game with very simple rules: This game starts with a pile of n coins.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Question 2, which is in three parts, centers around a two-player game with very simple rules: This game starts with a pile of n coins. The two players take turns removing coins from the pile, either 1 , 2, or 3 coins at a time. The player removing the last coin loses. You will prove by strong induction that if each player plays the best strategy possible, the first player will win if n mod4{0,2,3} and the second player will win if nmod4=1. Formalization Before you do so, you will need to formalize the rules of the game and the conjecture you will be proving. The following notation is defined to support this process in Part 1 and your proof in Parts 2 and 3: - The two players are elements of the set A={0,1}. I.e. one of them is player 0 and the other is player 1 . This notation is useful because if you call one player p, then the other is simply 1p - Three predicate functions are provided: turn, take, and wins: - For any player p in A and any n in N+, turn (p,n) means that it is the turn of player p to remove 1,2 , or 3 coins from a pile of n coins - For any player p in A and any m in N+, take (p,m) means that player p takes m coins from the pile of coins - For any player p in A, wins (p) means that player p will win the game if both players play the best strategy possible - Finally, you can also use the % notation for mod if you want: a mod b can be written as a %b b) (4 marks) If, during a player's turn, that player takes all the coins in the pile, they will lose the game. c) (4 marks) After a player takes k coins from a pile of n coins during their turn (where k<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions