Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Ok, so I know the overview a bit. I would like to know why one should use one, what they're used for, and maybe even the history behind their purpose.

X = X (Y) + 7 ... 5 = 5 (20) + 7 ... 32 is the sum.

So, using the problem above, which is perfectly legal for a function and a variable/constant/object to reside in, what advantage would that be over, say, this:

X = X + 20 + 7 = 32.

It seems to me that the use of a function is quite lacking in detail of why it is useful, what purpose is serves, and how it makes things better.

Can anyone here give me an answer as to the purpose, reason, or advantage in using a function?

PS: I am expecting the rolling thumbs downs, but I really do not care. I would just be happy for a simple answer to what a function's purpose is.

share|improve this question
5  
This makes zero sense as it's written. What is $X$, $Y$, what is $7\cdots 5$? where does $5(20)$ come from? –  Alex R. Nov 20 '13 at 21:42
2  
Where have you heard of the concept of a function? Are you covering them in class? If so, what are you doing with them in class? From your question it almost seems as though you're not using the same definition for "function" as the rest of us. –  Jack M Nov 20 '13 at 21:44
    
I just assume a function is anything with parentheses around it, such as X (3) = 10. Am I wrong? Please correct... –  Why use Functions Nov 20 '13 at 21:46
3  
The downvotes are (probably) because your question makes absolutely no sense, not because you are challenging the use of a commonly used/taught object in mathematics. –  fhyve Nov 20 '13 at 21:47
1  
A function is not something that simply has parentheses around them. For instance, 3(4+1) is not a function, it is multiplication. A function is a thing that takes objects of a certain sort (say clothing in a store) and associates to them other objects of another sort (say numbers: like how much each piece of clothing costs). We denote this by $f(x) = y$, where $f$ is the function, $x$ is the input and $y$ is the output. And if it is not implicit what sort of objects your function is dealing with, you write $f:A \rightarrow B$ where A is the set of inputs and B is the set of outputs. –  fhyve Nov 20 '13 at 21:51

6 Answers 6

This might help: What are functions used for?

Here's one of my own reasons to use functions: they help describe input-output relations, which have real-world applications. I'll give an example:

Suppose $f$ is a function that tracks revenue at a lemonade stand. It takes "number of cups sold" as an input and gives "dollars made" as an output. It might look like this:

$f(x)=.25x$

Assuming that each cup of lemonade costs $.25$ cents. So if I sell $5$ cups, then I make:

$f(5)=.25(5)=1.25$ dollars. If I sell $10$ cups, I make:

$f(10)=.25(10)=2.50$ dollars. In this case, we call $10$ the input and $2.50$ the output. Does that make sense?

share|improve this answer
    
No, it doesn't make complete sense to me. Why does your first function example equal .25x? –  Why use Functions Nov 20 '13 at 21:49
1  
And why would you need a function for this? Can't one just multiply the amount each cup costs, and increment the value by the factor of the cups sold, e.g. 10c x .25l? Why do you need an input for to be specially treated as "function" if the math required to get the result is elementary multiplication factors? It's not like one would write down an equation to multiply lemonade this way. –  Why use Functions Nov 20 '13 at 21:49
    
$x$ is what we might call the input. So when we define a function, we just leave as $x$. Then we can plug in different values for $x$ (such as 5 or 10) and then the function gives an output for those values of $x$. –  user66360 Nov 20 '13 at 21:51
    
Ok ... but if you read my second comment above you will see what I am really questioning on your part. –  Why use Functions Nov 20 '13 at 21:52
    
I mean it's just a really basic example to help show you how functions work. –  user66360 Nov 20 '13 at 21:54

I have a clear memory of being philosophically opposed to function notation when I was introduced to it in Algebra II as a sophomore in high school. (I was 15 or 16 years old at the time.) I could see no point in rewriting a perfectly good equation like $y=x^2+1$ as $f(x)=x^2+1$. It just seemed like extra, extraneous, unnecessary, mathematical verbiage. Sophomore ("wise fool") that I was, I gave the teacher, Mr. Alderman, a hard time about it. I was an obnoxious teenage pain in the ass. (I have since outgrown that description; I am no longer in my teens.)

As I recollect, I came to terms with $f(x)$ when I realized that you can also have another function, $g(x)$, at the same time. If you write down two equations, say $y=x^2+1$ and $y=x+1$, you are obligated to solve for $x$. But if you write down $f(x)=x^2+1$ and $g(x)=x+1$, you are under no such obligation. Function notation is a way of naming things, so that you can call on them when you need them. Instead of saying "Hey you!" all the time, you can say "Hey Frank!" or "Hey Gus!"

There's more to it, of course, than that, as other answers here have addressed. I think I also simply got used to using the notation. But to the extent that the OP is baffled by why anyone would want to bother with seemingly pointless notation, I thought it worth stipulating that he or she is not alone in that experience.

share|improve this answer

You said in a comment that you believed a function was "anything with parentheses around it", which explains why your question is so confusing. It's possible that you were simply expressing yourself badly, but it would seem you actually just don't know what a function is.

So let's start with the definition of a function.

A function is a rule which transforms numbers into other numbers.

So, "double and add one" is a function. "Count the number of e's in the English word for the number" is another.

If we take the first example, "double and add one", then the result of applying that function to, say, $6$ is $13$. $6$ is what kbball calls the input, and $13$ is what they the output.

We usually give a function a name for short, such as $f$. We then write, for instance, $f(3)$ for the result of applying the function to $3$. Note that we are not somehow multiplying $f$ by $3$. Putting the $3$ in parentheses after $f$ is just a way of representing "apply $f$ to $3$". It is a little bit confusing at first.

Hopefully this at least clarifies the basics. Let me know if you already knew this and I misunderstood the source of your confusion, or if you need more details.

share|improve this answer

Functions, simply put, are methods of encoding relational information. Whenever you have something which depends upon something else then you essentially have a function.

Consider the following example.

You keep a thermometer outside your room and you note down the temperature of thermometer every hour. You notice that the temperature varies from time to time: The temperature you read off the thermometer depends on the time you read it at. In this way we can say that temperature is a function of time which we can write as $T(t)$. In case there's any confusion, this notation does not say $T\times t$, it's to say that $T$ (temperature) is a function of $t$ (time).

One cold winter day, you buy yourself a heater. You set the heater to maintain your room at a cozy $24^\circ$C in your room. You know that the amount of energy your heater consumes is dependent on the ambient temperature; the colder it is outside, the more energy it takes for your heater to maintain room temperature. This is another functional dependence, your energy usage is a function of the temperature $E(T)$.

If you wanted to keep track of your heater's energy usage overtime, then you need information from both functions: To find out the energy usage at a specific point in time, you need to know the temperature at that time and the energy consumption at that temperature. In mathematical lingo, the energy consumption as a function of time is given by the composition of our two functions $E(T(t))$.

Notice that in our example we did not write down any numbers. We did not need to know the forms of our functions. Functions are ultimately about the relationships between different quantities. The very fact that you know one quantity depends on another is very powerful. In our running example, the very fact that you know your energy consumption depends on the temperature means that you could (conceivably) use your power bill as a record of temperatures. Thinking in terms of functions and relationships is not only a useful way of encoding information, but also invites a better way of thinking about different objects.

Ultimately, I would not worry too much right now about the fact that you do not find functions useful. If you continue in your mathematical education, I guarantee that you will find a place for them, especially if you later decide to learn calculus. Functions are so generally useful that many of us have forgotten what it's like not to know them.

share|improve this answer

Functions are a way of associating things of one sort to objects of another sort. A formal way of talking about objects of a certain sort is with sets. So we start with that:

Definition: A set is a collection of things, where you don't double count, and order doesn't matter. For instance, the set of the first four letters in the English alphabet is a set, and we denote this by $\{a, b, c, d\}$. We can have more complicated functions like the set of whole numbers which we denote by the symbol $\mathbb{N} = \{1, 2, 3 ... \}$, or real numbers (numbers with possibly infinite decimals) by $\mathbb{R}$.

Now that we have some sets, we can define functions.

Definition: A function is a pair of sets $A$ and $B$, called the domain and range of a function (inputs and possible outputs), together with a rule $f$ of associating each element of $A$ to a single element of $B$. Here is where I think the confusion is coming from: if $x$ is an element of $A$, we denote the thing in $B$ that we are sending it to by $f(x)$. We are not multiplying $f$ and $x$, the thing $f(x)$ is its own thing which cannot be split. So we can define the rule $f$ by an equation $f(x) = y$, where $y$ is something consisting of numbers

Example: I have a ball 400 meters above ground and I want to know what it's position at any time is. Lets denote its position as a function of time. that is, our function takes the set of real numbers $\mathbb{R}$ (time) as input, and the set $\mathbb{R}$ (meters above ground) as output. From physics, we have that the distance $d(t)$ at time $t$ is $d(t) = -9.8t^2 + d(0)$, where $d(0) = 400$ is where the ball starts. So our function $d(t) = -9.8t^2 + 400$ is not just multiplication.

Example: Addition is also a function. Let $s:\mathbb{N} \rightarrow \mathbb{N}$ be a function that takes a whole number, and returns a whole number, where the rule is $s(n) = n+1$. This is a super simple function, it just takes your number and adds 1. But again, it is not just multiplication.

We can have more complicated examples, like unconstrained population growth (like bacteria that hasn't reached the boundary if its petri dish, where the population doubles in size every 1.3 hours). These functions are generally of the form $f(t) = a2^{t/T}$ where $t$ is time, $a$ is the size of the population at time 0, $T$ is the time it takes for the population to double. So if we have 4000 cells at time 0, and it takes 1.3 hours for the population to double, then at our function for the number of cells at hour t after our first measurement (time 0) is $f(t) = 4000 \cdot 2^t/1.3$.

share|improve this answer

Functions are about inputs and outputs. A function comes with an input space (the domain) and an output space (the codomain), and a rule to get from the former to the latter.

Because thinking too long about what "=" in $f(x) = x^2$ means makes my head hurt, I'm going to use a different notation. Let $f : \mathbb{R} \to \mathbb{R}; \ x \mapsto x^2$. The first part means that $f$ takes inputs in the real numbers, and outputs in the real numbers. The second part specifies the rule. Here, $x$ is not a variable previously introduced. It's what's called a "dummy variable". It doesn't have a value we need to solve for; it is just a placeholder for the input. When we want the output corresponding to some input $a$, we write $f(a)$. However, people are lazy, and we often reuse $x$ for this purpose, which is why you see $f(x)$.

Still, this is not anything new, right? You know how to square things. When you want to compute the value of this function at $7$, then yes, you use arithmetic. But why just $7$?

Often, we want to treat functions as things by themselves. We can pick up a function, and ask questions about the function as a whole object.

For example, we might want to ask:

  • is there a way to "undo" $f$? If $f : x \mapsto x + 8$, then yes. But if $f : x \mapsto |x|$, then no.

  • "what can we get out of $f$"? For $f : x \mapsto 10x$, we can get every real number. But for $x \mapsto e^x$, we can only get the positive ones.

  • For how many $x$ is $f(x) = 0$? For $f : x \to \sin x$, it's infinitely many. For $f : x \to x^3 - 6x^2 + 11x - 6$, it's three.

We don't even have to make functions about the real numbers. Given some appropriate definitions, I can make a function that, given a shape, tells me how many holes it has. For example, a sphere has zero, and a donut has one. Some of those tubes at waterparks might have two though. Computing this is not something one does with arithmetic! But because we have developed a rigorous way of talking about functions, we can just say "let $\chi$ be a function from the set of all shapes to the non-negative integers", and we can ask questions about it in the same way.

We care about functions because they let us talk about an operation as a whole object, instead of pointing out specific values. And not just arithmetic operations, but complicated ones too, like the above $\chi$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.