Optimization explained to a middle school kid

Solution 1:

First of all, let's lose the coins. That doesn't make any sense. How can the number of coins you get be somehow related to the direction in which you walk? Surely if there are coins lying around on the ground, the amount you get should be proportional to how far you walk, not in what direction.

Maybe the following is a better visualization of the problem. You are inside a circular wall, with some large radius, say a mile. Every step you take east, I'll pay you 5 gold. Every step you take north, I'll pay you 7 gold. How can you maximize the amount of money you make?

Where you end up and how much money you make are functions only of how many steps east and how many steps north you take. It doesn't matter in what order you take them. Therefore, we may as well begin by stepping only north, and then step only east until we hit the wall. So the only question is when to stop going north and go east.

At first it seems like we should just only go north, since we get more money that way. But towards the end of our journey, when we're just one step away from the wall, if we look to our right we'll find that we can step several steps to the east before hitting the wall. So clearly at that point we should head east. So it's not hard to intuitively see why going only north isn't optimal.

That's the easy part.

But now we need to work out exactly when to turn east. The basic idea is that every step I take north, I'm sacrificing a certain number of steps east. Because of the way the circle is getting shallower and shallower as I go north, (the eastern wall is approaching me faster and faster), I'm sacrificing more and more as I go north. How much eastward distance I sacrifice on a given step north has to do with the slope of the circle.

When we take a step north and sacrifice $x$ steps east, we gain a net total of $7-5x$ gold, which becomes negative at the point $x=\frac75$. By zooming into the circle and applying properties of similar triangles, it should be possible to essentially reinvent enough of differential calculus to show what you're trying to prove.

Solution 2:

I'd probably start with easier numbers to visualise. For example $10$ and $5$, you can explain that every step in $1$ direction you pick up $£5$, and every step in the other you pick up $£10$. Therefore to collect the same amount of money in the first direction as the second you have to walk twice as fast (or far). Hopefully this can start the intuitive thinking about the relationship between the ratios.

Solution 3:

I know you said to perhaps avoid equations of lines, but I think the lines here are a crucial point. You don't need to "know" how to plot them though, just somehow convince yourself that the following description makes sense.

Try to draw the set of points in the positive quadrant where $S = 1$. This should be easy to do for the intercepts $(1/5, 0)$ and $(0, 1/7)$, and then work out that everything on the line between them also has $S = 1$. Now try again for $S = 2$, which has intercepts $(2/5, 0)$ and $(0, 2/7)$, and so on. What you find is that increasing $S$ corresponds to making this triangle larger and larger, but always in the same horizontal:vertical ratio of $7:5$. enter image description here

The key thing to take away from this is that all the points having the same $S$ are a line, and increasing this $S$ is just sliding this line to be a higher parallel line.

Now we include the constraint that $x^2 + y^2 = 1$, i.e. we want to only look at points lying on the unit circle. Trying to maximise $S$ while still having $(x, y)$ lying on the circle means that you will slide the triangle to make it larger and larger until the line just touches the edge of the circle, i.e. the line is tangent to the circle. (It's also interesting here that for a suboptimal $S$, there are two solutions - this could make for some interesting discussion). You make a picture like the following:

enter image description here

where the outer triangle $ADE$ is in the ratio $7:5$, and the angle $ABE$ is a right angle because tangents to circles meet the diameter at right angles. The point $B$ is the point achieving the maximum. Now all you need to explain is why the smaller triangle $ACB$ is in the ratio $5:7$, which can be done in several ways (if $m$ is a gradient, the perpendicular gradient is $-1/m$, etc etc).

Solution 4:

This is related in an interesting way to the method of Gradient Descent:

  • Why is it that if you find yourself on a 2D-plane tilted by a slope of $a$ in the $x$-direction and a slope of $b$ in the $y$-direction, the steepest uphill direction will be toward $(a,b)$?

I have no idea how you would convince someone without going into at least some mathematical details, but from my perspective I have the following reasons:

  1. If one moves perpendicular to the $v=(5,7)$ vector, which would be toward $\hat v=(-7,5)$ you would gain zero score from the expression $5x+7y$. Simply we have $5\cdot(-7)+7\cdot 5=0$.
  2. Any direction can be decomposed into two parts in terms of the two perpendicular directions $v=(5,7)$ and $\hat v=(-7,5)$, and only the part in direction of $v$ will increase the score.

Good luck breaking this down and coming up with a visual representation of it. I am positive it can be done, but I am less sure how you would omit any of the non-intuitive details.


enter image description here

At least you can say that the part of "some direction" pointing in the direction of $v$ is shorter than "some direction" itself, and so it achieves the same score while traversing a shorter distance. The red dotted line represents the part of "some direction" not contributing to the score at all.