Bitwise Operators and Negative Numbers

When representing integers using a fixed number of bits, negative numbers are typically represented using two’s complement. If using n bit numbers, the two’s complement of a number x with 0 x < 2n is (-x) mod 2n = 2n - x. But what do you do if you want to work with unbounded/multiple-precision integers? Fixing x and letting the number of bits go to infinity, you will notice that increasing n by one simply adds a 1 at the left. For instance,

Bitwise Operators and Negative Numbers continued »

Release: Sputsoft Numbers 0.2 (formerly SputArithmetic)

I am very excited about this release. The library has been redesigned and almost everything has been rewritten. Even the name has changed, it is now called Sputsoft Numbers (instead of SputArithmetic).

Release: Sputsoft Numbers 0.2 (formerly SputArithmetic) continued »

Book Review: The Book of Numbers

Conway and Guy: The Book of Numbers

The Book of Numbers is a wonderful book about, well, numbers. And lots of them. From ancient ways of writing numbers to Gaussian integers to surreal numbers. The authors are some tough mathematicians, too. John H. Conway is Professor of Mathematics at Princeton University, an authority in game theory and group theory, and the inventor of the Game of Life and surreal numbers. Richard K. Guy is professor emeritus of mathematics at the University of Calgary and has (co)authored several hundred publications on combinatorial game theory, number theory and graph theory.

Book Review: The Book of Numbers continued »

Arithmetic by Geometry

Today real numbers are most often represented by applying (elementary) functions to (decimal) integers. Throughout history, though, arithmetic and propositions involving (positive) real numbers were often considered from a purely geometrical point of view. Real numbers were identified by the length of some line segment and, e.g., the product of two numbers was identified by the area of a rectangle with side-lengths equal to the two numbers. This made sense from a physical/applied point of view, but it had certain shortcomings.

Arithmetic by Geometry continued »

Line-line Intersection in the Plane

How do you calculate the point where two lines in the plane intersect? It is not very hard to do, but the formula can look quite complicated, depending on how you write it up. This article is a reminder that it can be expressed in a simple manner.

Line-line Intersection in the Plane continued »

Visualizing the Pythagorean Theorem

Most people are familiar with the Pythagorean theorem: In a right-angled triangle the square of the hypotenuse is equal to the sum of the squares of the other two sides. As the name of the theorem implies, it is attributed to Pythagoras, a Greek mathematician who lived around 500 B.C. The theorem is also included in Euclid‘s Elements, an encyclopedia of all known mathematics around 300 B.C. But how do you actually prove the Pythagorean theorem?

Visualizing the Pythagorean Theorem continued »

Fractions and Circles

Conway and Guy: The Book of Numbers

Fractions produced by mediants have some very interesting properties. We saw some of them in connection with the Stern-Brocot tree. This articles explores a more curious property, relating fractions to circles in the plane. It was discovered in 1938 by Lester R. Ford and is also mentioned in Conway and Guy’s The Book of Numbers.

Fractions and Circles continued »

Book Review: Prime Obsession

Derbyshire: Prime Obsession

Prime Obsession: Bernhard Riemann and the Greatest Unsolved Problem in Mathematics is a book about the Riemann Hypothesis, posed by Bernhard Riemann in 1859. As the book title says, it is one of the greatest unsettled mathematical conjectures remaining today. It is among David Hilbert‘s list of twenty-three mathematical problems and one of the seven millennium problems presented by the Clay Mathematics Institute.

Book Review: Prime Obsession continued »

The Stern-Brocot Tree of Fractions

Consider two fractions \frac{m_1}{n_1} and \frac{m_2}{n_2} with positive numerators and denominators. The fraction \frac{m_1+m_2}{n_1+n_2} is called the mediant of \frac{m_1}{n_1} and \frac{m_2}{n_2}. It is straightforward to show that the mediant is placed numerically between the original fractions,

The Stern-Brocot Tree of Fractions continued »

Book review: The Pleasures of Counting

Korner: The Pleasures of Counting

The Pleasures of Counting is a book about people working with mathematics and challenges they have faced. The book has 544 pages with a total of 19 chapters and 3 appendices. It contains a lot of material and is split into five parts: The uses of abstraction, Meditations on measurement, The pleasures of computation, Enigma variations, and The pleasures of thought.

Book review: The Pleasures of Counting continued »