Friday, November 25, 2011

Basic Mathematics of "Angry Birds" (Tuklas Vol. 13, No. 2 - Nov. 26, 2011)

BASIC MATHEMATICS OF "ANGRY BIRDS"

"Angry Birds" has been a popular touchscreen game that quenched the boredom and leisure of many since its inception in 2010. The mathematics behind the "Angry Birds" is found in describing the path that the bird takes to get to its target. Figure 1 provides a schematic diagram of the game. The goal is to launch the bird, by drawing the slingshot, to target green pigs situated on the other side of the screen. There is a story line behind the animosity the birds have over the pigs, but it suffices to say that they are motivated enough to sacrifice themselves as avian cannonballs. 

Figure 1: Schematic diagram of the "Angry Birds" game. The inset is
a zoomed-in version of the bird on the slingshot.
With a bird riding on it, the slingshot is drawn tight such that it makes a certain angle \(\theta\) with respect to the horizontal within the reasonable interval \( \left[0,\frac{\pi}{2}\right] \). This is referred to as the launching angle. It is also the angle between the horizontal and an arrow that represents the take-off velocity of the bird (see zoomed-in inset of Fig. 1). When the slingshot is released, the bird takes off with initial speed \(v_0\) in the direction denoted by the arrow. 

Since the game is laid in 2d (i.e., on a plane), then position can be described by coordinates \( (x,y) \), where \(x\) denotes position along the horizontal axis and \(y\) position along the vertical axis. Let us take the origin of the axis as the launching point for the angry bird, i.e., \( (0,0) \) as depicted in Fig. 1. The position of the target (e.g., the green pig) is at \( (p,q) \). For the sake of simplicity, let us take \( q \approx 0 \) (i.e., the target is situated at a vertical level close to the level from which the bird is launched). 

During its flight, the bird changes its position \( (x,y) \) so that \( x = x(t) \) and \( y = y(t) \) are functions of time \(t\). This motion, known as projectile motion, is a combination of both the forward horizontal motion and falling vertical motion. Indeed, not all falling objects fall straight down to the ground. It all depends on how the object is launched. Thanks to Galileo Galilei and Isaac Newton, who laid the foundations of our current understanding about objects in motion in the 17th century, we can write down the mathematical equations to quantify motion. 

The displacement is generally a product of the speed of motion and time. According to the findings of Galileo, the bird's horizontal speed should not change throughout its flight since nothing is pushing the bird to move forward horizontally (Note: the game always takes place on a windless day so that one can conveniently neglect the effect of air). That means \( x(t) = (v_0 \cos \theta) t \) where \(v_0 \cos \theta \) is the component of the bird's initial motion along the horizontal axis. On the other hand, some invisible agent is pulling the bird down so that it is bound to fall back to the ground. According to Newton, this agent is known as gravity which makes falling objects close enough to the ground (i.e., anything lower than Mt. Everest) gain speed at a constant rate, \(g\), on its way down. Consequently, \( y(t) = (v_0 \sin \theta) t - g\left(\frac{t^2}{2}\right) \), where \( v_0 \sin \theta \) is the component along the vertical axis of the bird's initial motion. In summary, the equations of motion in terms of time t are: \[ \begin{align} x(t) &= (v_0 \cos \theta) t \\ y(t) &= (v_0 \sin \theta) t - g\left(\frac{t^2}{2}\right) \end{align} \]
By eliminating \(t\), an equation for \( y = y(x) \) can be written as follows,  \[ y(x) = (\tan \theta)x - \left(g\frac{{v_0}^2}{2}{\cos}^2 \theta\right)x^2 \] which is an equation for a parabola (concave downward) on the Cartesian plane. Indeed if you observe the paths traced out in the game, they do resemble the parabola.

What is more interesting is that one could maximize the range (i.e.,how far the bird projectile would land away from the slingshot for any given initial speed \(v_0\)
) by simply adjusting the launching angle. In order to determine the optimal angle \(\theta^{\ast}\), one solves for \(t\) for \( y = q \approx 0 \). This leads to a quadratic equation whose roots are: \[ t^{\ast} = 0 \text{ and } t^{\ast} = \frac{1}{g}(2 v_0 sin \theta) \] 

The only relevant solution is the latter one, which is now used to determine the final position \( x(t^{\ast}) \). The range \(R\) is simply the difference between the horizontal position of the angry bird, i.e., \( x(0) = 0 \) and the final position; hence,  \[ R= (v_0 \cos \theta)t^{\ast} = (v_0 \cos \theta)\left(\frac{1}{g}\right)(2v_0 \sin \theta) = \left(\frac{1}{g}\right)({v_0}^2 \sin 2\theta) = R(\theta). \]
By using the basic concepts of differential calculus, \(R(\theta)\) is maximized such that \(\frac{dR}{d\theta} = 0 \) and \(\frac{d^2R}{d^2\theta} < 0\). Hence, \[ \begin{eqnarray*} \left.\frac{dR}{d\theta}\right|_{\theta=\theta^*} &= & \left.\frac{v_0^2}{g}\left(2\cos2\theta\right)\right|_{\theta=\theta^*} =0\\ & &\Rightarrow \cos2\theta^* = 0 \Rightarrow 2\theta^* = \frac{\pi}{2} \Rightarrow \theta^* = \frac{\pi}{4} \equiv 45^{\circ}\, . \end{eqnarray*} \]

Consequently, \(\frac{d^2R}{d^2\theta} = -\sin 2\theta < 0 \) for \( \theta = \theta^{\ast} \). Therefore, \( \theta^{\ast} = 45^{\circ}\) does give the maximum range. This can be verified through the game. One would see that if \(\theta > 45^{\circ}\), the angry bird can go up so high but does not really travel forward by as much. On the other hand, if \(\theta\) is too small, the bird lands on the ground right away before being able to move appreciably forward.

So next time you play "Angry Birds", find a protractor and mark your screens with the special angle \(45^{\circ} = \frac{\pi}{4}\). I
t might be quite useful in aiming for those nasty swines.

ABOUT THE AUTHOR:
Dranreb Earl Juanico is an Assistant Professor at the Ateneo de Manila University. He obtained his B.S., M.S., and Ph.D. in Physics at the University of the Philippines in 2002, 2004 and 2007, respectively.

OLYMPIAD CORNER
from the 14th Turkish Mathematical Olympiad, 2006

Problem: Points \(E\) and \(F\) on side \(CD\) of a convex quadrilateral \(ABCD\) are given such that \(DE = FC\). The circumcircles of triangles \(ADE\) and \(ACF\) meet again at \(K\) and those of \(BDE\) and \(BCF\) meet again at \(L\). Show that the points \(A, B, K, L\) lie on a circle.

Solution: 

Let \(M\) be intersection of \(DC\) and \(AK\), and \(N\) be theintersection of \(DC\) and \(BL\). Based on  the powers of the point \(M\) with respect to the circles \(ADE\) and \(AFC\), we have \[ ME\cdot MD=MK\cdot MA=MF\cdot MC \hspace{20px} (1) \]
Using the derived equality \(ME\cdot MD=MF\cdot MC\) and the given \(DE=FC\),\[ \begin{align*} ME\cdot MD &= MF\cdot MC \\ ME\cdot ( ME+DE) &= MF\cdot ( MF+FC) \\ (ME)^2+ME\cdot DE &= ( MF)^2+MF\cdot FC \\ (ME)^2+ME\cdot DE &= (MF)^2+MF\cdot DE \\ (ME)^2-(MF)^2+ME\cdot DE-MF\cdot DE &= 0 \\ (ME-MF)(ME+MF)+DE(ME-MF) &= 0 \\ (ME-MF) (ME+MF+DE) &= 0 \end{align*} \] Noting that \(ME+MF+DE>0\), then \(ME=MF\) and hence \(M\) is the midpoint of segment \(FE\). Since \(DE=FC\), then \(MD=MC\) and therefore \(M\) is the midpoint of segment \(CD\).

Likewise, based on the powers of point \(N\), we have \[ NE\cdot ND=NL\cdot NB=NF\cdot NC \hspace{20px} (2) \] where can it also be shown, using the same arguments as above, that \(N\) is the midpoint of segment \(CD\). Hence \(M\) and \(N\) represent the same point.

From \((1)\) and \((2)\), we have \[ MK\cdot MA\underset{(1)}{=}ME\cdot MD\underset{M=N}{=}NE\cdot ND\underset{(2)}{=}NL\cdot NB\underset{M=N}{=}ML\cdot MB \] which tells us that \(A,B,K,L\) all lie on a circle. 

PROBLEMS
  1. Evaluate \[1+\frac{1}{2}+\frac{2}{2}+\frac{1}{2}+\frac{1}{3}+\frac{2}{3}+\frac{3}{3}+\frac{2}{3}+\frac{1}{3} +\ldots+\frac{1}{n}+\frac{2}{n}+\ldots+\frac{n}{n}+\frac{n-1}{n}+\ldots+\frac{1}{n}.\]
  2. \(ABCD\) is a square, \(E\) and \(F\) are the midpoints of the sides \(AB\) and \(BC\) respectively. If \(M\) is the point of intersection of \(CE\) and \(DF\), prove that \(AM\) = \(AD\).
  3. If \(A, B\) and \(C\) are the measurements of the angles in each of the vertices of the triangle \(ABC\), show that \[ \cos A + \cos B + \cos C \leq \frac{3}{2}. \]
We welcome readers to submit solutions to the problems posed below for publication consideration. Solutions must be preceded by the solver's name, school affiliation and year level. The deadline for submission is December 3, 2011 (extended to December 10, 2011).

Thursday, November 17, 2011

Invariance (Tuklas Vol. 13, No. 1 - Nov. 19, 2011)

INVARIANCE

Consider this scenario: At first, a room is empty. Each minute, either one person enters or two persons leave. After exactly \(3^{1999}\) minutes, could the room contain \(3^{1000}+2\) people?

Problems such as this present a significant level of shock factor to those who would encounter them for the first time. Of course, we can always try to use brute force in solving problems like these, but it is highly impractical. So instead of trying to deal with the mess and complexity of the problems head on, it would be wise for us to "reduce" them by only considering the essential properties or entities that such problems possess. There are many ways in which we can do this, but for this article, we are mainly focusing on determining invariants.

As the term implies, an invariant is an aspect of a problem that does not change, even if the conditions and other properties of the problem do change. It can be numeric or non-numeric in nature, though in most cases, it is found to be a numerical quantity. 

An example of an invariant can be seen in Euler's Formula. This formula states that there is a relationship between the number of edges (\(e\)), vertices (\(v\)) and faces (\(f\)) of a polyhedron without "holes", in particular \[v - e + f = 2\] Meaning whether the polyhedron is a cube, a tetrahedron or a "buckyball", the quantity \(v-e+f\) is always equal to 2, and as such, it is an invariant. 

Now let us return to the problem posed at the beginning of the article. We can start by making a general case, wherein we let \(n\) be the number of people in the room. After one minute, there will be either \(n+1\) or \(n-2\) people. Note that the difference between the two possible outcomes is 3. The next minute, the possible number people in the room can be \(n+2, n-1\) or \(n-4\). Observe that the difference between any two outcomes is either a 3 or 6. 

In the long run, we can actually conclude that, at any fixed time \(t\), the possible values for the population of the room differ from one another by a multiple of 3. 

So after \(3^{1999}\) minutes, it would be possible for us to have \(3^{1999}\) people in the room (this means that 1 person comes in after every minute.). Based on our conclusion above, the other possible populations of the room should differ \(3^{1999}\) by a multiple of 3. And since \(3^{1999}\) is a multiple of 3, hence the other population outcomes should also be a multiple of 3. This means therefore that \(3^{1000}+2\) will not be a valid population. 

The problem above gave us an example of a divisibility invariant (divisible by 3). The simplest divisibility invariant is parity, which merely refers to the oddness or evenness of a number. This concept will be explored in greater detail through the following problems. 

Let \(a_1, a_2, \ldots, a_n\) represent an arbitrary arrangement of the numbers \(1, 2, 3, \ldots, n\). Prove that if \(n\) is odd, the product \[(a_1 - 1)(a_2 - 2)(a_3 - 3)\ldots(a_n - n)\] is an even number. 

What we can do here is consider the sum of the terms.  \[\begin{align*} (a_1 - 1)(a_2 - 2)(a_3 - 3)\ldots(a_n - n) & = (a_1 - 1)(a_2 - 2)(a_3 - 3)\ldots(a_n - n)-(1+2+...+10) \\ & = (1+2+...+10) - (1+2+...+10) \\ & = 0 \end{align*} \]

The sum therefore is an invariant, since its always equal to zero (an even number), regardless of the arrangement of the numbers. Since the number of terms is odd, the only possible way for them to have an even sum is for the \(n\) terms to have at least one even number. This basically solves the problem. 

In the figure below you may switch the signs of all numbers of a row, column, or a parallel to one of the diagonals. In particular, you may switch the sign of each square corner square. Prove that at least one -1 will remain in the table.

1111
1111
1111
1-111

Let \(S\) represent the eight boundary squares (except the four corners). We note that the product of those squares is equal to -1. After every transformation, it is either none get switched (this is in the event that the sign of the corner square is altered), or two of the squares in \(S\) get switched: 

1 and 1 becomes -1 and -1,
-1 and -1 becomes 1 and 1,
1 and -1 becomes -1 and 1,
-1 and 1 becomes 1 and -1.

Since the product of the resulting pair is the same as the original pair, the product of the squares in \(S\) will always remain at -1. This means that there will always be at least one -1 in the table. 

The vertices of a cube are labeled \(a, b, c, d, w, x, y, z\) as seen in the figure. Vertices \(a\) and \(c\) are initially given a value of 1, while the rest of the vertices are given a value of 0. If you are allowed to add 1 to each of any pair of adjacent vertices, can you eventually get all the vertices to have the same value? 


You can actually get your hands dirty for this problem, and no matter what you do, you will not be able to get the desired result of making all values equal. But how can you prove this? 

We can let \(s_1 = a + c + w + y\) and \(s_2 = b + d + x + z\). Hence at the start, \(s_1 -s_2 = 2\). The end result we want is such that all the vertices will have the same value; this implies therefore that \(s_1 - s_2 = 0\). 

What happens when we add 1 to each of any pair of adjacent vertices? Notice that every time we pick such a pair, one of them belongs to \(s_1\), and the other belongs to \(s_2\). Therefore each time we perform the process, 1 is added to both \(s_1\) and \(s_2\). This makes the difference \(s_1 - s_2\) remain equal to 2, which means it is actually an invariant. 

Since the difference can never be equal to 0, thus we can conclude that we cannot get all the vertices to have the same value.

ABOUT THE AUTHOR:
Timothy Robin Teng is an Instructor at the Ateneo de Manila University. He is currently finishing his Ph.D. in Mathematics at the same university.

OLYMPIAD CORNER  
from the 17th Asian Pacific Mathematics Olympiad, March 2005

Problem: Prove that for every irrational real number \(a\), there are irrational real numbers \(b\) and \(b^{\prime}\) such that \(a+b\) and \(ab^{\prime}\) are both rational while \(ab\) and \(a+b^{\prime}\) are both irrational.

Solution: 
Let \(a\) be an irrational number. We first show that there exists an irrational number \(b\) such that \(a+b\) is rational and \(ab\) is irrational.

For this, we consider the number \(a^2\). If \(a^2\) is irrational, let \(b=-a\). Then \(a+b=a-a=0\) is rational, and \(ab=a(-a) =-a^2\) is irrational. If, on the other hand, \(a^2\) is rational, let \(b=a^2-a\) (difference between a rational and irrational number). Then \(a+b=a+(a^2-a)=a^2\) is rational, and \(ab=a(a^2-a)=a^2(a-1)\) is irrational (product of a rational number \(a^2\) and irrational number \(a-1\)).

We next show that there exists an irrational number \(b^{\prime}\) such that \(ab^{\prime}\) is rational and \(a+b^{\prime}\) is irrational. Let \[ b^{\prime}=\frac{1}{a} \text{ or }b^{\prime }=\frac{2}{a}. \]
Then \(ab^{\prime}\) is a rational number, which has a value of either 1 or 2. Now note that
\[ a+b^{\prime}=\frac{a^2+1}{a}\text{ or  }a+b^{\prime}=\frac{a^2+2}{a}. \]
Next we take the difference, \[ \frac{a^2+2}{a}-\frac{a^2+1}{a}=\frac{1}{a} \] where the result is an irrational number. This implies that at least one of \(\frac{a^2+1}{a}\) and \(\frac{a^2+2}{a}\) is irrational (both of them cannot be rational since the difference of two rational numbers is a rational number). This shows that there exists an irrational \(b\) such that \(a+b^{\prime}\) is irrational.
 
PROBLEMS

  1. From 2011 subtract half of it at first, then subtract \(\frac{1}{3}\)of the remaining number, next subtract \(\frac{1}{4}\) of the remaining number, and so on, until \(\frac{1}{2011}\) of the remaining number is subtracted. What is the final remaining number?
  2. In triangle \(ABC\), \(\angle A = 96^{\circ}\). Extend \(BC\) to an arbitrary point \(D\). The angle bisectors of \(\angle ABC\) and \(\angle ACD\) intersect at \(A_1\), and the angle bisectors of \(\angle A_1BC\) and \(\angle A_1CD\) intersect at \(A_2\), and so on. The angle bisectors of \(\angle A_4BC\) and \(\angle A_4CD\) intersect at \(A_5\). Find the size of \(\angle A_5\) in degrees.
  3. Let \(a_1 , \ldots , a_n, b_1, \ldots , b_n\) be positive numbers, prove that \[ \sum_{i=1}^{n}{\frac{1}{a_{i}b_{i}}}\sum_{i=1}^{n}(a_{i}+b_{i})^{2} \geq 4n^{2}. \]
We welcome readers to submit solutions to the problems posed below for publication consideration. Solutions must be preceded by the solver's name, school affiliation and year level. The deadline for submission is November 26, 2011.

PEM Class List (Teachers)

PROGRAM FOR EXCELLENCE IN MATHEMATICS 2011-2012 
Teachers Part I: November 26 and December 10, 2011

Module 1
Problem Solving Strategies
Schedule: Sat, 9:30-11:30AM
Teacher:
Dr. Ma. Alva Aberin

Room: CTC 102


#
School
Last Name
First Name
M.I.
Attendance
OC
1
2
1
Caloocan High School
Bataller
Liza
D.A.
Y


2
Caloocan High School
Corona
Generieve
B.
Y


3
Caloocan High School
Rubino
Erlan
P.
Y


4
Colegio San Agustin - Makati
Gacutan
Rolando
B.
Y


5
Colegio San Agustin - Makati
Llanto
Paolo
A.
Y


6
Colegio San Agustin - Makati
Maristela
Jasmin
D.
Y


7
Immaculate Conception Academy
Baranda
Agnes
D.
Y


8
Lourdes School of Mandaluyong
Arpia
Dionelyn
S.
Y


9
Lourdes School of Mandaluyong
Duavit
James
V.
Y


10
Lourdes School of Mandaluyong
Sebastian
Modesto Jr.
C.
Y


11
Lourdes School Quezon City
Dela Cruz
Carlo
R.
Y


12
Lourdes School Quezon City
Lim
Carmela
D.
Y


13
Lourdes School Quezon City
Lumbre
Angelina
P.
Y


14
Manila Science High School
Aniban
Diana Grace
B.
Y


15
Manila Science High School
Pollo
Anancita
L.
Y


16
Manila Science High School
Ramirez
Julie Anne
O.
Y


17
Notre Dame of Greater Manila
Geraldoy
Rodel
V.
Y


18
Notre Dame of Greater Manila
Narciso
Ma. Rizaliana
D.C.
Y


19
PAREF Southridge School
Alcaraz
Rex

Y


20
PAREF Southridge School
Tadeo
Jigs
T.
Y


21
PAREF Southridge School
Tamayao
Nancisco
S.
Y


22
Philippine Pasay Chung Hua Academy
Espina
Esterlita
D.
Y


23
Philippine Pasay Chung Hua Academy
Franco
Helen
L.
Y


24
Philippine Science High School - Main
Granada
Kiel
F.
Y


25
San Sebastian College Manila
Fernandez
Marilyn

Y


26
San Sebastian College Manila
Noblejas
Marissa

Y


27
St. Matthew College
dela Cruz
James Robin
R.
Y


28
St. Scholastica's College, Manila
Muli
Eduardo, Jr.
D.
Y


29
St. Scholastica's College, Manila
Soto
Antonio

Y


30
St. Theresa's College of Quezon City
Abriol
Dave

Y


31
St. Theresa's College of Quezon City
Narvaez
Marvin

Y


32
St. Theresa's College of Quezon City
Viloria
Khriztoffer

Y


33
Uno High School
Ang
Kurt Byron
C.
Y


34
Uno High School
Rosario
Jay-Ar
S.
Y


35
Xavier School
Bague
Adelaida
H.
Y


36
Xavier School
Hernandez
Linda May
S.
Y