wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> Random Noughts-and-Crosses
(Message started by: ThudanBlunder on Jul 28th, 2009, 12:49am)

Title: Random Noughts-and-Crosses
Post by ThudanBlunder on Jul 28th, 2009, 12:49am
If the players X and O randomly choose which square to play, what is the ratio X wins: O wins: Draw?

Title: Re: Random Nought-and-Crosses
Post by rmsgrey on Jul 28th, 2009, 1:09am
An obvious solution is just to brute force it - look at the 362880 equiprobable orders of the 9 squares, and see which (if either) player wins first in each case. Estimated runtime is under a second, so there's not a lot of incentive to optimise the code - even if you run through all 387420489 9-digit 0-free numbers, runtime shouldn't be much more than a minute or two...

Is there a more interesting/enlightening solution?

Title: Re: Random Nought-and-Crosses
Post by ThudanBlunder on Jul 28th, 2009, 1:15am

on 07/28/09 at 01:09:21, rmsgrey wrote:
Is there a more interesting/enlightening solution?

Well, once upon a time it would have been a challenge.
Actually, my solution is not very complicated.

Title: Re: Random Nought-and-Crosses
Post by pex on Jul 28th, 2009, 2:08am
Well, by complete enumeration, the ratio is [hide]737 : 363 : 160[/hide]. I can't really think of a more interesting/enlightening/not very complicated solution that would yield such numbers (for example, the ratio X wins : O wins is almost, but not quite, 2:1), but I look forward to seeing it.

Title: Re: Random Nought-and-Crosses
Post by rmsgrey on Jul 28th, 2009, 2:39am
Interesting - I usually play that O plays first...

Title: Re: Random Nought-and-Crosses
Post by Grimbal on Jul 28th, 2009, 5:43am
It depends whether you play noughts-and-crosses or crosses-and-noughts.

I knew it as "X and O", where X goes first.

Title: Re: Random Nought-and-Crosses
Post by pex on Jul 28th, 2009, 5:50am
I knew the game as "butter, cheese and eggs" (in Dutch), for no apparent reason.

Title: Re: Random Noughts-and-Crosses
Post by ThudanBlunder on Jul 28th, 2009, 6:35am
Aka tic-tac-toe, assume X goes first.
I remember struggling with this one when I was a kid.

Title: Re: Random Noughts-and-Crosses
Post by ThudanBlunder on Sep 5th, 2009, 8:31am
As my internet access is presently confined to hotel lobbies and internet cafes, I will for the moment just post my answer: [hide]737:363:160[/hide]



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board