Archive

Posts Tagged ‘trigonometry’

Geometry problem: a property of the 30-70-80 triangle

December 4, 2022 Leave a comment

Consider a triangle {XYZ} with angles {\angle X = 70^\circ}, {\angle Y = 30^\circ}, {\angle Z = 80^\circ}. Let {ZT} be the bisector of the angle {\angle XZY}. Consider {U \in XZ} such that {UT || YZ}. Prove that the triangle {YUZ} is isosceles. 

Read more…

Weitzenböck’s inequality

June 2, 2022 3 comments

Given a triangle {\Delta ABC}, denote by {a,b,c} the lengths of the sides opposite to angles {A,B,C}. Also denote by {S} the area of the triangle. Weitzenbrock’s inequality states that the following holds:

\displaystyle a^2+b^2+c^2 \geq 4\sqrt{3}S.

There are multiple ways of proving this inequality. Perhaps one of the most straightforward ways to approach this is to use the law of sines and trigonometry. We have {a=2R\sin A} where {R} is the circumradius. Moreover, {R} is related to {S} by {R= \frac{abc}{4S}}. Thus

\displaystyle S = \frac{abc}{4R} = \frac{8R^3 \sin A\sin B\sin C}{4R} = 2R^2 \sin A\sin B\sin C.

Therefore the original inequality is equivalent to

\displaystyle \sin^2A +\sin^2 B+\sin^2 C \geq 2\sqrt{3} \sin A \sin B\sin C.

One would be tempted to try the arithmetic geometric mean inequality here, but that cannot work, since the inequality is not homogeneous and {A,B,C} are not free, they verify {A+B+C=\pi}. However, note that the function {\sin} is concave on {[0,\pi]} therefore, applying Jensen’s inequality we get

\displaystyle \sin A+\sin B+\sin C \leq 3\frac{\sqrt{3}}{2}.

As a consequence, using cyclic sums over {A,B,C}, we get

\displaystyle \frac{3\sqrt{3}}{2} \sum \sin^2 A \geq \sum \sin^2 A \sum \sin A\geq 9 \sin A\sin B\sin C,

where for the last inequality above we applied AM-GM inequality two times. Regrouping we obtain exactly

\displaystyle \sin^2A +\sin^2 B+\sin^2 C \geq 2\sqrt{3} \sin A \sin B\sin C,

which is equivalent to the original inequality. Note that with the same ideas we have

\displaystyle \frac{3\sqrt{3}}{2} \sum \sin A\sin B \geq \sum \sin A\sin B \sum \sin A\geq 9 \sin A\sin B\sin C,

showing that we also have

\displaystyle \sin A\sin B+\sin B\sin C+\sin C\sin A \geq 2\sqrt{3} \sin A \sin B\sin C.

Observe that the equality can hold only if the triangle is equilateral.

This leads to the stronger inequality

\displaystyle ab+bc+ca\geq 4\sqrt{3}S.

Other proofs can be found in the Wikipedia article.

It can be observed that combining the above inequalities we can get the isoperimetric inequality for triangles

(a+b+c)^2 \geq 12\sqrt{3}S,

where the equality holds if and only if the triangle is equilateral.

Find coefficients of trigonometric polynomial given samples

January 27, 2022 Leave a comment

Suppose the values {v_i} of some trigonometric polynomial

\displaystyle p(\theta) = a_0+\sum_{k=1}^N (a_k\cos(k\theta)+b_k\sin(k\theta))

are known for a set of distinct angles {\theta_i \in [0,2\pi]}, {i=1,...,M}

Question: Recover the coefficients of the trigonometric polynomial {p} that verify {p(\theta_i) = v_i} when {M = 2N+1} or which best fits the values {v_i} in the sense of least squares when {M>2N+1}

Answer: Obviously, since there are {2N+1} unknowns, we need at least {2N+1} equations, therefore we restrict ourselves to the case {M\geq 2N+1}. The equalities {p(\theta_i) = v_i} produce a set of {M} equations which has at most a solution when {M \geq 2N+1}, provided the rank of the matrix of the system is {2N+1}. Define the function

\displaystyle f(x) = \sum_{i=1}^{M}(a_0+\sum_{k=1}^N (a_k\cos(k\theta_i)+b_k\sin(k\theta_i)) - v_i)^2.

This function is a sum of squares, which has zero as a lower bound. The function {f} can be written using norms as {f(x) = \|Ax-v\|^2} where

\displaystyle A = \begin{pmatrix} 1 & \cos \theta_1 & ... & \cos (N\theta_1) & \sin\theta_1 & ... & \sin(N\theta_1) \\ \vdots & \vdots & \ddots & \vdots & \vdots & \ddots & \vdots \\ 1 & \cos \theta_M & ... & \cos (N\theta_M) & \sin\theta_M & ... & \sin(N\theta_M) \end{pmatrix}, x = \begin{pmatrix} a_0\\ a_1\\ \vdots \\ a_N \\ b_1 \\ \vdots \\ b_N \end{pmatrix}, v = (v_1,...,v_M)^T

A straightforward computation shows that the gradient of {f} is

\displaystyle \nabla f(x) = A^TAx-A^Tv.

The {(2N+1)\times (2N+1)} matrix {A^TA} is invertible, provided all angles {\theta_i,\ i=1,...,M} are distinct. This is a direct application of the formula of the Vandermonde determinant: using operations on columns you can recover the Vandermonde matrix corresponding to {x_j = e^{i\theta_j}}. Therefore, one can always solve the system {\nabla f(x) = 0} when {M\geq 2N+1} and {x^* = (A^TA)^{-1}A^Tv} will minimize {f}. In particular, when {M=2N+1} the minimum will be equal to zero and the coefficients of the trigonometric polynomial verifying {p(\theta_i) = v_i} will be found. When {M>2N+1} the best fit, in the sense of least squares, of the values {v_i} with a trigonometric polynomial will be found.

Below, you can find a Python code which solves the problem in some particular case.

import numpy as np
import matplotlib.pyplot as plt

N = 5 # coeffs
M = 2*N+1 # M>=2N+1 samples

# function to be approximated
def fun(x):
    return np.sin(x+np.sqrt(2))+0.3*np.sin(5*x-np.sqrt(3))+0.1*np.sin(8*x-np.sqrt(7))

thetas =np.linspace(0,2*np.pi,M,endpoint=0)
dthetas =np.linspace(0,2*np.pi,1000,endpoint=1)

# values of the function at sample points
vals = fun(thetas)

A = np.zeros((M,2*N+1))

# construct the matrix of the system
A[:,0] = 1
for i in range(0,N):
    A[:,i+1] = np.cos((i+1)*thetas)
    A[:,N+i+1] = np.sin((i+1)*thetas)

coeffs = np.zeros(2*N+1)


B = (A.T)@A
print(np.shape(B))

# solve the system to find the coefficients
coeffs = np.linalg.solve(B,A.T@vals)

# function computing a trigonometric polynomial
def ptrig(x,c):
    res = np.zeros(np.shape(x))
    res = c[0]
    n = len(c)
    m = (n-1)//2
    for i in range(0,m):
        res = res+c[i+1]*np.cos((i+1)*x)+c[i+m+1]*np.sin((i+1)*x)
    return res

vals2 = ptrig(thetas,coeffs)

# plotting the result
plt.figure()
plt.plot(thetas,vals,'.b',label="Sample values")
plt.plot(dthetas,fun(dthetas),'g',label="Original function")
plt.plot(dthetas,ptrig(dthetas,coeffs),'r',label="Fitted trigonometric polynomial")
plt.legend()
plt.savefig("TrigPoly.png",dpi=100,bbox_inches='tight')
plt.show()

For the parameters chosen above the program outputs the following result. You can play with the input parameters to observe the changes.

Putnam 2019 – Problem B2

March 11, 2020 Leave a comment

B2. For all {n \geq 1}, let

\displaystyle a_n = \sum_{k=1}^{n-1} \frac{\sin\left( \frac{(2k-1)\pi}{2n}\right) }{\cos^2\left(\frac{(k-1)\pi}{2n}\right) \cos^2\left( \frac{k\pi}{2n}\right)}.

Determine

\displaystyle \lim_{n \rightarrow \infty} \frac{a_n}{n^3}.

Read more…

Putnam 2019 A2

March 3, 2020 5 comments

A2. In the triangle {\Delta ABC}, let {G} be the centroid, and let {I} be the center of the inscribed circle. Let {\alpha} and {\beta} be the angles at the vertices {A} and {B}, respectively. Suppose that the segment {IG} is parallel to {AB} and that {\beta = 2\tan^{-1}(1/3)}. Find {\alpha}.

Read more…

Putnam 2018 – Problem B4

February 8, 2019 Leave a comment

B4. Given a real number {a}, we define a sequence by {x_0=1}, {x_1=x_2=a} and {x_{n+1} = 2x_nx_{n-1}-x_{n-2}} for {n \geq 2}. Prove that if {x_n =0 } for some {n}, then the sequence is periodic.

Putnam 2018, Problem B4

Solution: The path to the solution for this problem is really interesting. The first question that pops in mind when seeing the problem is: How do I prove that a sequence is periodic?. It’s not obvious from the given recurrence relation that this should happen, and what’s with the condition {x_n = 0}?

Read more…