# Thread: need an integer producing function

1. ## need an integer producing function

I need a function such that for any real positive input, the output is an integer--AND is a different integer for each different input.

Does such a thing exist?

2. Of course, one-to-one functions have a different y value for all x values.

y=mx+b would be one function that suits your criteria.

3. Originally Posted by rainer
I need a function such that for any real positive input, the output is an integer--AND is a different integer for each different input.

Does such a thing exist?
I don't think that a 1-1 map $\mathbb{R}^+ \rightarrow \mathbb{Z}$ is possible since the domain is an uncountable set and the range is countable.

4. How about: $\displaystyle y=m\left\lfloor x\right\rfloor + b$ where $b,m\in\mathbb{Z} \ \mbox{and} \ x\in\mathbb{R}^+\mbox{?}$

5. Originally Posted by dwsmith
How about: $\displaystyle y=m\left\lfloor x\right\rfloor + b$ where $b,m\in\mathbb{Z} \ \mbox{and} \ x\in\mathbb{R}^+\mbox{?}$
Correct me if I'm wrong, but this would not always produce an integer y for any real positive x.

Originally Posted by skeeter
I don't think that a 1-1 map $\mathbb{R}^+ \rightarrow \mathbb{Z}$ is possible since the domain is an uncountable set and the range is countable.
Is there a proof or theorem somewhere that says or implies that if "the domain is an uncountable set and the range is countable" then there can be no "one to one map $\mathbb{R}^+ \rightarrow \mathbb{Z}$" ? I'd be very interested in that.

Thanks

6. It is essentially the definition of "uncountable".

If there were a one-to-one function from an uncountable set to a subset of the positive integers, then f(x)= n would assign a positive integer to each x in the set. We would be "counting" the set.