r/learnmath • 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

125 comments sorted by

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:

48

u/rhetoricalimperative New User 1d ago

This is good but students should be reminded that not all relations are functions. A function specifically is a rule that allows only one result due each input.

13

u/Snatchematician New User 1d ago

That’s what they said

7

u/testtdk New User 1d ago

They didn’t specifically point out that you can only get one output per input. Kind of important.

0

u/Snatchematician New User 13h ago

Yes they did 

-2

u/Temporary_Pie2733 New User 1d ago

The rule is just one part of a function. A function that squares natural numbers is distinct from a function that squares integers, even though both are defined using the map x ⟼ x2.  

5

u/paul5235 New User 1d ago edited 1d ago

The input and output don't have to be numbers. It can also be a collection of numbers, for example, or anything else. You can have a function string length:

"text" -> 4
"an other text" -> 13

A function is just something that assigns an output to an input. And it has to be the same output for an input every time. (In programming you have a function to get a random number, but in mathematics such a thing would not be called a function)

2

u/Zatujit New User 1d ago

What do you mean by predictable

3

u/Charming_Shallot_239 New User 1d ago

And so an equation is simply the specific gears and wheels that make it so?

8

u/iOSCaleb 🧮 1d ago

An equation is simply a statement that says two expressions have the same value.

2

u/Zestyclose-Turn-3576 New User 1d ago

Yeah, that's an important fundamental that can be misunderstood if you start thinking about = as an assignment statement in a programming language.

2

u/BigGuyWhoKills New User 1d ago

The onus falls on the programming instructor to clarify that. Mostly because different languages use the equal sign differently.

=
==
===

I'm a backend dev. That third one frightens and confuses me.

5

u/itmustbemitch pure math bachelor's, but rusty 1d ago

From a Javascript perspective, which is the only thing I personally know that uses ===, the real thing to fear is ==. Javascript took what you expect out of == and gave it to ===, and snuck an ambiguous abomination into the == you thought you could trust

4

u/Zestyclose-Turn-3576 New User 1d ago

Ruby is blessed with ==, ===, .eql?, and .equal?, but I would prefer that languages use := for assignment instead of =.

All of these are distractions from mathematical equality of course.

2

u/BigGuyWhoKills New User 1d ago

Just to be careful, I will continue to fear the last and will now include the middle one when javascripting.

2

u/karlnite New User 1d ago

Equation is just when two things are equal. So if x=2y, then the function is dividing x by 2 to get y, because the equation shows a proportionality or relationship between x and y.

2

u/Temporary_Pie2733 New User 1d ago • Bravo

That's more of a programming answer than a math answer. "Functions" in programming languages aren't necessary total or deterministic.

8

u/jbrWocky New User 1d ago

sort of backwards lol. this is the math function, not a programming function.

-8

u/brynaldo New User 1d ago edited 1d ago

Why does the rule have to be predictable? You could have a function f:A→B, where A = {6, π, -7} and B = {purple, monkey, dishwasher}.

Edit: I should've what you mean by "predictable"

18

u/rocqua New User 1d ago

Predictable here means that the exact same input always gives you the exact same output.

Not that similar inputs give similar outputs.

15

u/jsdodgers New User 1d ago

how is your example any less predictable?

10

u/defectivetoaster1 New User 1d ago

You’ve not actually defined the function here you’ve just defined the domain and range, f could be anything from mapping 6 to purple, π to monkey and -7 to dishwasher to mapping all of A to monkey

12

u/Southlander24 A friendly Redditor!👋 1d ago

Yes, I am aware that a function is a mapping between sets. However, if they are going to learn calculus, they don't have to be aware about this more abstract notion of a function.

1

u/brynaldo New User 1d ago edited 1d ago

Sorry, by predictable I thought you meant that it could be easily encoded (e.g. x |-> x2 ), but as others pointed out maybe you meant deterministic? In my experience, functions are often taught incorrectly and this can trip up students later on (questions like, "given the function f(x)=√x, what is the domain of f(x)?"). I think care should be taken to differentiate between definitions and useful explanations. And fair enough, OP did ask for simple terms not formal definitions.

3

u/iOSCaleb 🧮 1d ago

Deterministic would be a more accurate description: a given function always returns the same value for a given input. But OP asked for “simple terms,” and predictable is easy to understand: if you know what a function does, what it’s definition is, then you know what it’s output should be for any input.

1

u/brynaldo New User 1d ago edited 1d ago

Great points. I had (mis)understood OP's use of "predictable" to mean "simple"/"compressible", e.g. you can encode the mapping from natural numbers to even numbers with the rule x |-> 2x. In my experience, students who are taught that a function is just a simple rule can get confused, as they conflate functions with equations or expressions.

I agree with keeping definitions digestible, but I think a lot of difficulty can be avoided later on with careful wording and avoiding absolutes. Functions are not always predictable (whatever that means) and don't always map elements of numeric sets to elements of other numeric sets, but the ones of interest in a calculus class often will.

2

u/jetsonian New User 1d ago

To be fair, predictable doesn’t mean “simple” outside of Math.

It means exactly how they used it, as a synonym to deterministic, that with the given inputs you can determine the output reliably.

-1

u/brynaldo New User 1d ago edited 1d ago

I think the right word in that case is "predictive": relating to, making, or useful for predicting future events or outcomes. A predictable rule would be one whose overall behaviour would be easy to tell from a few examples. If we are told that a function maps 1 to 2, 2 to 4, 3 to 6, and that its behavior is predictable, then it might be a good guess that it maps x to 2x.

0

u/shitterbug New User 1d ago

Or in proper math terms (instead of "deterministic"): "well-defined"

2

u/trevorkafka New User 1d ago

"predictable" here means that it will consistently give one consistent output for a given input

0

u/brynaldo New User 1d ago

what about the word "predictable" implies only one output? A (multi-valued) function "predictably" maps a single input to multiple outputs.

1

u/trevorkafka New User 1d ago

Not being dense helps you understand intended meaning beyond face value.

1

u/brynaldo New User 23h ago

No need for personal insults. If you don't want to continue the conversation just don't reply. It's all good.

1

u/AlterEgo5695 New User 1d ago

That would be perfectly valid, and still predictable -- once we've decided which element from "B" the function "f" should return for each element in "A".

That definition makes up the function body "f(x)", and is part of the function definition. If we leave it out or don't specify it, the function would not be well-defined.

-1

u/ybungalobill New User 1d ago

"function is a machine" explanation only works for computable functions. Functions can be described by uncomputable relations.

1

u/henke37 New User 13h ago

An example please?

-12

u/jeffcgroves New User 1d ago

I'm going to annoyingly point out that this specific image is actually two functions, which might be confusing. Each purple thingy is one function

9

u/Southlander24 A friendly Redditor!👋 1d ago

It's a function made up of two simpler functions. f(x) = 4x and g(x) = x + 7, so the composite function is g(f(x)), but we could also define h(x) = 4x + 7 from the beginning and that would also be the same.

-3

u/jeffcgroves New User 1d ago

Yes, but I think it's harder to understand that way. A function is more of a "black box" (purple box?)-- you don't have to look inside it

4

u/bishtap New User 1d ago

You could have a function that takes some input, does various things to it, and produces the output.

f(x)=3x+2

A function might use other functions but is still one function.

0

u/jeffcgroves New User 1d ago

Yes, but that introduces functional composition, which is more complicated

4

u/bishtap New User 1d ago

Would you say that there is functional composition going on in the function f(x) = 3x + 2?

1

u/jeffcgroves New User 1d ago

No. It's just a function.

1

u/bishtap New User 1d ago

Was the comment that guy's image showed having the function f(x)=4x + 7 ?

1

u/jeffcgroves New User 1d ago

No, it was showing two functions composed

1

u/bishtap New User 1d ago

You said f(x) = 3x + 2 has no functional composition. Ok

If I rewrite f(x) = 4x + 7

f(x) = +( *(4,x) , 7)

Is that functional composition?

1

u/jeffcgroves New User 1d ago

I'm talking about the boxes, not the notational form

→ More replies

4

u/fermat9990 New User 1d ago

Isn't f(x)=4x+7 the single function being illustrated here?

-2

u/jeffcgroves New User 1d ago

Not in my opinion, no. This is functional composition, which is more complex

1

u/fermat9990 New User 1d ago

I guess that I'm thinking of high school algebra!

Cheers!

2

u/bishtap New User 1d ago

https://www.reddit.com/r/learnmath/s/kRGgzwhKRD

He says f(x) = 3x + 2 is a single function.

1

u/fermat9990 New User 1d ago

I'm lost! Thanks!

2

u/bishtap New User 1d ago

f(x) is a single function.

1

u/fermat9990 New User 1d ago

Got it! Thanks!

3

u/Xehanort107 New User 1d ago

Don't worry, I will annoyingly reply and say that this is meant to break down the steps of a function into operations. While each step can be defined as it's own function, the complete output of 4x+7 is also itself a function.

I say this with the same lighthearted poking that you have given. All in good fun, just education for the fun of learning, for whoever may read this squabble.

0

u/jeffcgroves New User 1d ago

Operations are functions. I'm saying breaking down functions is a more complex step than just treating them as black boxes

2

u/iOSCaleb 🧮 1d ago

Functions are composable; it’s true that each of the purple blocks is a function, and also true that the entire line from “Input” to “Output” is a function. So you’re not wrong, but so what?

-2

u/MaksRudra New User 1d ago

I think black box metaphor is better

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 as f : ℝ → ℝ, 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/x would 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 :)

2

u/Stixwoman New User 1d ago

marry me!!

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

I need it in simple terms that still hold meaning.

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.

23

u/shitterbug New User 1d ago

This is not a good definition for beginners. It's only valuable after you have already understood what a function is.

0

u/[deleted] 1d ago

[deleted] — view deleted comment

13

u/shitterbug New User 1d ago

I'm not saying that there are errors in what you wrote. I'm saying that it's a terrible explanation for a beginner.

For example, my favorite definition has got to be: 

A vector is an element of a vector space.

That is imo the absolute best definition of "vector" one can give. But of course it's absolutely terrible for people who just begun learning.

The simplest definition for function I know: an assignment rule (between two sets). That can be understood with just knowing what a set it. You don't need products, or subsets, or whatever. And once one knows this, one can get familiar with the idea and later understand your version.

0

u/[deleted] 1d ago

[deleted] — view deleted comment

7

u/jomteon New User 1d ago

Does it strike terror or fear in the heart of the reader?

Correct. For someone who is already struggling to come to grips with the high school level of what a "function" is, your explanation is far too difficult. It is simple, I will give you that, but I'd be money that when OP said "simple", they were implying both simple and easy. While yours is simple, it is by no means easy. Maybe for you it is; maybe for someone naturally adept at math; but not for someone struggling with the high school use-case of a function. They clearly need an easier explanation.

1

u/Popular_Molasses7945 New User 1d ago

Correct.

The simplest definition for function I know: an assignment rule (between two sets).

So what you are saying is that the OP would come away with a more complete understanding of what a function is based on your definition of function?

Just curious: What makes you think that the OP knows what you mean by "assignment" and what you mean by "rule" and what you mean by "between two sets"?

1

u/jomteon New User 1d ago

I didn't give a definition to OP, so not sure what you're getting at.

Anyway, no, I don't think OP knows what you mean by "between two sets". If they're a student in North America, I'd be surprised if they knew what a set was to begin with.

2

u/shitterbug New User 1d ago

Did you even read my comment beyond "terrible explanation"? It seems not.

1

u/nimcha3 New User 1d ago

Dude

4

u/Lmio New User 1d ago edited 1d ago

Saving this reply even though I get it but for future purposes 👍

1

u/Popular_Molasses7945 New User 1d ago

👍

2

u/Agreeable_Speed9355 New User 1d ago

This is the correct answer. The other answers involving a "rule" or procedure might be easier to grasp for the novice but are akin to little white lies we tell to children. The idea of taking an input, doing a sequence of arithmetic steps, and arriving at an output is a gentle introduction to functions, however it leaves a lot out and it's important not to internalize this simplified view forever.

OP: Consider a thermometer in your home. Every day at noon for a month you record the date (x) and you read and record the temperature (f(x)). This is an example of the set of ordered pairs definition of a function given above. The domain set is the set of dates we specified, the codomain is the set of all temperatures your thermometer could read, and the range is the set of temperatures observed. This example suggests that the rule or machine "definition" is weak in that there isn't some process by which one can know f(x) through some sort of arithmetic machinery.

This is before even getting into the weeds about what constitutes a valid "rule" or how to specify one. Consider that two different procedures or rules can always result in the same output for a given input. Explicitly, let f(x) be the rule that one takes x and adds 1, i.e. f(x)=x+1. Now consider the rule g(x) that takes x, adds two, and then subtracts 1, i.e. g(x)=x+2-1. The rules are different, implementing the arithmetic on a machine means different procedures are being performed, and yet these are the same function regardless of the fact that different rules were used to obtain the same result. Even deeper into the weeds one can see that there are more functions than "rules" can spell out.

TLDR: the correct definition of function is that of ordered pairs given above, there are major flaws with the rule definition, and yet naively we start there because it's easier

1

u/crijogra New User 1d ago edited 1d ago

this is super basic but i feel like nobody explained this to me before :s, is this algebra? calculus?

how can i educate myself on these ultra basic concepts that many advanced concepts use?

i thought it was a great explanation, even i understood relation, domain, range and functions

now i have more questions, like what uses do domains and range have other than to identify if its a function or not but i guess that a whole different conversation

1

u/Popular_Molasses7945 New User 1d ago edited 1d ago

now i have more questions, like what uses do domains and range have other than to identify if its a function or not but i guess that a whole different conversation

Asking questions is the beginning of explorations, investigations, and examinations.

If you were to go to Google Sheets, which is a free spreadsheet, the first thing you might notice in the formula bar is the following function notation:

fx

That notation right there tells you that when it comes to using spreadsheets, you are dealing with functions.

But the above is how you start to learn little by little, And you start to ask questions when you read math notation, questions like:

  1. Why is this here?
  2. What does it mean?

1

u/Tall-Pop-8497 New User 17h ago

I dont know of any place that teaches these very basic things but an actual math lecture in university. But there it was done pretty much in the first 2 weeks of the first semester.

I would probably put it into set theory but not sure. The name of the lecture is something like "fundamentals of mathematics".

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. 

  • an input-output machine, with the rule that every input has exactly one output. 
  • two sets, one called the domain and one called the range, along with a rule that maps each element of the domain one element in the range. 
  • a subset of the Cartesian product of two sets, such that each element of the first set appears in exactly one ordered pair. 

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 inputs
  • Y: the co-domain, i.e. the set of all acceptable outputs
  • f(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/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.

9

u/jbrWocky New User 1d ago

this is...very wrong. An equation is not the same as a function. A function is very specifically a directional relationship between a Domain and a Codomain

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/Away-Wave-5713 New User 14h ago

Oh also u might be too stressed or smth, watch some organic chemistry tutor 😭

-1

u/Away-Wave-5713 New User 14h ago

Oh and y=f(x), using f(x) just means that the equation depends on x ig cuz y could just be another variable. I could have f(y) also. The main point is the function/equation gives an output when u input stuff which is the x.

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.

-1

u/Charming_Shallot_239 New User 1d ago

The definition of a function is never the problem. It's easily understood.

Differentiating it from it corresponding equation is the tricky bit. Both are equations (erm, they have an equals sign), so why do we need two different forms?

3

u/LucaThatLuca Graduate 1d ago edited 1d ago

an equation is simply a kind of sentence ("1+1=2" is just a way of spelling "one plus one is two"). on the other hand a function is a specific mathematical object. so they are two entirely different things.

schools want to talk about functions because they are very useful in very many ways, they want to talk about graphs etc. but they want to do this much earlier than they want to teach what a function is, so they just want you to deal with it, basically.

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.

4

u/ChampionGunDeer New User 1d ago

That's not a rule of calculus–it's part of the definition of a function. Also, squareroot(x) returns no more than one value for every non-negative real number x, which makes it a function of x. On the other hand, if x remains our domain variable, then x=y2 does not describe a function of x for the vertical line test reason you mentioned, as the graph is a rightward-opening parabola. Did you mean for your example to be this one, instead? To get the same graph using squareroot(x), we would actually need to bundle that function with its negative: y = ±squareroot(x).