Thursday, June 25, 2015

Solving a Quadratic with a Straightedge and Compass

In most high school algebra classes, students learn to solve a quadratic ax2 + bx + c = 0 using a variety of different methods.  The most common methods taught are factoring, graphing, completing the square, or using the quadratic equation.  However, a method for solving a quadratic using a straightedge and compass is described near the end of the book Number: The Language of Science by Tobias Dantzig (first published in 1930).
To solve the quadratic equation ax2 + bx + c = 0 using a straightedge and compass, let p = -b/a and q = c/a.  Use a compass and straightedge to plot out the coordinates U(0, 1), P(p, 0), Q(0, q), R(p, q), and S(p, 1) and then construct rectangle UQRS and its diagonals.  Then, using where the diagonals of the rectangle intersect at point C, construct circle C with radius CU.  Circle C will then intersect the x-axis at the two solutions X1 and X2.
For example, let’s say you wanted to solve the quadratic x2 – 6x + 5 = 0.  Then a = 1, b = -6, and c = 5, and p = -b/a = 6 and q = c/a = 5.  Use a compass and straightedge to plot out the coordinates U(0, 1), P(6, 0), Q(0, 5), R(6, 5), and S(6, 1) and then construct rectangle UQRS and its diagonals.  Then, using where the diagonals of the rectangle intersect at point C(3, 3), construct circle C with radius CU.  Circle C intersects the x-axis at x = 1 and x = 5, which are the two solutions to x2 – 6x + 5 = 0. 

We can show that this method will always work by finding a Cartesian equation for circle C, setting y equal to zero (for the x-axis), and simplifying the answer to being the quadratic equation (x = (–b ± √(b^2 – 4ac))/2a).  The center of circle C is the midpoint of U(0, 1) and R(p, q), which is (p/2, (q + 1)/2), and the radius of circle C is half the distance between U(0, 1) and R(p, q), which is r = ½√(p2 + (q – 1)2).  Therefore, the equation for circle C is (x – p/2)2 + (y – (q + 1)/2)2 = (½√(p2 + (q – 1)2))2 or when y = 0, (x – p/2)2 + ((q + 1)/2)2 = ¼(p2 + (q – 1)2).  Applying some algebra, (x – p/2)2 + ((q + 1)/2)2 = ¼(p2 + (q – 1)2) è (2x – p)2 + (q + 1)2 = p2 + (q – 1)2 è (2x – p)2 = p2 + (q – 1)2 – (q + 1)2 è (2x – p)2 = p2 + (q2 – 2q + 1) – (q2 + 2q + 1) è (2x – p)2 = p2 – 4q è 2x – p = ±√(p2 – 4q) è 2x = p ± √(p2 – 4q) è x = (p ± √(p^2 – 4q))/2.  Substituting p = -b/a and q = c/a as defined above, x = (–b ± √(b^2 – 4ac))/2a, which is the quadratic equation.

If the quadratic equation ax2 + bx + c = 0 has two imaginary solutions, circle C will not intersect the x-axis.  However, the solution can still be found with a straightedge and compass by performing a few additional steps.  First, construct a perpendicular bisector of QR through C called CM.  Second, construct a tangent OT of circle C.  Third, construct circle O with radius OT.  Circle O will then intersect line CM at the two solutions Z1 and Z2, in which the x-coordinate is the real part and the y-coordinate is the imaginary part. 

For example, let’s say you wanted to solve the quadratic x2 – 4x + 5 = 0.  Then a = 1, b = -4, and c = 5, and p = -b/a = 4 and q = c/a = 5.  As before, use a compass and straightedge to plot out the coordinates U(0, 1), P(4, 0), Q(0, 5), R(4, 5), and S(4, 1) and then construct rectangle UQRS and its diagonals.  Then, using where the diagonals of the rectangle intersect at point C(2, 3), construct circle C with radius CU.  This time, however, circle C does not intersect the x-axis, so construct a perpendicular bisector of QR through C called CM, construct a tangent OT of circle C, and construct circle O with radius OT.  Circle O intersects the line CM at Z1(2, 1) and Z2(2, -1), and so the two solutions are x = 2 ± i.

We can also show that these additional steps will always work by combining the Cartesian equation for circle O and the equation of the vertical line CM and showing that its solution (x, ±y) can be entered into x’ = x ± yi to simplify into the quadratic equation (x’ = (–b ± √(b^2 – 4ac))/2a).  As mentioned above, the center of circle C is (p/2, (q + 1)/2), and so the vertical line CM can be represented by x = p/2.  The length of segment CO is the distance between O(0, 0) and C(p/2, (q + 1)/2), which is CO = ½√(p2 + (q + 1)2).  Segment CT is a radius of circle C, which we also know from above is CT = ½√(p2 + (q – 1)2).  Since ΔCTO is a right angle triangle, CT2 + OT2 = CT2, or substituting, (½√(p2 + (q – 1)2))2 + OT2 = (½√(p2 + (q + 1)2))2.  Applying some algebra, (½√(p2 + (q – 1)2))2 + OT2 = (½√(p2 + (q + 1)2))2 è OT2 = ¼(p2 + (q + 1)2) – ¼(p2 + (q – 1)2) è OT2 = ¼(p2 + q2 + 2q + 1) – ¼(p2 + q2 – 2q + 1) è OT2 = ¼(4q) è OT2 = q è OT = √q, which means the radius of circle O is √q.  The Cartesian equation for circle O is then x2 + y2 = q.  Combining this with x = p/2, (p/2)2 + y2 = q è y2 = q – (p/2)2 è y2 = ¼(4q – p2) è y = ±½√(4q – p2).  Now if x = p/2 and y = ±½√(4q – p2), x’ = x + yi = p/2 ± ½√(4q – p2)i = p/2 ± ½√(4q – p2)√(-1) = p/2 ± ½√(p2 – 4q) = (p ± √(p^2 – 4q))/2.  Substituting p = -b/a and q = c/a as defined above, x’ = (–b ± √(b^2 – 4ac))/2a, which is the quadratic equation.


Therefore, there exists a method for solving a quadratic with a straightedge and compass.  The steps themselves are fairly simple, but the proof is not.  Even more difficult than the proof must have been the invention of the method itself, which must have been by some creative genius.

Thursday, June 18, 2015

Divisibility Rules

When you were younger, you probably learned to skip count by 2, 5, and 10.  Skip counting by 2 leads to the sequence 2, 4, 6, 8, 10, 12, 14, (and so on); skip counting by 5 leads to 5, 10, 15, 20, 25, 30, (and so on); and skip counting by 10 leads to 10, 20, 30, 40, 50, (and so on).  If you were an observant student, you may have noticed that all the numbers in the skip counting sequence for 10 ended in a 0, all the numbers in the skip counting sequence for 5 ended in either a 0 or 5, and all the numbers in the skip counting sequence for 2 ended in either a 0, 2, 4, 6, or 8. 


2, 5, and 10

In effect, you observed divisibility rules for 2, 5, and 10: if a number ends in 0, 2, 4, 6, or 8, then that number is divisible by 2 (or even); if a number ends in a 0 or 5, then that number is divisible by 5; and if a number ends in 0, then that number is divisible by 10

The reason for these simple divisibility rules for 2, 5, and 10 is because our numbering system is in base 10, which itself is divisible by 2, 5, and 10.  Mathematically, we know that 625 is divisible by 5 because 625 = 62 x 10 + 5 = 5 x (62 x 2 + 1).  In general, the number comprised of all the digits before the last one must be divisible by 10 (and also 5 and 2) because of our base 10 numbering system, which means only the last digit needs to be tested for divisibility.

4

There are also divisibility rules for other numbers that are not so obvious.  Since 4 divides into 100, if the last two digits of a number are divisible by 4, then the entire number is divisible by 4.  For example, 714,036 is divisible by 4 because the last two numbers (36) are divisible by 4.  Mathematically, 714,036 = 7140 x 100 + 36 = 7140 x 25 x 4 + 9 x 4 = 4 x (7140 x 25 + 9). 

8

Since 8 divides into 1000, if the last three digits of a number are divisible by 8, then the entire number is divisible by 8.  For example, 714,032 is divisible by 8 because the last three numbers (032) is divisible by 8.  Mathematically, 714032 = 714 x 1000 + 32 = 714 x 125 x 8 + 4 x 8 = 8 x (714 x 125 + 4).

3

Although the number 3 does not divide into any multiple of 10 like the other numbers we have looked at (2, 4, 5, 8, and 10), it does, however, divide into 9, and 99, and 999 (and so on), which are all exactly one less than a multiple of 10.  This property allows us to make the following divisibility rule for 3: if the digits of a number add up to a multiple of 3, then that number is divisible by 3.  For example, the number 531 is divisible by 3 because the digits add up to 5 + 3 + 1 = 9 which is a multiple of 3.  Mathematically, 531 = 5 x 100 + 3 x 10 + 1 = 5 x (99 + 1) + 3 x (9 + 1) + 1 = 5 x 99 + 5 x 1 + 3 x 9 + 3 x 1 + 1 = 5 x 99 + 3 x 9 + 5 + 3 + 1 = 5 x 33 x 3 + 3 x 3 x 3 + 5 + 3 + 1 = 3 x (5 x 33 + 3 x 3) + 5 + 3 + 1.  Therefore, if the digits 5 + 3 + 1 add up to a multiple of 3, the entire number must be a multiple of 3.

9

A similar divisibility rule for 3 can be made for the number 9, since 9 also divides into 9, 99, 999, (and so on).  If the digits of a number add up to a multiple of 9, then that number is divisible by 9.    For example, 648 is divisible by 9 because 6 + 4 + 8 = 18 which a multiple of 9.  (In fact, the rule can be applied a second time to 18, because its digits add up to 1 + 8 = 9.)  Mathematically, 648 = 6 x 100 + 4 x 10 + 8 = 6 x (99 + 1) + 4 x (9 + 1) + 8 = 6 x 99 + 6 x 1 + 4 x 9 + 4 x 1 + 8 =  6 x 99 + 4 x 9 + 6 + 4 + 8 = 6 x 11 x 9 + 4 x 9 + 6 + 4 + 8 = 9 x (6 x 11 + 4) + 6 + 4 + 8.  Therefore, if the digits 6 + 4 + 8 add up to a multiple of 9, the entire number must be a multiple of 9.  (This divisibility rule is also discussed in a previous blog.)

6

Divisibility rules for composite numbers can be made by combining rules of its (relatively prime) factors.  Since 2 x 3 = 6, the divisibility rule for 6 is the divisibility rule for 2 and 3 combined.  If the digits of a number add up to a multiple of 3, and if the number ends in 0, 2, 4, 6, or 8, then that number is divisible by 6

12

Similarly, since 3 x 4 = 12, the divisibility rule for 12 is divisibility rule for 3 and 4 combined.  If the digits of a number add up to a multiple of 3, and if the last two digits of the number are divisible by 4, then the entire number is divisible by 12.


11

Now we have found divisibility rules for the first 12 numbers other than 7 and 11.  There are divisibility rules for 7 and 11, but they are a little trickier.  First let us examine the divisibility rule for 11, which is less tricky than 7.  Powers of ten are alternately one less and one more than a multiples of 11.  In other words, 10 = 11 – 1, 102 = 100 = 99 + 1 = 11 x 9 + 1, 103 = 1000 = 1001 – 1 = 11 x 91 – 1, 104 = 10000 = 9999 + 1 = 11 x 909 + 1, and so on.  This unique property allows us to make the following divisibility rule for 11: if the digits of a number alternately add and subtract to a multiple of 11, then that number is divisible by 11. For example, 363 is divisible by 11 because 3 – 6 + 3 = 0 which is a multiple of 11.  Mathematically, 363 = 3 x 100 + 6 x 10 + 3 = 3 x (99 + 1) + 6 x (11 – 1) + 3 = 3 x 99 + 3 x 1 + 6 x 11 – 6 x 1 + 3 = 3 x 99 + 6 x 11 + 3 – 6 + 3 = 3 x 9 x 11 + 6 x 11 + 3 – 6 + 3 = 11 x (3 x 9 + 6) + 3 – 6 + 3.  Therefore, if the digits alternately add and subtract to a multiple of 11, the entire number must be a multiple of 11.

7

There are two divisibility rules for 7 that can either be used or combined depending on convenience.  Fortunately, 7 is divides into 1,001, which is 103 + 1.  That also means that it divides into (103 + 1)(103 – 1) = 106 – 1 = 999,999.  It also divides into (103 + 1)(106 – 103 + 1) = 109 + 1 = 1,000,000,001.  Carrying on in this fashion, we can show that 7 divides into 106n – 3 + 1 and 106n – 1 for any positive integer n.  Much like 11 (which divides into 102n – 1 + 1 and 102n – 1 for any positive integer n), if every three digits of a number alternately add or subtract to a multiple of 7, then that number is divisible by 7.  For example, 127,311,212 is divisible by 7 because 127 – 311 + 212 = 28 which is a multiple of 7.  Mathematically, 127,311,212 = 127 x 1,000,000 + 311 x 1,000 + 212 = 127 x (999,999 + 1) + 311 x (1,001 – 1) + 212 = 127 x 999,999 + 127 x 1 + 311 x 1,001 – 311 x 1 + 212 = 127 x 999,999 + 311 x 1,001 + 127 – 311 + 212 = 127 x 142857 x 7 + 311 x 143 x 7 + 127 – 311 + 212 = 7 x (127 x 142857 + 311 x 143) + 127 – 311 + 212.  Therefore, if every three digits alternately add and subtract to a multiple of 7, the entire number must be a multiple of 7.  (The number 142857 found in the above calculations is a cyclic number related to repeating powers and repeating decimals, which is discussed in a previous blog.)

This trick of alternately adding and subtracting three digits can be used multiple times in succession, but it can sometimes lead to three-digit numbers that are not obviously multiples of 7 at first glance, and so another trick is needed to test these three-digit numbers.  We can use the fact that 21 is a multiple of 7 for a second divisibility rule for 7 that will help with these three-digit numbers: if 2 times the last digit subtracted from the remaining digits is a multiple of 7, then that number is divisible by 7.  For example, 231 is divisible by 7 because 23 – 2 x 1 = 21 which is a multiple of 7.  Mathematically, 231 = 23 x 10 + 1 = 23 x 10 + 1 – 21 + 21 = 23 x 10 – 20 + 21 = 10 x (23 – 2 x 1) + 21 = 10 x (23 – 2 x 1) + 3 x 7.  Therefore, if 23 – 2 x 1 is a multiple of 7, the entire number must be a multiple of 7.  Both of these divisibility rules for 7 can be combined more than one way if needed.

Summary

A summary of all the divisibility rules discussed in this article can be found in the following table:

#
Divisibility Rule
2
If a number ends in 0, 2, 4, 6, or 8, then that number is divisible by 2.
3
If the digits of a number add up to a multiple of 3, then that number is divisible by 3.
4
If the last two digits of a number are divisible by 4, then the entire number is divisible by 4.
5
If a number ends in a 0 or 5, then that number is divisible by 5.
6
If the digits of a number add up to a multiple of 3, and if the number ends in 0, 2, 4, 6, or 8, then that number is divisible by 6.
7
If every three digits of a number alternately add or subtract to a multiple of 7, then that number is divisible by 7.
If 2 times the last digit subtracted from the remaining digits is a multiple of 7, then that number is divisible by 7.
8
If the last three digits of a number are divisible by 8, then the entire number is divisible by 8.
9
If the digits of a number add up to a multiple of 9, then that number is divisible by 9.
10
If a number ends in 0, then that number is divisible by 10.
11
If the digits of a number alternately add and subtract to a multiple of 11, then that number is divisible by 11.
12
If the digits of a number add up to a multiple of 3, and if the last two digits of the number are divisible by 4, then the entire number is divisible by 12.

These rules have several applications, which include testing a number to be prime, as well as providing a convenient way to mentally check mathematical solutions.