# 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 (to indicate when light goes on and light goes off). The range will just be 0 and 1, nothing in between, while the domain is a continuous value, time.

• You just gave an example. A related one is the floor function $\lfloor x\rfloor$, the greatest integer $\le x$. – André Nicolas Nov 21 '13 at 1:53
• Yes, what I mean is, does it have a specific name? Is it defined in a specific way? It is not a continuous function, so I don't think it is defined using limits, or is it? – jbx Nov 21 '13 at 1:55
• While a function can respect the continuity of its domain, it doesn't have to. Just like it doesn't have to respect order, or inequality, or all sorts of other things. I recommend checking out how a function is set-theoretically defined. – Malice Vidrine Nov 21 '13 at 2:03
• There is no special name. Except in the trivial case, it cannot be continuous, but saying "not continuous" is definitely not enough. – André Nicolas Nov 21 '13 at 2:34

It makes sense and your example is a good one. A function is required to return a single value for each element of the domain, but doesn't have to be continuous. A couple other example of functions on $\Bbb R$ are $\lfloor x \rfloor$ and the function that is $1$ if $x$ is rational and $0$ otherwise.

• So in my case, am I correct to say that it is not a continuous function? And the definition of it can still be: $lights: \Bbb R_{\geq0} \rightarrow \{0,1\}$ – jbx Nov 21 '13 at 2:00
• Yes, that is correct. We seem to confuse people when we "draw a function " and always make it continuous, even differentiable. Most functions are not – Ross Millikan Nov 21 '13 at 2:06

I would say it has to do largely with whether the function is continuous. If a function on $I \subseteq \mathbb{R}$ is continuous, with $I$ an interval, its range is either a single value (discrete) or an interval.

This is because continuity preserves a property called "connectedness".

• Yes, its those kinds of issues I am asking about. In the example I gave, if the function was $lights(t)$, $t$ is definitely a continuous value, but at the same time the result is just 0 or 1. So is it a continuous function or not? Or does it have a specific name? And how is it defined (do you put $lim$ etc.)? – jbx Nov 21 '13 at 1:57
• $lights(t)$ is not continuous if the light ever changes state. You have defined it fine-you have explained what the value is for any $t$ – Ross Millikan Nov 21 '13 at 2:02
• @jbx As Ross said, the function is discontinuous if the light switch ever changes state. – Eric Auld Nov 21 '13 at 2:06