How many triangles with positive area have all their vertices at points in the coordinate plane, where and are integers between and , inclusive?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
Count all ways to pick 3 of the 25 points, then subtract picks lying on one line. Sort those lines by direction so none are missed.
Solution
Three points make a triangle unless they sit on one straight line. So count all groups of three points, then take away the groups that lie on a line.
1. All groups of three. There are points. The number of ways to choose of them is
2. Groups on one line. A line through of the points holds groups of three. A line through points holds groups. A line through exactly points holds . Now go through the directions a line can have.
3. Flat rows. rows, each with points: .
4. Upright columns. Also .
5. Diagonals going up to the right. One long diagonal has points, two have , and two have (the shorter ones hold only or points). That gives .
6. Diagonals going down to the right. Same count by mirror symmetry: .
7. Lines that go across and up. Starting from a point, the next grid point on such a line is over and up. Three such points need columns of width, so they must use columns . Examples: , then , then . That is lines.
8. The other tilted directions. The same count works for across and down, across and up, and across and down (turn or flip the grid). Each gives lines, so all four together give .
9. Steeper or flatter tilts. A line that goes across and up (or across and up, and so on) would need columns to reach a third point. The grid has only columns, so these give nothing. The same goes for the upright versions.
10. Total on lines: .
11. Triangles: .
The answer is .
Why this works
When most choices work and a few fail, count everything and subtract the failures. The hard part is making sure the list of failures is complete. Sorting lines by their steps (across and up) and asking "can three points fit in the grid?" gives a checklist that catches the easy-to-miss tilted lines.
The trap
Forgetting the lines that are not flat, upright, or 45 degrees, such as through (1,1), (3,2), (5,3). Missing those 12 triples gives 2160, choice (C).
Concise solution
There are lattice points, so ways to choose three of them. A choice fails to be a triangle exactly when the three points are collinear, so count collinear triples and subtract.
A line through the grid containing of the points contributes collinear triples. Go through the possible directions.
Horizontal: rows of points, . Vertical: likewise .
Slope : for each sign there is one diagonal with points, two with , and two with (shorter diagonals hold fewer than points). Per sign: . Both signs: .
Slope and : a line of slope through lattice points steps right and up, so it can hold at most grid points, e.g. . For slope the three points have and with : lines. By symmetry (reflect and swap axes) each of the four slopes gives lines, for collinear triples.
Any other slope (such as or ) would need a horizontal or vertical span of at least to fit three lattice points, impossible here.
Collinear triples: . Triangles: .
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Counting & Probability, Chapter 5: More With Combinations (§5.2)
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.3)
- Introduction to Counting & Probability, Chapter 8: Basic Probability Techniques (§8.3)
Techniques
Split into exhaustive cases and handle each · Count the complement and subtract from the total