Questions tagged [functions]

For elementary questions about functions, notation, properties, and operations such as function composition. Consider also using the (graphing-functions) tag.

A function $f$ defined on a set $X$ is an assignment of an element in some set $Y$ to each element of $X$. The set $X$ is called the domain of the function and $Y$ is called the codomain. The elements of $X$ are the inputs to the function and the elements of $Y$ are the potential outputs. For some input $x \in X$, its corresponding output in $Y$ is denoted $f(x)$. Not every element of $Y$ needs to be the output corresponding to some input though: the subset of $Y$ containing the elements that are an output of the function is called the range of $f$. When a function $f$ has domain $X$ and codomain $Y$, this is signified by writing $f \colon X \to Y$, and the assignments of inputs to outputs is signified by writing $f\colon x \mapsto f(x)$.

If you have a function whose codomain is the domain of another function, you can compose those two functions. In symbols if you have a function $f\colon X \to Y$ and a function $g \colon Y \to Z$, their composite is a function $g\circ f\colon X\to Z$ defined by the assignment $g\circ f\colon x \mapsto g(f(x))$.

For many examples of functions, the domain and range of the function are topological spaces, meaning that they are equipped with some notion of geometry. In this case we like to think of the function $f\colon X\to Y$ geometrically as the subset of the points $(x,f(x))$ in the topological space $X \times Y$. This subset of all the input-output pairs is called the graph of $f$.

Often mathematics textbooks will define a function slightly more rigorously than this though. They'll say that a function $f \colon X \to Y$ is a relation $R$ on the set $X \times Y$ such that

  1. For each $x \in X$ there is some $y \in Y$ such that $xRy$. Each input needs an output.
  2. If $xRy$ and $xRz$, then $y=z$. Each input needs exactly one output.

Here are a bunch of examples of functions:

  • Many examples of functions covered in elementary and high school have as their domain and codomain the real numbers $\mathbf{R}$. A basic example is the function $f \colon \mathbf{R} \to \mathbf{R}$ defined by the rule $f(x) = x^2$. Thinking geometrically, the graph of $f$ is the set of all points $(x,x^2)$ in the plane $\mathbf{R}^2$, and this forms a parabola. Note that while the codomain of this function is $\mathbf{R}$, the range consists of only the non-negative real numbers.

  • Here's a silly example. For any set $X$ we can define an identity function $\mathbf{1}_X$ with domain and codomain $X$ such that $\mathbf{1}_X \colon x \mapsto x$.

  • Let $W$ denote the set of all strings of letters of the alphabet, so like $\text{npr}$ or $\text{asdfasdf}$ or $\text{butt}$ for example. And let $\mathbf{N}$ denote the set of natural numbers. We can define a function $\ell\colon W \to \mathbf{N}$ such that $\ell$ assigns to each word it's length. So $\ell(\text{defenestration}) = 14$. Also $\ell(\text{butt})=4$.

  • Using the same set $W$ in the last example, let's define another function $\tau\colon W \to W$ such that $\tau$ "reverses" a word. So $\tau(\text{defenestration}) = \text{noitartsenefed}$, and $\tau(\text{butt}) = \text{ttub}$. A few neat properties of $\tau$ that deserve to be pointed out, $\tau \circ \tau = \mathbf{1}_W$, and also $\ell\circ\tau = \ell$.

33723 questions
14
votes
1 answer

Find the function of separation between two functions

I seriously doubt that is what it is actually called, but I'm not very knowledgeable in this matter. Conceptually, what I am trying to do is calculate the function of a line/curve that shows the divide between two other functions. As a visual…
Abion47
  • 263
13
votes
2 answers

A curve that starts with exponential growth and levels out

I'm stuck on a mathematical problem in a small feature I'm building for a website. I need a function that starts out with exponential growth and than levels out as x grows. I've drawn this wonderful picture to communicate what I'm looking for since…
13
votes
6 answers

Equation for a smooth staircase function

I am looking for a smooth staircase equation $f(h,w,x)$ that is a function of the step height $h$, step width $w$ in the range $x$. I cannot use the unit step or other similar functions since they are just one step. I have been experimenting with…
user1420
  • 165
  • 1
  • 1
  • 8
13
votes
1 answer

Separable and non-separable function

Can someone explain to me what is the difference between separable and non-separable function? I found some explanations, but these explanations are not in "human form". For example, I found that separable function can be expressed like…
Petr
  • 139
12
votes
1 answer

Can functions have multiple inputs?

Now bear with me here, I'm not the best at math. I'm just trying to find out something that I never really learned. I was wondering, can a function have multiple inputs such as this one below? $$f(x,y) = x \cdot y$$
12
votes
3 answers

How to tell if a function is one-to-one or onto

We just learnt this today in Discrete Math, and now I'm trying to review from the textbook. However unfortunately during this lecture I was completely lost with no idea what was going on. I know that for one-to-one, every $x$ has an unique $y$ and…
user7349
  • 143
  • 1
  • 1
  • 5
12
votes
3 answers

show this function $f(m,n)=f(n,m)$.

let $m,n\in \mathbb N^{+}$,and such that $$f(m,n)=f(m-1,n)-nf(m-1,n-1)$$ and $f(m,0)=f(0,n)=1$. show that $f(m,n)=f(n,m)$. I have found $$f(m,1)=-mn+1$$ $$f(m,1)=f(m-1,1)-n$$ so we have $$f(m,1)=-mn+f(0,1)=-mn+1$$
math110
  • 93,304
12
votes
5 answers

Is it possible to combine two integers in such a way that you can always take them apart later?

Given two integers $n$ and $m$ (assuming for both $0 < n < 1000000$) is there some function $f$ so that if I know $f(n, m) = x$ I can determine $n$ and $m$, given $x$? Order is important, so $f(n, m) \not= f(m,n)$ (unless $n=m$).
11
votes
5 answers

Why do we limit the definition of a function?

Why do we limit the definition of a function to only one y per x? For example, the square root function. We only allow the principal square root of a number, rather than, say, the square root of 9 being both 3 AND -3. Why is this? Thanks!
OpieDopee
  • 1,149
  • 1
  • 12
  • 30
11
votes
1 answer

Question on the "empty function"

Let's say that I have a function $f: A \to B$. I'd define a function, rigorously, as a set $$ \{(x, f(x)) \mid \forall x \in A, \; \exists ! b \in B \; s.t. b = f(x)\}. $$ If $A = \emptyset$, then $f \subset \emptyset \times A$, but $\emptyset…
11
votes
2 answers

How is the similarity of the structure of two functions defined?

Consider the sets $X=\{1,2,4\}$ and $Y=\{A,B,C\}$ and then consider two functions $f:X\to X$ and $g:Y\to Y$ defined as $f=\{(1,4),(2,1),(4,1)\}$ and $g=\{(A,C),(B,A),(C,A)\}$. Certainly, these function have the same "structure", but what is it? What…
Garmekain
  • 3,124
  • 13
  • 26
11
votes
5 answers

Defining a piecewise function using restricted operations

Question Can the piecewise function $$f(x) = \begin{cases} 0 & \text{if $x > 0$} \\ 1 & \text{if $x = 0$} \\ 0 & \text{if $x < 0$} \\ \end{cases}$$ be defined using only the operations $+ , -, *, /, |\cdots|, \max$, and $\min$? What I…
spyr03
  • 1,024
11
votes
5 answers

Is $f(x)=|x|$ a convex function?

While reading an article on Convex functions, I came across the following statement: The absolute value function $f(x)=|x|$ is convex (as reflected in the triangle inequality), even though it does not have a derivative at the point $x = 0$. Now…
Student
  • 9,196
  • 8
  • 35
  • 81
11
votes
4 answers

What is the difference between a surjective and a continuous function?

What is the difference between a surjective and a continuous function? If a function is surjective then it takes all values so it is continuous and also if a function is continuous then it takes all values then it is surjective :( ?
user200491
10
votes
3 answers

Does the domain of the function depend on how you write it?

What is the domain of the function $f(x,y)= \sqrt{xy} $. In this case, domain is $D=\{(x,y) \in R^2: \}$ Since $ \sqrt{xy} = x^{0.5}y^{0.5} $ I can write the function equivalently as $f(x,y)= x^{0.5}y^{0.5} $ but in this case domain is only…