On Twitter and in the comments on The Times’s website, it was clear that some readers knew immediately how to solve the problem because they had learned combinatorics, an area of math that figures out the number of ways things can be shuffled. Other readers just tried to count, an almost hopeless task. “I don’t think I’ve ever met anybody who’s counted right,” Dr. Loh said.

[Like the Science Times page on Facebook. | Sign up for the Science Times newsletter.]

To solve the problem, start with this observation: Any three lines in the diagram define one and only one triangle. It follows that the total number of triangles will be equal to the number of three-line combinations that can be chosen from a group of six lines.

How do you calculate that? Choose a line, any line. Since there are six lines, there are six choices. Next, choose a line to be the second side of the triangle. At first, you might think there are again six choices, but one line has already been chosen as a line for the first side, so only five choices are left. Likewise, for the third side of the triangle, there are four lines left to choose from.

Thus, the total number of ways you can choose the sides of the triangle equals 6×5×4, or 120. Clearly, there are not 120 triangles in the diagram. That’s because all of those combinations are being counted more than once.

For clarity, number the lines from 1 to 6, and look at the triangle defined by lines 1, 2 and 3. It’s the same triangle whether you choose line 1, then line 2, then line 3; or line 1, then line 3, then line 2.