点博弈和动态规划

发布于 2024-08-31 22:18:02 字数 212 浏览 3 评论 0原文

我正在尝试用动态编程解决点游戏的变体。

常规的点游戏是用一排点来玩的。每个玩家在各自的线端获得一或两个点,没有留下任何点的人获胜。

在此版本的游戏中,每个点都有不同的值。每个玩家轮流轮流并在线的两端各取一个点。我想提出一种使用动态编程来找到第一个玩家保证获胜的最大金额的方法。

我在理解这个问题时遇到了问题,并试图为解决方案编写一个重现。任何帮助表示赞赏,谢谢!

I'm trying to solve a variant of the dot game with dynamic programming.

The regular dot game is played with a line of dots. Each player takes either one or two dots at their respective end of the line and the person who is left with no dots to take wins.

In this version of the game, each dot has a different value. Each player takes alternate turns and takes either dot at either end of the line. I want to come up with a way to use dynamic programming to find the max amount that the first player is guaranteed to win.

I'm having problems grasping my head around this and trying to write a recurrence for the solution. Any help is appreciated, thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多情出卖 2024-09-07 22:18:02

看看这个网站:http://people.csail.mit.edu/ bdean/6.046/dp/,特别是问题 10:

游戏的最佳策略。考虑一排 n 个硬币,其值为 v(1) ... v(n),其中 n 是偶数。我们通过轮流与对手进行游戏。在每个回合中,玩家选择该行中的第一个或最后一个硬币,将其从该行中永久删除,并获得硬币的价值。确定如果我们先行动,我们绝对可以赢得的最大可能金额。

如果我正确阅读您的帖子,这正是您想要的。解决方案非常简单,并且在我看来解释得很好。

Take a look at this site: http://people.csail.mit.edu/bdean/6.046/dp/, especially problem number 10:

Optimal Strategy for a Game. Consider a row of n coins of values v(1) ... v(n), where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row, removes it from the row permanently, and receives the value of the coin. Determine the maximum possible amount of money we can definitely win if we move first.

It's exactly what you want if I'm reading your post right. The solution is pretty simple and it's explained very well there in my opinion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文