Please show ALL STEPS, NEAT HANDWRITNG ONLY and answer ALL PARTS please :)
1. Consider the following game: suppose there are three piles of stones starting with 3, 5, and 7 in each pile. Two players take turn playing this game. During their turn, a player can choose one of the three piles that are currently nonempty and remove any positive number of stonescurrently presented in that pile. Whoever takes the last stone loses the game.
(a) Describe how to model this game using a graph, in such a way that paths in your graph represent the different states that you can have in this game. Specify whether your graph is directed or undirected. Carefully describe what the vertices of your graph represent, and when two vertices are connected with an edge.
b) Suppose Player 1 (who makes the first move in this game) just won. What can you say about the path from (3, 5, 7) to (0, 0, 0) in this graph?
c) Suppose the game currently has 1 stone in the first pile, 2 stones in the second, and 2 stones in the third, and it is Player 1’s turn to make their move. Describe a winning strategy for this player.
a) We can model this game using a graph by plotting it as the players take their moves, and it will be directed towards (0,0,0) where the game ends.
The only time the vertices will be connected with the edge is at the time when a pile becomes empty.
b) Player 1 won, means the last move was made by player 2. Which means the total number of moves are even, telling us that the no. of vertices in our graph in even.
c) If player 1 takes 1 stone from any pile containing 2 stones,
Now the piles contain 1,1 and 2 stones.
Case 1: Player 2 picks up 1 stone from a pile with 1 stone.
Case 2: Player 2 picks up 1 stone from the pile with 2 stones.
Case 3: Player 2 picks up 2 stones from the pile with 2 stones.
In case 1, player one can just take 2 from the 2 stone pile and leave player 2 with the last stone to pick.
In case 3, player one can just pick any one stone, leaving only one for Player 2
But in case 2, piles are at 1,1,1 which means player 1 will lose.
So Player 1 has to pick a stone from the second or third pile, and hope for Case 1 or 3 mentioned above.
Please show ALL STEPS, NEAT HANDWRITNG ONLY and answer ALL PARTS please :) 1. Consider the...
Answer the following Nim game style questions.
(Robert's Game) In this game, two players take turns removing stones from a pile that begins with n stones. The player who takes the last stone wins. A player removes either one stone or p stones, where p is a prime dividing the number of stones in the pile at the start of the turn For which n does the First Player have a winning strategy? A winning strategy for the First Player...
A subtraction game Subtraction games are two-player games in which there is a pile of objects, say coins. There are two players, Alice and Bob, who alternate turns subtracting 4.9. A SUBTRACTION GAME 19 from the pile some number of coins belonging to a set S (the subtraction set). Alice goes first. The first player who is unable to make a legal move loses. For example, suppose the initial pile contains 5 coins, and each player can, on his turn,...
Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the task specified. You can draw the flowcharts with a pen/pencil on a piece of paper and scan it for submission. Please ensure that the scanned file and your handwriting are clear and legible. However, it is preferable to draw flowcharts using a drawing software. Here are links to some free drawing tools https://www.draw.io/ www.lucidchart.com http://dia-installer.de/ https://pencil.evolus.vn/ ---------------------------------DON'T NEED THE PYTHON CODE... JUST THE ALGORITHM...
Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the task specified. You can draw the flowcharts with a pen/pencil on a piece of paper and scan it for submission. Please ensure that the scanned file and your handwriting are clear and legible. However, it is preferable to draw flowcharts using a drawing software. Here are links to some free drawing tools https://www.draw.io/ www.lucidchart.com http://dia-installer.de/ https://pencil.evolus.vn/ ---------------------------------DON'T NEED THE PYTHON CODE... JUST THE ALGORITHM...
Need Help with homework problem writing the game of nim in Python IDLE. Its a well known game with a number of variants. The following variant has an interesting winning strategy. Two players alternately take marbles from a pile. In each move, a player chooses how many marbles to take. The player must take at least one but at most half of the marbles. Then the other player takes a turn. The player who takes the last marble loses. Instructions...
Your task in to design a game of Nim in Python. In this game “Two players take turns removing objects from distinct heaps or piles. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap/pile. The goal of the game is to avoid taking the last object.” (Wikipedia) In your implementation of the game, there will be 3 piles of objects. At the start...
Please show ALL STEPS. NEAT HANDWRITING ONLY PLEASE Thank You! In the game Starcraft there are three races: Terran, Zerg, and Protoss. A new player to the game gets to pick one race with equal probability. Once a race is chosen, the players will stay with their choice for their entire gaming career. Based on the league record, • 60% of new Terran players can get out of Bronze League, • 30% of new Zerg players can get out of...
The game of Nim: This is a well-known game with a number of variants. The following variant has an interesting winning strategy. Two players alternately take marbles from a pile. In each move, a player chooses how many marbles to take. The player must take at least one but at most half of the marbles. Then the other player takes a turn. The player who takes the last marble loses. Write a C program in which the computer plays against...
1. NIM game. This is a different version or easier version of NIM game Consider a pile of 5 matchsticks. Two people take turns removing 1 or 2 sticks each time from this pile. Suppose both players play smartly (nobody plays a fool move trying to let the opponent wins. But there is only one winner anyway) a)If the person getting the last stick wins, will the first player win? Why? Show the steps the first and second player will...