• We continue with our study of triangles in this post. We will consider a few elementary rules related to triangles. I will also give some comments on what we can glean from some of the rules. Here, I wish to apologize to the reader. Typesetting mathematical formulas using HTML is too tedious. Hence, I have typeset them using MS Word and have just included images of the derivations.

    Sine Rule

    The first set of relations we will derive are known as the sine rule. We use the properties that

    1. the angle subtended by a chord of a circle at the center of the circle is twice the angle subtended at the circumference of the circle and
    2. the altitude from the apex of an isosceles triangle to the opposite side bisects the opposite side.

    We first consider the case of an acute angled triangle, shown below.

    Here, ABC is the triangle and the circle is its circumcircle, meaning that O is the circumcenter. We consider the chord BC and hence ∠BOC = 2 ∠BAC. Also, since OB and OC are radii of the circle, triangle OBC is isosceles. Also, since OD is the altitude from O to BC, BD = CD. Hence, triangle OBD is right angled at D. This gives us

    In a similar way we can prove

    If triangle ABC is right angled at A, we get the following diagram

    The other relations can be derived in similar way when the right angle is at B or C.

    When triangle ABC has an obtuse angle at A we get the following diagram

    The other relations can be derived in similar way when the obtuse angle is at B or C.

    In all three cases, whether the triangle is acute, right, or obtuse angled, we have obtained

    The sine rule indicates that the ratio of the length of a side to the sine of the angle opposite the side is a fixed for a given triangle. This means that the longer the side the larger must be the sine of the angle opposite the side. And since the sine function is an increasing function, this means that the side opposite larger angles must be longer, which is a fundamental theorem of geometry.

    Cosine Rule

    The second set of rules is known as the cosine rule. Again we have three cases.

    If C is an acute angle then, with reference to the figure below

    If C is a right angle then, with reference to the figure below,

    If C is obtuse then, with reference to the figure below,

    The cosine rule can be summarized as

    The cosine rule has the square of the side opposite an angle being subtracted in the numerator. This means that the longer the opposite side, the smaller the cosine. And since the cosine function is a decreasing function, this means that the smaller cosine maps to a larger angle. In other words, the cosine rule too tells us that the side opposite the larger angle is the longer side.

    Projection Rule

    The third set of rules is the projection rule. Again, we have three cases.

    If C is acute then, with reference to the figure below,

    Here, CD is the ‘projection of CA onto BC, while BD is the ‘projection’ of BA onto BC, which is why this rule is so named.

    If C is a right angle then, with reference to the figure below,

    If C is an obtuse angle then, with reference to the figure below,

    We have proved the projection rule for all three cases for C. Hence, we can obtain

    Napier’s Analogy

    The fourth set of rules is known as Napier’s analogy. Now, by the sine rule we have

    We now use an algebraic process known as componendo-dividendo. Let me explain this briefly.

    Suppose we know that

    Then, we can conclude that

    Let us prove this before we proceed with Napier’s analogy.

    Suppose

    Then

    This gives us

    From this we can obtain

    and

    Since

    we can conclude that

    Now, returning to Napier’s analogy, we have

    This means that

    Hence, we can conclude that

    Half Angle Formula – Sines

    The fifth set of rules are the formulas for the sines of half the angles of the triangle. Using the cosine rule we can obtain

    Hence, we can collate this as

    Half Angle Formula – Cosines

    The sixth set of rules are the formulas for the cosines of half the angles of the triangle. Once again, using the cosine rule we get

    We can collate this as

    Half Angle Formula – Tangents

    We can combine the previous two results to get

    This gives us

    Area of Triangle

    We know that the area of a triangle is half the product of its base and its height. The figures below show the cases where C is acute, right, and obtuse. In each case it is clear that the height of the triangle is b sin C = c sin B, which is simply a rearrangement of the sine rule. The base of the triangle is a. Hence, the area of the triangle is

    We can understand this as half the product of two sides and the sine of the angle included between the two sides. This gives us

    Also, since

    which gives us

    We can also obtain Heron’s formula as follows

    We have obtained many basic formulas related to triangles in this post. In the next post, we will obtain formulas relating the radii of various circles to the lengths of sides and trigonometric ratios of the angles of the triangle. However, since I am traveling this week, I will not be posting anything next week. I will resume on 30 October 2026.

  • In the previous post, Primer to Properties of Triangles, I had solved a geometry problem based on properties of the equilateral and right-angled triangles. I promised that I would use that as a launching pad for a series on Properties of Triangles. Students of mathematics are introduced to triangles and circles quite early in their schooling. And these geometric figures recur over the years with deeper concepts being introduced every time. Hence, even though students are introduced to the name and some basic properties of these figures as early as Grade 1, they find themselves still learning about them in Grade 12! I would like us to go on that journey, albeit in a much more accelerated manner, and beyond, addressing some arcane properties that are rarely taught in school. This series deals with triangles. We will consider circles in a later series. In this post, I only wish to take us though the nomenclature we will follow while discussing the various features related to the triangle ABC.

    A triangle, of course, is a simple closed geometric figure composed of three line segments that form three angles. We will use the following convention when speaking of sides and angles of a triangle. For the triangle ABC, the vertices will be denoted using the corresponding letters A, B, and C. The measures of the internal angles of the triangle will also be denoted with the italicized upper case A, B, and C. The sides will be denoted using the letters of the vertices that form the endpoints of the side. The length of the side opposite a given vertex will be denoted with the lower case a, b, and c.

    Hence, a is the length of BC, b the length of CA, and c the length of AB. Note that I denoted a side as CA rather than as AC. This is to preserve the cyclical order of the vertices, which will become important later when we need to memorize increasingly complicated formulas. Using this convention, we have the following figure.

    In many of the formulas we will derive, another quantity, namely the semi-perimeter will feature prominently. The perimeter of a triangle, of course, is the sum of the lengths of the three sides. The semi-perimeter, therefore, is half the perimeter. In particular, we have

    Of course, each triangle has three sides and three angles, leading to some relationships between them. Due to this, triangles can be classified either by the relationships between their sides or their angles.

    If all three sides of a triangle are equal in length, then the triangle is said to be equilateral. If two sides of a triangle are equal in length, then the triangle is said to be isosceles. And if all three sides are of different lengths, the triangle is said to be scalene.

    If all three angles of a triangle are acute, it is said to be an acute-angled triangle. If one angle of a triangle is a right angle, it is called a right-angled triangle. And if one angle of a triangle is obtuse, it is an obtuse-angled triangle.

    Now, this series on Properties of Triangles will require a considerable amount of trigonometry. Hence, I suggest you read My Trigger, No Metric, Beginnings, A Mathematical Partnership, Round and Round, Trigonometric Identity Crises, The Trigonometric Turntable, and Concluding Uncomplex Pitstop, in which I took a pitstop in the series on complex numbers to introduce us to the basics of trigonometry.

    We will also be dealing with some ‘centers’ of triangles in our exploration. Let us proceed to define these.

    A perpendicular bisector of a side of a triangle is the line passing through the midpoint of the side and that is perpendicular to the given side. By definition, any point on the perpendicular bisector is equidistant from the vertices that form the side. Hence, any point on the perpendicular bisector of AB will be equidistant from A and B. Now, the three perpendicular bisectors of the sides of a triangle intersect at a point called the circumcenter, which we will denote with O. It is called this because, with O as the center and radius equal to the distance between O and any vertex, you can draw a circle that circumscribes the triangle. That is, every part of the triangle will be inside the circle, with the vertices on the circumference of the circle. This circle is known as the circumcircle and its radius is the circumradius, denoted with R.

    Similarly, an angle bisector of an angle of a triangle is the line passing through the corresponding vertex that divides the internal angle at the vertex into two equal halves. By definition, any point on the angle bisector is equidistant from the arms that form the angle. Hence, any point on the angle bisector of angle A is equidistant from CA and AB. (Note again the order in which I chose to list the sides. Always A to B to C to A.) The three angle bisectors of the angles of a triangle intersect at a point called the incenter, which we will denote with I. It is called this because, with I as the center and radius equal to the perpendicular distance between I and any side, you can draw a circle that inscribes the triangle. That is, every part of the circle will be inside the triangle, with the three points of tangency lying on the triangle. This circle is called the incircle and its radius is the inradius, denoted with r.

    Now, if we join a vertex of a triangle to the midpoint of the opposite side, we get a median. We will denote the midpoints with letters D, E, and F, D being opposite A, E opposite B, and F opposite C. Hence, the three medians are AD, BE, and CF. The three medians intersect at a point known as the centroid, which we will denote with G. A property of the centroid is that it divides each median in the ratio 2:1, with the large part being between the vertex and the centroid. Hence, G divides AD such that AG:GD = 2:1.

    Now, a line passing through a vertex and perpendicular to the opposite side is called an altitude. The three altitudes of a triangle intersect at the orthocenter, denoted with H. The points where the orthogonals meet the opposite side are known as the feet of the perpendiculars, denoted with L, M, and N. Hence, AL, BM, and CN are the altitudes of triangle ABC.

    (Source: Go Geometry)

    Now, if we produce the line from a vertex beyond the next vertex, we form external angles of a triangle. For example, producing AB beyond B forms an external angle outside the triangle with BC as one of its arms. Similarly, producing AC beyond C forms a second external angle outside the triangle with BC as one of its arms. The bisectors of these two external angles and the bisector of angle A intersect at an excenter, denoted by IA. Similarly, the excenters opposite B and C are denoted by IB and IC respectively. With I1 as center and radius equal to the distance of IA from BC, a circle can be drawn that touches the two produced arms. This circle is known as an excircle. A triangle has three excircles. The radii of these three circles will be denoted as rA, rB, and rC.

    If you wish to see how the various centers and circles change, check out this Geogebra app. All the centers and circles are there except the excenters and excircles. Enjoy!

  • After a considerably long break, I resumed with two quite heavy posts on Gödel’s Incompleteness theorems. It’s time to crank down to more reasonable levels of mathematics. I recently came across the problem depicted with the figure below:

    Point G is where the medians of the triangle ABC intersect. The triangle BDG is equilateral with side length l. Determine the lengths, AB, BC, and CA, of the sides of triangle ABC.

    Since G is where the medians intersect, it follows that D, E, and F are the midpoints of BC, CA, and AB respectively.

    This means that BD = DC = 1, giving us BC = 2.

    Now, since triangle BDG is equilateral, it follows that ∠GDC = 120°. Also, since GD = DC, triangle GDC is isosceles, leading to the conclusion that ∠DGC = 30°.

    Now, ∠BGD = 60° and ∠DGC = 30°. Hence, ∠BGC = 90°.

    Now, consider triangle BGC. We have just obtained that ∠BGC = 90°. We also know that BG = 1 and BC = 2. Hence, using Pythagoras’ theorem, we can conclude that GC = √3.

    Since G is the centroid of triangle ABC, G divides each of the medians in the ratio 2:1, with the large portion being between the centroid and the vertex.

    Hence, GE = 1/2 and FG = √3/2.

    Now, triangle EGC is a right angled triangle, right angled at G with GE = 1/2 and GC = √3. Once again using Pythagoras’ theorem, we get EC = √13/2, leading to CA = √13.

    Similarly, triangle BGF is a right angled triangle, right angled at G with BG = 1 and FG = √3/2. Using Pythagoras’ theorem we get BF = √7/2, leading to AB = √7.

    Of course, the key to solving this problem lay in realizing that BE and CF are perpendicular to each other, leading to a set of right angled triangles for each of which we can use Pythagoras’ theorem. If triangle BGD was not an equilateral triangle or if G was not the centroid of triangle ABC, the solution would not have been possible using pure geometry, which is what we have done. In that case, we would have needed to use trigonometry specifically as it relates to the angles and sides of a triangle. And in the next post we will move to studying the triangle properly.

  • In the previous post we looked at the system of Gödel numbering that allowed Gödel to map any natural number to a unique mathematical expression. In this post we will look at how Gödel succeeded in using this system of numbering to make mathematical statements refer to themselves.

    First remember that Gödel used the following mapping as the foundation of his numbering system:

    Let us build Gödel’s proof slowly and one step at a time. Consider the mathematical statement ~(s0=s0). Recall that s0 means the successor of 0, namely the number 1. Hence, this statement in English would be “1 is not equal to 1”. Using the mapping above, the initial Gödel numbers are 1, 8, 7, 6, 5, 7, 6, 9. Since there are eight numbers here, the corresponding Gödel number for the statement will be 21×38×57×76×115×137×176×199. This is obviously a very large number and we will not both ourselves with calculating it. Let us just label it as N. Note that the statement ~(s0=s0) is a false statement. Despite this, it has a Gödel number, namely N.

    Now consider the statement “The second symbol in the statement ~(s0=s0) is a left parentheses.” This is obviously a true statement. This is a metamathematical statement about the statement ~(s0=s0), namely that its Gödel number (N) has a partial prime factorization of 38 since 3 is the second prime (corresponding to the second symbol) and 8 is the Gödel mapping for ‘(‘ as seen in the table above.

    In effect what we are saying is that 38 is a factor of N but 39 is not. We can convert this sentence into precise English to obtain the sentence “There exists some integer x such that x multiplied by 38 is equal to 21×38×57×76×115×137×176×199, and there does not exist any integer x such that x multiplied by 39 is equal to 21×38×57×76×115×137×176×199.” If we convert this to mathematical symbols we will get

    where ss … ss0 contains as many repetitions of s to get us to 38, ss … ss0 contains as many repetitions of s to get us to 39, and ss … ss0 contains as many repetitions of s to get us to 21×38×57×76×115×137×176×199.

    Of course, since the above statement contains only the symbols used in the Gödel mapping system, it has a Gödel number.

    But note what we have done. We have managed to convert a metamathematical statement about the original statement ~(s0=s0) into a pure number using the system of Gödel numbering.

    Now, any mathematical proof is nothing but a sequence of mathematical statements. Each of the statements can be mapped onto its own Gödel number. But also every sequence of statements can also be similarly mapped. Potentially, we could consider a statement like “There exists some sequence of statements with Gödel number M that proves the statement with Gödel number K.” In common English this would translate to “The statement with Gödel number K can be proved.”

    What Gödel did now was substitute a statement’s own Gödel number into the statement itself. Let us see how this is done.

    (Source: Masterclass)

    Consider the statement (∃x)(x = sy). What this says is “There exists a number denoted by the variable x such that x is the successor of the number denoted by the variable y.” In short “y has a successor.” Quite obviously, this statement has a Gödel number, which we will designate as p. Now let us substitute p in place of y to get (∃x)(x = sp), or “p has a successor.” This statement too has its own Gödel number. But it is not any arbitrary number. Rather, it is related to y and p. We began with a statement with a Gödel number p. Then we replaced the variable y with the number p. And the variable y maps onto the number 17. Hence, we can denote the new Gödel number as replace(p, p, 17), which reads “In the statement with Gödel number p replace with p the symbol which maps to the number 17.”

    Now consider the statement “The statement with Gödel number replace(y, y, 17) cannot be proved.” Now, the statement with Gödel number replace(y, y, 17) is taking the statement with Gödel number y (at present just an unknown variable), and replacing with the variable y any occurrence of the symbol y (which maps to 17).

    Take a breather here because we have obtained a metamathematical statement in which the letter y is being used in three different ways! Grab a coffee and croissant and come back when you have mulled this over sufficiently!

    So we have the metamathematical statement “The statement with Gödel number replace(y, y, 17) cannot be proved,” for which we can calculate a Gödel number, say q.

    Now Gödel forms a new statement by substituting the number q wherever y occurs in the earlier statement. The new statement is “The formula with Gödel number replace(q, q, 17) cannot be proved.” Let us denote this statement with G. Quite obviously G also has a Gödel number. What is it?

    By definition replace(q, q, 17) is the Gödel number of the statement that results from taking the statement with Gödel number q and replacing with q wherever there’s a symbol with Gödel number 17. But this is exactly how we obtained G! Because of the uniqueness of prime factorization, we now see that the statement G is referring to is none other than G itself.

    What G asserts is that it cannot be proved! Quite obviously we have obtained a statement whose truth value cannot be determined. If it could be determined then we would be able to prove that the statement “This statement cannot be proved” can be proved, which yields a logical contradiction.

    Hence, even though we know in out guts that G cannot be proved, we will be unable within the system of mathematical logic to prove it. Hence, the truth value of G from within the system of mathematical logic is undecidable.

    What we have obtained is a true statement that cannot be proved, yielding to the conclusion that the system of mathematical logic is incomplete.

    We have explained (hopefully!) Gödel’s first theorem that any consistent mathematical system is incomplete. His second theorem states that no mathematical system can prove its own consistency.

    Suppose that a mathematical system can prove its own consistency. Then there would exist a sequence of mathematical statements that could be distilled into the English statement “This set of mathematical axioms is consistent.”

    However, by the first theorem we know that the set of axioms is incomplete. Consider the statement “this set of axioms is incomplete.” This is equivalent to saying “There are true statements that cannot be proved.” But this last statement is logically equivalent to G!

    What we have here is a contradiction. If the mathematical system could prove its consistency, it could prove G. But G cannot be proved. Hence, no set of axioms can prove its own consistency.

    The repercussions of Gödel’s theorems cannot be exaggerated. Prior to that mathematicians like Georg Cantor, David Hilbert, and Bertrand Russell were hoping to develop a self-contained system of mathematics that was both complete and consistent. Gödel’s theorems put paid to those efforts. What he showed was that any mathematical system that can perform basic arithmetic can be made to refer to itself. And once that happens all sorts of self-referential statements can be framed, which can be paradoxical or contradictory, resulting in incompleteness and inability to prove consistency.

    But in a very real sense, it forced mathematicians to focus elsewhere rather than on developing a more mechanistic kind of mathematics. For example, despite framing the famous Russell’s paradox within set theory, Russell nevertheless partnered with Alfred North Whitehead to write the Principia Mathematica (PM), choosing the weaker Zermelo-Fraenkel (ZF) set theory specifically to prohibit paradoxes. Gödel’s theorems show that, since ZF is powerful enough to perform basic arithmetic, it is necessarily incomplete and cannot prove its own consistency, thereby rendering one of the main goals of PM unrealizable. And the world is richer for it!

  • I was first introduced to Gödel’s incompleteness theorems when I was doing my master’s degree when one of my apartment mates suggested that I should read Gödel, Escher, Bach: An Eternal Golden Braid by Douglas Hofstadter. When I read the book, I was immediately hooked. However, to be frank, I did not understand that Hofstadter was actually addressing the issue of consciousness in the book. It was only later, when I was doing my degree in theology that I re-read the book and things began to fall into place.

    While the ideas of the book have swirled around in the back burner of my mind ever since, it was only recently, when someone asked for a simple explanation of the theorems, that my attention once more went to Gödel’s groundbreaking accomplishments.

    Prior to the publication of Gödel’s theorems, mathematicians like David Hilbert were bent on developing a self-contained, consistent, and complete body of mathematics. His goal was to produce a body of mathematics in which every statement could be proven true or false using a finite number of steps such that no statement could be proven both true and false. One of the foundational works that lay behind Hilbert’s program was the Principia Mathematica (PM) by Alfred North Whitehead and Bertrand Russell. This magnum opus had lofty goals, stated as follows:

    1. “to analyse to the greatest possible extent the ideas and methods of mathematical logic and to minimise the number of primitive notions, axioms, and inference rules.” This meant that they wanted as few axioms and rules as possible that would lead to as many results as possible.
    2. “to precisely express mathematical propositions in symbolic logic using the most convenient notation that precise expression allows.” This meant that they wanted a concise and coherent set of symbols that would be able to express all possible logic statements without any ambiguity or confusion.
    3. “to solve the paradoxes that plagued logic and set theory at the turn of the 20th century, like Russell’s paradox.” This meant that they wanted a system in which paradoxes would be impossible to express. In particular, Russell’s paradox is stated as follows: Let R be the set of all sets that are not members of themselves. If R is not a member of itself, then its definition entails that it is a member of itself; yet, if it is a member of itself, then it is not a member of itself, since it is the set of all sets that are not members of themselves. The resulting contradiction is Russell’s paradox. There is a more common statement of this. On an island, there is a barber who cuts the hair of every person who does not cut their own hair. Does the barber cut his/her hair or not? If he/she cuts his/her hair, then by definition, he/she should not be cutting his/her hair.

    In PM, Whitehead and Russell intended to formulate a system of logic in which formulations such as Russell’s paradox would be impossible.

    Kurt Gödel c. 1926 (Source: Wikipedia)

    However, just a few years after PM was published, Gödel came along and demonstrated that such paradoxes are possible within the logical system used by PM. Not only that, but Gödel demonstrated that any sufficiently powerful logical system will contain truthful statements that cannot be proven true within the system as well as statements whose truth values cannot be determined from within the system. This shattered Hilbert’s dream of developing a mathematical system that was complete and consistent.

    Gödel’s genius was developing a system by which he could correlate statements about a mathematical system to statements within the mathematical system. The centerpiece of this is the process of Gödel numbering, which eventually allows a mathematical system to talk about itself. Since the process of Gödel numbering is not something us commoners would normally think of, I will address the set up of the numbering system in this post and leave the explanation of how Gödel used this system to frame self-referential statements for the next post.

    Gödel begins by assigning a Gödel number to each of the symbols used to make mathematical statements.

    Each of the symbols x, y, z, etc. are assigned prime numbers greater than 12. Hence, we get the Gödel number of x is 13, of y is 17, and of z is 19. You will have noticed that the only numeral in the table is the one for zero. Under the zero is what indicates ‘the successor of’, which might be obscure to most readers. This simply tells us what the next number is. Hence, s0 is the successor of 0 and, therefore, represents 1; ss0 is the successor of the successor of 0 and, therefore, represents 2; and sss0 is the successor of the successor of the successor of 0 and, therefore, represents 3.

    Now, let us consider the statement 1 = 1. First, this would have translated to s0 = s0, a statement that contains five symbols. From the table they correspond to 7, 6, 5, 7, 6. Gödel needs to be able to map this statement, now coded as a sequence of Gödel numbers to a unique number. So, he takes the first five prime numbers 2, 3, 5, 7, and 11. Then he evaluates 27×36×55×77×116 = 425,431,762,237,666,800,000. Yes, the system of Gödel numbering yields extremely large numbers. And we are nowhere close to being done!

    Now, the prime factorization of any natural number is unique except for the order of the factors. If we insist on writing the factors in the order of the primes, then the factorization is unique. This means that the number 425,431,762,237,666,800,000, which has the prime factorization of 27×36×55×77×116, necessarily represents the statement 1 = 1.

    If we continue in this way, every mathematical statement can first be reduced to a sequence of Gödel numbers and then to a single (large) number whose ordered prime factorization is the sequence of Gödel numbers. This creates a map between every mathematical statement and a unique number.

    Suppose, for example, we are given the coded number 13, 891, 649, 379, 189, 120. We can factorize this number to obtain 13, 891, 649, 379, 189, 120 = 27×36×51×75×116. Hence, 13, 891, 649, 379, 189, 120 is the code for the sequence of Gödel numbers (7, 6, 1, 5, 6). From the table above we can see that this sequence of Gödel numbers represents the mathematical statement 1 ~= 0.

    Now, since every number has a unique ordered prime factorization, it follows that every number can be ‘decoded’ to represent a unique sequence of Gödel numbers, which in turn can be further ‘decoded’ to represent a unique mathematical string.

    With this method Gödel successfully created a one to one map between mathematical strings and numbers. Once this has been done we encounter an interesting situation. Every number can now be considered as the number itself or as Gödel coded mathematical string. Hence, it now becomes possible to make the mathematical strings contain self referential aspects. That is, the numbers, being mathematical strings, can be made to refer to themselves. Of course, since the coded Gödel numbers themselves are large, the self-referentially coded Gödel numbers will be even larger. Yet, even if we cannot actually calculate the values of the self-referentially coded Gödel numbers, we know that each mathematical string has a unique coded Gödel number. This is the power of the numbering system that Gödel introduced. We will consider that in the next post.

  • My annual stint of grading IB papers started this week. So I will tackle only a relatively simple problem today. I will take a break for about three weeks while I am grading papers and resume after that. I recently came across the problem depicted below.

    We are given that the external quadrilateral is a parallelogram and have to determine the area of the red region. Let us begin by labeling some of the vertices and the different regions. This is shown below.

    In the figure above, the lower case letters represent the areas of the regions. Hence, the region labeled ‘a’ has an area equal to a.

    Now, the area of ΔAFD will be half the area of the entire parallelogram. Similarly, the areas of ΔABF and ΔDFC will add up to half the area of the parallelogram. Hence, we can obtain

    a + b + c + d + i + j + k = e + f + g + h (1)

    Also, the areas of ΔAED and ΔEBG will add up to half the area of the parallelogram. And the same can be said about the sum of the areas of ΔEDG and ΔBGC. Hence, we obtain

    a + c + e + g + j = b + d + f + h + i + k (2)

    Adding the two equations gives us

    2a + b + 2c + d + e + g + i + 2j + k = b + d + e + 2f + g + 2h + i + k

    Cancelling the terms that appear on both sides of the equation gives us

    2a + 2c + 2j = 2f + 2h

    This means that

    a = (f + h) – (c + j) = (79 + 10) – (72 + 8) = 9

  • (Source: Pinterest)

    There are many ill-informed ideas about mathematics. One is that there is a solution to every problem, as suggested by the meme above. This is not true. There are problems that have no solutions. Then there are problems which have solutions, but whose solutions cannot be solved without significant computational power. And there are problems which have solutions but the solutions to which are difficult, if not impossible, to reach even with sophisticated computational power.

    Of course, there are problems which have solutions that can be reached with minimal computational resources but which can also be reached by means of educated guesswork. Note the important qualifier ‘educated’. I’m not talking about taking potshots in the dark, but of a process through which a solution, which would normally elude us through regular analytical approaches without a computer, can be reached quickly with a couple of well-thought-through guesses. In order to explore this, consider this equation I recently came across:

    Image generated by ChatGPT with the prompt [Generate a cartoon style image of a chancellor handing a graduate a diploma with the tag line “This qualifies you to make educated guesses.”] on 19 May 2026

    We have to solve for n. Of course, using the laws of exponents, we can write this as

    So we want a number the sum of whose first three powers is 39. We can proceed by trying various numbers like

    Now we can simply solve the equation

    to give

    Of course, there was no guarantee that the sum of the first three powers of a natural number would be the value on the right hand side of the equation. After all, the graph of

    looks like

    While I have only shown the region from x = -6 to x = +6, the domain of the function is all real numbers. Moreover, the derivative of the function is

    The discriminant of this function is

    Since the discriminant is negative, the function is strictly increasing in its domain. Since the function is a cubic, we can conclude that the range is all real numbers. In other words, the equation

    will have a real solution for all real values of k. Hence, we were simply lucky that k = 39 gave us the solution x = 3. What this means is that our guesswork, while in this case fruitful, could have simply been a case of never ending frustration as we tried different values. For example, suppose we had k = 20. Then we would proceed as follows

    This would mean that the solution is between x = 2 and x= 3. So we can check x = 2.5 to get

    This means that the solution is between 2 and 2.5. So we can check for x = 2.25 to get

    This means that the solution is between 2.25 and 2.5. So we can check for x = 2.375 to get

    We can continue on an on. The exact solution to the equation is

    while the solution to 14 decimal places is x ≈ 2.31127130571219. It should be clear that this kind of solution is not practical for a generic equation of the form

    Of course, we recognize that the original equation

    supposedly appeared in an exam and the students were expected to solve it without using any calculating or computing device. Hence, a numerical solution such as the one I used to solve

    is not on the cards. Rather, we recognize that, for a non-calculator question, the value of k must be the sum of the first three powers of some natural number. With this in mind, we could attempt to proceed in a different way. We can first recognize that x, x2, and x3 form a geometric sequence. Hence, we can use the formula for the sum of terms of a geometric sequence to obtain

    Rearranging this we get

    Now, since the sum of the coefficients of this equation is zero, it means that x – 1 is a factor of the left hand side. This gives us

    Of course, this means that one of the expressions in parentheses is equal to zero. However, x cannot be equal to 1 since that is excluded as seen above. This yields

    which is the same as

    Hence, the method of using the geometric sequence has not led to anything useful. Is there another approach? We can check for patterns by listing the results for the first few natural numbers as seen below.

    This pattern for the last digit will always be repeated since it depends only on the last digits of each value of x. Hence, we can summarize the table above as follows

    What this tells us is that, if the last digit of k is 1, 2, 6, or 7, then the solution must necessarily be obtained by using some computational device since x will not be a natural number. Of course, this does not guarantee that x will be a natural number if the last digit of k happens to be 0, 3, 4, 5, 8, or 9.

    But let us consider some examples that will allow us to make a good informed starting guess. Suppose we are given

    From the last table, we can conclude that, if there is a natural number solution for x, then it must end in 3, 7, or 9. We can also see that 203 = 8,000 and 303 = 27,000. This means that the only possible solutions, if there is a solution, are 23, 27, or 29. Since 12,719 is closer to 8,000, we can guess that x = 23. And if we check this, we will see that it is indeed the solution.

    Now suppose we are given

    Again from the table, we can conclude that the solution, if it exists, must end in 3, 7, or 9. Also, 403 = 64,000 and 503 = 125,000. Hence, the solution is 43, 47, or 49. Since 106,079 is closer to 125,000 than to 64,000, we can guess that the solution is 47. After all, 49 is so close to 50 that we would expect a sum that is even closer to 125,000 than 106,079 is. And indeed 47 is the solution.

    Let’s try one more example. Suppose we are given

    From the table we can conclude that the solution, if it exists, must end in 2, 4, or 8. Now 603 = 216,000 and 703 = 343000. Hence, the solution must be 62, 64, or 68. Since 266,304 is about a third of the way between 216,000 and 343,000, we guess 64, which turns out to be the correct solution.

    But what if we are given

    The table would suggest that the solution, if it exists, must end with 1. Also, since 403 = 64,000 and 503 = 125,000, we might think that the solution would be x = 41. Moreover, since 68,073 is quite close to 64,000, we might think that this confirms that x = 41. However,

    meaning that x = 41 is not the solution. With a computing engine we can obtain x ≈ 40.4924277600178.

    Now, the original equation was

    Keeping this form, suppose we consider the equation

    Making the substitution

    we can convert the equation to

    Now, we can use the method we have discussed above to guess a likely solution for x. If it so happens that we are given an appropriate value of k, which is actually the sum of the first three powers of a natural number, then we will be able to find the solution for x without too much trouble. Then we can obtain

    as the solution to the given equation.

    Why don’t you try it? You are given

    What is the exact value of n? There is a natural number solution to this. Can you reach it with just one guess as indicated in the process above?

  • This will be the final post in the series on counting principles. Here, I wish to deal with a strange idea of balancing parentheses. If that seems like a strange term itself, let me explain. An arrangement of n left parentheses ‘(‘ and n right parentheses ‘)’ is said to be balanced if, for every right parenthesis, there exists a corresponding left parenthesis before it. Examples of balanced arrangements are

    where corresponding colors indicate the parentheses that pair up. Examples of unbalanced arrangements are

    where the black colored right parenthesis indicate the first unbalance parenthesis for which there is no left parenthesis before it. All the parentheses after that are colored dark brown because, after the unbalanced parenthesis, there is no point trying to pair up the parentheses.

    The problem we are faced with it this: Given n pairs of left and right parentheses, how many unbalanced arrangements are there?

    Consider an unbalanced arrangement. We proceed from left to right until we encounter the first unbalanced right parenthesis. This must necessarily be in an odd position, since for the right parenthesis to be unbalanced, there must be totally one more right parentheses than left parentheses.

    Suppose the position of the unbalanced parenthesis is 2k + 1. Hence there are k balanced pairs to the left of the unbalanced parenthesis. And there are 2n – 2k – 1 parentheses to the right of it. Of these there is one extra left parenthesis than right parenthesis. So there are n – k left parentheses and n – k – 1 right parentheses to the right of the unbalanced parenthesis.

    Let us reverse all of these 2n – 2k – 1 parentheses, making the left parentheses into right ones and vice versa. Now there will be n – k – 1 left parentheses and n – k right parentheses to the right of the unbalanced parenthesis.

    So now there will be k + n – k – 1 = n – 1 left parentheses and k + n – k + 1 = n + 1 right parentheses. Note that this holds true regardless of where we located the first unbalanced parenthesis! Hence, the problem has boiled down to placing n – 1 left parentheses in 2n positions. This can obviously be done in 2nCn – 1 ways.

    Let us consider some examples to ensure we have done this correctly. Suppose n = 5 and k = 2. Then the unbalanced bracket is in the 5th position. So we have

    or some such arrangement, where we have k = 2 pairs of balanced pairs (in green) to the left of the unbalanced right parenthesis (in red). To the right of this unbalanced parenthesis we have 2n – 2k – 1 = 5 parentheses, n – k = 3 of them being left parentheses (in purple) and n – k – 1 = 2 right parentheses (in orange). After reversing the parentheses to the right of the unbalanced parenthesis we will have the arrangement

    where there are n – k – 1 = 2 left parentheses (in orange) and n – k = 3 right parentheses (in purple) to the right of the original unbalanced parenthesis (in red). So now there are totally n – 1 = 4 left parentheses (occupying positions 1, 3, 9 and 10) and n + 1 = 6 right parentheses (occupying positions 2, 4, 5, 6, 7 and 8).
    Suppose, instead that n = 5 and k = 3. Then we have

    or some such arrangement, where we have k = 3 pairs of balanced pairs (in green) to the left of the unbalanced right parenthesis (in red). To the right of this unbalanced parenthesis we have 2n – 2k – 1 = 3 parentheses, n – k = 2 of them being left parentheses (in purple) and n – k – 1 = 1 right parentheses (in orange). After reversing the parentheses to the right of the unbalanced parenthesis we will have the arrangement

    where there are n – k – 1 = 1 left parentheses (in orange) and n – k = 2 right parentheses (in purple) to the right of the original unbalanced parenthesis (in red). So now there are totally n – 1 = 4 left parentheses (occupying positions 1, 3, 5 and 10) and n + 1 = 6 right parentheses (occupying positions 2, 4, 6, 7, 8 and 9).

    Comparing the cases for k = 2 and k = 3 we can see that the number of left and right parentheses after reversing remains the same. The only thing that changed is the positions of the left and right parentheses. So it is simply an issue of choosing n – 1 positions for the left parentheses out of the existing 2n positions. The number of ways in which this can be done is

    Let us consider a question. A class has 51 students. In an election for class representative, 3 candidates A,B, and C contest the elections. When the votes are counted it is found that A secured 26 votes, B 20 votes, and C 5 votes. If the counting of ballots was done in a random order, in how many ways could the votes have been counted so that at every stage A had more votes than both B and C?

    Here the votes for B and C do not actually differ. We can consider them together. Hence, A received 26 votes and the opponents received 25 votes. In order for A to be ahead of both B and C, A should have received the first vote. Now, we can view votes for A as left parentheses and votes for thee opponents as right parentheses. For A to be ahead after the first vote, the votes should be ‘balanced’. The total number of arrangements of the 25 remaining votes for A out of the remaining 50 votes is 50C25. However, the number of unbalanced arrangements of votes is 50C24. Hence, the number of ways in which A would have always been ahead of the opponents is 50C25 – 50C24 = 126,410,606,437,752 – 121,548,660,036,300 = 4,861,946,401,452.

    So, allow me to leave you with a question. Tom the cat and Jerry the mouse are playing a game on the computer. Tom launches applications while Jerry hits ALT-F4 to terminate the applications. If Jerry hits ALT-F4 when no application is running, the computer will shut down. If both of them work randomly, what is the probability that Jerry manages to shut down the computer before Tom launches 5 applications? You can find the solution here.

    With that we conclude the series on counting principles. I will move to solving some problems that intrigue me from the next post onward for a few weeks before I start another series.

  • Launching Pad

    Russian Matryoshka dolls. (Source: Cambridge Mathematics)

    We are in the middle of a series on counting principles. In The Inclusion-Exclusion Principle, we saw a method of counting that ensured we counted everything while not double counting anything. Now, we are ready to go ahead with our study of derangements as promised.

    Understanding Derangements

    Let us first define what a derangement is. A derangement is a permutation or arrangement in which no item occupies a position it previously occupied. This, I guess, is still a little vague. So let us consider a couple of examples.

    Suppose we have a set of n letters that are in the mailperson’s bag. Obviously, each of these letters has an address on the envelop. However, if the mailperson delivers them such that no letter is delivered to the address on its envelop, then we have a derangement.

    Or suppose n patrons of a restaurant check their coats in with the maître d’. On their way out the patrons collect the coats, but none of them receives their own coats. In that case, we have a derangement.

    We could visualize a derangement as below

    Here, we have five items (A, B, C, D, and E). However, none of the items in green matches the corresponding item in red. Using the ordering ABCDE, the above derangement is BEACD. In what follows, I will use red lettering to indicate an item that is not deranged, that is, an item that is placed where it belongs. And I will use green lettering to indicate an item that is deranged, that is, an item that is not placed where it belongs.

    We can begin counting the number of possible derangements with small set sizes. For example, with 2 items, A and B, there are 2 permutations:

    As shown above, there is only one derangement.

    If we increase the set size to 3 items, A, B, and C, there will be 6 permutations:

    As can be seen above, there are only 2 full derangements.

    We can increase the set size to 4 items, A, B, C, and D, to get 24 permutations:

    As seen above, there are 9 full derangements, indicated in green boxes.

    Now, with a set of 5 items, we will have 5! or 120 different permutations. I don’t know about you, but I’m disinclined to even write out all these permutations, let alone scrutinize each to determine which items are deranged, then determine which permutations are indeed full derangements, and then to count the number of full derangements. If you have way too much time on hand for mind numbing tasks, please feel free to step away and undertake this not just for a set of 5 items, but a set of (say) 10 items, for which you can write down and scrutinize all the 3,628,800 permutations!

    You see, the factorial function grows at an alarming rate. What might even be manageable for a set of 5 items, with 120 permutations, becomes an onerous task for a set that is just double the size, with millions of permutations. Hence, there must be a better way of determining the number of derangements given the size of the set. And, thankfully, there is!

    We will proceed along two routes, both yielding the same result. But because the paths are different, we will discover different insights on the process. The first route we will adopt will use the inclusion-exclusion principle that we saw in the previous post. The second route will use a recursive formula.

    Derangements using the Inclusion-Exclusion Principle

    Given n items, there are n! different ways of permuting them. Out of these n! ways, there are (n – 1)! arrangements in which item 1 is fixed in its own position. These (n – 1)! arrangements include arrangements in which some other items may also be in their own positions. Similarly, there are (n – 1)! arrangements in which item 2 is fixed in its own position. Again, these (n – 1)! arrangements include arrangements in which some other items may also be in their own positions.

    Of course, for each of the n items there are (n – 1)! arrangements in which that item is fixed in its own position. Since there are n items in all, we are looking at

    arrangements in which at least 1 item is fixed in its own position.

    So now we have in consideration the initial n! less the arrangements in which 1 item is fixed. Hence under consideration now are

    arrangements. It is clear, however, that there has been double counting for arrangements in which any pairs of items are both in their own positions. Hence, per the inclusion-exclusion principle, we now need to add all the arrangements in which pairs of items are fixed in their positions.

    Suppose items 1 and 2 are fixed. There are (n – 2)! such arrangements and these arrangements include arrangements in which items other than 1 and 2 are also fixed in their positions. There are, of course nC2 different pairs of items and for each such pair there will be (n – 2)! arrangements in which the items in the pair are fixed in their positions. So we are looking at

    arrangements in which 2 or more items are fixed in their positions. As mentioned, due to double counting, these need to be added back. After this adjustment we will be considering

    arrangements. Of course, now we have overcompensated for the arrangements in which 3 items are fixed in their positions. We will need to subtract these.

    Now supposed items 1, 2, and 3 are fixed in their positions. There are (n – 3)! such arrangements and these will include arrangements in which items other than 1, 2, and 3 are also fixed in tier positions. There are nC3 different triplets of items and for each such triplet there will be (n – 3)! arrangements in which the items of that triplet are fixed in their positions. So we are looking at

    These arrangements will need to be subtracted from the running total that we have, yielding

    Continuing in this manner, we can see that the final number of derangements after all the appropriate inclusion-exclusion will be

    This can be written in a more compact form as

    Using this formula we obtain the table below for values of n up to 10.

    Derangements using a Recursive Formula

    The second method for counting derangements is by using a recursive formula. We will first derive the recursive formula and then modify to demonstrate that it is equivalent to the one we just derived. Once again, we start with a set of n items. Now consider item 1. In order for us to end with a derangement, this item must be placed in one of positions 2 to n. Hence, there are n – 1 ways of placing item 1. Since the number of derangements is a whole number, we can conclude that

    where X is another whole number that we have to determine. Till now, we have placed 1 of the n items in a position other than its own.

    Now let us focus on the kth item since it has been dislodged by item 1. We can either place it in position 1 or in one of the remaining n – 2 positions. It we place the kth item in position 1, then we still have to derange the remaining n – 2 items, which can be done in Dn – 2 ways. If we do not place the kth item in position 1, then there are still n – 1 items, including the kth item, that have to be deranged, which can be done in Dn – 1 ways. Since the kth item must go either in position 1 or in one of the other n – 2 positions, the two cases are mutually exclusive and exhaustive. Hence, we can conclude that

    The expression in the square brackets should remind us of the binomial identity

    You will recall from The World of Sagacious Selections, in which we dealt with combinatorial arguments, that we derived the above result for choosing r out of n items by focusing on one item, concluding that the selection either does contain this item, represented by the first term on the right, or does not contain this item, represented by the second term on the right.

    While deriving the recursive equation

    we used the same idea of focusing on one item and deciding whether it still needs to be deranged, represented by the first term in the square brackets, or has already been deranged, represented by the second term.

    This can be expanded and rearranged as follows:

    Supposed we designate

    Then we can see that the earlier equation can be written as

    Using this recursively we get

    Substituting in terms of the derangement values we get

    This can be rearranged as

    We can now substitute values for n to obtain the corresponding expressions for Dn. This will give us

    Considering the expression for D6, we can see that it can be rewritten as

    And since 0!=1!=1, we can further write it as

    Using sigma notation, this can be written as

    This can be generalized to

    which is exactly the same expression we obtained earlier using the inclusion-exclusion principle.

    Derangements and the Inclusion-Exclusion Principle

    The formula for derangements can be further written as

    where the nested parentheses show how the inclusion-exclusion principle works, much like the matryoshka dolls in the image at the start of this post. What this formula tells us it that we can calculate the number of derangements by considering the total number of permutations and subtracting the cases where at least 1 item is fixed, subtracting the cases where at least 2 items are fixed, subtracting the cases where at least 3 items are fixed, and so on. Due to the fact that (-1)n oscillates between 1 and -1, the nested parentheses accomplish the same final result as do the alternating signs in the original formula we obtained, namely

    Why Derangements aren’t Deranged

    So far the discussion has been reasonably theoretical. And you might wonder if there is any reason for understanding derangements beyond the curiosity of mathematicians. I’ve tried to determine how the idea of derangements came about but have not been able to land on a definitive answer. It is quite likely, as in many cases in mathematics, that some mathematician just toyed with the idea and that the idea later found applications. So what are some of these applications?

    In the workplace, if you wish to ensure everyone in a team has the opportunity to be responsible for every process, the idea of derangements is essential. In fact, if the team leader intentionally uses the idea of derangements, he/she could reallocate in a more efficient manner than just reassigning and checking if he/she has obtained a full derangement.

    In coding, the idea of derangements is used to check for coding errors. In stochastic processes, derangements are used to determine the entropy of a system. In chemistry, the idea of derangements are used in the study of isomers, the number of which increases rapidly especially for compounds with long carbon chains. In graph theory, the idea of derangements can be used to determine unique walks or paths in a graph. In optimization, derangements are used in situations similar to the traveling salesman problem or the assignment problem.

    In other words, while it is likely that the idea of derangements began with the toying of a mathematician, it has a wide range of applications today. But what surprises me in something that I am going to deal with in the next post. It is a result that is shocking to say the least and downright mysterious. Whatever could it be? And with that cliff hanger, I bid you au revoir for a week.

  • Recapitulation

    We are currently in the middle of a series on counting principles. At the conclusion of the previous post, I had promised you that we would look at the idea of derangements. However, I realized that we need to lay some ground work before we get to derangements. When we count, how do we ensure that we are not double counting any element? In other words, “How do we ensure that we count every item without counting any item more than once?” Anyone who is involved in any kind of statistical study needs to pay attention to this so that each data point is given the same weightage. So let me introduce you to the inclusion-exclusion principle.

    Basics with Two Categories

    We begin with the most basic set-up with all items classified into two categories (say A and B). Since items can have multiple classifications, we can represent this using the Venn diagram below:

    The Venn diagram has three regions labelled 1, 2, and 3. Set A includes regions 1 and 2, while set B includes regions 2 and 3. If we just add the number of items in sets A and B, we can see that the central region (2) will be counted twice. In other words, the items that belong in both sets will be double counted. To avoid this, we need to subtract the items that belong in the intersection of the two sets.

    This can be written as

    The last term on the right side of the equation recognizes that some items have been ‘included’ more than they need to be and explicitly ‘excludes’ them from the count. This adjustment by excluding what was included too many times is what gives the principle its name.

    Counting with Three Categories

    Of course, we know that demographics includes many more than two categories. So how would the inclusion-exclusion change if we had three categories? The Venn diagram below indicates the situation.

    As shown in the diagram, there are now 7 distinct regions. Set A includes regions 1, 2, 4, and 5. Set B includes regions 2, 3, 4, and 6. And set C includes regions 4, 5, 6, and 7. If we add sets A, B, and C, we will count regions 2, 5, and 6 twice and region 4 thrice. We can proceed as before and exclude the intersection regions of two sets. But since region 4 belongs to A∩B, B∩C, and C∩A, we will have excluded region 4 thrice. This means that regions 1, 2, 3, 5, 6, and 7 are now counted once, but region 4 is not counted. Of course, it is a simple matter to add it back to include it. This is represented as

    We have encountered the terms like the ones in red before in the case where we had only two categories, A and B, and had to compensate for overcounting the regions in the intersection of the two sets. The term in green is a new term, introduced because, by compensating for the overcounting of the regions in the intersections of pairs of sets, we ended up undercounting the intersection of all three sets.

    Extension to Four Categories

    What would happen if there were more than 3 categories? Unfortunately, a 2 dimensional representation will no longer suffice. So let us label the regions as follows: 1: only A; 2: only B; 3: only C; 4: only D; 5: only A and B; 6: only A and C; 7: only A and D; 8: only B and C; 9: only B and D; 10: only C and D; 11: only A, B, and C; 12: only A, B, and D; 13: only A, C, and D; 14: only B, C, and D; and 15: A, B, C, and D.

    Now set A includes regions 1, 5, 6, 7, 11, 12, 13, and 15. Similarly set B includes regions 2, 5, 8, 9, 11, 12, 14, and 15. Set C includes regions 3, 6, 8, 10, 11, 13, 14, and 15, And D includes regions 4, 7, 9, 10, 12, 13, 14, and 15. Now, when we just add A, B, C, and D, the regions 5 to 10 will be counted twice, regions 11, 12, 13, and 14 will be counted thrice, and region 15 four times. The over counting for regions 5 to 10 would need an ‘exclusion’ by subtracting the intersection of pairs of sets. However, this would mean that the regions that involve the intersection of exactly three sets (i.e. 11, 12, 13, and 14) would have been ‘excluded’ three times over, meaning that they would not be ‘included’ anymore. It would also mean that the region 15 has been counted negative 2 times! This can be adjusted by now ‘including’ these four regions. However, this means that region 15 is now ‘included’ 2 times. Hence, we make a final adjustment and subtract the intersection of all four sets. This is represented as

    Here the red terms represent the adjustments for regions 5 to 10, the green ones for regions 11 to 14 and the blue one for region 15.

    Generalization

    If we continue in this manner, adding more categories, we will be able to demonstrate that

    This can be written in a more compact form as

    I recommend you take a close look at how the last two equations are actually the same as we will need such ‘parsing’ of formulas in future posts!

    What we have seen here is that we can recursively ‘exclude’ intersections with greater number of sets and in so doing avoid the twin traps of overcounting and undercounting. With this foundation, in the next post we will look at a way of counting ‘derangements’. Stay grounded till then.