Sunday, December 23, 2012

Perfect Christmas Tree Math


Here's a fun little post for the holidays!  It's not going to teach any new math concepts, though it is a neat demonstration of an out of the ordinary use for mathematics.  It describes mathematically how to decorate the perfectly proportioned Christmas tree.  I can't honestly say that I have tried it myself, though I don't doubt that it might be useful!

A department store in the United Kingdom by the name of Debenhams issued a challenge to the University of Sheffield math students to devise a mathematical algorithm to determine the optimum number of ornaments, tinsel, and lights in relation to the size of the tree, as well as the perfect size of the star for the top of the tree.  Members of the University's SUMS Math group were able to come up with a set of equations that described precisely what the challenge required:

Courtesy of http://www.shef.ac.uk/polopoly_fs/1.227830!/image/formulaslarge.jpg
The students say that the calculation took about two hours to design, though to actually compute the equations is as simple as entering numbers into a calculator.  The stated purpose of the formula is to help holiday shoppers to be smarter when purchasing decorations for their tree, as with this knowledge they will be able to buy the precise number of baubels and lights rather than have a box of extras leftover once the tree is done, or else not have enough and so have to go and fight through the mall crowds to get more.  It also means that people can find the right size angel or star for their tree, rather than guessing and then potentially being way off when they actually get home.  They say that the formulas are versatile enough to apply to large trees suitable for the Royal Family, right down to smaller trees that are more common.  You can check out the original news release here.

It's probably a stretch to think that this set of equations will make it into widespread use, as decorating for the holidays is way more about spending time with friends and family and having good times, rather than looking for mathematical precision in a Christmas tradition.  However, it's a fun exercise to show young math students that demonstrates yet another useful and unexpected use of math in everyday life.

Happy Holidays to all of my followers, and all the best in the New Year!


Thursday, December 6, 2012

How to Derive the Equation of a Circle


Continuing from my last post about the Equation of a Circle, here I would like go through an exercise which hopefully explains more about "why" the equation looks the way it does.  The equation of a circle isn't a difficult one to memorize, and the modifications that you can make to it to shift it either horizontally or vertically are very similar to the methods used in translating graphs of functions.  However, the theory behind the equation is very distinctively about a circle.

To begin, let's start with a point (5, 7).  Now, I ask to find points that are exactly 5 units away from this point.


To begin, it is very straightforward to deduce points that are horizontally and vertically in line with the center point.  We simply move 5 units up and down, and left and right.  This allows us to identify the points (10, 7), (0, 7), (5, 12), and (5, 2).


After these points, it seems that finding new points gets a bit more difficult.  However, it should be fairly obvious that by asking for points that are 5 units away from the center, this is essentially asking for points along a circle with radius of 5.  So then, how to find another set of coordinates (x, y)?


If you pay attention to how I have purposefully drawn the radius in the above picture, you will notice that I have inscribed a right angle triangle with a hypotenuse (radius) of 5.  This is one of the special triangles, a 3-4-5 triangle.  So then, if we then use the dimensions of this triangle, and rotate and flip it around the circle, we can come up with several more exact points that are on the circle: (8, 11), (9, 10), (8, 3), (9, 4), (2, 11), (1, 10), (2, 3), (1, 4).


As you can see, the points that we have identified are beginning to fill out the circle.  But, how can we identify even more (x, y) points?  It doesn't look like there are any points that lie on whole number integer coordinates left.  All that remains are fractional coordinates, and that seems like a lot more work than it's worth to identify more points!  Maybe we can find an expression to more accurately pinpoint ordered pairs, that will include all of those that we've already identified plus all of the ones that we can't?  Let's go back to our picture, and note the generic triangle now inscribed.


If we say that our radius of 5 is the hypotenuse of a right angle triangle, and we already know what the center point of our circle is, then we can do a bit of arithmetic to come up with generic side lengths for our triangle.  If we sweep the radius around the circle, and we always let the inscribed point be called (x, y), then we can state expressions that denote the length of the sides.  In this example, the horizontal side is equal to x-5.  I've visualized this in the following image.


Similarly, the vertical side length of our new triangle can be shown to be y-7.

Now, since we have described a right angle triangle with defined sides, we can apply the famous Theorem of Pythagoras to this triangle (a2 + b2 = c2).  This means that we can come up with the following equation:



And by now, you should recognize that this is the form of the equation of a circle:


Quite simply, this equation looks the way it does because it is based on the Pythagoras Theorem.  The circle equation really isn't a difficult one to have to memorize, but hopefully this demonstration has shown you the value of triangles and geometry in deriving more advanced math concepts.  Please don't forget to hit the +1 button below, and also follow me on twitter!  You can even click here to tweet about my post.

Credit to a YouTube video by DrJamesTanton where I got the idea for this post.


Sunday, November 25, 2012

Equation of a Circle


Once you have worked with functions for a while, inevitably you will begin to wonder "what about circles?"  You have explored all sorts of different equations and their graphs.  Perhaps you've even gone so far as to rotate graphs sideways and learn how to manipulate those equations as well.  But despite these seemingly more involved concepts, you've yet to come across circles.  For such an apparently simple shape, why have these not been included in such rudimentary graphing lessons.

Well, circles are a little different from what you've done so far.  For starters, circles technically aren't functions.  This may surprise you at first, but recall the vertical line test.  Would a circle pass such a test?  Of course not, because passing a straight vertical line through any point on a circle (except for the tangent points on the sides) would also intersect the circle on its opposite side.  Try it and you will see!  So, if a circle is not a function, then how do we handle describing their equations?  That is a little different, but really not much harder than your typical parabola graph.  Follow along and I will explain the equation of a circle in more detail.

For starters, let me just show you the equation for a simple circle.  Consider a circle with a center at the origin (0, 0) with a radius of 1.  We call this a unit circle.  Here is what the equation looks like:


It looks simple, right?  This equation can also be modified using similar concepts to how you would manipulate a function, such as a parabola.  There is a simple change to make to the equation that causes the graph of the function to translate left or right, and a second similar change you can make that results in a vertical translation of the graph.  In this case, depending on where you want to shift your circle, that is the variable you modify.

So, if you want to center your circle at (2, 0), which is a horizontal translation of 2 units to the right, you would change the above formula to include an (x-2)2 term.  Think of it as "if x=2, the whole x term becomes 0.  So 2 is its root."  Same thing applies to vertical translation.  If you change the y term to be (y-5)2, then you can see that the whole y term becomes 0 when y=5, so this means that the circle is centered at a height of y=5.  If we combine these two translations, we shift the circle to have a center of (2, 5), and the final equation looks like this:


Hopefully you can see how easy it can be to locate the center of a circle based on its equation, and how equally simple it can be to determine the equation of a circle just by a visual inspection.  However, to fully describe a circle, there is still something missing.  We haven't looked at what the "1" means.

To fully describe a circle mathematically, the only things that you need to know about it are the coordinates of its center, as well as its radius.  You may think that you should need more information, but think of it as the mathematical equivalent of a geometry set's compass.  To draw a perfect circle with a compass, all you do is put the point down at the center, set the radius, and spin the pencil around the paper.  You only needed those two pieces of information to be able to construct a circle.

Continuing with our example, the radius of our circle is described by the 1 term.  Technically, you can think of it as a 12 term, which provides for our circle to have a radius of 1 (or a unit circle).  To change our radius to 5, we would change the 1 to a 25, because just like the x and y terms, the radius term is also squared.  If we wanted a radius of 7, we would put the term as 49.  In general, this term is r2.

If we put all of these components together, we can come up with the general form for the equation of a circle.  We can include terms that allow for horizontal and vertical translation, as well as whatever radius we want.  Let's call the horizontal shift term "a" and the vertical shift term "b", and the radius "r".  In this case, here is the general form of the equation of a circle:


The equation describes a perfect circle, and doesn't allow for any stretching or compressing along either of the axes.  All that needs to be done is determine the circle's center point and radius, and you can easily fill in the relevant values.

As an example, consider the circle that has radius of 10, and is centered at (-5, 7).  Here is its equation:


Here is the opposite form of the question: what is the center and radius of the circle described by the following equation:


Quick analysis of this by comparison to the general form allows you to find that the center point is (-12, -2) and has a radius of 12.

Hopefully you can see that graphing circles is a little bit different from graphing more familiar functions, though still similar enough that the math concepts we've learned so far can easily be adapted to apply here as well.  In my next post, I would like to explain a little about just "why" the equation of a circle looks the way it does.  For teachers, this is also a good exercise to have students explore when first learning how to graph circles.  

Remember to please click the +1 button below to share my post!


Wednesday, November 14, 2012

How to use LaTeX Equation Editor


This is a post aimed at anyone who has a reason to type math symbols.  It is about the LaTeX equation editor, which is an online math utility.  I'm sure that many people know of this already, but it was only recently shared with me, and so I would like to share with anyone else who will find this valuable.  In particular, those who I feel this will benefit are: teachers and education professionals; students doing math homework; graduate students preparing thesis material.  Of course, anyone having to put any kind of math equations into a document will appreciate this.

The LaTex math symbol code generator can be found online at http://www.codecogs.com/latex/eqneditor.php.  It's a little intimidating at first glance, but after a little bit of experimentation, you should be able to generate any math equations that you can write down on paper.

In the upper control panel, you can select the functions that you wish to include.  For example, if you click the a/b button (left side of the panel), this is the generator for a fraction expression.  You can put any level of detail into the equations, and nest them within each other as necessary.  When you select the function, you will see a code for that function appear in the large main rectangle directly underneath the control panel.  When you become a LaTeX professional, you can just type your function codes directly into this box.  Once you click the function buttons to generate code, you will also find sets of brackets {}, in which you can type numbers, letters, or insert additional function codes.  Beneath the box, you can find some formatting options, below which you will see your math expression, rendered as an image .gif file.  You can copy this image, and then paste it into your document.

For example, if I want to generate an image for y=mx+b, rendered in a nice, textbook-like font, here is how you would do it.  This is a very simple example.  All you would do is type this in the box, and then observe the rendered image below.  This one doesn't require specific selection of functions from the control panel.  Here is what it looks like:


Note how much more professional it looks, compared to regular in-line text.

Another example will demonstrate the function abilities.  Let's try to write y=x2 + 2x + 1.  First, I would type "y=x" and then click the xa function button, which denotes exponents.  This would make your code look like "y=x^{}".  Into the brackets, you click and type a 2, and then you can move the cursor to the end and just finish typing the remainder of the equation.  The final expression looks like this: y=x^{2}+2x+1, and here is the image file:


To make a slightly more complicated functions, let's try to write y = x2/3/4.  You have to build complex equations from the outside-in.  So type "y=" to start, and then we need to select the fraction button, the a / b button.  That displays the code "y=\frac{}{}".  In this case, you type the numerator in the first brackets, the denominator in the second brackets.  However, the numerator has a fraction in it.  So, you click within the first brackets, and then type x and then add the new function, the exponent one again.  Into the additional brackets that appear, you can type 2/3, and then in the final set of brackets, type the 4 for the denominator.  Here is what the code looks like for this one:  y=\frac{x^{2/3}}{4}, and here is the image:


The best part about this code generator is that it updates the .gif file in real-time, so you don't have to type out a huge, complicated expression, and then hope you get it right.  If you make a mistake, you will see it right away, and then you can modify as necessary until you get what you want.  When you have it correct, you can right-click and save the equation image as an individual file, and then immediately erase your code and start over again with a new equation.

I find the LaTex equation editor to be extremely helpful, especially here on my blog when I want to show more complex expressions.  It does require having to go to a separate website, typing your code, and then coming back to your original document and inserting a file.  So, for ease, I often will just type straight text into my documents.  However, for that extra professional appearance, you cannot argue that the generated codes look fantastic!  If you have never used this before, I highly recommend that you give it a try!  If this is new to you, as it was to me recently, and you find value in this, then please click the +1 button below to share this!


Monday, October 29, 2012

Minimum Distance Between Two Parallel Lines


A lot of students seem to have difficulties in determining the minimum distance between two parallel lines.  Conceptually, if you have these two lines next to each other with the same slope, you can draw any number of different lines that can connect the two, though they all would be at different angles.  However, the shortest line that you can draw is the one that is perpendicular to them - the line that has no relative side to side travel to add extra length to the connecting line.  This post will hopefully explain simply how this can be done, while showing that it isn't really anything more difficult than identifying the information that you need, and then using a series of simpler concepts to get to the final solution.  You will hopefully find that these problems really aren't that difficult!  Please do me a favor and click the +1 button at the end to help me share my post!

Sometimes you will be given two lines (or line segments) or an equation to start with.  Here, let's start even further back, just for practice.  Let's begin just with two random ordered pairs that I've selected.

Find the equation of the line AB that crosses through the points A(2,1) and B(4,6).

As I described in my previous post here, you can determine the equation of this line quite easily.

Slope m = (y2-y1) / (x2-x1) = (6-1) / (4-2) = 5/2
Y-intercept b = y-mx = 1-(5/2)*2 = (-4)
Therefore: y = (5/2)x - 4.  This is the equation of our line.  You shouldn't have had problems following along through this step, though if you'd like some review, check out my post here.  Now that we have our first line, let's develop the rest of our problem.

What is the minimum distance between line AB and a parallel line CD that passes through point C(3,8)?

Recall that parallel lines, by definition, are lines that have the same slope, and so will never cross or come closer together.   Also, though you can fit any length of line in between these two starting lines, the shortest one you can draw between them is perpendicular.  Draw two lines and convince yourself of this!  The minimum distance between the two lines is a line perpendicular to them both. 

Here is a small recap of the information that we already know to help us answer this question, as well as a bit of an outline of how we will go about solving it.

Finding the distance between our line and point
  • First line: y = (5/2)x - 4
  • Point on second line = (3, 8).  FYI, you now have enough information to determine the equation of the second line, though it's not required right now.
  • Shortest distance between the lines is an intersecting line that is perpendicular to both. 
  • The distance can be calculated by the distance formula. What does this need?  We need two points. We have one given to us, and now we need the second point, which will lie on our first line.
  • We find this second point at the intersection of the starting line and the perpendicular line that passes through the given point. How do we find this intersection?
  • The intersection is where the equations of the two lines are equal.  We have the first equation, solved in the first step above.  How do we get the second equation, of the perpendicular line?
  • The second equation comes from knowing the given point, and the slope perpendicular to our parallel lines.  Recall: the slope that is perpendicular to slope "m" is "-1/m".
  • Solving the system of equations will yield our second point of interest.  And once we have the point, we can simply plug numbers into the distance formula to find our final answer.
It seems like a lot, but if you follow it through, you can see the logic behind all of the steps. Find one thing which leads to another, which leads to another, which leads us to the solution.  This is another good piece of advice for working with more complex problems.  Look at what you need to find, and try to step backwards to identify helpful steps that you can take to progress through the process. Ask yourself "what do I need to find this?" and then "what do I need to find that?" and you will then find that you have outlined your own strategy of how to solve the problem!

So then, let's get to the numbers.  To start, let's find the equation of the perpendicular line.  We have a point (3,8), and we want the slope that is perpendicular to the slope (5/2)... which is (-2/5). Now we can find our equation.

(y-y1) = m(x-x1)
y-8 = (-2/5)(x-3)
y=(-2/5)x + (6/5) +8
y=(-2/5)x + (46/5)

Our line and point, with the perpendicular minimum distance shown.
Now we want to find the intersection point of this perpendicular line with our first line (equation y=(5/2)-4). To do this, we solve the system of equations by setting them to be equal to each other, solve for the variable x, and then sub in this x value into either one of the original line equations to find y.  x and y are the ordered pair of our second coordinate.

Solve the following system:
y=(5/2)x - 4
y=(-2/5)x + (46/5)

(-2/5)x + (46/5) = (5/2)x - 4
(-2/5)x - (5/2)x = (-4) - (46/5)
(-4-25)x/10 = (-20-46)/5
(-29)x/10 = (-66/5)
x = (-66/5)(10) / (-29)
x = 660 / (5)(29)
x = 132/29 Here is our x value! (Kinda ugly, but sometimes that's what you get!)

Now we put that value into either one of the first two equations in our system, and solve for y.  Both will give the same answer... they have to! We're talking about the POINT where the two lines cross, and hence are EQUAL in both cases.

y = (5/2)x - 4
y = (5/2)(132/29) - 4
y = 660/58 - 4
y = (660 - 232) / 58
y = 428/58
y = 214/29 Here is our y value! (Just as ugly as x!)

Here's our system, with the intersection point now displayed.  Looks like our calculations are correct!
So, we have our point on the first line as (132/29, 214/29).  Now all we need to do is find the distance between this point, and the given point (3,8).  To do this we can use the distance formula.  I've explained the distance formula in another post, so I'll just go ahead and use it here.

distance, d = sqrt[(x2-x1)2 + (y2-y1)2
(Again, my apologies for not being able to show a proper square root sign.)
d = sqrt[(3-132/29)2 + (8-214/29)2]
d = sqrt[(-45/29)2 + (18/29)2]
d = sqrt[(2025+324)/841]
d = sqrt[2349/841]
d = (9/29)*sqrt(29) This is the answer!

Unfortunately, we get a nasty looking answer.  But that doesn't make it any less correct.  Hopefully you were able to follow along with how I approached this problem, and how we arrived at the solution, because these are the kinds of steps and logical thinking that you will need to use.  In all likelihood, most questions that you will encounter in your math studies are going to look a whole lot friendlier than this monster.  As always, feel free to leave any comments or questions below, and I'll do my best to address them. :)  Also, please remember to click the +1 button below if this was helpful.  You can even tweet about it automatically by clicking this link.  Bookmark my site and come back again!


Related Posts