glyperezrl

2022-07-15

Discrete Math Functions
$f:\mathbb{N}\to \mathbb{N}$ such that $f\left(x\right)=2x$
$f:\mathbb{Z}\to \mathbb{Z}$ such that $f\left(x\right)=2x$
How are these two different?
And also $h:\mathbb{R}\to \mathbb{R}$ where $h\left(x\right)=\sqrt{x}$
$f:\mathbb{N}\to \mathbb{N}$ where $f\left(x\right)=\sqrt{n}$

nuramaaji2000fh

Expert

Step 1
Because $f:\mathbb{N}\to \mathbb{N}$ has only positive values in difference with $f:\mathbb{Z}\to \mathbb{Z}$ that has negative values too.
Step 2
for $h:\left[0,\mathrm{\infty }\right]\to \mathbb{R}$ (From $\left[0,\mathrm{\infty }\right]$ and not $\mathbb{R}$ because $\sqrt{x}$ is not defined in negative reals) we have that $h\left(x\right)>0$ for every x in difference with $f:\mathbb{N}\to \mathbb{N}$ that $f\left(x\right)>1$ for every x.

Expert

Step 1
In the first case, for any x such as $x\in \mathbb{N}$ and $x\in \mathbb{Z}$ then ${f}_{\mathbb{N}}\left(x\right)={f}_{\mathbb{Z}}\left(x\right)$. Given that all natural numbers are integers, then there is no difference for the (sub)domain of natural numbers. However, the second function is also defined for negative integers which are not natural numbers, and therefor they are not defined in the first function.
v.g. ${f}_{\mathbb{Z}}\left(-1\right)=-2$, however ${f}_{\mathbb{N}}\left(-1\right)$ doesn't have any sense.
So both functions are different because their domains and codomains are different.
Step 2
In the second case (I will asume $f\left(n\right)=\sqrt{n}$), both h and f are not well defined, as $h\left(-1\right)$ does not exist in $\mathbb{R}$, and f(2) does not exist in $\mathbb{N}$.
Step 2
However, if for a certain x such as $x\in \mathbb{N}$ and $x\in \mathbb{R}$ and f(x) is defined and h(x) is defined, then $f\left(x\right)=h\left(x\right)$, v.g. $f\left(4\right)=h\left(4\right)=2$. Otherwise the functions are different. v.g. f(2) does not exist but $h\left(2\right)=\sqrt{2}$, and $h\left(-1\right)$ does not exist, but $f\left(-1\right)$ has no meaning, and f(1.5) has no meaning while $h\left(1.5\right)=\frac{1}{2}\sqrt{6}$.

Do you have a similar question?