When is arccos a rational multiple of pi?
Recently I had to test if the of some algebraic number is a rational multiple of or not. I found this solution online and since it is quite nice, I write it here in a more generalized form.
Suppose that is an algebraic number. Under which circumstances we have
Suppose that with . Then and applying we see that
It is well known that the function is polynomial for . If we denote then is a polynomial of degree with leading coefficient . Since we have , the minimal polynomial associated to must divide . This gives us the following necessary condition:
If then there exist , such that (the minimal polynomial of ) divides (where is the Chebyshev polynomial of degree ).
It is not difficult to see that this condition is also sufficient. Now, using this we have the following application:
Consequence. If is an algebraic number whose minimal polynomial has a leading coefficient which is not a power of , then
Since the minimal polynomial has a leading coefficient which is not a power of , it cannot divide for some positive integer . Therefore, following the arguments stated above, .
Applications.
 if .
 for if and is not a power of .
Romanian Masters in Mathematics contest – 2018
Problem 1. Let be a cyclic quadrilateral an let be a point on the side The diagonals meets the segments at The line through parallel to mmets the extension of the side beyond at The line through parallel to meets the extension of the side beyond at Prove that the circumcircles of the triangles and are tangent .
Problem 2. Determine whether there exist nonconstant polynomials and with real coefficients satisfying
Problem 3. Ann and Bob play a game on the edges of an infinite square grid, playing in turns. Ann plays the first move. A move consists of orienting any edge that has not yet been given an orientation. Bob wins if at any point a cycle has been created. Does Bob have a winning strategy?
Problem 4. Let be positive integers such that and . Let be the set of values attained by as runs through the positive integers. Show that is the set of all positive divisors of some positive integer.
Problem 5. Let be positive integer and fix distinct points on a circle. Determine the number of ways to connect the points with arrows (oriented line segments) such that all of the following conditions hold:
 each of the points is a startpoint or endpoint of an arrow;
 no two arrows intersect;
 there are no two arrows and such that , , and appear in clockwise order around the circle (not necessarily consecutively).
Problem 6. Fix a circle , a line to tangent , and another circle disjoint from such that and lie on opposite sides of . The tangents to from a variable point on meet at and . Prove that, as varies over , the circumcircle of is tangent to two fixed circles.
Source: Art of Problem Solving forums
Some quick ideas: For Problem 1 just consider the intersection of the circle with the circle . You’ll notice immediately that this point belongs to the circle . Furthermore, there is a common tangent to the two circles at this point.
For Problem 2 we have . Eliminate the highest order term from both sides and look at the next one to get a contradiction.
Problem 4 becomes easy after noticing that if divides and then divides .
In Problem 5 try to prove that the choice of start points determines that of the endpoints. Then you have a simple combinatorial proof.
Problem 6 is interesting and official solutions use inversions. Those are quite nice, but it may be worthwhile to understand what happens in the noninverted configuration.
I will come back to some of these problems in some future posts.
SEEMOUS 2018 – Problems
Problem 1. Let be a Riemann integrable function. Show that
Problem 2. Let and let the matrices , , , be such that
Prove that .
Problem 3. Let such that and , where is the identity matrix. Prove that if then .
Problem 4. (a) Let be a polynomial function. Prove that
(b) Let be a function which has a Taylor series expansion at with radius of convergence . Prove that if converges absolutely then converges and
Source: official site of SEEMOUS 2018
Hints: 1. Just use and . The strict inequality comes from the fact that the Riemann integral of strictly positive function cannot be equal to zero. This problem was too simple…
2. Use the fact that , therefore is symmetric and positive definite. Next, notice that . Notice that is diagonalizable and has eigenvalues among . Since it is also positive definite, cannot be an eigenvalue. This allows to conclude.
3. First note that the commutativity allows us to diagonalize using the same basis. Next, note that both have eigenvalues of modulus one. Then the trace of is simply the sum where are eigenvalues of and , respectively. The fact that the trace equals and the triangle inequality shows that eigenvalues of are a multiple of eigenvalues of . Finish by observing that they have the same eigenvalues.
4. (a) Integrate by parts and use a recurrence. (b) Use (a) and the approximation of a continuous function by polynomials on compacts to conclude.
I’m not sure about what others think, but the problems of this year seemed a bit too straightforward.
Using parfor in Matlab
We all know that loops don’t behave well in Matlab. Whenever it is possible to vectorize the code (i.e. use vectors and matrices to do simultaneous operations, instead of one at a time) significant speedup is possible. However, there are complex tasks which cannot be vectorized and loops cannot be avoided. I recently needed to compute eigenvalues for some 10 million domains. Since the computations are independent, they could be run in parallel. Fortunately Matlab offers a simple way to do this, using parfor.
There are some basic rules one need to respect to use parfor efficiently:
 Don’t use parfor if vectorization is possible. If the task is not vectorizable and computations are independent, then parfor is the way to go.
 Variables used in each computation should not overlap between processors. This is for obvious reasons: if two processors try to change the same variable using different values, the computations will be meaningless in the end.
 You can use an array or cell to store the results given by each processor, with the restriction that processors should work on disjoint parts of the array, so there is no overlap.
The most restrictive requirement is the fact that one cannot use the same variables in the computations for different processors. In order to do this, the simplest way I found was to use a function for the body of the loop. When using a matlab function, all variables are local, so when running the same function in parallel, the variables won’t overlap, since they are local to each function.
So instead of doing something like
parfor i = 1:N commands ... array(i) = result end
you can do the following:
parfor i=1:N array(i) = func(i); end function res = func(i) commands...
This should work very well and no conflict between variables will appear. Make sure to initialize the array before running the parfor, a classical Matlab speedup trick: array = zeros(1,N). Of course, you could have multiple outputs and the output array could be a matrix.
There is another trick to remember if the parpool cannot initialize. It seems that the parallel cluster doesn’t like all the things present in the path sometimes. Before running parfor try the commands
c = parcluster('local'); c.parpool
If you recieve an error, then run
restoredefaultpath c = parcluster('local'); c.parpool
and add to path just the right folders for your code to work.
Regular tetrahedron – computing various quantities in terms of the sidelength
Sometimes one needs to find certain quantities related to the regular tetrahedron in , like volume, radius of the circumscribed sphere, radius of inscribed sphere, distance between opposite sides, etc. in terms of the sidelength which we’ll note in the following with . In the past I needed to find the angle under which every side is seen when looking from the center of the regular tetrahedron.
Here’s a trick which can help you find rather easily everything you need related to the regular tetrahedron: just embed it into a cube. We can see rather easily that when drawing certain diagonals of the faces of a cube, like in the figure below, we can recover a regular tetrahedron. Now it becomes rather easy to solve all questions above. We note that the ratio between the side of the cube (denoted by ) and the side of the embedded tetrahedron (denoted by ) is : .
Here are a few ideas:
1. Finding the volume of the tetrahedron in terms of its sides.
The volume of the cube is . The volume of the tetrahedron can be obtained by cutting four corner pyramids with volumes (recall that volume of a pyramid is (area of base) (height) ). Therefore the volume of the regular tetrahedron is . Replacing we get that the volume of the tetrahedron is .
2. Finding the circumradius .
It is not difficult to see that the sphere passing through the vertices of the tetrahedron also passes through the vertices of the cube. Therefore its radius is a long diagonal of the cube divided by . This gives . Replacing we get that the circumradius is .
3. Finding the inradius .
Once we have the volume and the circumradius, finding the inradius is not that difficult, since the symmetry of the figure shows that , where is the distance from a vertex to the opposite face, also called the height. We can find the height from the formula of the volume (recalled above), and then find . Also note that since the center of the tetrahedron is also the centroid, we must have , so we have another quick finish solution.
However, let’s use the cube to do this. We can choose a system of coordinates putting the origin at the center of the cube (and tetrahedron). Put the cube so that its vertices have coordinates and suppose that the tetrahedron corresponds to the vertices , , , . All we need to do is to compute the distance from the origin to the plane . This is immediate if we know the equation of this plane. Fortunately, it is really easy to see that the coordinates of verify (if not, then note that the normal to is the vector and figure out the remaining translation constant). We know that if a plane is defined by the equation then the distance from to this plane is
Apply this to our problem and the distance from the origin to becomes . Replace and we get .
4. Find distance between opposite sides.
This is particularly easy with the cube. The distance between the opposite sides is exactly the distance between two parallel faces of the cube and that is .
5. Find angle made by two rays connecting the center with vertices.
Use the coordinate system introduced in 3. and just compute the angle between vectors and , for example. If is the angle between and we get that
Therefore .
Plotting 3D level sets in Paraview
Surfaces can be represented as certain levelsets for some 3D functions. Given a set of points with values attached to them a level set associated to a certain number will separate the points into two sets: with values higher or lower than the number considered. It is nice to have good looking plots when working with the levelset method in shape optimization. Paraview is a nice, open source framework, which has the right tools in order to produce high quality plots.
I’ll briefly describe below how to use Paraview to make some nice pictures of levelsets. First of all, you’ll need your data in some format that Paraview can understand. I use vtk file format for which there is a nice automated interface in the software I use for the optimization (FreeFem++). In the vtk file you need to have a set of points and a scalar value attached to them.
If you want to create levelsets associated to certain values, follow the steps below:

 Load your file (containing points with at least a scalar value) and click Apply.
 Next, go to Filters/Alphabetical and select “Cell Data to Point Data” (if you forget to do this, you’ll get a rough surface where you see the discretization). Click Apply.
 Then apply the Contour filter (by clicking the button or going in Filters/Alphabetical). You’ll have to select the field for which the contours will be drawn and then put in the values of the levelsets you want to see. Click Apply. An example can be seen below.
If your levelset cuts the boundary of the domain, Paraview will draw a hole there. If you want to have a closed region instead, you need to use the IsoVolume filter instead of the Contour one. The difference is that you need to specify two values and Paraview will draw the surface enclosing the points corresponding to these values. Many other features are directly available: you can color the level set following another scalar value, you can set the lighting, etc. You can also symmetrize your geometry using the Reflect filter. Below you can see a result built from my work.
You can also create animations in a pretty straightforward way. Just go to View and select the Animation box. Then you’ll see the animation options. Add a Camera object with Orbit field selected. You’ll be presented with multiple options, like the center of rotation, direction of the vertical and initial position. Once everything is set, click the play button to see the animation. Then go to File/Save Animation to save it to a file.
I heard that Paraview could to many things when dealing with visualization aspects, but I hesitated to use it until now since the interface is not straightforward. The use of Filters is not clear in the beginning, but after playing with some examples, everything becomes really easy to use. The next step is to automatize all this using scripts.
Happy New Year!
Putnam 2017 A3 – Solution
Problem A3. Denote . Then is continuous and . We can see that
Now note that on we have so . Furthermore, on we have so multiplying with we get . Therefore
To prove that goes to we can still work with . Note that the negative part cannot get too big:
As for the positive part, taking we have
Next, note that on
We would need that the last term be larger than . This is equivalent to . Since is continuous on , it is bounded above, so some delta small enough exists in order for this to work.
Grouping all of the above we get that
Since we get that goes to .