Published
- 6 min read
Inner circle of a function
I came across an interesting challenge from a tweet:
Hiring our first employee today. Gave this insanely hard problem for round 1, try it out if you’re free: https://t.co/gRxG2jl9xt
— sir MIT, PhD in Vast Demented Atrophy (@iwontoffendyou) Sep 21, 2023
It is a simple problem, but can be tricky depending on how you see it.
I made a GeoGebra snippet that describes the same problem, but the and axis is swapped, because it is easier to write and understand if instead of .
Feel free to play around with the snippet. You can drag point left and right until the outer circle has radius 1. Then you can see the radius of inner circle being questioned, by checking the height of point .
GeoGebra
Things to try
You can drag around point and the construction will follow around, according to the constraint of the original problem.
As you may have noticed, the line that stretches from origin to and to the outer circle is actually a single line. It is easy to see now that the distance to plus the radius of the inner circle , actualy sums up as the radius of .
Thus, if we make equal to 1, we see that is around .
The tools we are using: GeoGebra, make it easy for us to construct the problem and then just “experiment” to get the feel of how the solution might be.
When I tried to solve the original problem, I went directly to try to solve it algebraically (more on that later).
In this section, I just want to focus on how to “play around” and having fun.
If you click the left panel called Algebra, you can see all the rules and constraints I already input in the GeoGebra notebook.
These rules can be read from top to bottom and it will be sorted in a dependency manner. So, first item is evaluated/solved first.
The notebook can be edited. So you can try type all sort of rules. It won’t be saved, though. So when you refresh, it will return to the original state.
You can try to change function into something else, like . The entire notebook then adapt accordingly to the new constraints.
Constructions
To build the constraints presented here, we go to the Algebra calculator view
- Define the function placeholder. To follow original problem, I used instead of
- We want a point in the x axis to be used as a slider. So we create point
- We want to place a point (the first constraint) in the function , so this point is
- The inner circle must be tangent with , so we have the second constraint. This means the derivative of both the function and inner circle equation must be the same.
- As a shortcut, define an angle theta . From the relation that function derivative is
- From the height of Point , we know that , so we can calculate
- Make a circle using Point and radius
- Calculate distance from center of the circle to origin, name it
- Make a circle for the outer circle with radius .
Solution using Algebra
This section used a more analytical approach as compared with just declaring the construction using GeoGebra. Some variable have different meaning here.
I modified the original problem by swapping with . This way, I used the function instead of using square root.
First constraint comes from the function itself, which is
I ignored the outer circle for now. So, the second constraint comes from the inner circle equation. Let’s say that the center is a point . But the height is equal to because the circle is tangent from x axis. Thus we can simplify:
From , taking the derivative, we know the rate of change should be:
From the definition of , we should be able to find relation to and
We can now use to retrieve by using the fact that
Now, the key connection is to realize that the rate of change of the function has to be the same with the inner circle. Because the circle has to be always connected with the function as increases. Alternatively, by the tangent rule, the circle is always tangent to the function. So, if we variate , the center of the circle will move as constrained by above rules.
We now want to see the behaviour of the center of the inner circle, from the origin.
Notice that the distance of the center of the inner circle to the origin, can be calculated using Pythagorean theorem. If the point is , then basically . But . Also, from ,
Now, the last constraints. We take into account the outer circle.
Since by the problem statement, it was stated that the outer circle be intersected with the inner circle, then the tangent at the point of intersection has the same direction. We can then conclude the outer radius is equal to . But . Which brings us the to the final constraint:
Backtracking and solving it one by one, you will have:
Combine with
Use with , then
We have an equation with variable and . We need one more equation that has these two variables. But at this point, I found some interesting shortcuts from the constraint.
If you observe the polynomials, has degree 4. But the graph of is only mirrored by axis. So there is only two possible that will have the same .
Since the roots might be duplicated, we can try finding the discriminant of the polynomials and set it to zero (means some roots appears more than once).
But, uh… calculating a determinant of a polynomial with degree 4 is exhausting, so I used Wolfram Alpha to do that
The result is:
From the discriminant, we entirely isolate value of .
For and it means and . Which is the solution if the inner circle is located above the origin . But this is not what we want to find.
So, the other factors must contain the solution: . Notice although has degree six, if we replace we will have polynomial of with degree 3. This is solveable and must contains at least 1 root, since the polynomial has odd degree.
But again, I’m too lazy to do that. So, I let Wolfram Alpha solve it again
With the equation rearranged into , we got direct result into , which is approximately .