1
$\begingroup$

There is a big discussion in our class.

Teacher says,

$f:\mathbb Z^{+}\rightarrow \left\{0\right\}$ and $f(x)=0$ is a constant function.

But, student says only

$f:\mathbb R\rightarrow \left\{0\right\}$ and $f(x)=0$ is a constant function

or $$f(x)=0\,\,\forall x\in\mathbb R$$

Unfortunately, wikipedia doesn't cover this problem.

What is the right statement?

$\endgroup$
1

2 Answers 2

4
$\begingroup$

Both are constant, the difference is just the domain, that is, the values your function is allowed to take as input. It is constant in so far as the output is always the same no matter what the input is, and this value doesn't have to be $0$, it can be anything else as long as it's the only value the function can output.

Sure, in the function given by the teacher, $f(-2)$ will be undefined, but saying it like that is misleading. The value $-2$ is not part of the domain, $f$ can't accept $-2$ as input, it's not as if $f(-2)$ existed but had some weird undefined value, it just doesn't exist at all. So the function effectively only outputs one value, in this case it's $0$. I hope I'm making sense and not confusing you further.

EDIT (can't comment on other posts) : @Angel I think what they mean by "$f : \mathbb{Z} \rightarrow 0$ means $f(x) = 0$ not for all $x$" is "the value of $f$ isn't $0$ for all $x$ since there are values of $x$ (outside of the domain) where $f$ isn't defined and as such for which $f(x)$ isn't $0$". A confusion about what functions and domains are, and the teacher probably has an habit of writing $\forall x$ instead of $\forall x \in \mathbb{R}$ which might lead to further confusion about what "for all" means in general.

$\endgroup$
2
  • $\begingroup$ Yes, now I understand..thank you. $\endgroup$
    – nonuser
    Dec 3, 2021 at 13:26
  • $\begingroup$ @Uretki I see, that makes sense. That would be where the confusion stems from, and if so, then I agree with you. This clarifies it. $\endgroup$
    – Angel
    Dec 3, 2021 at 13:35
3
$\begingroup$

A constant function is a function which is constant. That is $f(x)=c$ for all $x$ and some $c$. There is no reason to restrict this definition to the case where $c,x\in\mathbb{R}$ and $f:\mathbb{R}\to\mathbb{R}$.

$\endgroup$
6
  • $\begingroup$ Well, who is right? $\endgroup$
    – nonuser
    Dec 3, 2021 at 13:02
  • 2
    $\begingroup$ @I'mastudent Did you not read the answer? The teacher is right. $\endgroup$
    – Angel
    Dec 3, 2021 at 13:06
  • $\begingroup$ $f:Z\rightarrow 0$ means, $f(x)=0$ not forall $x$. $\endgroup$
    – nonuser
    Dec 3, 2021 at 13:15
  • $\begingroup$ "There is no reason to restrict this definition to the case where..." And yes, the definition of a constant function is a function such that there is some $c\in{Y}$ such that $f(x)=c$ for all $x\in{X}.$ $\endgroup$
    – Angel
    Dec 3, 2021 at 13:17
  • $\begingroup$ @I'mastudent No, that is definitely not what that means, and I have no idea where you get that from. $\endgroup$
    – Angel
    Dec 3, 2021 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .