A cuboid is composed by $81 \times 125 \times 128 $ cubes. How many cubes are crossed by a (main) diagonal of the cuboid?
(note: I chose the numbers for the sides so that the case of the diagonal passing through a vertex of an inner cube is not possible)
Answer
Suppose we
move along the diagonal, parameterizing our movement by a number t that runs from 0 at one corner to 1 at the opposite corner.
Then
we enter a new cube every time one of 81t, 125t, 128t crosses an integer. These all happen at different times except that at the very start (t=0) all three happen together but we are entering only a single cube.
So the total number of cubes is
81+125+128-2 = 332.
Here's another way of saying it that some may find more congenial:
Consider the planes, parallel to the sides of the cuboid, that divide it into those cubes. As we travel from one corner to the other, we enter a new cube every time we cross one of those planes. There are 80+124+127=331 planes in all; plus the one cube in which we start, for a total of 332 cubes.
No comments:
Post a Comment