Tuesday, 24 June 2008

Pick Two


A colleague from Colorado sent me an interesting probability problem the other day. I like it because it illustrates one of those serendipitous qualities of mathematics. Here is the problem. A Jar has a mixture of Red and White balls so that if you withdraw two, the probability of getting two alike, or two of different color are both equal to one-half. You may want to stop and try it before you read on.

Ok, so we let r = the number of red ones and W be the number of white ones, and the total is r+w. So how could we draw one of each color? Well, red first, and then white, or white first and then red. If we find the probability of each of these conditional events and add them up, that will have to equal 1/2. Ok, the probability of red on the first draw is r/(r+w), and on the second ball the probability is w/(r+w-1) since one of the red balls will be missing. The opposite order is exactly the same with the w and r reversed, so the probability of getting one of each color is 2rw/[(r+w)(r+w-1)]. Setting that equal to 1/2 we get

If we exapand (r+w)2 and subtract the 4rw we get 0=r2-2rw +w2-r-w. NOTICE the symmetry, we could exchange r and w and get the same equation. We know right off that any solution (a,b) will have another soltuion (b,a).

One of the things that is often hard for students is to think of one variable as a constant and the other as a variable. I like to use the word "pronumeral", like a pronoun only instead of him or her we say "that number". It is like a variable that doesn't vary, we just don't know what it is in a particular case. So think of w as if it were fixed. We have that many white balls in the jar and we are wondering how many red can be put in to make the problem work... see it.. w is a "fixed" unknown, but r is going to "vary". That makes the equation a quadratic in r; Ar2 +Br+c=0 where A=1, B= -2w-1, and C=w2-w.

We can solve this using the quadratic formula, but if this solution is going to be a rational number, and the number of balls in a jar must be rational, then the discriminant, the expression under the squre root radical in the quadratic forula, B2-4AC, must be a perfect square. B2= 4w2+4w+1 and 4AC= 4w2-4w; so B2-4AC= 8W+1. If there is a rational solution, it must be when 8W+1 is a perfect square. Wait, I know this one! That's a problem from number theory. The numbers that make 8W+1 a perfect square are called triangular numbers; 1, 3, 6, 10, 15. They are the sum of the first n counting numbers. But a neat thing happens if we plug 1 in for W, the solution for r is 3.... and if we use 3 for w, r=6. Each time we substitute one of the triangular numbers into the quadratic, the next comes out as a solution. So the probability of drawing two balls of the same color, (or of two that are not alike) will equal 1/2 whenever the number of balls of each color are consecutrive triangular numbers. A very geometric solution to a very algebraic question.

Friday, 20 June 2008

More on The Am-Gm Inequality

The arithmetic mean-geometric mean inequality is an equality in only one situation, when all the numbers are the same. It would seem such an obvious statement would be of almost no mathematical use, but in fact, it is a very useful tool. If you graph y=(x)1/3 you notice that the function is always increasing. That means if a1/3 > b1/3 then a>b. That leads to a rather big idea in algebra/geometry.

When we seperate a number into parts that add up to that number it is called a partition of the number. One partition of 12 into three values is 6 + 4 + 2. What we get from the Am-Gm inequality is that the products of any partition is greatest when the elements of the partition are all equal. For partitions of 12 into three numbers, the highest product is 4(4)(4)=64.
Try any of others, it will always be less. (6)(4)(2) is only 48; and 6(3)(3)= 54. There are others, but none of the partitions of three numbers will be as large as 64.

You may be intuitively familiar with an example of this from geometry. Take any rectangle with a given perimeter; the one with the largest area is a square. In fact, the square is the largest area for any quadrilateral with a given perimeter.

You can prove the same propetry for triangles algebraicly with Heron's formula. You remember Heron's formula; for any trinangle with sides a, b, and c, we find the semi-perimeter S= (a+b+c)/2. Then the area is given by [S (s-a)(s-b)(s-c)]1/2. If we hold the perimeter constant, then s1/2 is a constant, and we can rewrite the area as the product of two square roots, (s)1/2 times [(s-a)(s-b)(s-c)]1/2. But since (s)1/2 is a constant, the area is larger or smaller depending on the product of (s-a)(s-b)(s-c); and from the Am-Gm inequality we know that this product is largest when all three values are equal. But s-a = s-b=s-c means that a=b=c, so the maximum area for any perimeter is when the triangle is equilateral.

With a little geometric effort, you can show that the same is true for a polygon of any number of sides, the one with the greatest area for any perimeter is the regular polygon.

Concave polygons have a angle that juts into the interior of the shape, and convex ones do not. It should be easy to see that if a shape was concave you could just flip the concave part out and keeping all the sides exactly the same length you have created
a shape with a larger area, so trivially (always be suspicious when that word is used, even now) a maximal area for any perimeter will be convex. Now imagine a convex polygon and focus on three consecutive vertices.

Now create an ellipse that has its two foci (that is the plural of focus) at the two extreme vertices, and passes through the third point. One of the properties you ought to remember about an ellipse is that the sum of the distances from any point on the ellipse to the two foci is a constant, so if we move the one point along the ellipse, we will not be changing the length of the two sides, and the perimeter of the polygon is staying constant. Now what is happening to the interior area of the polygon as we move this point along the ellipse. The only part of the interior of the polygon that changes is inside the triangle formed by the three vertices. But this triangle has a constant base, and as we move the third point around the ellipse.... we are changing the height of
the triangle. The area is the greatest where the height is the greatest, and that happens when the altitude rises from the midpoint of the two foci; and at that point, the triangle is isosceles. The area is greatest if we make these two sides of the polygon equal. Now pick three other points, and repeat endlessly until all the exterior sides are congruent to maximize the area.

Closing with a neat toy you can use if you want to post mathematical equations in your blogs or MySpace pages (and I KNOW you want to do that). You can download it atthis link ;and keep it on you web page or save it to your google homepage or ... be creative..

Tuesday, 17 June 2008

What Mean Did You Mean?

Most of your math studies have focused on equations and identities… stuff on one side equal to stuff on the other side. Lots of big ideas in math, however, involve inequalities; where one thing is always less than another, or at least less than or equal. I was thinking about one flying back to the US (and boy, are my arms tired…. Ok, very bad, forgive please) and it offered the additional chance to introduce a notation you might not have seen yet.


Most of the time when you hear the word average or mean you think of them as the same thing. Add up all the numbers and divide by how many numbers there are. OK, the actual name of this is the Arithmetic Mean; but as far back as Pythagoras the Greeks had several others . There is a a Heronian mean (remember Heron and the formula for finding the area of a triangle given the three side lengths?)although the term sub-contrary mean was used (Pythagorus lived 500 years before Heron).Another ancient mean was the harmonic mean (this is the one you use to answer questions like what is your average speed if you drive to town at 60 mph and drive home at 40 mph..and the answer is NOT 50 mph), and even the standard deviation you studied in statistics units, is a type of mean, called the RMS, for Root-Mean-Square. But today, we want to talk about the arithmetic mean, and the geometric mean and a special inequality that ties them together.


If you remember arithmetic sequences, and geometric sequences, the big idea was that one was about addition (or subtraction) and the other about multiplication. That idea about the names extends to the arithmetic and geometric means. Ok, so let’s use a little formal notation, cause it feels so good. You know the arithmetic mean… \( \bar{x} = \frac{x_1 + x_2 + \cdots +x_n}{n}\) where x1 means the first number and x2 the second, etc…  \( \frac{\Sigma_{i=1}^{n} ({x_i})}{n}\)

The geometric mean works the same way, except instead of adding the numbers, we multiply them, and instead of dividing by n, we take the nth root. So for two numbers , say 2 and 8, the geometric mean would be (2*8)1/2 = 4. If there were three numbers, we would take the cube root of their product, etc for more numbers. If that sounds like a screwy way to find the middle, let me point out one of the places it is useful. Suppose you have a triangle with sides of 3, 5, and 10. The perimeter is 18. What the arithmetic average gives you is the length of the sides if you wanted to make a triangle with the same perimeter and all sides equal, in this case we want each side to be 6.


If a rectangle has sides of 2 and 8 then its area is 16; but what if we wanted to make a rectangle with the sides all the same that had the same area. That would be a square, so we take the square root of 16 and get 4. The geometric mean of 2 and 8 is 4. We can do that with a solid too. Take a box with length, width and height of 2, 9, and 12 respectively. The volume is 216 cubic units. If we want a perfect cube with the same volume, we take the cube root of (2*9*12) and get 6. We say the geometric mean of 2, 9 and 12 is (216)1/3. Of course we could do the same thing with any number of values, but the meaning in four-space or five-space etc, is a little harder to visualize. We even have a symbol for multiplying that allows us to write products in a condensed form similar to the sigma notation. The symbol we use is a capital Greek Pi. We can write  \( \Pi _{i=1}^{5} ({i+2})\)when we want to multiply (1+2) (2+2)(3+2)(4+2)(5+2). Notice we incremented through the numbers from 1 to 5 and added 2 to each, but instead of adding as we do with sigma notation, we multiply. Then we can write the geometric mean as  [(x1)(x2)…(xn)]1/n

If you remember how you can write a sequence in your TI-calculator and use the "sum" command to do the sigma notation, then you will be thrilled to know there is a command to find the product of the numbers in a string (look one line below the "sum" entry on your calculator.


So NOW we are ready to get to the big inequality we wandered through all that to get to; for any group of numbers, the geometric mean is always less than or equal to the arithmetic mean. Try a few simple ones, with two numbers, say 4 and 9, the geometric mean is 6, but the arithmetic mean is 6.5; or pick any three numbers of your choice and try it again.


For two numbers there is a really cool (is it still ok to say “cool”) geometric proof that is totally visual, and it gives me a chance to show you one more way that the geometric mean is MEANingful (couldn’t resist). If we take two lengths, call them a and b, and place them together on a single line, then M is the midpoint of a+b, and a+b/2 is the distance from m to either end of the line segment. But if we let the line comprising a and b be the diameter of a semi-circle, the perpendicular distance c from P, where a and b join to a point on the semicircle is the geometric mean of a and b, and r is the arithmetic mean. It is clear that r, being the hypotenuse of a right triangle, is always going to be greater than or equal to c, a leg. It is also easy to show that c = (a b)1/2, the geometric mean of a and b. Since r=(a+b)/2, then the distance MP is r-b, which is (a-b)/2. So we have r2 = c2+MP2 . Substituting in we get (a+b)2/4 = c2 + (a-b)2/4 so 4c2= (a+b)2 –(a-b)2 . The right side of this is a2+2ab+b2 – (a2-2ab+b2) and when we subtract we are left with 4c2 = 4ab, or just c2 = ab, hence c=(ab)1/2 and is the geometric mean of ab.



Later, I will try to show a really nice application of this inequality to solve the birthday problem.

Friday, 13 June 2008

Mr Galloway's Jumping Frogs.



Mr Galloway sent me an animated puzzle on a excel spreadsheet that he and Mr Brock had been trying to solve (Ok, obviously they have WAY to much time on their hands) It is supposedly from a 2nd grade test in China or somewhere (don't belive everything you read on the internet, children). You can play it (and save to your own computer if you want) here . I'm going to wait to publish the solution, but if you are going crazy, here are two helpers... One, If you post a comment, someone will respond...even if it has to be me.. two,, a generous tip... two in a row of the same color is wrong, and finally a tip from old Sherlock Holmes who said"When you eliminate the impossible, what is left, is possible... I'll get back to this in a few days. THINK! And if you solve it, send me a comment.


Ok, too easy for some.. so there is a 2 dimensional variant of the puzzle here

The problem was first published by
Eduard Lucas, a 19th century French Mathematician; but versions of the problem may well date back to 8th century Arabia.

Lucas also created the Towers of Hanoi problem, try it here. He also did LOTS of work on the Fibonacci sequence (1,1,2,3,5,8,13...) and developed a generalized version that is called the Lucas sequence