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
1
vote
3 answers

Find domain and codomain of this function...

So, the function is: $$ z(x)=\sqrt{-4^x+6\cdot2^x-8}$$ We have to find domain and codomain. There are many more function in the exercise, I just want to know how it's done, so I can do the next examples on my own.
A6SE
  • 1,645
1
vote
1 answer

Inverse of "percent of total"

I have three variables: a = 1 b = 4 c = 5 I wanted a linear function which give me a percentage based on that the bigger the value is, the bigger the percentage will be : I's easy, it's the percent of the total : $$y = {x\over (a+b+c)}$$ (With x…
1
vote
1 answer

Scaling a scale

I have a list of input values from 0 to 100. Each value must be scaled to a short scale, that start from 20 to 80. So: 0=>must be 20 100=> must be 80 and each numbers between 0 and 100 must take a scaled value into 20-80 range. What's the formula…
markzzz
  • 61
1
vote
0 answers

Basic question about function equality (range vs codomain)

This specific question has arisen out of my attempts to do a wider exercise (link). Context We say two functions, $f$ and $g$, are equal if all three of the following conditions are met: (i) they have the same domain (ii) they have the same…
Penelope
  • 3,147
1
vote
0 answers

Does it make sense to define a function with a dependent number of dimensions?

I was thinking about the notation of function mappings, such as $$f: \mathbb R^n \rightarrow \mathbb R^m,$$ and wondered if there would be any point to considering functions with variable output (or input) dimensions. In this case I would imagine…
Michael M
  • 382
  • 2
  • 14
1
vote
1 answer

Count the number of unique values that $f(n) = \lfloor \frac{n^2}{2023} \rfloor$ can take if $n \in [1, 2023]$

Consider the following step function: $f: \mathbb{N} \rightarrow \mathbb{N}, f(n) = \lfloor \frac{n^{2}}{2023} \rfloor$ Where $n \in [1, 2023]$. How many distinct values does the step function take? Thanks!
user1296188
1
vote
1 answer

Basic Definition of a Function

In the past, I came across a very elegant definition (below) of a function, which is based on the fundamental concepts of triples, pairs, and sets. However, I find it difficult to search the internet for any citations that I could refer to. One…
1
vote
1 answer

How to find x-intercepts of the graph of $f$

Given the following function $$f(x) = \frac {\sin (4x)}{2x}$$ How to find $x$-intercepts of the graph of $f$ on the interval $0 \le x \le \pi$?
Grey
  • 13
  • 1
  • 4
1
vote
2 answers

General form of functions

Is there a general form for functions? For example if the function is a polynomial, the general form is well-known. But is there a general one, covering every possible function?
user92596
1
vote
1 answer

Proving if a linear part of a function exists using algebra.(proof of the second derivative being zero at some point/points)

I know that the following question can be resolved using derivatives but nonetheless, I would like to hear a more fluid and lucid approach. Any hand waving explanation and approximations are welcome. The question is:- Prove that there exists a…
1
vote
1 answer

Does $\operatorname{Log}(z^n)=n\operatorname{Log}(z)+2ik\pi$?

I study complex functions and I need to prove or disprove that for each $n$ that belongs to the natural numbers, there is a $k$ that belongs to the integers so for every $z$ that belongs to $\mathbb{C} \setminus (-\infty,0]$ I get …
Shani Naim
  • 21
  • 2
1
vote
2 answers

Odd and even functions, parametric equations

Suppose that $x=f(t)$ and $y=g(t)$ define $y$ as a function of $x$ and that this is known to be an even function. If $g$ is an even function is it true that $f$ must be an odd function? (Here I should have said $f$ cannot be an odd function + a…
1
vote
1 answer

Creating a Function to Modify Another Function's Output for a Specific Input

Let's hypothesize a function $f(x)$ that checks the validity of some value $x$ in a set of number $X$. At the beginning each number is valid, so $f(x)=1$ for all $x$. Then we define a higher-order function $g$, that takes a number $x_i$ and works on…
pava
  • 11
  • 2
1
vote
2 answers

Example of non bijective functions $f,g:X\to X$ such that $g\circ f=id$

I want example for some functions $f,g:X\to X$, where $X$ is an arbitrary set, such that $g(f(x))=Id_{X}(x)$ and $f$ and $g$ either not bijective (this means $f$ is bijective, $g$ is not bijective is OK. $f$ and $g$ both are bijective is No. $f$ and…
1
vote
1 answer

Pre-image of a subset that contains an element with no association.

I got into an argument with my professor today in my beginner foundations in computer science course. We are using the textbook Discrete Structures, Logic, and Computability. At the bottom of the third page in Chapter 2, the book…