首页 > 其他 > 详细

GAME THEORY

时间:2021-04-23 00:25:00      阅读:20      评论:0      收藏:0      [点我收藏+]

GAME THEORY

BASH GAME

Definition

  • Two numbers: \(N, K \ (1 \leq K \leq N)\)
  • A pile of \(N\) stones
  • \(2\) players (Player A and Player B)
  • Rules:
    1. Two players take turns taking away stones, Player A starts first.
    2. \(1 \leq x \leq K\) stones can be taken each time.
    3. If no stone remains, the game ends.
    4. The last player who took stones wins.

With the value of \(N\) and \(K\) given, who will win?

Example

If \(N = 4, K = 2\):

Red numbers represent the number of stones Player A chose each turn.
Blue numbers represent the number of stones Player B chose each turn.

\[\begin{aligned} &\quad \text{Steps} \quad \text{Winner}\ &①\ \color{#EA6C6D}{1} \ \color{#3199E1}{1} \ \color{#EA6C6D}{2} \qquad \ \ \color{default}{A}\ &②\ \color{#EA6C6D}{1} \ \color{#3199E1}{2} \ \color{#EA6C6D}{1} \qquad \ \ \color{default}{A}\ &③\ \color{#EA6C6D}{2} \ \color{#3199E1}{2} \quad\ \qquad \color{default}{B} \end{aligned} \]

As we can see, if and if only Player A chose \(1\) stone the first step, Player A wins.

GAME THEORY

原文:https://www.cnblogs.com/zhangtianli/p/14691158.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!