{"id":3206,"date":"2016-03-23T21:36:12","date_gmt":"2016-03-24T04:36:12","guid":{"rendered":"http:\/\/www.dresan.com\/blog\/?p=3206"},"modified":"2017-03-26T14:48:08","modified_gmt":"2017-03-26T21:48:08","slug":"all-the-transitions-of-tic-tac-toe-redux","status":"publish","type":"post","link":"https:\/\/dresan.com\/blog\/2016\/03\/23\/all-the-transitions-of-tic-tac-toe-redux\/","title":{"rendered":"All the Transitions of Tic-Tac-Toe, Redux"},"content":{"rendered":"<p><a title=\"Full Size Image\" rel=\"https:\/\/dl.dropboxusercontent.com\/u\/15015293\/Photos\/tic-tac-toe-v5a.png\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/15015293\/Photos\/tic-tac-toe-v5a.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3207\" title=\"tic-tac-toe-v5a-small-contrast\" src=\"http:\/\/www.dresan.com\/blog\/wp-content\/uploads\/2016\/03\/tic-tac-toe-v5a-small-contrast.png\" alt=\"\" width=\"600\" height=\"485\" srcset=\"https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/tic-tac-toe-v5a-small-contrast.png 600w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/tic-tac-toe-v5a-small-contrast-300x242.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>What was supposed to be a quick exercise to help me visualize a reinforcement learning problem has turned into a much larger project, one which I&#8217;m reluctantly calling a temporary halt to: a visualization of all the states of Tic-Tac-Toe.<\/p>\n<p><a rel=\"attachment wp-att-3208\" href=\"http:\/\/www.dresan.com\/blog\/?attachment_id=3208\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3208\" title=\"transitions\" src=\"http:\/\/www.dresan.com\/blog\/wp-content\/uploads\/2016\/03\/transitions.png\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/transitions.png 800w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/transitions-300x225.png 300w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/transitions-600x450.png 600w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>What I found is that it&#8217;s surprisingly hard to make this work: all the states want to pile on top of each other, and there are a few subtleties to representing it correctly. To make it work, I had to separately represent <em>board positions<\/em> &#8211; the typical X&#8217;es and Oh&#8217;s used in play &#8211; from <em>game states<\/em>, such as Start, X Wins, O Wins, and Stalemate.<\/p>\n<p><a rel=\"attachment wp-att-3210\" href=\"http:\/\/www.dresan.com\/blog\/?attachment_id=3210\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3210\" title=\"Screenshot 2016-03-23 21.20.33\" src=\"http:\/\/www.dresan.com\/blog\/wp-content\/uploads\/2016\/03\/Screenshot-2016-03-23-21.20.33.png\" alt=\"\" width=\"600\" height=\"710\" srcset=\"https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/Screenshot-2016-03-23-21.20.33.png 620w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/Screenshot-2016-03-23-21.20.33-300x355.png 300w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/Screenshot-2016-03-23-21.20.33-600x710.png 600w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>The Mathematica for this is gnarly and a total hack; it probably could be made more efficient to process all 17,000+ transitions of the game, and I definitely need to think of a way to make each state appear in its own, non-overlapping position. But that will require more thought than my crude jitter function above, the time it takes to run each render is way too long to quickly iterate, and I have a novel to finish. I don&#8217;t want to get stuck in a grind against a game known for its stalemate.<\/p>\n<p><a rel=\"attachment wp-att-3214\" href=\"http:\/\/www.dresan.com\/blog\/?attachment_id=3214\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3214\" title=\"stalemate\" src=\"http:\/\/www.dresan.com\/blog\/wp-content\/uploads\/2016\/03\/stalemate.png\" alt=\"\" width=\"600\" height=\"800\" srcset=\"https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/stalemate.png 600w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/stalemate-300x400.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Ugh. You can see the jumble there; it&#8217;s hard to see which transitions lead to X&#8217;s or O&#8217;s victory and which lead to stalemate. I have ideas on how to fix this, but I want my novel done more and first, dag nab it. So let me give you all the transitions of Tic-Tac-Toe in their full glory (<a href=\"https:\/\/dl.dropboxusercontent.com\/u\/15015293\/Photos\/tic-tac-toe-v5a.png\">22.8mb<\/a>). I could say more about this problem &#8211; or I can say what I have, call it victory, and move on.<\/p>\n<p><a rel=\"attachment wp-att-3213\" href=\"http:\/\/www.dresan.com\/blog\/?attachment_id=3213\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3213\" title=\"x-wins\" src=\"http:\/\/www.dresan.com\/blog\/wp-content\/uploads\/2016\/03\/x-wins.png\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/x-wins.png 800w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/x-wins-300x225.png 300w, https:\/\/dresan.com\/blog\/wp-content\/uploads\/2016\/03\/x-wins-600x450.png 600w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>On to the novel. It&#8217;s going well.<\/p>\n<p>-the Centaur<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What was supposed to be a quick exercise to help me visualize a reinforcement learning problem has turned into a much larger project, one which I&#8217;m reluctantly calling a temporary&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[67,8],"class_list":["post-3206","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-gaslights-and-rayguns","tag-intelligence","ratio-2-1","entry"],"_links":{"self":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/3206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/comments?post=3206"}],"version-history":[{"count":15,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/3206\/revisions"}],"predecessor-version":[{"id":3223,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/3206\/revisions\/3223"}],"wp:attachment":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/media?parent=3206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/categories?post=3206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/tags?post=3206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}