Welcome, I don't know why you are here, but I will tell you what is this blog about so you don't waste any time looking around . This is a math blog, as you already know. Here I will expose math topics, from simple algebra, to calculus and all in between. My idea here is to make this interactive, depending on the feedback I get, so make sure to comment on the posts if you don't understand something or you want me to write about some particular subject, because my aim is to help people, not to show off all my knowledge or to shout out "cool" stuff. I know math can be boring to most people and I intend to write of the most general subjects seen in school, highschool and college in a way that anyone can understand. Here you will find some very basic stuff written in simple words, how to solve word problems, what is math, algebra, math in games, fractions, multiplication, division, math for kids, for adults, cool math, boring math, whatever I find interesting to discuss and whatever YOU want to see here, so I'm counting on you to make this interactive, let's make that happen.
Mostrando entradas con la etiqueta math rock. Mostrar todas las entradas
Mostrando entradas con la etiqueta math rock. Mostrar todas las entradas

17 may 2013

Linear Functions

Linear functions.


Alright! now that we built the basis (defining functions and linear equations) we can talk about linear functions, don't mix that up with linear transformations, we will talk about that eventually. Now it will come to light why the word linear. At this point, it would be good if you get some graphing software, such as Matlab, Derive, Mathematica, Octave or even google. Some of them are free, some not, Matlab can get quite expensive depending on the license you buy. I will make a post about some of them, eventually, and for this one, I will use Derive, because it is the simplest one. We will see about that later.
How does a linear function look like? well, it is a function, so it has to relate two sets, and satisfy the condition that, for every element of the domain, there is one and only one corresponding element in the codomain.
y = mx +b  <-- this is the "face" of a linear function. Why m? why b? what is variable? what is fixed?
m and b are fixed numbers, what I wrote is the slope intercept form, we'll see about that name.
For now, m and b are fixed numbers, x and y are the variables. So, an example of a linear function is 
y=3x+2 or y=7.5x+8/4.
This is not the only face a linear function can have. You can have 
Ax+By = C <--- this is called the standard form
you can go from one to the other performing the same operations on both sides as we did in the linear equations post. Let's see how to go from the standard to the slope intercept
Ax+By = C  <---- we need to get y alone on the left side, so let's subtract Ax from both sides
By = -Ax +C  <--- now let's divide both sides by B
y = -A/Bx +C/B
so, m = -A/B and b = C/B.
Alright, that is how they can look like. They are equations, because there is an equal sign somewhere in there, and they are linear, because no variable is raised to no power (remember there is an implicit hidden power of 1, x^1= x ) and no variable is input of any weird function, such as cos(x) or e^x or Ln(x) or such. So, linear.
Ok, what we can do with these things? can we solve them? the answer is  no, we can't.
There are infinite pairs (x,y) that satisfy  y = x +4, think about it.
If x is 1, y is 5, so (1,5) is a possible solution, but if x is 2, y is 6, so (2,6) might as well be the solution. So hopefully you understand that it doesn't make any sense to say "solve y = x+4"
So, what can we do with these linear functions? graph them, solve for particular values of x OR y.
And that's pretty much it, so let's graph this. How can we do that?
Well, as we saw, there are infinte pairs that make that equation true, if we set a two dimesional space, where x is the horizontal coordinate and y is the vertical coordinate, the pair (1,5) determines a point in that plane, and so does (2,6) and (3,7) and they don't have to be integers, (1.5,5.5) also satisfies the equation. So let's graph all those points along with a couple more (that I get just by selecting random x's and seeing what y ends up being) and see what we get
.
This is something we can actually do with pen and paper, and hopefully you will see that if you join the points you get a straight line, now I'm not going to prove that, but I can show you a graph that I get form Derive if I input y=x+4

What Derive does is basically plot thousands of points, now we don't got time for that, and we are smart. If we have two points, we can draw a line, right? that is all we need, two points, a pen, paper and a ruler, more than two points is redundant, hopefully that makes sense.
And this is the reason that they are called linear, because the graph is a line.
Ok, there are a few more elements to discuss, and the reason why the slope intercept form is "better" than the standard (it is easier to do some things with the standard though)
First, what gives the name to the slope intercept form. Remember it was  y=mx+b
m is the slope, we will talk about that later
and b "is the intercept" Acutally, (0,b) is the y intercept, if you notice, at the y axis, x is 0 (because x is the shift with respect to the y-axis, positive to the right, negative to the left)
So, just by looking at it, we can tell the slope and we can tell the y-intercept (point of intersection of the line and the y axis).
The slope is the number with the x, and it makes sense to call it slope too.
Picture this scenario, we have  y = mx, no b (or b=0, however you want to see it)
there is a fixed point here,  (0,0) no matter what m is, if x is 0, y is 0.
So, say m is 1, y=x, we can get the point (1,1) and draw a line with that and (0,0)
but if m is 2? we get (1,2) instead, and if m=100, we get (1,100) let's see how that looks like.

the green is y=x, the purlpe y=2x and the brownish is y=100x
so, as the slope grows, the line gets steeper, and that is what we think about when we see the word slope, right? a big slope, a very steep thing, so if the slope is 100, it should be steep, compared to what? well, to a slope of 1, if the slope is small, say  0.0001 , then we should expect almost no slope,
if the slope is 0, we should have an horizontal line (that is what one imangines with "no slope" )
and if the slope is negative, the line "goes down" ( as x increases y decreases)
so a slope of -100 for example, would be very steep, but pointing down.
Hopefully all this makes sense, I hope to get some feedback. I will put a couple of problems, but we will come back to this, in a more practical sense. Let me know what you think in the comments.

1)  3x +2y  = 7   <---- what is the slope here?
2)  5y = 3+x <--- write this in the slope intercept form
3) 5x+7y = 11 <--- what is the y-intercept here?

Functions

 Functions.


Ok, today we are going to talk about functions. You have to be aware that this is a HUGE topic in math and here I only want to give a simple word definition on what functions are, so we can move on to linear functions, graphing and all that stuff. So a function, a function is, in simple words, a relation between two sets. You have set A (that could be a bucket of dirty socks) and set B (that could be a bucket of gloves), a function is a relation between the elements of those sets (for example, pair the sock with the glove of the same color). Now, there is a condition that a function must satisfy. All elements of the input set (the set you apply the function to) must have a corresponding element in the output set and ONLY ONE. That is why we make a difference bewteen the input set and the output set, and they are called Domain and Codomain (or Range) respectively. So you have to specify what sets you will use, and for a given relation, you can define the function with a pair of sets and not with another pair. 
Let's see real examples of this. Say set A ={1,2,3,4}  (the numbers 1,2,3 and 4) and set B={2,4,6,8}, so we define a relation, with A as the domain and B as the Codomain and the relation is as follows  f(a) = 2a. What does this mean? That for an input "a" (a is an element of A, i.e 1,2,3 or 4)
we get the outcome by multiplying it by 2. Now, is this relation a function? Well, we have to see if it satisfies the condition, does each element of A have a corresponding element in B? let's see,  
f(1) = 2*1 = 2 so, (1,2) is the ordered pair. (an orderer pair is what the words say, two things, in a particular order) Is 2 in B? yes, does 1 have any other corresponding element in B? no, if we multiply 2*1 we will get 2 and only 2. So far we have no problem, but we can't say it is a function yet, we have to see if this holds for 2,3 and 4. And it does, you can check that f(2) =4,  f(3) = 6 and f(4) = 8. All 4,6 and 8 are in B and for none of the a's (2,3 and 4) we have more than one corresponding element in B. So f(a)= 2a is a function if we use A={1,2,3,4} as the domain and B={2,4,6,8} as the codomain. What happens if we flip the roles? what if we want B to be the domain? Same relation
f(b) = 2b  ( we use b now because B is the domain, we could have used x in both cases, the a and b were to emphatize the domain). Well, it works for 2,  f(2) = 4 and the pair (2,4) with 2 in B and 4 in A is valid pair, because 4 is in A, but none of the others, f(4) = 8, 8 is not in A (and that is enough to prove it is not a fucntion, but let's see the rest)  f(6)= 12, 12 is not i n A, and  f(8) = 16, not in A.
Som the same relation, f(x) = 2x, is a function with domain A and codomain B, but it is NOT a function with domain B and codomain A. Let's see a couple of examples.
I will use X for the domain set and x for the domain's elemets and same with Y and y with the codomain.
X={1,2,3,4} ; Y={1,2,3,4}
f(x) =2
This relation (we can't call it function yet) relates all x's with the number 1. If we were to list the
ordered pairs, we would have (1,2), (2,2), (3,2) and (4,2). Is it a function? You may say no, because all elements of X have the same corresponding element in Y, you would have fallen in my trap (muahaha) the condition is that all elements of X have one and only one correspondinf element in Y. And that happens, all of them have one and only one, who cares if all have the same, there's no rule with that, there is also no rule that says there can't be unpaired elements in the Codomain. So this is indeed a function. Another example....
I will just give the orderer pairs here, same X and Y as before. I will use the notation "(x,f(x))" for the set of all the ordered pairs given by the relation.
"(x,f(x))" = {(1,1), (2,1), (2,2),(3,3),(4,4)}
Is this relation a function?? NO!! why? because 2 (the "x 2") has two corresponding elements, so not a function.
I will leave some problems for you to work, relations, you tell me if they are function or not, and if not, why? Leave your answers in the comments.

1)  X={1,2,3,4} and Y={2,3,4,5}
f(x) = x+1

2) X={1,2,3,4} and Y={2,3,4}
f(x) = x+1

3)  X={0,2,4,8} and Y={2,3,4,5} 
"(x,f(x))" = {(0,2),(2,3),(4,4)} 

4) X={1,2,3,4} and Y={2,3,4,5}
f(x) = 1