# What is the probability of $\cos(\theta_1) + \cos(\theta_2) + \cos(\theta_1 - \theta_2) + 1 \le 0$?

What is the probability of $\cos(\theta_1) + \cos(\theta_2) + \cos(\theta_1 - \theta_2) + 1 \le 0$ given that $\theta_1$ and $\theta_2$ are chosen randomly between $0$ and $2\pi$?

• What have you attempted ? You should show that you have already worked on the question you ask... Oct 21, 2016 at 22:02
• 1) Do you agree with my solution ? 2) I would be very interested by knowing the origin of this interesting problem because I have another related question that I have just submitted (math.stackexchange.com/q/1982170) and hopefully may interest you. Oct 24, 2016 at 9:50

Let us denote:

$$\tag{1}f(\theta_1,\theta_2):=\cos(\theta_1) + \cos(\theta_2) + \cos(\theta_1 - \theta_2) + 1.$$

Using relationships:

$$\cos(a)+\cos(b)=2 \cos\left(\frac{a+b}{2}\right)\cos\left(\frac{a-b}{2}\right)$$

$$1+\cos(a)=2\cos\left(\frac{a}{2}\right)^2,$$

one can write $f(\theta_1,\theta_2)$ under a product form:

$$\tag{2} f(\theta_1,\theta_2)=4 \cos\left(\dfrac{\theta_1}{2}\right) \cos\left(\dfrac{\theta_2}{2}\right)\cos\left(\dfrac{\theta_1-\theta_2}{2}\right) \le 0$$

Thus the discussion on inequation

$$\tag{3} f(\theta_1,\theta_2)\le 0$$

amounts to a regionalization of the domain $(\theta_1,\theta_2) \in [0,2\pi) \times [0,2 \pi)$, materialized by the square ABCD (see graphics below).

More precisely, the regions where inequality (3) is verified are determined by their boundaries (characterized by an occurence of a transition between positive and negative values):

$$\text{for factors } \ \begin{cases}\cos(\theta_1/2):&\text{line FG with equ.} \ \theta_1=\pi \\\cos(\theta_2/2):&\text{line EH with equ.} \ \theta_2=\pi\\ \cos((\theta_1-\theta_2)/2):&\text{lines EF and GH with equ.} \ \theta_1-\theta_2=\pm\pi\end{cases}$$

These boundaries define 6 regions. Which regions are the good ones ?

Determining the sign of $f(\theta_1,\theta_2)$ for each region can be done by obtaining the sign of each factor; the regions to be selected are those where the product of these 3 signs is negative.

This process, rather long, generates a kind of checkerboard pattern (one and only one sign changes when a boundary is crossed). Whence the idea of a simpler method: it suffices to test a single point inside an arbitrary region, color this region in white (resp. red) according to the sign of $f(\theta_1,\theta_2)$ [negative (resp. positive)], then color all the neighbouring regions with the opposite color, etc...

For example, the lower left square AGIE, tested positive because $f(\theta_1,\theta_2)>0$ for test point $J(\theta_1,\theta_2)=(\pi/2,\pi/2),$ will be colored red. Its neighbouring regions, EFI and GHI, will then be colored in white, etc...

In a last step, the areas of the white regions are added, and the result is the ratio between this sum of areas and the area of the square. One finds in this way

$$\text{Probability} \ = \ \frac{1}{4}.$$

• No hurry. The graph is readable as it. I just thought that would be a nice improvement. Have a good sleep. Oct 22, 2016 at 0:08
• @Ian Miller New graphics available. Oct 22, 2016 at 18:01
• +1 May I ask what software you use to plot these elegant graphs @JeanMarie? Is it Mathematica?
– msm
Oct 24, 2016 at 0:25
• @msm It's Geogebra. I'm a rather recent user, discovering that this software is a wonderful swissknife ! Oct 24, 2016 at 7:33
• @JeanMarie It should be. Thank you for sharing that.
– msm
Oct 24, 2016 at 9:12