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
2
votes
1 answer

Is $(g \circ f)^{-1} (x)$ equal to $(f^{-1}\circ g^{-1})(x)$ or not?

Is $(g \circ f)^{-1} (x)$ equal to $(f^{-1}\circ g^{-1})(x)$ or not?
dj1
  • 23
2
votes
1 answer

What function should I use to solve this? Simple question ;)

I need to write a simple function to be implemented in a computer program. It should have as imput a number from 2 to 9 and gives as output a number from 1 to 5. When the input is higher 6-7-8-9 the output should be lower 1-2. The opposite when the…
KingBOB
  • 434
2
votes
1 answer

Line passing trough two points

Theroem: Given two points $A$ and $B$ with coordinates $(x_A;y_A)$ and $(x_B;y_B)$ then the equation of the line passing trough both $A$ and $B$ is $$y= y_{A/B}+\frac{\Delta y}{\Delta x}\cdot(x-x_{A/B})$$ $$ \text{where} \frac{\Delta y}{\Delta…
PunkZebra
  • 1,595
2
votes
4 answers

Cancelling common factors and equality of functions

Suppose we have two expressions: $\frac{x-1}{x-1}$ and $1$. In the first expression we cancel the nominator and the denominator and are left with $\frac{1}{1} = 1$ and the first two expressions are said to be equal. Now let us define two functions…
LearningMath
  • 1,201
2
votes
2 answers

Function with only one real root

I'm trying to show that the function $f(x)=2x+3sinx+xcosx$ has only one real root (which is $0$) I've noticed that this is an odd function and therefore if it has a second real root $x_0>0$ then $-x_0$ will be a root as well. Then I tried using…
user92596
2
votes
1 answer

The "sin-cos-maximum" function

Is there some specific notation for the function $f(x):=\max\{\cos(x),\sin(x)\}$, or maybe some equivalent compact expression? Improvement: Actually, maybe a compact equivalent expression for its squared…
2
votes
2 answers

Prove that the function: f: $\mathbb{N} \mapsto \mathbb{Z}$ defined as f(n)= $\frac{(-1)^n(2n-1)+1}{4}$ is bijective.

Prove that the function: f: $\mathbb{N} \mapsto \mathbb{Z}$ defined as f(n)= $\frac{(-1)^n(2n-1)+1}{4}$ is bijective. This is rough. I've been staring at this one for a while now. I get stuck on the injective part. I set f(a)=f(b), and I'm trying to…
2
votes
1 answer

Getting a function that passes through 'n' points

Is there a way to get a periodic function that passes through n arbitrary points?
2
votes
2 answers

Bijection between $\mathbb N \times \mathbb N$ and $\mathbb N$

Show that $\mathbb{N} \times \mathbb{N} \sim\mathbb{N}$. I found a bijection such that $g(k,l): \mathbb{N} \times \mathbb{N} \to \mathbb{N}$ by $$g(k,l) = {(k+l)(k+l-1) \over 2} - (l-1)$$ But I am having trouble showing that it is 1-1 and onto. …
Sam
  • 419
2
votes
2 answers

If $F$ is injective, and so is $F \circ G$, does $G$ have to be?

If $F$ is an injective (one-to-one) function, and the composite of the two $(F \circ G)$ is injective, is it possible for $G$ to not be injective?
2
votes
2 answers

How to simplify / combine function equtions containing `if`?

I have two eqution (blue / green), composed them using a simple if (black). Blue: (2x)^2 / 2 Green: 0.5 + (1 - (2(1-x))^2) / 2 Black: (x < 0.5) ? (2x)^2 / 2 : 0.5 + (1 - (2(1-x))^2) / 2 See it in action on Fooplot:…
Geri
  • 123
2
votes
3 answers

Function with $f \circ f \circ f=f$

What are the functions with $f \circ f \circ f=f$ defined from a set $E$ to itself? I can prove that such a function is onto iff it is one to one. So suppose also that $f$ is bijective. If $E=\mathbb{R}$ we have as solutions $f(x)=x$ and $f(x)=-x$…
2
votes
1 answer

Ordered Weighted Averaging operator clarification

I was just lookning at the difinition of the OWA operator. It is defined as: $F(a_1, ..., a_n) = \sum_{j=1}^n w_j b_j$ where $b_j$ is the $j$th largest of the $a_i$. The part that strikes me odd is "$b_j$ is the $j$th largest". I am not…
2
votes
3 answers

How to prove that: $f(A\cap B) \subseteq f(A) \cap f(B)$, and some few others

With $f:X \rightarrow Y; A, B \subseteq X; C, D \subseteq Y$, I'm given these identities: 1. $f(A\cap B) \subseteq f(A) \cap f(B)$ 2. $f(A\setminus B) \subseteq f(A) \setminus f(B)$ 3. $f^{-1}(C\cap D) \subseteq f^{-1}(C) \cap f^{-1}(D)$ 4. $A…
1
vote
1 answer

How to tell whether or a function is surjective or injective?

If one is given the following: $$A = \{(x, y)\mid x \in \mathbb{R}, y \in \mathbb{Z}, y = \lceil x \rceil\},$$ a relation from $\mathbb{R}$ to $\mathbb{Z}$. How would I be able to tell whether or not it is injective or surjective? I checked if…
dreamin
  • 189