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
0 answers

How to develop a function which returns the 'n'th number divisible only by primes (excluding primes)?

To elaborate, I'd like to programmatically find numbers which can only be divisible by primes and themselves. I'd like to ensure primes are excluded from the output. $n$ would be the input. A few examples to clarify; $n=1$ returns 4, $n=2$ returns…
2
votes
2 answers

Calculate unique hash from two integers

Is it possible to produce unique number (an integer) from two integers? The two numbers are points in 2d coordinate system, their value can be 0, negative and positive. I can assume that all points will be in range +- (-1000,1000) my first guess was…
qwertik
  • 21
2
votes
2 answers

What is the intuitive way to understand addition of functions?

I am studying some basic maths to refresh my knowledge. It is told that like numbers we can add two functions. While I got the mechanics of it but I don't understand the importance of it. Similar is the case for subtraction, division and…
vivek
  • 179
2
votes
1 answer

$f(x)\geq 0$, $f^{\prime}(x)>0$ and $\frac{f(x)}{f(\frac{x}{2})}=a$, where $a$ is a fixed constant value. Only $f(x)=x^{b}$ be possible?

I meet one problem. The function $f(x)$ satisfies $f(x)\geq 0$, $f^{\prime}(x)>0$ and $\frac{f(x)}{f(\frac{x}{2})}=a$, where $a$ is a fixed constant value. It is easy to see $f(x)=x^{b}$ and $a=2^{b}$ meet these conditions. The question is there any…
2
votes
4 answers

A function that is one to one but not onto $\mathbb{Z}$ to $\mathbb{N}$

Can someone please tell me if I can have a function that is one to one but not onto $\mathbb{Z}$ to $\mathbb{N}$? I tried these formulas \begin{align*} F(x) & = x^2+1\\ F(x) & = x^2 -1 \end{align*} But it always gives me a function that is onto…
Yooko
  • 21
2
votes
4 answers

Find a surjective function $f:\mathbb{N}\to \mathbb{Q}$

I'm trying to find a surjective function $f:\mathbb{N}\to \mathbb{Q}$; I know that at least one such function must exist since $\mathbb{Q}$ is countable, but I haven't been able to find one. Can someone show me one such function? Best…
lorenzo
  • 4,032
2
votes
0 answers

Family of Functions with "Common Restriction"

Is there a discussion in literature of "families of functions with common restrictions"? What I mean is: given a family $F$ of functions we define $$ D_F = \left\{x \in \bigcup\nolimits_{f \in F}\operatorname{dom}(f)\ \middle|\ f_1(x) = f_2(x)…
Herng Yi
  • 3,156
2
votes
2 answers

What is the domain of $f(x)=x^x$?

What is the domain of $f(x)=x^x$ ? I used Wolfram alpha where it is said that the domain is all positive real numbers. Isn't $(-1)^{(-1)} = -1$ ? Why does the domain not include negative real numbers as well? I also checked graph and its visible…
nsm
  • 71
2
votes
1 answer

Injective and Surjective Function (Mapping)

I had a question about mapping, for example: what do they mean by $R \times R \to R$? is that not just $R \to R$?
2
votes
0 answers

Equality implies equality, name?

Let $f_1: A \rightarrow F_1$ and $f_2: A \rightarrow F_2$. How would one call the following property of these two functions: $$\forall a_1, a_2 \in A: f_1(a_1) = f_1(a_2) \Rightarrow f_2(a_1) = f_2(a_2)$$ Does this have something to do with…
2
votes
2 answers

On the meaning of set-valued mappings

here one question that may look stupid. Why in general one insists on naming in a different way functions and set-valued functions just because one is single valued and the other is not? I mean, from topology, we define as function an object that…
frank
  • 279
2
votes
2 answers

Studying this function: $y = \frac{x^2}{1+\log|x|}$

I'm still studying this function: $$y = \frac{x^2}{1+\log|x|}$$ And now I'm dealing with the study of the monotony. So I got the first derivative, this: $$y\,' = \frac{x(1+\log{x^2})}{(1+\log|x|)^2}$$ Then I put the first derivative $>…
Overflowh
  • 483
2
votes
2 answers

Find the domain of the given function.

I have the function $f(x)=\cos^{-1}(\frac{1}{2\cos(x)})$ and I have to find its domain. What I know is that the domain of $\cos^{-1}(x)$ is $[-1,1]$ so I think that $\frac{1}{2\cos(x)}$ should be at least $-1$ and $1$ at most. So $-1=0.5/\cos(x)$…
user41736
  • 337
2
votes
0 answers

Constructing an iterative "signature" function

Please pardon my rather crude description of this problem, I am not very adept at mathematical notation and language, but I will do my best to describe it in a way as to be understandable. I have one number, lets call it $K$. I need to be able to…
2
votes
1 answer

Is tangent monotonically increasing?

According to wolfram a function is monotonic if its derivative never changes sign, but the derivative doesn't have to be continuous. So I feel the answer is Yes, tangent is monotonically increasing. Maybe not?
newbyca
  • 131