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

A game involving Even and Odd functions

I was doodling around today and thought of this fun game. Two players take alternate turns playing this game. A function from now on refers to real valued functions with domain $\mathbb R$, and Odd and Even functions have the usual meaning. A…
Train Heartnet
  • 2,534
  • 3
  • 25
  • 42
3
votes
1 answer

Intersection points of a function and its inverse.

Why is it that when $f$ is an increasing function then the points of intersection of $f$ and $f^{-1}$ lie on the line $y=x$?
user92596
3
votes
1 answer

$x^y+y^x=c$ across the reals

Inspired by: For integers $a\ge b\ge 2$, is $f(a,b) = a^b + b^a$ injective? (a question worth looking at IMHO). My question is very simple. Let $x,y,c$ be positive real numbers, where $c$ is constant. $x^y+y^x=c$ represents a curve in 2D. Can…
ShakesBeer
  • 3,641
3
votes
2 answers

If $f( \cos^2(x) ) = \cos^2(x)$ can I assume that $f(x) = x$?

I am new to functions and domains and I am not sure that I can assume following because I think that the range of first function is $[0, 1]$ and the range of second is $(-\infty, \infty)$. The original question: Find $f(x)$ if $f( \cos^2(x) ) =…
3
votes
1 answer

Exact value of expression

Let $$f(x)=\frac{4^x}{4^x+2}$$ and $$S=\sum_{n=1}^{2005}f\left(\frac{n}{2005}\right)$$ What is the exact value of $S$? I tried to write $a=4^{\large\frac{1}{2005}}$, then $$S=\sum_{n=1}^{2005}\frac{a^n}{a^n+2}$$ but I still cannot simplify it. Is…
user164524
3
votes
3 answers

Finding if a function is onto?

Is the following function onto? It is a piece-wise function. Let the function $f:\mathbb{R}\rightarrow \mathbb{R}$ be $f(x)= \begin{cases} 2-x &, x\le 1 \\ \frac{1}{x} &, x>1 \end{cases}$ If we say $g(x)=2-x$ then it is one to one because make let…
Fernando Martinez
  • 6,698
  • 19
  • 74
  • 108
3
votes
2 answers

Function for this game movement graph?

This may be too easy for you, but here goes: I'm creating a kind of ski slalom game where I want the horizontal speed/direction to follow the attached graph. X is time, Y is horizontal speed. Positive horizontal speed makes my skier go right,…
3
votes
4 answers

Slightly equal functions

Can there exist two elementary functions $f(x)$ and $g(x)$ defined everywhere on the real axis such that, \begin{align} f(x)&=g(x)\qquad \text{if} \quad a\le x\le b\\ f(x)&\neq g(x)\qquad \text{if} \quad xb\end{align} where…
Edwin_R
  • 491
3
votes
3 answers

Finding the explicit notation of $f(n)$, based on it's recursive description.

I came across this problem on a HackerRank challenge. The function $f(n)$ is $1$ if $n = 0$ $2f(n - 1)$, if $n$ is odd $f(n -1) + 1$, if $n$ is even I solved the problem using a recursive function and it worked just well. However, I am assuming…
Winster
  • 31
3
votes
1 answer

Pairing function

Is there any pairing function that could encode two positive, natural numbers, with values ranging from $0$ to $3000$, into a single natural number with a value less or equal to $65535$?
rid
  • 133
3
votes
4 answers

How do you find the domain and range without having to graph?

Like, is their an algebraic method? For example if I am asked to find the domain of $g(t) = \sqrt{t^2 + 6t}$ , how do I determine the range of this? Is their a universal algebraic method that I don't know about?
Ishamel
  • 57
3
votes
2 answers

Is there a technical name for $f$ such that $(g \circ f)(a_1, a_2,\cdots)$ yields $g(a_1, a_2, \cdots)$?

Is there a technical name for a function $f$ such that $(g \circ f)(a_1, a_2,\cdots) \rightarrow g(a_1, a_2, \cdots)$? That is, is there a name for a function $f$ such that the result of composing $g$ with $f$ is $g$ invoked with $f$'s…
3
votes
2 answers

This function is injective

I'm trying to prove this function is injective: $$f:P(\mathbb N)\to \mathbb R, f(M)=\sum_{n\in M}3^{-n}$$ I've already proved that this function is well-defined but I couldn't prove this function is injective. Even to the case $|M|=2$, I found…
user42912
  • 23,582
3
votes
2 answers

Is this a valid function?

I am stuck with the question below, Say whether the given function is one to one. $A=\mathbb{Z}$, $B=\mathbb{Z}\times\mathbb{Z}$, $f(a)=(a,a+1)$ I am a bit confused about $f(a)=(a,a+1)$, there are two outputs $(a,a+1)$ for a single input $a$ which…
user2857
3
votes
1 answer

finding all functions: $f(\frac{x+a}{b})=f(\frac{f(x)+a}{b})$,$f:\mathbb{Q}\rightarrow \mathbb{Z}$

If i have this equation: $f(\frac{x+a}{b})=f(\frac{f(x)+a}{b})$ such that $x\in \mathbb{Q}$, $a\in \mathbb{Z}$ , $b\in\mathbb{N}$ and $f:\mathbb{Q}\rightarrow \mathbb{Z}$ Need to find all functions there are in this way. So i can choose $a=c-f(x)$…
mather
  • 47