How Often the First Player Wins at Tic-Tac-Toe Splits Three Ways by What Is Taken as Equal ── counting move sequences equally the first player wins 0.514108, choosing empty squares uniformly 0.584921, and playing best 0 ── the same "share of first-player wins" answers three different questions ── [Paper 607]
Abstract
In tic-tac-toe two players take turns marking a 3x3 grid, and whoever gets three marks in a row, column or diagonal wins. "How often does the first player win" is answered by three ways of counting. No new theorem or law is claimed. Scope of this paper (scope note): No new theorem or law is claimed──that tic-tac-toe is drawn with best play, and that there are 255168 sequences and 5478 positions, are known. That a finite game has a determined outcome under best play has been known since Zermelo (1913). Openings are not treated──best replies are shown only for the move after a centre, corner or edge opening. How people play is not discussed──"playing at random" means only choosing uniformly among the empty squares. Relation to earlier papers: Paper 164 showed that "probability" has four addresses: frequency, belief, axiom and context──the three numbers here differ in what is taken as equal on the same tree, an example of where probability is placed changing the number. Paper 602 solved the positions of Nim exhaustively──tic-tac-toe can likewise be solved by following the whole tree, but here the issue is not who wins but the weights needed to state it as a share. What is added is deriving three shares from the same tree and setting them side by side, computing the probabilities under random play exactly as fractions and matching them with random games, and placing the separator on what is taken as equal and showing that the length of a sequence changes its weight. First, counting move sequences equally, the first player wins 0.514108──the sequences stopped when the game is decided number 255168: 131184 first-player wins, 77904 second-player wins and 46080 draws (Section 2). Second, playing at random, the first player wins 0.584921──if both choose uniformly among the empty squares, the first player wins with probability exactly 737/1260, the second with 121/420=0.288095, and the game is drawn with 8/63=0.126984. Playing 200000 random games gave 0.584060 for the first player, a difference of 0.000861 from the formula (Section 3). Third, with best play on both sides, the first player wins 0──the value of the opening position is a draw, and every one of the 9 first moves leads to a draw (Section 4). Fourth, and this is the core. The three numbers differ in what is taken as equal──each sequence counted as one, each empty square equally likely at every move, or the best move on both sides. Playing at random, shorter sequences are more probable, and since first-player wins are decided early, their share is larger than when sequences are counted (Section 5). Fifth, on the side of best play, one wrong reply loses──if the first player takes a corner, 7 of the second player's 8 replies lose and only the centre keeps the draw. If the first player takes the centre, the 4 edges lose (Section 4). How often does the first player win at tic-tac-toe? The answer splits three ways by what is taken as equal──counting the 255168 sequences equally gives 0.514108, both players choosing uniformly among empty squares gives 737/1260=0.584921, and best play on both sides gives 0, always a draw. Three different weights are placed on the same tree──playing at random, a sequence of length L has probability one over the product of the numbers of available squares, so the early first-player wins count more. On the side of best play, after a corner the second player has no drawing reply but the centre. Placed among the earlier papers──this is an example of the addresses of probability in Paper 164 changing a number on one grid. Like Nim in Paper 602 it is solved by following the whole tree, but asking for a share needs weights. To be honest──neither openings nor how people play are treated; three ways of counting are only set side by side. On the making of this work: The ideas and content of this work stem from the author's own considerations. Assistance from an AI (a large language model) was used for structuring, English translation, and checking the algebra. Any remaining errors or misinterpretations are solely the author's. Feedback and corrections are sincerely appreciated. Keywords: tic-tac-toe, game tree, first-player win rate, optimal play, weighting of counts. ----- 三目並べは、3x3 のますに二人が交互に印を置き、縦・横・斜めのどれかに自分の印を三つ並べた方が勝つ遊びである。「先手はどれだけ勝つか」を、三つの数え方で出す。新しい定理も法則も主張しない。 本稿の射程(射程注記):新しい定理も法則も主張しない──三目並べが最善同士で引き分けになること、手順が 255168 通り・局面が 5478 通りであることは、いずれも既知である。有限の対局が最善同士で決まった結果を持つことは、ツェルメロ(1913)以来知られている。定石を扱わない──最善の応手は、中央・角・辺の初手のあとの一手だけを示す。人の打ち方を論じない──「でたらめに打つ」は空いたますを等しい確率で選ぶことに限る。既刊との関係:論文164 は「確率」が頻度・信念・公理・文脈の四つの住所を持つと示した──本稿の三つの数は、同じ木の上で何を等しいと置くかの違いで、確率の置き場所が数を変える例である。論文602 はニムの局面を総当たりで解いた──三目並べも同じく木を全部たどって解けるが、ここでは勝ち負けそのものより、それを割合で言うときの重みが問題になる。加えたのは、同じ木から三つの割合を出して並べたこと、でたらめに打つ確率を分数で正確に出し、乱数と突き合わせたこと、分離子を「何を等しいと置くか」に置き、手順の長さが重みを変えることを示したことである。 第一に、手順を等しく数えると、先手の勝ちは 0.514108 である──勝負がついた所で止める手順は 255168 通りで、先手の勝ち 131184、後手の勝ち 77904、引き分け 46080 だった(第2節)。 第二に、でたらめに打つと、先手の勝ちは 0.584921 である──二人とも空いたますから等しい確率で選ぶと、先手の勝ちは正確に 737/1260、後手は 121/420=0.288095、引き分けは 8/63=0.126984 だった。乱数で 200000 局打たせると先手の勝ちは 0.584060 で、式との差は 0.000861 だった(第3節)。 第三に、二人とも最善を尽くすと、先手の勝ちは 0 である──初めの局面の値は引き分けで、初手を 9 か所のどこに打っても引き分けだった(第4節)。 第四に、これが本稿の芯である。三つの数は、何を等しいと置くかの違いである──手順を一本ずつ等しく数えるか、一手ごとに空いたますを等しく選ぶか、互いに最善を選ぶか。でたらめに打つと、短く終わる手順ほど確率が大きく、先手の勝ちは早く決まるので、手順で数えたときより大きくなる(第5節)。 第五に、最善の側では、応手が一つ間違うだけで負ける──先手が角に打つと、後手の 8 か所の応手のうち 7 か所は負けに落ち、引き分けに残るのは中央だけである。先手が中央に打つと、辺の 4 か所が負けに落ちる(第4節)。 三目並べで先手はどれだけ勝つか。答は、何を等しいと置くかで三つに分かれる──勝負がつくまでの手順 255168 通りを等しく数えると先手の勝ちは 0.514108、二人とも空いたますから等しい確率で打つと 737/1260=0.584921、二人とも最善を尽くすと 0 で必ず引き分けになる。同じ木に、三つの別の重みを置いている──でたらめに打つと、長さ L の手順の確率は一手ごとの選べるますの数の積の逆数で、短く終わる先手の勝ちが重く数えられる。最善の側では、先手が角に打つと後手は中央に打つほかに引き分ける手が無い。既刊との位置──論文164 の言う確率の住所が、同じ盤の上で数を変える例である。論文602 のニムと同じく木を全部たどって解けるが、割合を問うと重みが要る。正直に言えば──定石も人の打ち方も扱わず、三つの数え方を並べただけである。 作成にあたって:本稿の着想と内容は、著者自身の考察に基づくものです。文章の構成整理や英訳、数式の確認には AI(大規模言語モデル)の助力を得ました。最終的な内容の解釈や誤りがあれば、それらはすべて著者の責に帰します。お気づきの点があれば、ご教示いただければ幸いです。 キーワード:三目並べ、ゲーム木、先手の勝率、最善手、数え方の重み。