
Teresa D.
asked 01/28/20Tic tac toe cubed
The cube shaped game board is made from 27 transparent unit cubes. Similar to regular version of tic tac toe you are trying to arrange your marbles into lines of 3. How many different winning lines are there in a 3x3x3 cube?
5 Answers By Expert Tutors

David W. answered 01/28/20
Experienced Prof
The 3-D cube is an ideal example for computer data structures and algorithms.
A 3 x 3 x 3 cube has 6 sides, each with 9 little cubes. Each of the 6 sides on a little cube may connect to none or one other cube. All solution chains begin and end with a surface cube. Solution chains connect cubes in a straight line, moving either from side to side or else from corner to corner (that is, in a straight line).
If the 3-D coordinates of each of the 27 little cubes are (x,y,z), then
(1,1,1) links to (2,1,1) links to (3,1,1) [along x-axis]
(1,1,1) links to (1,2,1) links to (1,3,1) [along y-axia]
(1,1,1) links to (1,1,2) links to [1,1,3] [along z-axia]
(1,1,1) links to (2,2,2) links to (3,3,3) [diagonal to opposite corner of cube]
…
Now, all solution chains begin or end with one of the surface cubes [that is, (2,2,2) never starts or ends a solution chain]. Also, reversed solution chains should be counted only once.
So, can we list the number of chains that start on a given cube? Yes !!
Corner - there are 8 corners - 7 chains (surface and inside diagonal) -- 56 chains
Center of edge -- there are 12 of these - each starts 3 chains - 36 chains
Center of surface -- there are 6 of these - each starts 1 chain - 6 chains
Center of big cube -- no chains
Total -- 98
This list follows a pattern that a computer may find using exhaustive enumeration (consider ALL possibilities). To count solutions and their reverse only once, 98/2 = 49.
There are 49 straight lines that solve the 3D tic-tac-toe.
Teresa D.
Thanks a lot!01/30/20

Mark H. answered 01/28/20
Tutoring in Math and Science at all levels
The way I read this, we are to find all of the unique lines of 3. We can use an XYZ coordinate system to describe the lines.
Looking at the X=1 face (plane), describe the 8 possible lines as follows:
(Note that "n" means "any" value)
1 1 n (the line Y=1 on the plane X=1
1 2 n
1 3 n
1 n 1 (the line Z=1 on the plane X=1)
1 n 2
1 n 3
1 Z n (the line Y=Z on the plane X=1)
1 n Y
Repeat this for the X=2 and X=3 planes, and we have 24 unique lines.
Next, look at the planes defined by a Y value:
Only the ones in bold are new ( 15 new)
1 1 n
2 1 n
3 1 n
n 1 1
n 1 2
n 1 3
Z 1 n
n 1 X
repeat for Y = 2 and Y = 3
And for the Z planes (new in bold ---6 are new):
1 n 1
2 n 1
3 n 1
n 1 1
n 2 1
n 3 1
Y n 1
n X 1
(Repeat for Z = 2 and Z = 3)
So far, we have 24 + 15 + 6 = 45 unique lines
Are there more???
EDIT:
I omitted the planes defined by the diagonal of the faces, However, even though these planes are unique, all of the lines on them are redundant, EXCEPT the lines between the most distant corners of the cube. There are 4 of these, putting the total at 49
Teresa D.
Thanks for your help! I had 24 winning lines for each layer and then I figured out the vertical lines by counting all the cubes on the top surface which gave me 9 and then I decided to find out the horizontal01/30/20
Teresa D.
Sorry 24 winning lines for all three layers together and 9 for vertical lines01/30/20
Teresa D.
And I got 8 winning lines for the horizontal wins on the outside01/30/20
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
William W.
I'm a little confused about the cubes. What is on the 6 surfaces of each cube?01/28/20