A rectangular floor that is feet wide and feet long is tiled with one-foot square tiles. A bug walks from one corner to the opposite corner in a straight line. Including the first and the last tile, how many tiles does the bug visit?
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
Each grid line crossed means a new tile. The bug crosses 16 lines one way and 9 the other, never two at once, so it visits 26 tiles.
Solution
Think about what happens as the bug walks: it stays in one tile until it crosses a grid line, and then it is in a new tile. So
as long as the bug never crosses two lines at the same moment (by walking exactly through a corner where four tiles meet).
- Lines across the length. The floor is feet long, so going along the length there are grid lines between the end walls. The bug crosses each one once.
- Lines across the width. The floor is feet wide, so there are grid lines between the side walls. The bug crosses each one once.
- Does it ever hit a corner? Put the start at and the end at . A point on the path is parts across for every parts up. To hit a tile corner, both coordinates must be whole numbers at once, and since and have no common factor other than , that only happens at the start and the end. So all crossings happen at different moments.
- Count. crossings, so the bug visits tiles.
The answer is .
Why this works
"New tile each time you cross a line" turns a picture into a count. The one thing that could spoil it is walking exactly through a corner, where two crossings happen at once and only one new tile is entered. For a floor by whose sides share no common factor, that never happens and the answer is . If they do share a factor, subtract one tile for each corner the path passes through.
Alternative approach
Check the rule on a tiny floor you can draw: a floor. The diagonal crosses lines one way and the other, and visits tiles, which you can confirm by sketching. Using the same rule on gives .
The trap
Answering 27 = 10 + 17, forgetting that the starting tile counts only once, or worrying about corner crossings that cannot happen here.
Concise solution
The bug starts in a corner tile. Every time its path crosses one of the interior grid lines it leaves one tile and enters a new one, so
provided the path never passes through a corner where a vertical and a horizontal line meet (which would count one crossing for two lines).
Between the two -foot walls there are interior vertical lines, and between the -foot walls there are interior horizontal lines. The diagonal passes through a lattice corner only at points with both coordinates integers; since that happens only at the two ends. So the crossings are all distinct.
Tiles visited: .
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 5: More With Combinations (§5.2)
- Introduction to Number Theory, Chapter 3: Multiples and Divisors (§3.3, §3.4, §3.7)
- Intermediate Counting & Probability, Chapter 4: Constructive Counting and 1-1 Correspondences (§4.4, §4.5, §4.6)
- Introduction to Number Theory, Chapter 4: Prime Factorization (§4.7)
Techniques
Map the objects to something easier to count · Set up the equation/formula and compute; no special trick needed