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

Show that $\frac{f(n)}{n!}=\sum_{k=0}^n \frac{(-1)^k}{k!}$

Consider a function $f$ on non-negative integer such that $f(0)=1,f(1)=0$ and $f(n)+f(n-1)=nf(n-1)+(n-1)f(n-2)$ for $n \geq 2$. Show that $$\frac{f(n)}{n!}=\sum_{k=0}^n \frac{(-1)^k}{k!}$$ Here $$f(n)+f(n-1)=nf(n-1)+(n-1)f(n-2)$$ $$\implies…
A.D
  • 6,400
  • 1
  • 20
  • 43
6
votes
5 answers

Squaring a real valued function

There is a function f(x) defined as $$f(x)= \sqrt{x+1}$$ And we need to find its square that is $$f^2(x)$$ Or in other words we have to find $$f(x) × f(x)$$ What I am doing is :- First I found the domain of f(x) that is $$[-1,\infty)$$ Then I found…
6
votes
4 answers

function for $f: [0,\infty) \to (0,1]$?

I'm using R to plot some data and I'd like to transform a distance variable with $[0,\infty)$ to a transparency parameter that accepts inputs $[0,1$]. I'd like $0$ distance to map to $1$ and increasing distances to map to decreasing numbers…
Michael
  • 163
6
votes
1 answer

What is the intuition behind a ((final - midterm)^2)/(100-midterm) grade bonus?

In my course (https://www.cs.bgu.ac.il/~ppl182/Guidelines) we have a grading policy in which you can gain a bonus to your final grade if you improve your grade between the midterm exam and the final exam. The formula for the bonus $b$ is $$b =…
Amit
  • 61
6
votes
6 answers

$f(x+1/2)+f(x-1/2)= f(x)$ Then the period of $f(x)$ is?

$f(x+1/2)+f(x-1/2)= f(x)$. Then the period of $f(x)$ is: a)$1$ b)$2$ c)$3$ d)$4$? Attempt: I substituted $x= x \pm1/2$ but the equations I got didn't help at all. How do I go about solving such a question? I am just looking for a hint and not…
Archer
  • 6,051
6
votes
5 answers

What are some examples of a doubling function $f:\mathbb{R} \to \mathbb{R}$

A function $f : X \to Y$ is a “doubling” function if for every $y \in Y$ , there are exactly two distinct values $x_1,x_2 \in X$ such that $f(x_1) = f(x_2) = y$. I am satisfied with the answer to my previous question - $f:\mathbb{R} \setminus \{0\}…
user266729
6
votes
2 answers

What's the name for a bijection where pairs of elements map to each other?

First, a bit of context. About a quarter of an hour ago I came across one of those "Internet math puzzles" on Facebook that stated: If 1 = 5, 2 = 10, 3 = 15, and 4 = 20, then 5 = ? The answer was supposed to be 1, as we had already stated. But of…
Joe Z.
  • 6,719
6
votes
2 answers

Trying to figure out a formula with given input and outputs.

I'm playing this video game where people can get kills, deaths, and assists , and all this is recorded on a stats website. The stats website gives you a rating by directly manipulating these numbers. In the first entry, I have 26 kills, 5 deaths,…
krikara
  • 478
6
votes
4 answers

How find the $f(m+1)-f(m)=\text{constant},\forall m\in\Bbb{N}^{+}$

Let $f:\mathbb{N}^{+}\to \mathbb{N}^{+}$ be a strictly monotone increasing function such that $$f(f(m+1))-f(f(m))=f(f(m+1)+1)-f(f(m)+1),\forall m\in \mathbb{N}^{+}.$$ Show that: $$f(m+1)-f(m)=\text{ constant},\forall m\in \mathbb{N}^{+}$$ My…
math110
  • 93,304
6
votes
4 answers

Solution of $x^2 + s(x)\cdot x - n = 0$, with $s(x)$ is the sum of digits of $x$.

This problem comes from an programming competition website, but I'd interested in analyze it from mathematics prespective. Given this problem below, we must create a program that could give us the correct output from the given input. The program…
6
votes
1 answer

Sketching weird Exponential graph

The formula of the line is - $$ y = 1 + 2^{-x} $$ Sketch the graph and show clearly whether it passes through the point $ (1,1) $ When $X = 0$ , $y =2$, so the $y$ intercept is at $y = 2$ . When $X = 1$, $Y = 1.5$ , this shows that it does not…
user307640
  • 2,632
  • 2
  • 17
  • 27
6
votes
2 answers

Function which is $2^n$ - periodic for all integers $n$

Is there a non-constant, continuous function $f: \mathbb{R} \longrightarrow \mathbb{R}$ such that for all integers $n$, $f$ is $2^n$-periodic? Notes: $n$ can be any integer, and so can be negative as well as positive. If I did not require $f$ to be…
Adam Rubinson
  • 20,052
6
votes
2 answers

Is there a theory about functions whose results are "negative" to the results of other functions?

Let's say we have a function $x \cdot 2$, which gives results: $2,4,6,8,10,\ldots$. We can construct "negative" function $x \cdot 2-1$, which results will be: $1,3,5,7,9,\ldots$. So the all natural numbers will be a sum of both results. But could be…
6
votes
2 answers

How to determine the number of digits needed to represent a number in different bases?

I am not a mathematician, but I do some computer programming and I am trying to find a solution to a fairly simple problem. Is there any known formula/equation/function for mathematically determining the number of display digits (aka "places") that…
O.M.Y.
  • 255
6
votes
3 answers

Is there an expression for a function that maps integers to one and non-integers to zero?

Is there a function that can be built with addition, multiplication, exponentiation, trigonometric functions, integrals, (and all of their inverses i.e subtraction, division, taking logarithms, $\arcsin(x)$, derivatives, etc) that would take an…
GuPe
  • 7,318