# Rational numbers from irrational numbers [closed]

Can any real function of irrational numbers be rational ? If possible, please give examples. Special case $e^ {\pi i } = -1$ seems to restrict solutions entirely to complex numbers. The question is right now vague as I do not know how to exclude "obviously derived " examples.

• Maybe more interesting to try to find a surjection $\mathbb{R}\setminus\mathbb{Q}\rightarrow\mathbb{Q}$. Nov 26, 2015 at 20:22
• On the opposite, can you find a continuous function that never maps an irrational to a rational, other than a rational fraction ?
– user65203
Nov 26, 2015 at 21:27
• @YvesDaoust $f(x)=|x|$? Nov 26, 2015 at 21:45
• @Wojowu: all piecewise functional inverses of rational fractions with rational coefficients never map an irrational to a rational. $|x|$ is such a function.
– user65203
Nov 26, 2015 at 22:51

Sure. Choose any constant function $f : \mathbb R \setminus \mathbb Q \to \mathbb Q$, for example

$$f(x) = 1 \quad\text{ for all } x \in \mathbb R \setminus \mathbb Q$$

If this answer seems flippant, you may want to sharpen the question.

• For kicks, define it as conways base 13 function everywhere else. Nov 26, 2015 at 22:50

The cosine of $\pi$ is -1, a rational number.

You can construct required function from any real function, rounding the result to finite number of decimals.

What about $f(x)=x^2$? One has $f(\sqrt2)=2$.

• should work for any, not only for square roots ...
– z100
Nov 26, 2015 at 19:51
• @oops, algebraic of course.
– user65203
Nov 26, 2015 at 21:06
• More generally, all algebraic numbers evaluate to $0$ for some polynomial function.
– user65203
Nov 26, 2015 at 21:06
• @YvesDaoust, what you say is ambiguous (in English!). Better to say, “Every algebraic number evaluates to $0$ for some polynomial function”. Nov 26, 2015 at 22:04
• @Lubin: I agree.
– user65203
Nov 27, 2015 at 10:21

A well-known example.

Is $m:=\sqrt{2}^{\sqrt{2}}$ rational? If yes, that is your answer.

If no, then $m^\sqrt{2}$ is your answer: $m$ and $\sqrt{2}$ are irrational, but $$m^\sqrt{2} = \left(\sqrt{2}^\sqrt{2}\right)^\sqrt{2} =\sqrt{2}^{(\sqrt{2}\cdot\sqrt{2})} = \sqrt{2}^2 = 2$$ is rational.

• This question generalizes this example. Nov 27, 2015 at 0:19

I don’t understand your question, since it seems to be insufficiently quantified. Do you mean, “Is there a function that takes every irrational number to a rational?”? Or do you mean, “Given an irrational number, is there a function that takes it to a rational image?”? Your example seems to support the second interpretation, in which case I’d suggest the function $f(x)=x/a$, if your given irrational number is $a$.

And you didn’t say what kind of function you were allowing. Any continuous function? Analytic? I can suggest all manner of discontinuous functions that take irrationals to rationals, beyond of course the ultimate in continuity, the constant functions.

• I meant a situation about any function of rationals mapped from independent irrational variable numbers, Nov 27, 2015 at 9:12

According to a famous theorem about trascendental numbers for all $\alpha$ real algebraic with $1\ne\alpha\ne0$ the number $\ln \alpha$ is trascendental. Consider the function $f(x)=e^x$ which is a bijection of $\mathbb R$ onto $]0,\infty[$; take now un $r\in$ $\mathbb Q^+$, for instance $r=7$; there exists x such that $f(x)=7$ but $f(x)=e^x=7\iff x=\ln 7$ hence $x$ is a trascendental number whose image by $f$ is rational.

You have this way infinitely many rational $r$ such that if $x=\ln r$ then $f(x)=r$ where x is irrational (it is trascendental indeed).

Several.

f(x) = x - x = 0

f(x) = x / x = 1, for x in R - {0}

f(x) = round(x, 5), where round() rounds a number to the specified quantity of decimal places.

The Dirac delta.

f(x) =
1 if x in Q,
0 if x not in Q


f(x) =The average of the first 10^6 digits of x (in base 10).

And so on...