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
35
votes
3 answers

When functions commute under composition

Today I was thinking about composition of functions. It has nice properties, its always associative, there is an identity, and if we restrict to bijective functions then we have an inverse. But then I thought about commutativity. My first…
34
votes
3 answers

Proving a function is onto and one to one

I'm reading up on how to prove if a function (represented by a formula) is one-to-one or onto, and I'm having some trouble understanding. To prove if a function is one-to-one, it says that I have to show that for elements $a$ and $b$ in set $A$, if…
FrostyStraw
  • 1,045
33
votes
2 answers

Punch 2000 holes in 2000 polygons with 1000 needles

You have two identical perfectly square pieces of paper. The area of each paper is 1000 units. On each paper, draw 1000 convex, non-overlapping polygons with all polygons having the same area (exactly 1 unit). Obviously, the polygons are covering…
Saša
  • 15,906
32
votes
4 answers

How to prove if a function is bijective?

I am having problems being able to formally demonstrate when a function is bijective (and therefore, surjective and injective). Here's an example: How do I prove that $g(x)$ is bijective? \begin{align} f &: \mathbb R \to\mathbb R \\ g &: \mathbb R…
Saturn
  • 7,191
28
votes
7 answers

Are all functions that have an inverse bijective functions?

To have an inverse, a function must be injective i.e one-one. Now, I believe the function must be surjective i.e. onto, to have an inverse, since if it is not surjective, the function's inverse's domain will have some elements left out which are not…
27
votes
1 answer

Composition of functions injective implies one of them is injective?

Suppose we have $f: X \to Y $ and $g:Y \to Z $ maps. Prove that: $g \circ f $ injective $\implies$ $f$ injective $g \circ f $ surjective $\implies $ $g$ is surjective Attempt: Pick any $x,x' \in X $ with $x \neq x'$. We ought to show that $f(x)…
user222186
26
votes
3 answers

Functions similar to Log but with results between 0 and 1

I need a function similar to Log but it should produce numbers between 0 and 1 Something like: f(0)=0 f(1)=0.1 f(2)=0.15 f(3)=0.17 f(100)=0.8 f(1000)=0.95 f(1000000000)=0.99999999 I need this in my program that I am programming and I can use only…
410503
  • 371
23
votes
4 answers

Why Is a Function Defined As Having Only One Y-Value Output?

I know that it is defined such that there is no more than one y-value output for any given x-value input, but I"m wondering WHY it is defined that way? Why can't we apply everything we know about functions to equations that have more than one…
Moshe
  • 331
17
votes
2 answers

Why $f(x) = \sqrt{x}$ is a function?

Why $f(x) = \sqrt{x}$ is a function (as I found in my textbook) since for example the square root of $25$ has two different outputs ($-5,5$) and a function is defined as "A function from A to B is a rule of corre- spondence that assigns to each…
user93957
17
votes
6 answers

Is there a continuous function $f(x)$ such that the inverse function is $1/f(x)$?

A student came to me with this question and I cracked my head for one hour but I couldn't unambiguously prove that it exists or it doesn't exist. Continuous and invertible function such that $f^{-1}(x) =1/f(x)$ on its domain of definition.
15
votes
9 answers

Is there a "largest function"?

In one of my classes, the professor asked about what we think the largest function was. Many thought perhaps ${e^x}^{e^x}$, but I thought about $n!$ When I talk about a "largest function", I mean the function that increases the quickest. The…
Prime
  • 869
15
votes
4 answers

Difference between function and equation

What is the precise difference between function and equation ? In which case will it be wrong if used( common mistakes )? Also will the Venn diagram overlap if I were to draw one ? Any help and discussions will be appreciated .
15
votes
7 answers

Expressing bitwise operations in terms of other functions

I'm asking in the spirit of these two questions: can bitwise operations (AND, OR, XOR) be expressed in terms of other (more familiar?) functions? I had been playing around with the bitwise operations in Mathematica a while back, and was at first…
15
votes
3 answers

Is f(x) = x smooth?

It may sound too basic to even be a question, but I couldn't find a straight answer in Wolfram Alpha, Wolfram Mathworld or Wikipedia. Several other examples of more complicated functions are given. In Wolfram Mathworld it is written that A smooth…
14
votes
3 answers

Why is $\sin : \mathbb{R} \to [-5,5] $ different from $\sin : \mathbb{R} \to \mathbb{R}$?

My teacher says these two functions are different, why though? $$\sin : \mathbb{R} \to [-5,5] \tag{1}$$ $$ \sin : \mathbb{R} \to \mathbb{R} \tag{2} $$ Both have the same domain and range. What difference does changing the codomain make here, so long…
William
  • 4,893
1
2 3
99 100