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$.

30922 questions
185
votes
9 answers

How to define a bijection between $(0,1)$ and $(0,1]$?

How to define a bijection between $(0,1)$ and $(0,1]$? Or any other open and closed intervals? If the intervals are both open like $(-1,2)\text{ and }(-5,4)$ I do a cheap trick (don't know if that's how you're supposed to do it): I make a…
user1411893
  • 2,073
  • 4
  • 13
  • 8
171
votes
4 answers

Overview of basic results about images and preimages

Are there some good overviews of basic facts about images and inverse images of sets under functions?
160
votes
1 answer

What functions can be made continuous by "mixing up their domain"?

Definition. A function $f:\Bbb R\to\Bbb R$ will be called potentially continuous if there is a bijection $\phi:\Bbb R\to\Bbb R$ such that $f\circ \phi$ is continuous. So one could say a potentially continuous (p.c.) function is "a continuous…
M. Winter
  • 28,034
  • 8
  • 43
  • 92
142
votes
1 answer

Identification of a curious function

During computation of some Shapley values (details below), I encountered the following function: $$ f\left(\sum_{k \geq 0} 2^{-p_k}\right) = \sum_{k \geq 0} \frac{1}{(p_k+1)\binom{p_k}{k}}, $$ where $p_0 > 0$ and $p_{k+1} > p_k$ for all $k$. In…
86
votes
13 answers

Is there a bijective map from $(0,1)$ to $\mathbb{R}$?

I couldn't find a bijective map from $(0,1)$ to $\mathbb{R}$. Is there any example?
ieb
  • 869
  • 1
  • 7
  • 3
73
votes
5 answers

Why do engineers use derivatives in discontinuous functions? Is it correct?

I am a Software Engineering student and this year I learned about how CPUs work, it turns out that electronic engineers and I also see it a lot in my field, we do use derivatives with discontinuous functions. For instance in order to calculate the…
69
votes
7 answers

How to straighten a parabola?

Consider the function $f(x)=a_0x^2$ for some $a_0\in \mathbb{R}^+$. Take $x_0\in\mathbb{R}^+$ so that the arc length $L$ between $(0,0)$ and $(x_0,f(x_0))$ is fixed. Given a different arbitrary $a_1$, how does one find the point $(x_1,y_1)$ so that…
sam wolfe
  • 3,676
  • 3
  • 24
  • 53
66
votes
8 answers

How do I prove that a function is well defined?

How do you in general prove that a function is well-defined? $$f:X\to Y:x\mapsto f(x)$$ I learned that I need to prove that every point has exactly one image. Does that mean that I need to prove the following two things: Every element in the domain…
Kasper
  • 12,734
  • 12
  • 60
  • 110
66
votes
18 answers

Is there a simple function that generates the series; $1,1,2,1,1,2,1,1,2...$ or $-1,-1,1,-1,-1,1...$

I'm thinking about this question in the sense that we often have a term $(-1)^n$ for an integer $n$, so that we get a sequence $1,-1,1,-1...$ but I'm trying to find an expression that only gives every 3rd term as positive, thus it would…
66
votes
7 answers

Functions that are their own inverse.

What are the functions that are their own inverse? (thus functions where $ f(f(x)) = x $ for a large domain) I always thought there were only 4: $f(x) = x , f(x) = -x , f(x) = \frac {1}{x} $ and $ f(x) = \frac {-1}{x} $ Later I heard about a fifth…
Willemien
  • 6,124
  • 4
  • 33
  • 83
65
votes
5 answers

Nice expression for minimum of three variables?

As we saw here, the minimum of two quantities can be written using elementary functions and the absolute value function. $\min(a,b)=\frac{a+b}{2} - \frac{|a-b|}{2}$ There's even a nice intuitive explanation to go along with this: If we go to the…
Oscar Cunningham
  • 15,389
  • 3
  • 43
  • 77
61
votes
6 answers

Find three non-constant, pairwise unequal functions $f,g,h:\mathbb R\to \mathbb R$...

I've been stumped by this problem: Find three non-constant, pairwise unequal functions $f,g,h:\mathbb R\to \mathbb R$ such that $$f\circ g=h$$ $$g\circ h=f$$ $$h\circ f=g$$ or prove that no three such functions exist. I highly suspect, by…
Franklin Pezzuti Dyer
  • 37,332
  • 9
  • 60
  • 145
59
votes
4 answers

Can there be an injective function whose derivative is equivalent to its inverse function?

Let's say $f:D\to R$ is an injective function on some domain where it is also differentiable. For a real function, i.e. $D\subset\mathbb R, R\subset\mathbb R$, is it possible that $f'(x)\equiv f^{-1}(x)$? Intuitively speaking, I suspect that this is…
polfosol
  • 8,721
  • 6
  • 27
  • 56
59
votes
6 answers

Is there a function whose antiderivative can be found but whose derivative cannot?

Does a function, $f(x)$, exist such that $\int f(x) dx $ can be found but $f' (x)$ cannot be found in terms of elementary functions. For example, if $f(x)=e^{x^2}$, then the derivative is easily calculated by using the chain rule. However, there…
zz20s
  • 6,362
  • 7
  • 23
  • 40
58
votes
7 answers

Big O Notation "is element of" or "is equal"

People are always having trouble with "big $O$" notation when it comes to how to write it down in a mathematically correct way. Example: you have two functions $n\mapsto f(n) = n^3$ and $n\mapsto g(n) = n^2$ Obviously $f$ is asymptotically faster…
Blnpwr
  • 901
  • 1
  • 7
  • 11
1
2 3
99 100