On a noughts and crosses board, how many possible unique combinations are there given a square grid of length n?
Assumptions/constraints:
This is a discrete maths question, which can be simplified by focussing on one of the options. If we look at the options for locating just the crosses on the grid, we know that the remaining locations must contain naughts and so similarly for the opposite condition. The maths is relatively simple, and is the solution to "choose k from n".
19-Feb-19 - Test suite updated to take into account solutions where the opposing player goes first.
Rayner, by N do you include odds and even lengths ? what's the minimal length too? Cant imagine a game being fun with just one square )
By 'n' I mean any length of square grid. You solution should still be valid for a 1x1 grid. (I've now added an extra test script for this case). Though in reality I agree such a game wouldnt be much fun!
https://www.mathworks.com/matlabcentral/cody/problems/44851 adds the dynamic of stopping play when someone wins, though Ciaran's test suite needs fixing before you can attempt this one
Lovely little problem Rayner, look forward to trying Ciaran's
This is a nice problem, but the solution test suit is poor.
To get 126 for n = 3 one need to assume same player always starts.
If either player could start we get more solutions.
I.E. number of solutions with 4 x's and 5 o's + number of solutions with 5 x's and 4 o's
https://www.mathworks.com/matlabcentral/cody/problems/44851 provides a more challenging extension that asks the user to take into account that games end when there's a "win".
My first attempt at producing a community problem so thanks for the feedback on improving the test suite.
85 Solvers
41 Solvers
110 Solvers
275 Solvers
Find the Oldest Person in a Room
348 Solvers