TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Solving Probabilistic Tic-Tac-Toe

138 点作者 Labo33311 个月前

10 条评论

igpay11 个月前
Hey all, I'm the author of Probabilistic Tic-Tac-Toe. I'm currently working with Louis to integrate this solver into the game itself so that people can play against it. I'm hoping to have it released by EOD and will update this comment when it's ready.
评论 #40677939 未加载
评论 #40677909 未加载
评论 #40675464 未加载
评论 #40676679 未加载
Labo33311 个月前
Author here!<p>It was such a power trip and blissful experience to discover the game on HN, think about a strategy, implement a solution, write a blog post (thanks again to orlp for his comment here that pointed out a mistake), email igpay (the author of the game), fork the repo, implement the algorithm in C# for Unity (it was my first time using those technologies but ChatGPT was quite helpful), get it merged and finally make it to the front page of HN where all of this started.<p>Thank you guys, this is why the Internet exists!
评论 #40681166 未加载
评论 #40681084 未加载
harpiaharpyja11 个月前
I don&#x27;t think the description on the page really captures how much of an improvement this is over traditional tic-tac-toe. It&#x27;s not at all about the outcome being contrary to how perfect or poorly someone played, though I&#x27;m sure that adds some excitement too.<p>Deterministic tic-tac-toe is a very &quot;degenerate&quot; game, for lack of a better word, where the game readily falls into a state where one player is guaranteed to win absent a major blunder. There just isn&#x27;t much space for actual decision making because most choices are just either obviously necessary or futile.<p>By making every square have different probabilities like you have, you&#x27;ve created a kind of &quot;terrain&quot; to the board that needs to be considered when making moves, which adds a whole new dimension. Because the layout is randomized, the utility of each square might get re-evaluated from game to game, which adds a whole new dimension to gameplay.
malisper11 个月前
There is a simpler way to handle loops. If you end up repeating a position, you know the turn player will repeat the same move as before. By iterating over every possible move and every possible response, you can calculate the expected value of a position. Writing out the equations where V(s, i, j) is the expected value of the position when turn player will attempt move i and the opposing player will attempt move j:<p><pre><code> V(s) = max i (min j V(s, i, j)) V(s, i, j) = (probability move i or move j changes the state) * V(new state) + (probability state doesn&#x27;t change) * V(s, i, j) </code></pre> You can solve the second equation for all i and j and then use that to solve the first equation.
评论 #40679318 未加载
评论 #40678602 未加载
H8crilA11 个月前
Are you sure there is only one solution to the set of max&#x2F;min equations? I&#x27;ve been trying to solve the probabilistic tic-tac-toe since it was published, and I believe there are actually multiple solutions here.<p>In fact I&#x27;m not sure that given a board there exists a best solution. I.e. I suspect that for most boards and for most fixed strategies you can create a counter-strategy that outperforms the given strategy (but perhaps then loses to some other strategy).<p>My code looks completely different, but I suspect you can uncover alternate solutions if you mess with the binary search. For example replace `x = (a + b) &#x2F; 2` with `x = (a + b) &#x2F; 3`, or even better pick a random point between a and b.
评论 #40675302 未加载
评论 #40674371 未加载
评论 #40676002 未加载
评论 #40674826 未加载
primitivesuave11 个月前
I implemented an expectiminimax player without the neutral state optimization that you described 2 days ago: <a href="https:&#x2F;&#x2F;keshav.is&#x2F;coding&#x2F;pt3" rel="nofollow">https:&#x2F;&#x2F;keshav.is&#x2F;coding&#x2F;pt3</a><p>It seems like even a naive search of the game tree in the browser produces a fairly strong computer opponent to a human player. It would be interesting to see if this optimization produces a better computer player to standard expectiminimax as I implemented here: <a href="https:&#x2F;&#x2F;github.com&#x2F;keshavsaharia&#x2F;pt3&#x2F;blob&#x2F;master&#x2F;src&#x2F;minimax.ts">https:&#x2F;&#x2F;github.com&#x2F;keshavsaharia&#x2F;pt3&#x2F;blob&#x2F;master&#x2F;src&#x2F;minimax...</a>
spywaregorilla11 个月前
I said this on the original thread. You don&#x27;t need to search the whole space. A greedy solution is fine.<p>Considering a simple score that utilizes the odds of you getting it vs. your opponent, the paths to or immediate victories&#x2F;losses opened up is nearly guaranteed to give you the optimal strategy every time.<p>If a slot has negative odds, meaning it&#x27;s more likely to help your opponent, you should NEVER play that slot unless you have no dissimilar options.<p>Many slots, based on position, assume a value of 0 and should be avoided while there&#x27;s positively valued options available.<p>If a slot has a &gt; 50% chance of handing you the win, you should always play it. (you could argue the model proves this rigidly at the 57% level)<p>9 calculations are all you need
评论 #40676676 未加载
fallingknife11 个月前
I played 20 games and only 1 was a draw. Interesting how this ends up being so rare compared to normal tic-tac-toe,
wsycharles0o11 个月前
I must say I&#x27;m so proud of the HN community for all the passion and curiosity for a problem like this!
phoronixrly11 个月前
I love how the other day when the Show HN[1] post was submitted there were a bunch of &#x27;Oh what a great problem to solve with AI&#x27;, when it was painfully obvious that it is not necessary... Is there astroturfing here or is AI the current hammer that everyone defaults to?<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40635397">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40635397</a>
评论 #40674880 未加载
评论 #40675899 未加载
评论 #40681052 未加载
评论 #40679299 未加载
评论 #40675174 未加载