# Marbles in a box

*Marbles in a Box printable sheet - problemMarbles in a Box printable sheet - methods*

Imagine a three dimensional version of noughts and crosses where two players take it in turn to place different coloured marbles into a box.

The box is made from 27 transparent unit cubes arranged in a 3-by-3-by-3 array.

The object of the game is to complete as many winning lines of three marbles as possible.**How many different winning lines are there?**

Once you have thought about how you might tackle the problem, click below to see four different methods for working out the number of winning lines in a $3 \times 3 \times 3$ cube.

**Alison's method**

- at a vertex
- at the middle of an edge
- in the centre of a face

From a **vertex** there are $7$ other vertices that you can join to in order to make a winning line. $7 \times 8 = 56$ lines, but this counts each line from both ends, so there are $28$ 'vertex' winning lines.

From the **middle of an edge** there are $3$ other middles-of-edges that you can join to in order to make a winning line. $3 \times 12 = 36$ lines, but this counts each line from both ends so there are $18$ 'middle of edge' winning lines.

From the **centre of each face** there is one winning line, joining to the opposite face, so there are $3$ 'centre of face' winning lines.

So in total, there are $28 + 18 + 3 = 49$ winning lines.

**James' method**

- Diagonal
- Not diagonal

**non-diagonal winning lines**first:

There are $9$ from front to back.

There are $9$ from left to right.

There are $9$ from top to bottom.

Considering the

**diagonal winning lines:**

On each layer there are $2$ diagonal winning lines so:

There are $6$ from front to back.

There are $6$ from top to bottom.

There are $6$ from left to right.

There are $4$ lines from a vertex to a diagonally opposite vertex.

In total, there are $27+18+4=49$ winning lines.

**Caroline's method**

- along an edge of the cube
- through the middle of a face
- through the centre of the cube

There are $12$ edges on a cube so there are $12$ winning lines **along edges**.

There are $6$ faces on a cube, and $4$ winning lines that pass through the middle of each face, so there are $24$ winning lines **through the middle of faces**.

Finally we need to consider the winning lines that go **through the centre cube**:

vertex to opposite vertex: $4$

middle of edge to middle of opposite edge: $6$

middle of face to middle of opposite face: $3$

In total, there are $12 + 24 + 4 + 6 + 3 = 49$ winning lines.

**Grae's method**

- in each horizontal plane
- in each vertical plane from left to right
- in each vertical plane from front to back
- in the diagonal planes

On a plane there are $8$ winning lines.

In the cube, there are $3$ **horizontal planes**, so $8 \times 3 = 24$ winning lines.

There are also $3$ **vertical planes going from left to right**, but now with only $5$ **new** winning lines per plane, as the $3$ horizontal lines have already been counted. So $5 \times 3 = 15$ winning lines.

On the $3$ **vertical planes going from front to back**, we now only have $2$ **new** (diagonal) winning lines per plane, as the $3$ horizontal and $3$ vertical lines, have already been counted. So $2 \times 3 = 6$ winning lines.

Finally, there are also **diagonal planes** to consider. There are $4$ winning lines going through the centre, from corner to diagonally opposite corner.

In total, there are $24 + 15 + 6 + 4 = 49$ winning lines.

**Try to make sense of each method.**

Now, try to adapt each method to work out the number of winning lines in a $4 \times 4 \times 4$ cube.**Can you adapt the methods to give a general formula for any size cube?**

Check that each method gives you the same formula.

*You may be interested in the other problems in our Reasoning Geometrically Feature.*

Take a look at Painted Cube to think about how to visualise parts of a cube.

Joel and Sarah from Sawston Village College, and Ethan from North Cross in New Zealand, found alternative methods for working out the number of different winning lines in a $3 \times 3 \times 3$ cube. Here is the description of Joel and Sarah's method. Ethan's method is shown below. Congratulations! Finding all the lines once, and none of them twice, is a real challenge.

Therefore, 8 regular solutions for a regular tic tac toe board x2 = 16.

24+16+9 = 49 winning lines.

The second part of the problem asked if it was possible to adapt the methods described for the $3 \times 3 \times 3$ cube to give a general formula for any size cube.

Jamal from King Edward VII School, Sheffield managed to adapt Caroline's method to a $4 \times 4 \times 4$ cube.

Remember that on a $3 \times 3 \times 3$ cube all winning lines must pass either:

- along an edge of the cube
- through the middle of a face
- through the centre of the cube

but these must be changed to make it work for a $4 \times 4 \times 4$ cube.

There are still 12 edges on a $4 \times 4 \times 4$ cube so there are 12 winning lines along edges.

Since on the larger cube there is no 'middle' of a face, I counted all the lines on each face that aren't along the edge instead, each one passes through the 'middle' four pieces of a face. There are 2 diagonals, 2 horizontal and 2 vertical lines on each of the 6 faces, so that's 36 more lines.

Again the $4 \times 4 \times 4$ doesn't have a 'centre' piece so I counted all the lines through the central $2 \times 2 \times 2$ block. I found there is exactly one winning line through any two of those eight pieces in the block. There are (8x7)/2 =28 pairs because I can choose from eight pieces for the first one, then from the remaining seven for the second, but I divide by two because it
doesn't matter in what order I choose at the pair.

Adding these up I have 12 + 36 + 28 = 76 winning lines.

Niharika used similar reasoning to find the number of winning lines in an $n \times n \times n$ cube.

Rachael from Lancaster Girls' Grammar School used James' method to find the same result, and then generalised the answer to $n \times n \times n$ cubes.

Considering the non-diagonal winning lines first:

There are 16 from front to back.

There are 16 from left to right.

There are 16 from top to bottom.

Considering the diagonal winning lines:

On each layer there are 2 diagonal winning lines so:

There are 8 from front to back.

There are 8 from top to bottom.

There are 8 from left to right.

There are 4 lines from a vertex to a diagonally opposite vertex.

In total, there are 48+24+4 = 76 winning lines.

If I now take a cube of size nxnxn, there are n^{2} non-diagonal lines from front to back, and left to right, and top to bottom. That makes 3n^{2} lines. Counting the diagonal ones, there are 2 in each of the n layers, in each of the 3 dimensions; so 6n lines. Then there's the four lines from a vertex to a diagonally opposite vertex. In total there are 3n^{2} + 6n +4
lines.

Llewellyn from Cowbridge Comprehensive School saw that Alison's method generalises easily, jumping straight to the nxnxn formula.

A cube has 8 vertices, 12 edges and 6 faces. Correspondingly there are three kinds of pieces: vertex, edge, and face. An $n \times n \times n$ cube has 8 vertex peices, 12(n-2) edge pieces and 6(n-2)^{2} face pieces.

From a vertex piece there are 7 other vertex pieces that you can join to in order to make a winning line. 7Ã—8 = 56 lines, but this counts each line from both ends, so there are 28 vertex winning lines.

From an edge piece there are 3 other edge pieces that you can join to in order to make a winning line. Remembering that this counts each line from both ends there are 3Ã—12(n-2)/2 = 18n - 36 edge winning lines.

From a face piece there is one winning line, joining to the opposite face, so there are 6(n-2)^{2}/2 = 3n^{2} - 12n + 12 face winning lines.

So in total, there are 28 + 18n - 36 + 3n^{2} - 12n + 12 = 3n^{2} + 6n + 4 winning lines. That means there are 76 winning lines in a 4x4x4 cube and 364 winning lines in a 10x10x10 cube.

Leah from St Paul's Girls' School saw how to adapt Grae's method to a solution for 4x4x4 cubes.

The winning lines may be counted by looking at lines:

- in each horizontal plane
- in each vertical plane from left to right
- in each vertical plane from front to back
- in the diagonal planes

On a non-diagonal plane there are 10 winning lines (4 horizontal, 4 vertical and 2 diagonal lines).

In the cube, there are 4 horizontal planes, so 10Ã—4=40 winning lines.

There are also 4 vertical planes going from left to right, but now with only 6 new winning lines per plane, as the 4 horizontal lines have already been counted. So 6Ã—4=24 winning lines.

On the 4 vertical planes going from front to back, we now only have 2 new (diagonal) winning lines per plane. So 2Ã—4 = 8 winning lines.

Finally, there are also diagonal planes to consider. There are 4 winning lines going from corner to diagonally opposite corner.

In total, there are 40 + 24 + 8 + 4 = 76 winning lines.

It is possible to adapt Grae's and Caroline's methods to the general formula and you might like to try using Leah's or Jamal's work to help you get started. Of course it's easier now you know what formula you're looking for!

### Why do this problem?

As well as giving students an opportunity to visualise 3-D solids, this problem provokes the need for students to work systematically. Counting the winning lines in an ad hoc way will result in double-counting or missed lines, with students getting many different answers. It is only by working in a systematic way that students can convince themselves that their answer is correct. By offering a variety of methods, we hope students will evaluate the merits of the different approaches, and recognise the power of methods which make it possible to generalise.

### Possible approach

*These printable worksheets may be useful:Marbles in a Box*

*Marbles in a Box - Methods*

"If I played a game of noughts and crosses, there are eight different ways I could make a winning line. I wonder how many different ways I could make a winning line in a game of three-dimensional noughts and crosses?"

The image from the problem could be used to show one example of a winning line.

Give students time to discuss with their partners and work out their answers. While they are working, circulate and observe the different approaches that students are using, and challenge them to explain any dubious reasoning. After a while, stop the group to share their results, perhaps writing up all their answers on the board (it is likely that there will be disagreement!).

"It's often difficult to know we have the right answer to a problem like this, because there is a danger of missing some lines or counting some lines twice. Here are the systematic methods that four people used to work out the number of winning lines. For each method, try to make sense of it, and then adapt it to work out the number of
winning lines of 4 marbles in a 4 by 4 by 4 cube."*The methods are arranged two to a sheet, so you could give each half of the class a different pair of methods to work on, or alternatively you could give everyone all four methods.*

"Once you have adapted the methods for a 4 by 4 by 4 cube, have a go at working out what would happen with some larger cubes, and perhaps try to write down algebraically how many lines of n marbles there would be for an n by n by n cube."

Bring the class together and invite students to present their thinking, by asking them to explain how to work out the number of winning lines in a 10 by 10 by 10 version of the game.

Finally, work together on creating formulas using each method for the number of winning lines in an n by n by n game (or gather together on the board the algebraic expressions they found earlier) and verify that they are equivalent.

### Key questions

How can you categorise the types of winning line, to make sure you don't miss any?

How would you extend Alison's/James'/Caroline's/Grae's method to count the number of winning lines in a 4 by 4 by 4 cube? Or an n by n by n cube?

### Possible support

Painted Cube offers students the opportunity to work with the structure of a cube and consider faces, edges and vertices.

### Possible extension

Extend the cubic 'grid' to a cuboid, possibly 4 by 3 by 3 to start with, and ultimately $n$ by $m$ by $p$, always looking for lines of 3 - unless students want to look for other length lines (they could look for lines of 2 on the 3 by 3 by 3 grid).