skip to content
Logo Sons Only Take After Their Fathers' Negative Attributes
Table of Contents

Bad Tricks

Before I knew about contest math, problems like this used to drive young Peter crazy:

AoPS keeplearning problem

Here’s some good advice:

For all problems, if there's a point inside of a polygon, and there doesn't seem to be any relationships, this calls for a rotation or a reflection.

— eduD_looC

So if you’ve seen this type of advice/problem before, you know to rotate 9090^\circ clockwise around BB and you’ll find a 90454590^\circ-45^\circ-45^\circ followed by a 12231-2\sqrt{2}-3 right triangle. Then APB=90+45=135\angle APB = 90^\circ + 45^\circ=135^\circ.

If you haven’t seen this problem before…

My first instinct would be to determine the side length of the square - following what I call the Genie Principle:

Obviously if you knew the side length of the square you could just use Law of Cosines on APB\triangle APB to immediately find APB\angle APB. But how hard is it to first find the length of the square? Let’s look at an “easier” problem first.

Equilateral Triangle Version

A point PP is selected within equilateral triangle ABCABC so that AP=aAP=a, BP=bBP=b, and CP=cCP=c. What is the side length of ABC\triangle ABC?

How could you solve this if you don’t know the rotation trick? Well, Paul Grimshaw on Quora already did this and got the following mess of a formula:

s=12(a2+b2+c2±6(a2b2+a2c2+b2c2)3(a4+b4+c4))s = \sqrt{ \frac{1}{2} \Big( a^2 + b^2 + c^2 \pm \sqrt{6(a^2 b^2 + a^2 c^2 + b^2 c^2) - 3(a^4 + b^4 + c^4)} \Big) }

You can read his solution yourself, but suffice to say it involves solving a big system of equations using trig identities, substitutions, and ultimately a cubic polynomial. I don’t believe during a contest you would be able to practically figure this out.

Square Version

Out of curiosity, let’s figure out a similar formula for the square version of this problem. Note that we only need to specify three of the distances from interior point PP to the vertices since the British Flag Theorem gives us the fourth.

Unlike Paul Grimshaw, I’m going to derive the formula using rotations :) First rotate square ABCDABCD 9090^\circ clockwise around point BB:

Asymptote diagram

Here’s the reverse the roadmap for how we’re going to solve this:

  1. We’re going to use the Law of Cosines on APB\triangle APB to find the side length of the square. To do this though, we’ll need to:
  2. Find cos(APB)\cos (\angle APB) by splitting up APB\angle APB into two parts: APP\angle APP' and BPP\angle BPP'.
  3. APP\angle APP': We’ll use Law of Cosines on APP\triangle APP' to figure out APP\angle APP'. To do this we’ll need to know:
  4. Side PPPP', which is part of BPP\triangle BPP'. However note that because we rotated by 9090^\circ, PBP\triangle PBP' is an isosceles right triangle. This gives us two bits of information:
    • BPP=45\angle BPP'=45^\circ, and
    • PP=b2.\overline{PP'}=b\sqrt{2}.

That was a little confusing to write. Hopefully this labeled diagram will help:

Asymptote diagram

From Law of Cosines on APP\triangle APP':

cos(θ)=a2+2b2c222ab\begin{aligned} \cos(\theta) &= \frac{a^2 + 2b^2 - c^2}{2\sqrt{2}ab} \end{aligned}

and then:

cos(APB)=cos(θ+45)=cosθcos45sinθsin45=a2+2b2c222ab22    1(a2+2b2c222ab)222=12(a2+2b2c22ab    1(a2+2b2c222ab)2).=a2+2b2c2(2b2(a+c)2)(2b2(ac)2)4ab.\begin{aligned} \cos(\angle APB) &= \cos(\theta + 45^\circ) \\ &= \cos\theta\, \cos 45^\circ - \sin\theta\, \sin 45^\circ \\ &= \frac{a^2 + 2b^2 - c^2}{2\sqrt{2}ab} \cdot \frac{\sqrt{2}}{2} \;-\; \sqrt{1 - \Big( \frac{a^2 + 2b^2 - c^2}{2\sqrt{2}ab} \Big)^2 } \cdot \frac{\sqrt{2}}{2} \\ &= \frac{1}{2} \Bigg( \frac{a^2 + 2b^2 - c^2}{2ab} \;-\; \sqrt{1 - \Big( \frac{a^2 + 2b^2 - c^2}{2\sqrt{2}ab} \Big)^2 } \Bigg). \\ &= \frac{ a^2 + 2b^2 - c^2 - \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) \,} }{ 4ab }. \end{aligned}

Finally we can do Law of Cosines on APB\triangle APB to get our final formula:

s2=a2+b22abcos(APB)=a2+b22ab(a2+2b2c2(2b2(a+c)2)(2b2(ac)2)4ab)=a2+b2+a22b2+c2+(2b2(a+c)2)(2b2(ac)2)2=12(2a2+2b2a22b2+c2+(2b2(a+c)2)(2b2(ac)2))=12(a2+c2+(2b2(a+c)2)(2b2(ac)2)).\begin{aligned} s^2 &= a^2 + b^2 - 2ab\, \cos(\angle APB) \\ &= a^2 + b^2 - 2ab \Bigg( \frac{ a^2 + 2b^2 - c^2 - \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) \,} }{ 4ab } \Bigg) \\ &= a^2 + b^2 + \frac{ -a^2 - 2b^2 + c^2 + \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) \,} }{ 2 } \\ &= \tfrac{1}{2} \Big( 2a^2 + 2b^2 - a^2 - 2b^2 + c^2 + \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) \,} \Big) \\ &= \tfrac{1}{2} \Big( a^2 + c^2 + \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) \,} \Big). \end{aligned}

Beautiful!

Double-Check

The irony that I was trying to find the side length of the square so that I could find the angle, but ended up using a rotation trick to find the angle first so I could find the side length is not lost on me. My point is that Paul Grimshaw did find the side length first without using a rotation trick and it was extremely painful. Observing the final formula above for a square confirms that it would be similarly painful for this trick problem.

Nonetheless, let’s just do a quick double-check that this gave us the correct answer:

s2=12(a2+c2+(2b2(a+c)2)(2b2(ac)2))=12(12+32+(222(1+3)2)(222(13)2))=12(1+9+(2416)(244))=12(10+(816)(84))=12(10+(8)(4))=12(10+32)=5+22.\begin{aligned} s^2 &= \tfrac{1}{2} \Big( a^2 + c^2 + \sqrt{-\, (2b^2 - (a + c)^2)\, (2b^2 - (a - c)^2) } \Big) \\[6pt] &= \tfrac{1}{2} \Big( 1^2 + 3^2 + \sqrt{-\, (2 \cdot 2^2 - (1 + 3)^2)\, (2 \cdot 2^2 - (1 - 3)^2) } \Big) \\[6pt] &= \tfrac{1}{2} \Big( 1 + 9 + \sqrt{-\, (2 \cdot 4 - 16)\, (2 \cdot 4 - 4) } \Big) \\[6pt] &= \tfrac{1}{2} \Big( 10 + \sqrt{-\, (8 - 16)(8 - 4) } \Big) \\[6pt] &= \tfrac{1}{2} \Big( 10 + \sqrt{-\, (-8)(4) } \Big) \\[6pt] &= \tfrac{1}{2} \Big( 10 + \sqrt{32 } \Big) \\ &= 5 + 2 \sqrt{2}. \end{aligned}

Remember we’re trying to find APB\angle APB with a=1a=1, b=2b=2, c=3c=3. Using Law of Cosines on APB\triangle APB gives:

cos(APB)=12+22(5+22)2(1)(2)=55224=22.APB=135.\begin{aligned} \cos(\angle APB) &= \frac{1^2 + 2^2 - (5 + 2\sqrt{2})}{2(1)(2)} = \frac{5 - 5 - 2\sqrt{2}}{4} = -\frac{\sqrt{2}}{2}. \\ \Longrightarrow \quad \angle APB &= \boxed{135^\circ.} \end{aligned}

Good Tricks

I wrote the entire section above because I wanted to illustrate what I consider a “Bad Trick”. I think it’s “Bad” because if you don’t know it there really isn’t a plan B. This is the worst kind of problem to encounter on a test if you haven’t seen the trick. On the other hand, I consider a “Good Trick” a way to solve a problem that makes the problem more easy or beautiful, yet doesn’t preclude a student from using a clunkier method if they are so inclined.

This has a weird implication though:

The genesis for this whole post was the following problem I encountered while studying with Curzon yesterday:

2017 SIMOC Grade 5 Problem 24

The ratio of the number of tables and chairs in a school is 7:5.7:5. After buying new chairs, the ratio becomes 4:3.4:3. Then new tables were bought and the ratio become 8:5.8:5. Given that the school bought 2323 more tables than chairs, how many chairs were there originally?

Algebra Solution

This is a straightforward (and might I say) boring problem involving a linear system of three equations and three variables. Use a single scaling variable:

  • Original chairs: 5x5x
  • Original tables: 7x7x
  • New chairs bought: cc
  • New tables bought: tt

Then:

7x5x+c=43,7x+t5x+c=85,t=c+23.\begin{aligned} \frac{7x}{5x + c} &= \frac{4}{3}, \\[6pt] \frac{7x + t}{5x + c} &= \frac{8}{5}, \\[6pt] t &= c + 23. \end{aligned}

Simplifying each equation:

x4c=0,5x+5t8c=0,tc=23.\begin{aligned} x - 4c &= 0, \\ -5x + 5t - 8c &= 0, \\ t - c &= 23. \end{aligned}

Solve this any way you’d like and end up with the following solutions:

x=20,c=5,t=28.\begin{aligned} x &= 20, \\ c &= 5, \\ t &= 28. \end{aligned}

and the original number of chairs is 5x=520=1005x=5\cdot20=\boxed{100}.

Can We Do Better?

Normally I wouldn’t have given this any more thought, except Curzon made an algebra mistake and ended up with the wrong answer. It also took a bit of time since solving triple systems isn’t exactly painless for an 8yo. This got me thinking:

  1. This question was on a 5th grade contest paper. Granted it’s the invite-only final round following the SASMO, but it’s for 5th graders nonetheless.
  2. Is this the fastest way to do this problem? If you were given this on the MATHCOUNTS National Speed Round, would this solution ensure you get the answer faster than your opponent?
  3. Is there a less general way to do this problem? Obviously our system solution is airtight and it didn’t matter that the numbers they gave us were 7:5,7:5, or 4:3,4:3, or 8:5,8:5, or 2323. But are those special in some way?
  4. Is the integer-ness of the problem important? The systems solution didn’t rely on that at all, meaning the problem could’ve been talking about the mass of some objects, or the height, or some other continuously measurable property. However the problem isn’t talking about anything like that. Instead it’s about tables and chairs, which you presumably only have an integer number of.

Considering all of these things together, the answer is: yes!

Ratio Scaling

There was no need at all for a triple system of equations. The ratios give us an incredible amount of information without doing any work:

  1. The final number of chairs is a multiple of 15. After we added some tables at the end, our ratio of tables-to-chairs goes from 4:34:3 to 8:58:5. Since the number of chairs didn’t change at this step and it’s both a multiple of 3 and a multiple of 5, it’s a multiple of 15.
  2. Using this information, we could’ve instead wrote our final two ratios as 20:1520:15 and 24:1524:15 instead of 4:34:3 to 8:5.8:5.
  3. The original number of tables is a multiple of 140. After we add some chairs in the beginning, our ratio goes from 7:57:5 to 20:1520:15 (i.e. 4:34:3). Since the number of tables didn’t change between these two ratios, the final number of tables is both a multiple of 77 and a multiple of 2020. Therefore we can rewrite the initial ratio as 140:100140:100 instead of 7:5.7:5.
  4. Using identical logic and scaling the second ratio by 7, the final number of chairs is a multiple of 105, and
  5. Likewise, the final number of tables is a multiple of 168.

So our new and improved ratios are, respectively, 140:100,140:100, 140:105,140:105, and 168:105.168:105. However our original solution for (tables,chairs)(\textbf{tables},\textbf{chairs}) could still be anything that fits the ratio 140:100,140:100, like (280,200),(420,300),(280,200), (420,300), etc…

So how do we decide? Well, we still haven’t checked the constraint that the school bought 23 more tables than chairs. Fortunately we can easily see that the ratios “as-is” already work!

Is This Even a Trick?

I think so. It’s a trick for 5th graders who haven’t studied Algebra 2 yet. It’s not as general as a systems solution, but it works here because all of the easy numbers and the discreteness of the problem. And like any other “Good Trick”, you might never see this solution if all you’re interested in doing is solving the problem the mechanical way with a system of equations.

Just to test the “standardness” of the solution to this problem, I asked ChatGPT and Grok. Each solved it using a system of four equations in four variables because they didn’t use a common scaling factor in the beginning (xx).

I then followed up asking them for a second solution. At this point they diverged. ChatGPT noticed you only needed three variables and proceeded as I did above. Grok started guess and checking using a ridiculous train of logic that ended up just magically trying the correct numbers because it already had the answer due to chat history. I probably should’ve started a fresh chat each time.

I asked for a third solution. ChatGPT wrote me a python script that just tried every multiple of 7:57:5 until it got something that satisfied the other constraints. Grok gave me the first solution again but it just solved the system in a different order lol.

Props to ChatGPT for not even suggesting a guess-and-check strategy.

But none of our esteemed AI friends even came close to providing this solution. Finally I suggested to both of them to note how the ratios changed before and after adding either chairs and tables and see if we could draw any conclusions about the divisibility of each number. At this point it seemed like they both sort of “got it”, but they both failed on the execution and ultimately up-scaled the ratios by the wrong numbers.

Thus, I stand by my assertion that this is indeed a non-standard solution. In other words, a Trick.