Monthly Archives: March 2018

Generalization of Pythagoras equation


About 3 years ago I discussed following two Diophantine equations of degree 2:

In this post, we will see a slight generalization of the result involving Pythagorean triplets. Unlike Pythagoras equation, x^2+y^2-z^2=0, we will work with a little bit more general equation, namely: ax^2+by^2+cz^2=0, where a,b,c\in \mathbb{Z}. For proofs, one can refer to section 5.5 of Niven-Zuckerman-Montgomery’s An introduction to the theory of numbers.

Theorem: Let a,b,c\in \mathbb{Z} be non-zero integers such that the product is square free. Then ax^2+by^2+cz^2=0 have a non-trivial solution in integers if and only if a,b,c do not have same sign, and that -bc, -ac, -ab are quadratic residues modulo a,b,c respectively.

In fact, this result helps us determine the existence of a non-trivial solution of any degree 2 homogeneous equation in three variables, f(X,Y,Z)=\alpha_1 X^2 +\alpha_2Y^2+\alpha_3Z^2+\alpha_4XY+\alpha_5YZ+\alpha_6ZX due to the following lemma:

Lemma: There exists a sequence of changes of variables (linear transformations) so that f(X,Y,Z) can be written as an equation of the form g(x,y,z)=ax^2+by^2+cz^2 with \gcd(a,b,c)=1.

Now let’s consider the example. Let f(x,y,z)=3x^2+5y^2+7z^2+9xy+11yz+13zx, and we want to determine whether this f(x,y,z)=0 has a non-trivial solution. Firstly, we will do change of variables:

\displaystyle{f(x,y,z)=3\left(x+\frac{3}{2}y +\frac{13}{6}z\right)^2 - \frac{7}{4}y^2 - \frac{85}{12}z^2 - \frac{17}{2}yz = g(x',y',z')}

where x' = x+\frac{3}{2}y +\frac{13}{6}z, y'=y and z'=z. Thus

\displaystyle{12g(x',y',z')=36x'^2 - 21 y'^2 - 85z'^2 - 102y'z' = 36x'^2 - 21\left(y'+\frac{17}{7}z'\right)^2+\frac{272}{7}z'^2=h(x'',y'',z'')}

where x'' = x',y'' = y'+\frac{17}{7}z' and z''=z'. Thus

\displaystyle{7h(x''',y'',z'') = 252x''^2 - 147y''^2+272z''^2=7(6x'')^2-3(7y'')^2 + 17(4z'')^2 = F(X,Y,Z)}

where X=6x'', Y=7y'' and Z=4z''. Now we apply the theorem to 7X^2-3Y^2+17Z^2=0. Since all the coefficients are prime numbers, we can use quadratic reciprocity to conclude that the given equation has non-trivial solution (only non trivial thing to note that -7\times 17 is quadratic residue mod -3, is same as -7\times 17 is quadratic residue mod 3).


Academia is not pious


Many young people (me included) might get attracted to academia due to the outward appearance of “freedom” of working hours and being “paid” for what you enjoy doing the most in your free time.

But in reality, academia is just like any other profession. There is politics, drama, ….. I will illustrate using Reddit examples:

Counting Cards – II


Since we have introduced the game of blackjack at the end of last year, we can now talk about the winning strategies. A hand with an ace valued as 11 is called “soft”, meaning that the hand will not bust by taking an additional card; the value of the ace will become one to prevent the hand from exceeding 21. Otherwise, the hand is “hard”.  Each blackjack game has a basic strategy, which is playing a hand of any total value against any dealer’s up-card, which loses the least money to the house in the long term. For example:


For details, like when to double-hard or double-soft, see:

Blackjack’s house edge is usually between 0.5%–1% when players use basic strategy. Card counting can give the player an edge of up to 2% over the house.

A card counting system assigns a point score to each rank of a card. When a card is exposed, a counter adds the score of that card to a running total, the ‘count’. A card counter uses this count to make betting and playing decisions according to a table which they have learned. The count starts at 0 for a freshly shuffled deck for “balanced” counting systems. Unbalanced counts are often started at a value which depends on the number of decks used in the game.

The most common variations of card counting in blackjack are based on statistical evidence that high cards (especially aces and 10s) benefit the player more than the dealer, while the low cards, (3s, 4s, 6s, and especially 5s) help the dealer while hurting the player.

Basic card counting assigns a positive, negative, or zero value to each card value available. When a card of that value is dealt, the count is adjusted by that card’s counting value. Low cards increase the count as they increase the percentage of high cards in the remaining set of cards, while high cards decrease it for the opposite reason. For instance, the Hi-Lo system subtracts one for each dealt 10, Jack, Queen, King or Ace, and adds one for any value 2-6. Values 7-9 are assigned a value of zero and therefore do not affect the count. Here is a quick explanation of this system:


A lot of content for this post was shamelessly copied from other articles. In case of copyright violation, please ask me to delete this.

Number Devil


If you enjoyed reading Lewis Carroll’s Alice’s Adventures in Wonderland, George Gamow’s Mr Tompkins, Abbott’s Flatland, Malba Tahan’s The Man Who Counted, Imre Lakatos’s Proofs and Refutations or Tarasov’s Calculus, then you will enjoy reading Enzensberger’s The Number Devil. But that is not an if and only if statement.


Originally written in German and published as Der Zahlenteufel, so far it has been translated into 26 languages (as per the back cover).

After reading this book one will have some knowledge of infinity, infinitesimal, zero, decimal number system, prime numbers (sieve of eratothenes, Bertrand’s postulate, Goldbach conjecture), rational numbers (0.999… = 1.0, fractions with 7 in denominator), irrational numbers (√2 = 1.4142…, uncountable), triangular numbers, square numbers, Fibonacci numbers, Pascal’s triangle (glimpse of Sierpinski triangle in it), combinatorics (permutations and combinations, role of Pascal’s triangle), cardinality of sets (countable sets like even numbers, prime numbers,…), infinite series (geometric series, harmonic series), golden ratio (recursive relations, continued fractions..), Euler characteristic (polyhedra and planar graphs), how to prove (11111111111^2 does not give numerical palindrome, Principia Mathematica), travelling salesman problem, Klein bottle, types of infinities (Cantor’s work), Euler product formula, imaginary numbers (Gaussian integer), Pythagoras theorem, lack of women mathematicians  and pi.

Since this is a translation of original work into English, you might not be happy with the language.  Though the author is not a mathematician, he is a well-known and respected European intellectual and author with wide-ranging interests. He gave a speech on mathematics and culture, “Zugbrücke außer Betrieb, oder die Mathematik im Jenseits der Kultur—eine Außenansicht” (“Drawbridge out of order, or mathematics outside of culture—a view from the outside”), in the program for the general public at  the International Congress of Mathematicians in Berlin in 1998. The speech was published under the joint sponsorship of the American Mathematical Society and the Deutsche Mathematiker Vereinigung as a pamphlet in German with facing English translation under the title Drawbridge Up: Mathematics—A Cultural Anathema, with an introduction by David Mumford.