r/learnmath • u/Overall_Affect_7799 New User • 1d ago
RESOLVED What exactly is a function?
😢😢 Im so freaking sorry but I just don't get it that much. I need it in simple terms that still hold meaning. I've tried searching it up multiple times and I got none of the explanations. Currently I haven't reached the introduction of calculus in school, I just want to advance but I don't fully understand what the first and most basic thing in calculus is
91
Upvotes
30
u/MrEmptySet New User 1d ago
What didn't you understand about the explanations you found? Can you describe what you do understand about what a function is to the best of your ability?
88
u/Southlander24 A friendly Redditor!👋 1d ago
A function is a machine that takes in a number and outputs another number, according to some predictable rule.
Search up 'function machine'. You'll get images like these:
9
u/LucaThatLuca Graduate 1d ago edited 1d ago
i guess you want the school answer...
you have been taught that a function "is a rule" that you can apply to any input to get a corresponding output.
for example, f(x) = x^2 "is a function" (the notation here is that the round brackets mean function application). this function squares its inputs. you can apply it to any input: f(3) is 9, f(t+2) is (t+2)^2, etc.
an important way of understanding functions is by using graphs, which you should think about. a graph is the collection of all inputs and outputs { (x, f(x)) }. you can plot these as points on a grid to visualise a function.
what do you need help with, specifically?
7
u/SV-97 Industrial mathematician 1d ago
Say you have a collections of things; for example all colors, or the natural numbers 1,2,3,4,5,..., or the collection of all animal species, or the collection of all real numbers, ... such collections are called sets in mathematics.
A set is made up of elements: the set of colors has the elements red,blue,green,yellow, and so on; the set of natural numbers has elements 1,2,3,4, ...; the set of animal species contains cats, dogs, birds, fish, ...; the set of real numbers contains numbers like 1,2,3,4 but also pi, or 1/2 or the square-root of 2.
Given two such sets, lets call them X and Y, a function is some way of associating to every element of the set X some element of Y.
Take for example X to be the set of animals and Y the set of colours, then we could define a function that assigns every animal its colour (lets assume for simplicity that all animals have just a single color). Lets call this function f. So if we have a species of brown dogs like a labrador perhaps, then that function f would associate to the species labrador the colour brown which we write f(labrador) = brown. We might also have a blue fish lika a tuna, then f(tuna) = blue. Or take a yellow bird like a canary, then f(canary) = yellow. To generally indicate that our function f assigns colors to animals we write
f : Animals → Colours, or more abstractly (since we decided to denote the set of animals by X and the set of colours by Y) we write f : X → Y.It's important to note some important properties here: every animal is assigned one colour in this example rather than potentially multiple ones (a canary is just yellow, not yellow AND red AND blue or whatever) and importantly for every animal there is *some* colour that is assigned (i.e. given any species the question "what colour does this species have?" has one unique answer), however colors may occur multiple times (we said that our labradors are brown, but so is a wombat or many cats or whatever), and moreover certain colours may not occur at all (for example there may be no animal that is golden). This holds for all functions: when f : X → Y is a function, then for every element x of X there is *EXACTLY ONE* y in Y such that f(x) = y --- however there may be certain y in Y such that for *NO* x in X we have f(x) = y.
The set X in f : X → Y is called the *domain* of f while Y is called the *codomain* of f. The set of values y in Y for which there *is* some x in X such that f(x) = y is called the *image* of the function. In our above example we would for example have brown in the image, because there is some animal that is brown. We would also have yellow in the image because some animal is yellow. But we would not have gold in the image because no animal is golden.
In calculus you will frequently encounter functions that are defined between different sets of numbers and they will frequently be defined via a sort of "rule": denote by ℕ the set of natural numbers (so 1,2,3,...) and by ℚ the set of fractions (so-called rational numbers). Then we could define a function f : ℕ → ℚ by assigning to every natural number n in ℕ its reciprocal 1/n (which indeed is in ℚ, because it's a fraction). A standard way of writing this is
f(n) = 1/n. Or as another example we could define the squaring function that just takes a real number and squares it, this would be written asf : ℝ → ℝ, f(x) = x²where ℝ denotes the set of real numbers.Note that our first rule would *not* define a function on the real numbers, i.e. writing
f : ℝ → ℝ, f(x) = 1/xwould be nonsense. This is because 0 is a real number, and for x=0 we would have f(x) = f(0) = 1/0 and that doesn't make sense; i.e. our "rule" doesn't work for x=0 so it can't define a function on any set that contains it.And that's the basics, hope it helps :)
4
u/bedrock_city New User 1d ago
I was confused when I first learned about functions too.
Like why do we say "f(x) = 2x + 5" instead of "y = 2x + 5"?
The point I was missing is that f is itself a mathematical object (for a "machine" that converts x to 2x + 5 in this case) and "f(x)" is just the notation to describe what f does. But there are other notations you can use to express f too.
And because it's a mathematical object you can do stuff to it. You can add/multiply/subtract/divide two functions, you can compose two functions, and that gives you a new function that is a different "machine". This becomes more important in more advanced math including calculus.
20
u/Popular_Molasses7945 New User 1d ago
Wow! A lot of comments trying to explain what a function is all about.
First, you need to know the meaning of the word relation, and then you need to know the meaning of a mathematical relation.
In math, a relation is a set of ordered pairs.
Example:
R = { (3, 7), (2, 9), (2, 1) }
The above can be read like this:
R is the set ordered pairs (3, 7), (2, 9), and (2, 1).
The first object of all pairs is a set called the domain.
Domain of R = {3, 2, 2}
The second object in each pair is a set called the range.
Range of R = {7, 9, 1}
[Remark: I hate it when people say that a function is a machine. A function is not a machine.)
Note that the first object in a pair is related to the second object in the pair.
In the pair, (3, 7), 3 is said to be related to 7. In (2, 9), 2 is associated with 9. In the ordered pair, (2, 1), 2 is connected to 1.
So a relation is an occurrence in which a thing is connected to or associated with another thing.
There is a special relation that is called a function. A function is a special relation in which each object in the domain is associated with exactly one object in the range.
Going back to the relation that is named R:
R = { (3, 7), (2, 9), (2, 1) }
We can now ask: Is R a function? Is each object in the domain {3, 2, 2} associated with exactly one object in the range {7, 9, 1}?
The answer is no, because an object in the domain, 2, is associated with more than one object in the range. Look carefully. 2 is associated with 9 and 1. So the relation named R is not a function.
Moreover, it is said that 2 maps to 9 and 1. And because it maps to more than one object in the range, the relation is not a function.
2
u/Qingyap New User 1d ago edited 1d ago
It's basically like this meme, except function is now body and you can tweak how it changes the input to give you the desired output
For example my body turns 2 into 4, and that body is 2(input) or 2x
Edit: though depend on some bodys you can't get a desired output from anything you put into the body, and vice versa where everything you put into it you can't get every output (1/x, x≠0 being a famous example), and note that the body only turns one thing into another, it doesn't turn one thing into several other things.
2
u/Wide_Ad_4486 New User 1d ago
There are several different equivalent ways to define a function.
As you can see the important part is “one input, one output.” (Interestingly, the reverse is not true. One output can correspond with many different inputs.)
3
u/AlterEgo5695 New User 1d ago edited 1d ago
Short answer: Roughly speaking, a function takes an input, and returns an output.
Long(er) answer: Formally, a function "f: X -> Y" with body "f(x)" consists of three parts:
X:the domain, i.e. the set of all acceptable inputsY:the co-domain, i.e. the set of all acceptable outputsf(x):function body, defines which output "f(x) ∈ Y" to return for any given input "x ∈ X"Note a function returns exactly one output from "Y" for any given input "x ∈ X"!
1
u/_gribblit_ New User 1d ago
A function is just a mathematical object with some rules around it.
* It accepts variables or parameters or arguments coming in. These are the x and y in f(x, y).
* The variables/parameters/arguments are drawn from one or more sets (integers, real numbers, anything really).
* The function produces a result in an output set.
* For each possible value of the input parameters there must be only one single output value.
That's it from memory, how you define the function is up to you, you could say f(x) = x + 2, or f(x : ℝ, y : ℤ) = x^y : ℝ, or so on.
If you've done some programming before, it's a very similar idea to functions in programming, just a series of mathematics steps that we give a name and follow the above rules, like sin, cos, and tan in trigonometry.
1
u/Budget-Knee3213 New User 1d ago
A function is something that takes a number and turns it into another number. Any expression with x and aithmethic operations can be seen as a function, since you can replace x with a number and get another number. For example, x + 1 turns 1 into 1 + 1 = 2, 2 into 2 + 1 = 3, 3 into 3 + 1 = 4, and so on.
1
u/ChampionGunDeer New User 1d ago
Let me simplify things a bit for this example.
Suppose everyone in the world has exactly one first name, exactly one last name, (I think both should be obvious, but your mileage may vary), and any amount of middle names.
One could easily make a first-name function, for which the domain would be the set of all people. It's range would correspond to the set of all answers to the question "What is your first name?", a question that will only ever have a single answer. An analogous scenario could apply for a last-name function.
However, there is no analogous scenario for a proposed middle-name function, as the question "What is your middle name?" no longer has single answers. The question is phrased so as to be answered with a single name. Such won't be possible for Adam Benjamin Cary Daniels. Does he answer it with "Benjamin", or with "Cary"? At best, you could make a function that outputs sets or ordered lists of names, but then you are no longer actually making a function analogous to the other two previously mentioned.
You give a function an input and it gives you one thing of a specified kind as output–not more.
1
u/Temporary_Pie2733 New User 1d ago
Say you have two sets, A and B. A relation is a set of pairs of values, one from A and one from B. A function is a relation where there is exactly one pair containing each value of A. So the function maps values from A to values in B, cannot map a single value in A to more than one value in B, and must map every value in A to some value in B. f(a) = b is a special way to write (a, b) is in f.
1
u/Own_Actuator_5561 New User 1d ago
1
u/RobertFullerton New User 1d ago
An interesting thought on that topic is what I call "bookkeeping functions." These are functions that I thought for a long time weren't functions. They are the basis for tensor calculus, which is the mathematics that Einstein uses in general relativity. They may also be one of the reasons the definition of a function is so opaque. A bookkeeping function is a function that renames a point that is say (5, 7) in one coordinate system but (6, 4) in another coordinate system that is produced by rotating the original system a specific number of degrees. Each and every point in both coordinate systems is a member of the function. In most functions you think only a line or a curve contains points that are members of the function. Also, the points don't change their position in space, they are only renamed. Would y = (x)^1/2 be a function? When I went to school the sq. rt. of 4 was +2 and -2, but now it may only be +2. Is a hyperbola a function? Most functions take the form of y = x^2 + 2x + 1, but Arthur Eddington in his book "The Mathematical Theory of Relativity," gives us a hyperbola with x = (sq. rt. of y^2 +1) etc. etc.
1
u/Scale-Heavy undergrad math major 1d ago
We want to assign values from set A to set B in a specific manner(rule). That rule is called a function.
Edit: Okay, probably not the best explanation for a secondary-school student. Imagine you have some inputs( set A) but you want to get outputs( set B) in a specific way. Your function is the way you get it. As others said, you can look at functions as output-producing machines.
1
u/his_savagery New User 1d ago
They are like the verbs or adjectives of maths.
I take a piece of toast. I apply the function of burning. I get burned toast.
We write it like this:
burn(toast) = burned toast
They are equal and therefore interchangeable. I can say things like the burn(toast) was black and crispy.
1
u/barbhav New User 1d ago
Think of it this way …
You go to the post office to mail a parcel. For every weight there is one and only one price. That’s a function. For every value of x (the weight) there is only one value for y (the price).
Now if you want something that isn’t a function it would be like this:
If I were to graph a circle with centre (0,0) and a radius of say three you would know that if I went to the value of 1 for x there would be two answers for y so this is not a function.
Therefore for a function every x can only have one value for y.
Another way to check if the relation is graphed … vertical line test
1
u/Numerous_Pause_5639 New User 1d ago
I guess I view a function as a transformation. It transforms with respect to domain and range, as others noted. A key difference is that for every input there is either zero or one output. So for example square root x is not a function (two outputs possible for one input, like square root 16 is both +4 and -4).
1
u/Person045 New User 1d ago
A process done to an input variable in order to get an output variable.
Take this function:
Y = 5x
The input is the x , the process we do is multiplying it by 5. After we do that we get the output y
1
u/Mountain-Time-1010 New User 1d ago
A simple way to think about a function as that it is a rule that turns a number into another number.
That’s not the full definition but a good way to start.
1
u/BothPanchoAndLefty New User 1d ago
It's just something that takes an input, does something to it, and returns an output.
It can also be described as an equation where the value of one variable depends on the value of another. If the value of one changes, the value of the other changes. Say f(x) is the function, and f(x) = 3x + 5. When x (the input) =2, f(x) = 11. When x = 3, f(x) = 14. 11 and 14 are the outputs for each input.
1
u/shitterbug New User 1d ago
A function f from X to X, in symbols f: X -> Y, is a collection of symbols {fx : x in X} \subset Y.
🌚
1
u/crijogra New User 1d ago
im so glad someone asked this lol i have always wanted to know this and reading the comments has been fruitful
1
u/Closed_Circuit_0 New User 1d ago edited 1d ago
Think of a device that takes an input signal and responds with an output signal.
Two deliveries of the same input signal always produce the same output signal. (For example, a voltmeter used twice on the same brand new battery will produce the same voltage both times.)
The totality of all possible input signals is the domain.
The totality of all the possible output signals is the range.
The behavior of such a device is completely specified by specifying, for each input signal, the corresponding output signal. Once we know this, we know how the device functions. (see what I did there?:)
1
u/Sea-Moth-4211 New User 1d ago
Take a number, double it, and add 1.
That's a function. A rule about what to do with some given input that generates an output. But the rule has to be phrased in a way that each input is only going to give one answer.
If I ask you what year Star Wars came out, there's only one answer, 1977.
If I ask you what movies came out on 1977, there are multiple answers. That's not a function.
If I ask you what's 22 , there's only one answer to that: 4.
But if I ask you what number you can square to get a 4, there are two answers to that: 2 and -2. (A negative times a negative is a positive.) So that question isn't a function, but the previous one is.
1
u/nanonan New User 1d ago
Fairly simple conceptually, it's a substitution. Given a value x, the function will substitute that with a value y. We would notate that as y = f(x). How you arrive at the value to substitute can be complicated though, and once we introduce concepts like real numbers and the axiom of choice it becomes downright nonsensical. It's best to begin by thinking in terms of algorithms, or in programming terms where you call a routine and it returns a value.
1
u/Vivid_Sock_1092 New User 1d ago
A subset of the Cartesian Product of two sets in which no first component occurs twice.
Set theory rules the universe!!
😃
1
u/grymoire New User 1d ago
Code you use twice (or more) but write once.
1
u/TheMagmaLord731 high-school nerd 1d ago
A function is something done to something else. If you have an input and an output, the function is the thing that transforms the input to the output
1
u/rikakor New User 21h ago
I think the relevant question here is not "what" but "why". Why on earth would anyone need a machine that converts numbers to other numbers? I like to think and explain functions as models. They are very useful in so many real-world applications. Even more so, if you accept multiple variables. Like, how much you can save in x years if you invest y money per month with an interest if z %. Or, how much weigh can a bridge hold considering its design and materials. Now a function takes your decisions and assumptions as input, and gives you a prediction as output.
I know that a function is a different thing mathematically. It is thoroughly explained in these comments and many books BUT does it help if you don't understand how and when and why we even need functions?
1
u/mH48124 New User 20h ago
RESOLVED おめでとう。
1
u/us__07 New User 20h ago
think of it as something that converts your input into an output, kind of a machine like x² is a "machine" that takes your input value (any number) and gives you the output value (the square of the number put as the input value)
1
u/pm-pussy4kindwords New User 12h ago
a function is a relation between two sets of numbers such that each input value (in the domain), only maps to a singular output value (in the range).
think of it like a machine where you put one number in and it spits another number out. That's a function.
1
u/finger_puppet_44 New User 11h ago
It’s like a little mathematical transformation machine. You put something in, the function performs a series of operations on the input, and then spits out a new answer.
For example, let’s pretend we have a function that changes the color of paint. Let’s say the function always adds yellow to whatever paint you put in. If you put in blue paint, yellow is added, and you get green paint; if you put in red paint, yellow is added, and you get orange paint; and so on. An entirely different function might add blue paint, or maybe it adds white paint to produce tints, or black paint to produce shades. Or maybe it adds white and yellow, to produce a new color that is also a tint.
But a specific function always does the same action or set of actions to whatever you put into it. The operations are always the same set for a given function, so when we put one number in and get another number out, there is a direct relationship between various input/output pairs, which is visualized by graphing the input/output (x,y generally) points.
1
u/Bulky_Midnight8238 New User 10h ago
Im gonna be mean n give the pure math definition:
So imagine you have 2 boxes of stuff (we'll label one of em set A and the other one Set B). A "relation" is essentially a series of steps you can apply to an object in A to send it to an object in B.
This relation is a function if 1: it maps the entirety of A to at least part of B and 2: if two objects in A are the same, then they must be sent to the same object in B by our above relation.
For a less confusing (and less pure mathy) answer: every output from the function has to have a unique output
1
u/securityguardnard New User 2h ago
A function is an illusive calculation. In reality, there is only three NOW. Everything happens now, evolving by novelty. Functions can be confusing, but remember they only happen out of nothingness
-2
u/Acrobatic-Repeat-657 New User 1d ago
Honestly, it's just a name... You already know what a function is. You just did not call it a function, but rather "a calculation". Now, normally in algebra (and that's for sure something you also already saw) we do not have simple calculations like
3+1=4
but now we have something like
x+1=y
So, a function is various calculations you perform, when a part of a calculation becomes unknown (x) and the result (y) is not specific anymore. That's what we call a function then.
I will give you an example where you need it. For example in physics, we want to examine how an object behaves over time, meaning we do not just have one position x and y, but over time various positions x and y. And a function describes in a more general way the movement, because we can now calculate where it is after 1 second or after 2 seconds. This would not be possible with a simple calculation. A function really is a row of calculations you can perform.
0
u/Away-Wave-5713 New User 14h ago
I'm first yr physics student and think of it as uhh equation 😭. Broski sry. Y=smth equation with x . Y is range and x is domain. Done. Next u should learn about if smth is a function or not using some horizontal or vertical rule.
0
u/Midwest-Dude B.Sc. Math 1d ago edited 1d ago
Wikipedia does a good job of explaining it fairly simply:
Function (mathematics)
The first image under the Definition section shows that a function is like a machine that takes in a value and spits out a value corresponding to the input. That's the idea.
0
u/Icy-Anteater-5311 New User 1d ago
its a blender, the fruits are domain and the juice are co-domain
0
u/Nagoltooth_ New User 4h ago
a morphism in 𝖲𝖾𝗍
-6
u/FlyingFlipPhone New User 1d ago
Everyone is mentioning the "output machine" where x is the input and y is the output. This is true. However, calculus also has a rule that each input can only have 1 output. For this reason, y=squareroot(x) is NOT a function. One way to visualize this rule is to draw a vertical line through the graph of the function. The line must meet the function at most one time.