Use CircleInversion on AIME problem​
​by Shenghui Yang
CircleInversion is just published on Wolfram Function Repository. There are many nice examples on the page already and I would like to show how you can use it in an interesting AIME problem on complex plane.

Problem

A regular hexagon with center at the origin in the complex plane has opposite pairs of sides one unit apart. One pair of sides is parallel to the imaginary axis. Let
R
be the region outside the hexagon, and let
S
1
z
z∈R
. Then the area of
S
has the form
aπ+
b
, where
a
and
b
are positive integers. Find
a+b
. (2008 AIME II Problem 13)

Code golf for solution

Use newly add CircleInversion in WFR, I can quickly find the value right before the final solution (AIME has certain type of convention for final answer):
Withcircles=
[◼]
CircleInversion
[Circle[{0,0},1],#]&/@BlockMapLine,
1
3
*Table[{Cos[θ],Sin[θ]},{θ,π/6,2π+π/6,π/3}],2,1,Area[RegionUnion@@(circles/.Circle->Disk)]
Out[]=
3
3
+2π

Analysis with inversion on Euclidean plane

I can quickly sketch the hexagon on complex plane using these facts:
WolframAlpha"regular hexagon",

Out[]=
Properties
Less
☑ Step-by-step solution
circumradius
s
inradius
3
s
2
≈0.866025s
height
3
s≈1.73205s
independent diagonal lengths

3
s
|
2s≈(1.73205s
|
2s)
area
3
3
2
s
2
≈2.59808
2
s
perimeter
6s
central angle
60°
π
3
​rad≈1.047​rad
interior angle
120°
2π
3
​rad≈2.094​rad
interior angle sum
720°4π​rad≈12.57​rad
exterior angle sum
360°2π​rad≈6.283​rad
centroid
(
x
0
,
y
0
)
apothem
3
s
2
≈0.866025s
(assuming center (
x
0
,
y
0
) and edge length s)
Because we know the distance between the opposite sides is 1, the inradius must be
1
2
. So we can find the circumradius by the following relation:
Solve[r2*
3
==12,r]
Out[]=
r
1
3

All six vertices (ABCDEF) are found by:
In[]:=
pts=
1
3
*Table[{Cos[θ],Sin[θ]},{θ,π/6,2π+π/6,π/3}];
The problem uses the complex mapping
1
z
on points in outside R, which is the same thing as the circle inversion with respect to the unit circle at
{0,0}
in Euclidean plane. We first need to take a look how the boundary looks under such inversion. Recall that The inverse of a line is a circle containing the center of inversion if the line does not contain the center:
t=π/6;​​styles={Opacity[0.4],Hue[#]}&/@(Range[6]/6);​​lines=BlockMap[Line,pts,2,1];​​disks=MapThreadAppend,styles,
[◼]
CircleInversion
[Circle[{0,0},1],#]&/@lines/.Circle->Disk;​​Graphics​​disks~Join~lines~Join~MapThread[label,{{"A","B","C","D","E","F"},Most@pts}]~Join~​​MapThreadlabel,{"A'","B'","C'","D'","E'","F'"},
[◼]
CircleInversion
[Circle[{0,0},1],#]&/@(Most@pts)/.Point->Identity~Join~{{Dashed,Circle[{0,0},1/2]}},PlotRange->{{-2,2},{-2,2}}
Out[]=
Take a look at the inversion diagram (from Wolfram MathWorld website) below, the closer a point sits beside the inversion center O, the farther it is sent away from
O
.
Therefore S is the union of the rainbow disks above, bounded by joining minor arcs passing A’B’C’D’E’F’ in sequence.
union=RegionUnion@@(disks[[All,-1]]);​​{Region[union],Region@RegionBoundary[union]}
Out[]=

,

The area is simply
Area[union]
Out[]=
3
3
+2π
Because we need answer in the form of
aπ+
b
, just use simple algebra:
27
===3
3
Out[]=
True
The answer is
a+b=2+27=
029

Code for Animation

Export"aime.gif",Table​​pts=
1
3
*Table[{Cos[θ],Sin[θ]},{θ,t,2π+t,π/3}];​​lines=BlockMap[Line,pts,2,1];​​disks=MapThreadAppend,styles,
[◼]
CircleInversion
[Circle[{0,0},1],#]&/@lines/.Circle->Disk;​​Graphics​​disks~Join~lines~Join~MapThread[label,{{"A","B","C","D","E","F"},Most@pts}]~Join~​​MapThreadlabel,{"A'","B'","C'","D'","E'","F'"},
[◼]
CircleInversion
[Circle[{0,0},1],#]&/@(Most@pts)/.Point->Identity~Join~{{Dashed,Circle[{0,0},1/2]}},PlotRange->{{-2,2},{-2,2}},{t,0,4π,0.1}

Utility functions