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

create function to calculate values

I'm writing a program that needs to determine a variable (opacity) based on a linear function of time (milliseconds elapsed during the program). Basically, over a period of 1000 milliseconds (end_time - start_time), I need to linearly calculate an…
2
votes
1 answer

Factorising a function in terms of its variables

Let $$ f = \left\{ \begin{array} 2e^{-x-y}& \text{if } y > x > 0\\ 0 &\text{otherwise}, \end{array} \right. $$ why can't this function be factorized as a function of $x$ times a function of $y$ for all pairs $(x,y)$ in the domain? Im struggling to…
Raul
  • 938
2
votes
2 answers

Which function would best describe Moore's law

Moore's law states that the transistor density on integrated circuits doubles every 2 years. So this is an exponential function. My question is simple; what function of the form $y= a \times e^{bx+c}$ would best describe this growth (with a length…
Phaptitude
  • 2,249
2
votes
1 answer

Show a function is one-to-one and onto

Consider f: ℝ{1} → ℝ{1} given by f(x) = x/(x-1) Show that f(x) is one-to-one and onto. What I have: If a function is one-to-one then it follows that if f(a) = f(b) then a=b. If a function is onto then it follows that ∀y∈Y, ∃x∈X such that f(x)=y. So…
2
votes
5 answers

Separation of variables

If I have a function $f(x,y)$, is it always true that I can write it as a product of single-variable functions, $u(x)v(y)$? Thanks.
2
votes
1 answer

Two questions about functions

Can someone give me an example of an instance where the pre-image of a function would NOT just be the domain. For instance, for $f(x)=x^2$, the image is all positive reals. The pre-image would consist of all elements in X that map to all y in the…
user112907
  • 21
  • 1
2
votes
2 answers

Range scaling with constraints

I'm not a mathematician, so sorry for the possible trivial question. I have a set of values in $x_i\in[0,1]$ (say for $i=1,\ldots,n$) whose sum can be greater than $1$. Now I want to scale them so that the new values $\hat{x}_i$ fall in the interval…
seg.fault
  • 153
2
votes
2 answers

Show an increasing function with an interval as a range is continuous

My professor gave us this problem out of his book: Show, if f: [a, b] --> R is an increasing function and the range of f is an interval, then f is continuous I'm not sure if I'm understanding correctly though. Wouldn't "the range of f is an…
K B
  • 39
  • 1
  • 4
2
votes
1 answer

Finding exactly one real solution to the system

I dont know how to go about finding the one real solution to the system where k is a real number Thank you
Maximiliano
  • 1,121
2
votes
2 answers

Function with a continuous domain but a discrete range

Does it makes sense for a function to have a discrete range even though the range is continuous? If yes how is it defined, and is it called something specific? To explain what I mean if one had to model time against whether the light is on or off…
jbx
  • 383
2
votes
1 answer

Mathematical notation to define a function/relation

I have to define a function using mathematical notation. A function is translating one molecule ID to a vector(array,one dimensional matrix) of states that it can be in. I basically need to say the following: For each of the molecule(in the set of…
2
votes
2 answers

N-dimensional function computation

There is a well-known concept of partial sums. I know how to apply it to the 1D, 2D and 3D. Suppose, we have N-dimensional function $F(X_1, X_2,\; \dots \;, X_n)$ which is a partial sum of some function $F'$ in this context. How can we derive the…
2
votes
1 answer

The largest value of $f(n) $

Let us consider a function $ f:\mathbb{N}_0 \to \mathbb{N}_0 $ following the relations: $ f(0)=0$ $f(n) = n+f\left(\left\lfloor \frac{n}{p} \right\rfloor\right)$ when the $n$ is not divisible by $p$ $ f(np) = f(n) $ Here $p>1$ is a positive…
2
votes
1 answer

Proving functions are injective or surjective

determine with proof whether the functions are injective or surjective: 1) $ g: \mathbb{R} \rightarrow \mathbb{R}$ $ g(x) = 3x^3 - 2x $ 2)$ g: \mathbb{Z} \rightarrow \mathbb{Z}$ $ g(x) = 3x^3 - 2x $ for 1) using the definition set $ f(x_1) = f(x_2)…
John
  • 31
2
votes
3 answers

One to one and bijection in $\mathbb{Z}^2$

I have the following: $f(m,n) = (3m+7n, 2m+5n)$ and I want to know if it is a bijection and if so, fine the inverse as well. Here's my approach: Suppose $f(m_1,n_1)=f(m_2,n_2)$ then: $$…
Dimitri
  • 1,287