Suppose a game of 3-D tic tac toe is played on a 6x6x6 cube. How many winning lines of 6-in-a-row are there through the cube?

Respuesta :

On a cube of side k and n dimensions, there are
[(k+2)ⁿ - kⁿ] / 2 
winning lines.

In your case,
k = 6
n = 3

Therefore:
[(6+2)³ - 6³] / 2 
= (8
³ - 6³) / 2 
= (512 - 216) / 2 
= 148

Hence, there are 148 6-in-a-row winning lines through the cube.