My question is based on the fact that if there is any special program, that allows to graph certain peculiar functions such as the following, $$f(x)=\begin{cases} 1, & \text{ if } x\in\mathbb Q; \\ 0, & \text{ if } x\notin \mathbb Q. \end{cases}$$ Or, $$g(x)=\begin{cases} 0, & \text{ if } x\in(\mathbb R\setminus \mathbb Q)\cup \{0\}, \\ 1/q & \text{ if } x=p/q,\ \gcd(p,q)=1,\ p\neq 0. \end{cases}$$
Asked
Active
Viewed 41 times
1
-
6Graphing $f(x)$ is quite problematic, as computers (having finite decimal expansions) effectively consider every real number rational. – Blue Apr 26 '21 at 07:57
-
3Graphing $f(x)$ is impossible, computer or no computer. Given any real number $(r)$, rational or irrational, and any $\delta > 0$, no matter how small, there will be both a rational and an irrational number in the neighborhood around $(r)$, of radius $\delta.$ – user2661923 Apr 26 '21 at 08:23
-
2Graphing $g(x)$ is impossible as well. The reason is the same. – Peter Apr 26 '21 at 08:24
-
1The image of that function will look like function const = 0 because rationals have 0 measure, whole measure is in irrational numbers. – robin3210 Apr 26 '21 at 08:39
-
Ah ok, thank you very much for clarifying my doubt about those two functions. – James A. Apr 26 '21 at 18:57
-
One has to wonder why $0$ gets to be an honorary irrational in the second function, rather than have $g(0) = 1$ like all the other integers. – Paul Sinclair Apr 26 '21 at 20:15