Math You Don't Need

If you really like math, check out Math You Don't Need.

Wednesday, November 9, 2011

Prerequisites

This math blog uses various symbols and requires some understanding of algebra. In this post I will define the symbols and give examples and references for self-study.

First some definitions:

  • The carat symbol, ^, is used for exponents. 3^2 is 3*3 or 9. 2^4 is 2*2*2*2 or 16.
  • Parentheses are used to group terms in order to avoid ambiguity. For example 3^2/4/5-1 is somewhat ambiguous. You could read it as 3^(2/4) / (5-1) or ((3^2) / (4/5)) - 1. You should always treat parentheses as a number. For 3^(6/2), you should first find (6/2) = 3, and then evaluate 3^3 = 3*3*3 = 27.
  • Order of operations: First evaluate from left to right Parentheses and Exponents, then Multiplication and Division, then addition and subtraction. For example, 3^2 - 4*(7-3)^2 / (1/2) can be evaluated in multiple ways, each of which is equally valid. After doing enough evaluations, you develop intuition about which way will be easiest. The term (7-3)^2 jumps out to me. You could either do the subtraction operation inside the parentheses first, or do the squaring first. Doing the subtraction gives us 4^2= 16. That was easy. Doing the squaring gives us (7-3)*(7-3) = 7*7 - 7*3 - 3*7 + 3*3 = 49 - 21 - 21 + 9 = 16. That was a little more difficult! Another point about order of operations is that it makes some parentheses unnecessary. Consider 2^4 - 3/2 + 16^(1/2) / 2. If we were to use parentheses to fully separate each calculation, it would look like (((2^4) - (3/2)) + ((16^(1/2)) / 2)). That's just too much to keep track of. Instead, we can remove the parentheses around 2^4 because order of operations tells us that exponents get applied before subtraction. Also the parentheses around 3/2 can be removed because division happens before subtraction and addition. So order of operations gives you the ability to unambiguously remove parentheses due to tighter and looser groupings (exponents and subtractions respectively).
  • Using letters instead of numbers: It is necessary to use letters instead of numbers in an equation if the goal is to make a general statement. If I tell you that I bought 3 chickens for 5 bucks a piece and spent 15 dollars, that's nice but it doesn't tell you how many chickens you can buy. I have just described the equation 3 * 5 = 15. Let's use letters instead. Let's use P for the price of chickens, N for number of chickens, and C for total cost of purchasing n chickens for P price. We can write this as n * P = C. There are two things you can do with this equation that you couldn't do with the numbers: you can figure out any of the numbers if you know the other two, and if you only know one of them you can create some scenarios using a reasonable range for another of the variables in order to estimate the third, unknown quantity. For example, chickens cost $4.37 today and we need to buy 10 for an event. We can now figure out C, the total cost since we know C = n * P = 10 * 4.37 = 43.70.
  • Algebra is the language of mathematics. If you understand Algebra, then you can not only follow along with all of my calculations, but you can come up with your own. Below I will attempt to build the scaffolding of Algebra, but it takes practice to become proficient. I highly suggest doing the exercises in the Khan Academy links below. They're fun and you'll learn Algebra!

Math Time
Let's start with some Exponent rules:

  • Exponents are really just shorthand for the same thing multiplied together over and over. 3^5 = 3*3*3*3*3. (x+1)^3 = (x+1) * (x+1) * (x+1). Some ideas pop out pretty quickly. What is 1^2? 1*1 = 1. What about 1^5? 1*1*1*1*1 = 1. We can see that 1^n = 1 whenever n is a whole number greater than 0 (i.e. 1, 2, 3, ....). Similarly 0^2 = 0 * 0 = 0. 0^n = 0 under the same conditions on n. Now let's look at negative numbers raised to powers. (-2)^2 = (-2) * (-2) = 4. (-2)^3 = (-2)*(-2)*(-2) = -8. Let's look at how exponents work when we multiply numbers with the same base (the base is the number being raised to the power). 3^2 * 3^3 = 3*3 * 3*3*3 = 3^5. By this same logic, 3^60 * 3^40 = 3^100. Note that 3 = 3^1. The exponent of 1 is assumed if it is not written. For more exponent rules, check out http://www.khanacademy.org/video/exponent-rules-1?playlist=Algebra+I+Worked+Examples. You can also look at the next two videos, exponent rules 2 and 3. If we use symbols instead of numbers we see some general truths come out: a^x * a^y = a^(x+y).
  • Let's talk about fractions and division. A fraction such as 5/3 should be thought of as "how many 3's does 5 have?" If you have trouble thinking about what a 5 or a 3 is, you can think about a 5 gallon bucket and a 3 gallon bucket. How many 3 gallon bucket loads could fit in a 5 gallon bucket? Let's look at some examples:
    • 2/1: How many 1's does 2 have? 2
    • 3/2: How many 2's does 3 have? 3 has one full 2, and half of another 2, so 1.5 or 1 and 1/2 (which is called a mixed number and I'll write it as 1 1/2 from now on)
    • 1/2: How many 2's does 1 have? 1 only contains half of one 2, so 1/2 or .5
    • 3/(1/2): How many 1/2's does 3 have? It takes two halves to make a whole, and 3 is three wholes, so it takes 6 halves to make 3.
    • (1/2)/3: How many 3's does 1/2 have? 1/2 only has 1/6 of a 3.
  • So we can start making some generalizations about fractions. First off, you can't divide by zero, so don't even try! (unless you're in calculus, then go hog wild!) If we look at a fraction, it pretty clearly has a top and a bottom. 5/3 has 5 on top and 3 on bottom. The top is called the numerator and the bottom is called the denominator. The numerator is 5 and the denominator is 3 in the example above. There is an indispensable property to know which is called multiplying by the reciprocal. We already saw that 3/(1/2) = 6 and we also know that 3*2 = 6. That property generalizes to (a/b)/(c/d) = (a/b) * (d/c). This is stated as "dividing by a fraction is the same as multiplying by it's reciprocal," or "flip and multiply". If you don't have a solid background in fractions (which is nothing to be ashamed of), then I highly suggest watching the series of Khan Academy fraction videos at http://www.khanacademy.org/video/multiplying-fractions?playlist=Developmental+Math.
  • I will say a little more about fractions.
    • When you multiply fractions (3/4) * (5/11) you multiply the numerators and denominators. (3*5) / (4*11). If you ever forget a rule like this, try two or three examples. Consider (3/1) * (1/3). Intuitively you know it should be three thirds, or 1. 
    • When you add fractions, you need a similar denominator. Consider 1/2 + 1/3. The easiest way to get a common denominator is to multiply the two denominators that you are trying to add together, 2*3=6. The idea is that you can represent 1/2 as 3/6, and 1/3 as 2/6, so now we have 3/6 + 2/6. Fractions with the same denominator can now be added together. If I have 3 parts of 6 and 2 more parts of 6, then I have 5 parts of 6, or 3/6 + 2/6 = 5/6. Another way you can write this is (3+2)/6. When you have the same denominator, you can combine terms and add the numerators.
    • If you have more complex numerators and denominators such as (4*5 + 1)/(3^2 - 1) they can sometimes be simplified. The art of simplification (it really is an art) comes from intuition which comes from doing it over and over and over again. Practice with the exercise portion of the Khan Academy.
  • Now let's talk about factoring and distributing. Suppose you have 3 * (5+2). You can figure that out by noting that 5+2 = 7, and 3*7 = 21, but you can also distribute the 3 and note that 3*5 + 3*2 = 15 + 6 = 21. 3 * (5+2) = 15 + 6. You can distribute the 3 to each number being added, and you can do the opposite, which is called factoring, and factor out the 3 from 15 and 6. As another example, 27 - 9 = 9 * (3 - 1). You could also factor out a -9, -9 * (-3 + 1). If we start using symbols, we can write x * (a+b) = x*a + x*b. Also consider x^2 + x. That's just x*x + x, so we can factor out an x to get x * (x + 1). We can do this with more than two terms, too. 3*x^4 + 4*x^2 - x = x * (3*x^3 + 4 * x - 1). So far, we have been factoring and distributing one number. What if we have (x + y)^2. We know that is (x+y) * (x+y), but how do we distribute this? In the same way. Treat the left x+y as an atomic thing and you get (x+y)*x + (x+y)*y. We just distributed the quantity (x+y) to the right (x+y). Now if we distribute x in we get x*x + y*x + (x+y)*y. Now distribute the y and we get x*x + y*x + x*y + y*y. Remember that multiplication is commutative (in other words, 3*5 = 5*3, you can switch the numbers around). We can simplify (x+y)^2 = x^2 + 2*x*y + y^2. To show that with numbers, let's use (3+4)^2 = 7^2 = 7*7 = 49. Also, (3+4)^2 = 3^2 + 2*3*4 + 4^2 = 9 + 24 + 16 = 49. To learn a little more about factoring quadratics (going from x^2 +2*x*y + y^2 to (x+y)^2) please watch the Khan Academy videos starting with http://www.khanacademy.org/video/factoring-and-the-distributive-property?playlist=Algebra+I+Worked+Examples.
If you can work with exponents, fractions, and factoring, then you have most of algebra covered. If you also become proficient with working with variables instead of numbers, then you are ready to tackle anything in this blog and more.

There are two more pieces that come up over and over in the math I have needed over the years, and they are an understanding of sequences and series. First let's talk about sequences:
  • I use the symbol a_0 and a_1, which should be read as a-sub-zero and a-sub-one. Let's look at one of my favorite sequences, the triangular numbers. The first five are 1, 3, 6, 10, and 15. In other words a_1 = 1, a_2 = 3, a_3 = 6, a_4 = 10, and a_5 = 15. You might be able to guess the pattern which is 1, 1+2, 1+2+3, 1+2+3+4, and 1+2+3+4+5. 
  • We could represent a_1 = 1, a_2 = a_1 + 2, a_3 = a_2 + 3, a_4 = a_3 + 4, and a_5 = a_4 + 5. What if we wanted to know a_10? We could add ten numbers together, but that would be a pain, especially when we start asking about a_100 and so on. The general form of any element of the sequence would be a_i = a_(i-1) + i. Read this as a-sub-i equals a-sub-i-minus-one plus i. Here i is a placeholder. If i = 4, we would have a_4 = a_3 + 4 which is what we saw above. But again, this is awful to compute when i is large. This is known as the recursive form of the sequence because it is defined based not just on i, but on previous terms of the sequence which are in turn based on previous terms of the sequence all the way down to the base case of a_1 = 1. If we can find a formula based only on i, that is called the closed form of the sequence, and is way easier to compute for large values of i. 
  • The clever mathematician Gauss figured this out in first grade. He finished his work early, and his annoyed math teacher told him to add up the numbers between 1 and 100 (or rephrased, find the 100th triangular number). After thinking about it for a minute, he spouted out the answer: 5,050! He realized that 1 and 100 added up to 101, 2 and 99 added up to 101, 3 and 98 added up to 101 and so on. There were 50 of these pairs of 101, so he got 50 * 101 = 5050. Pretty clever, huh. So in other words, the closed form of the solution is a_i = (i+1) * i/2. How, in general, do we go from a recursive form of a sequence to closed form? That is a subtle and complex field of mathematics (usually number theory) which is both useful and fun. I studied number theory in college because it was so fun.
Now let's talk about series:
  • When you have to add a bunch of similar things up, you have series. In textbooks you'll see the capital Greek letter, Sigma, which is terrifying to anyone who isn't a mathematician. In everyday math, we don't usually run into infinite sums (which is good, 'cause damn!). Instead we are usually dealing with some number of terms. In Loan Amortization, that number is 360. That's a lot of things to add up! When I write a sum in this blog, I will write it as (1 + x + x^2 + ... + x^(n-1)) for example. I find the sigma notation to be relatively obtuse and useless. The series should have enough terms to make it obvious what the ... refers to.
  • Time for some examples: Let's say we have two sums that we are subtracting. (x + x^2 + ... + x^n) - (1 + x + x^2 + ... + x^(n-1)). This is called a telescoping series, because all of the middle terms cancel out and your left with the two ends. So let's actually combine them: x - x + x^2 - x^2 + ... + x^(n-1) - x^(n-1) + x^n - 1. All of the terms cancel out except for the x^n term and the -1 term. We go from something really nasty that would take all day to compute by hand, to two computations. That's pretty sweet!
  • Using the idea of telescoping series as our intuition, we can solve a common series which comes up. Consider the series (1 + x + x^2 + ... + x^(n-1)). If we knew x and n, we could figure out the number that this sum added up to. Let's call that number S. We know from above how we could create a compact solution if we had another similar series, so let's state that a little more exactly. (x + x^2 + ... + x^n) - (1 + x + x^2 + ... + x^(n-1)) = x^n - 1. We know that the second series is S, and the first one looks just like S, but with all of the terms multiplied by x. If we factor out that x, then we get x*(1 + x + x^2 + ... + x^(n-1)) which is just x * S. Let's write it out now: x * S - S = (x + x^2 + ... + x^n) - (1 + x + x^2 + ... + x^(n-1)) = x^n - 1. Well, we can factor an S out of x*S - S to get S(x-1). If we now solve for S, we get S = (x^n - 1) / (x-1). So (1 + x + x^2 + ... + x^(n-1)) = (x^n - 1) / (x-1). I didn't believe it at first either. How could it be so nice looking! A surprising number of thing sin mathematics are very elegant, indeed.

Final Answers
Math is fun! If you want more help on this material, I highly suggest working through the practice problems on the Khan Academy website. They are both fun and educational, and they fill in the gaps. Math is very much built up one concept on top of another, so if you have gaps, it really impedes your ability to understand anything above those gaps. I am a huge fan of the Khan Academy website because it really tries to fill in those gaps.

Also, as always, feel free to comment with questions and I will answer them!

No comments:

Post a Comment