This page is part of the website

Mathematics Goes to the Movies

by Burkard Polster and Marty Ross


Cube (1997)

All about using prime numbers to avoid being sliced and diced. Too much stuff. There is a whole chapter in the book dedicated to this movie.Here are just some snippets of dialogue.

QUENTIN: Leaven, what do you read in school? Math?
HOLLOWAY: What can they mean?
Leaven puts on her glasses and begins to study the numbers.
Leaven opens a new door. The numbers we see are 645 372 (and later) 649.
LEAVEN: Prime numbers. I can't believe I didn't see it before.
QUENTIN: See what?
LEAVEN: It seems like if any of these numbers of prime, then the room is trapped. Ok, 645... 645, that's not prime. 372... no. 649... Wait, 11 x 59, its not prime either. So that room is safe.
QUENTIN: Wait, wait, wait. How can you make that assumption based on one prime number trap?
LEAVEN: I'm not. The incinerator thing was prime: 083. The molecular-chemical thingy had 137, the acid room had 149.
HOLLOWAY: You remembered all that in your head?
LEAVEN: I have a facility for it.

After Quentin almost got killed in a room although its numbers were not prime.
LEAVEN: I guess the numbers are more complicated than I thought.
WORTH: Maybe they mean nothing at all.
LEAVEN: No, it means they're more involved, they worked for us up to now have just been bad, I just need more time with them.

After Worth has confessed that he designed the outer shell of the labyrinth and that its overall shape is that of a cube.
LEAVEN: What are the dimensions of the outer shell?
WORTH: 434 feet square.
What he probably means by this is that the length of an edge of the inner shell is 434 feet.
Leaven starts to take steps inside the room to figure out its dimensions.
LEAVEN: 14 by 14 by 14.
WORTH: The inner cube cannot be flushed by the shell. There is a space.
LEAVEN: One cube?
WORTH: I don't know. It makes sense.
LEAVEN: Well, the biggest the cube then can be is... 26 rooms heigh, 26 rooms across, so... 17.576 rooms.
Dividing 434 by 14 gives 31. This would suggest that 31x31x31 rooms fit into the outer shell and therefore 29x29x29 into the inner shell. However, this does not take into account the thickness of the walls. Working backwards, we divide 434 feet by 28 to arrive at 15.5 feet, which suggests that the walls are about (15.5-14)/2 feet=1.5 feet thick, which sounds about right.
HOLLOWAY: 17.576 rooms? Oh, God that makes me queasy.
LEAVEN: Descartes...
Leaven opens a new door and puts on her glasses.
LEAVEN: Leaven, you are a genius!
We see three numbers: 517 478 565
LEAVEN: Cartesian co-ordinates, of course, coded Cartesian coordinates. They are uses in geometry to plot points on a three-dimensional graph.
QUENTIN: In English. Slower.
LEAVEN: Bonjour, these numbers are markers, a grid-reference, like altitude and longitude on a map. The numbers tell us where we are inside the cube.
QUENTIN: Then where are we?
LEAVEN: It works! Ok, all I have to do now is add the numbers together. The x-coordinate is 19
Here she scribbles 928 on a piece of metal and therefore 9+2+8=19. This also means that she is not talking about the number triple 517 478 565 that we just came across
Y is . . . Here she scribbles 856 giving 8+5+6=19 … 26 rooms. So that places us... seven rooms from the edge. (because 26-19=7)

QUENTIN: What's the matter?
LEAVEN: These co-ordinates: (14,27,14).
QUENTIN: What about them?
LEAVEN: Well, they don't make sense. Assuming the cube is 26 rooms across, there can't be a co-ordinate larger than 26. If this were right, then we would be outside the cube.

After they get back into the room with Rennes corpse (he was killed in an adjacent room)
WORTH: Wasn't Rennes killed in that room?
Worth opens the door to were Rennes was killed. There is nothing. All we see is black. Its the outer shell.
WORTH: How come there's nothing out there.
WORTH: HEY! Listen to what I'm saying! There was a room there before! We haven't been moving in circles, the rooms have!
LEAVEN: Of course.

LEAVEN: Its the only logical explanation. I'm such an idiot.
WORTH: What are you on to Leaven.
LEAVEN: Give me a minute. The numbers are markers point on a map, right?
WORTH: Right.
LEAVEN: And how do you map a point that keeps moving?
WORTH: Permutations.
QUENTIN: Permu... what?
LEAVEN: Permutations. A list of all the coordinates that the room passes through. Like a map that that tells you where the room starts, how many times it moves and where it moves to.
QUENTIN: The number tells you all that?
LEAVEN: I don't know. See, I've only been looking at one point on the map, which is probably the starting position. All I saw, was how the cube looked like before it started to move.
QUENTIN: Ok, so its moving. How do we get out?
LEAVEN: 27. I know where the exit is.

LEAVEN: You remember that room we passed through before, the one with the coordinate larger than 26?
WORTH: What about it?
LEAVEN: That co-ordinate placed the room outside the cube.
WORTH: A bridge?
LEAVEN: Right, but only in its original position.
QUENTIN: What are you talking about?
LEAVEN: Look, the room starts off as a bridge, then it moves its way through the maze, which is where we ran into it, but at some point it must return to its original position.
WORTH: So the bridge is only a bridge...
LEAVEN: ... for a short period of time. This thing is like a giant combination lock, when the rooms are in their starting position the lock is open. But when they move out of the alignment the lock closes.
WORTH: For a structure this size... it must take days to complete a full cycle.
QUENTIN: So when does it open?
We see Leaven doing some math.
LEAVEN: We find its original co-ordinates by adding the numbers,
QUENTIN: And what does that mean.
LEAVEN: You suck in math? Ok, I need the room numbers around as a reference point.
WORTH: 666... 897... 466...
QUENTIN: 567... 898... ok?
QUENTIN: And 545... Did you get that?
WORTH: 656... 778... 462...
LEAVEN: That's enough. X is 17, y is 25 and z is 14. Which means this room makes two more moves before returning to its original position.
WORTH: Do we have time?
LEAVEN: Maybe...
QUENTIN: Then let's go.
WORTH: Can you work out the traps in the system?
QUENTIN: Fuck the traps, let's get to the bridge.
WORTH: Well you threw out our last boot, you fucking idiot.
LEAVEN: Technically I can identify the traps.
WORTH: Technically?
LEAVEN: First I thought they were identified by prime numbers, but they're not. They're identified by numbers that are the power of a prime.
QUENTIN: Ok, so?
WORTH: Can you calculate that?
LEAVEN: The numbers are huge.
QUENTIN: But you can, right? You can?
LEAVEN: I have to calculate to numbers of factors in each set. Maybe if I had a computer...
QUENTIN: You don't need a computer.
LEAVEN: Yes, I do.
LEAVEN: Look! No one in the whole world could do it mentally! Look at the numbers: 567 898 545. There's no way I can factor that. I can't even start on 567. It’s astronomical!
KAZAN: Two... Astronomical.