# How can find domain and range of $f(x)=\sqrt{\sqrt 2 \lfloor x \rfloor - \lfloor\sqrt 2x \rfloor}$?

How can find $D_{f(x)},R_{f(x)}$ when $$f(x)=\sqrt{\sqrt 2 \lfloor x \rfloor - \lfloor\sqrt 2x \rfloor} \ ?$$
I help some problem like this for a question here ... (Domain and range of a floor function) But I get stuck on this to find Domain and Range of above function . If You can help me to find out , I will be very thankful .

• Is $x \in \mathbb R$? What are the square brackets for? – BDN Oct 1 '17 at 18:34
• @BDN Looking at the tag you can say its the floor function. – samjoe Oct 1 '17 at 18:37
• I think this can only be solved in general if there is a development law for any one p-adic representation of $\sqrt{2}$, so that one has a function which returns the correct number to every digit behind the comma. – user90369 Oct 6 '17 at 9:28
• The whole premise is questionable. One does not "find" the domain of a function. It is already known, otherwise one wouldn't have a function. A function by definition consists of two sets X,Y and a relation between elements of X and elements of Y that defines the mapping rule of this function. In other words: You cannot have a function if you only have one of the three components. – Johannes Hahn Oct 8 '17 at 18:05
• @JohannesHahn Right, but we could ask for the natural domain of this expression, and the resulting range. – zhw. Oct 8 '17 at 19:39

So, with the standard notation for the floor function, we are to study $$\bbox[lightyellow] { y = \sqrt {\sqrt 2 \left\lfloor x \right\rfloor - \left\lfloor {\sqrt 2 x} \right\rfloor } } \tag {1}$$

Let's first introduce some additional notation concerning the fractional part $\{x\}$ $$x = \left\lfloor x \right\rfloor + \left\{ x \right\}\quad 0 \le \left\{ x \right\} < 1$$ and the Iverson bracket $$\left[ P \right] = \left\{ {\begin{array}{*{20}c} 1 & {P = TRUE} \\ 0 & {P = FALSE} \\ \end{array} } \right.$$

Then the radicand can be written as \bbox[lightyellow] { \eqalign{ & r = \sqrt 2 \left\lfloor x \right\rfloor - \left\lfloor {\sqrt 2 x} \right\rfloor = \cr & = \sqrt 2 \left( {x - \left\{ x \right\}} \right) - \left( {\sqrt 2 x - \left\{ {\sqrt 2 x} \right\}} \right) = \cr & = \left\{ {\sqrt 2 x} \right\} - \sqrt 2 \left\{ x \right\} \cr} } \tag {2}

and, since the fractional part ranges within $[0,1)$, the radicand is bound to $$\bbox[lightyellow] { - \,\sqrt 2 < r = \left\{ {\sqrt 2 x} \right\} - \sqrt 2 \left\{ x \right\} < 1 } \tag {3}$$

If the function is defined in the real field, then its Domain of definition will be given by the values of $x$ such that $$\bbox[lightyellow] { x:\;\;0 \le \left\{ {\sqrt 2 x} \right\} - \sqrt 2 \left\{ x \right\}\quad \Leftrightarrow \quad \sqrt 2 \left\{ x \right\} \le \left\{ {\sqrt 2 x} \right\} } \tag {4}$$

It can be easily seen that the fractional part of a sum can be written as \bbox[lightyellow] { \eqalign{ & \left\{ {z + y} \right\} = \left\{ {\left\{ z \right\} + \left\{ y \right\}} \right\} = \cr & = \left\{ z \right\} + \left\{ y \right\} - \left\lfloor {\left\{ z \right\} + \left\{ y \right\}} \right\rfloor = \cr & = \left\{ z \right\} + \left\{ y \right\} - \left[ {1 \le \left\{ z \right\} + \left\{ y \right\}} \right] \cr} } \tag {5} so that the RHS of the inequality (4) above becomes \bbox[lightyellow] { \eqalign{ & \left\{ {\sqrt 2 x} \right\} = \left\{ {\sqrt 2 \left\lfloor x \right\rfloor + \sqrt 2 \left\{ x \right\}} \right\} = \cr & = \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\} - \left[ {1 \le \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\}} \right] \cr} } \tag {6} and the inequality transforms into \bbox[lightyellow] { \eqalign{ & \sqrt 2 \left\{ x \right\}\; \le \;\left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\} - \left[ {1 \le \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\}} \right] \cr & \quad \Downarrow \cr & \left\lfloor {\sqrt 2 \left\{ x \right\}} \right\rfloor + \left\{ {\sqrt 2 \left\{ x \right\}} \right\}\; \le \;\left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\} - \left[ {1 \le \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\}} \right] \cr & \quad \Downarrow \cr & 0 \le \left\lfloor {\sqrt 2 \left\{ x \right\}} \right\rfloor + \left[ {1 \le \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\}} \right]\; \le \;\left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} < 1 \cr} } \tag {7}

Now, the Poisson bracket cannot be one (because of the <1), so it shall be null, i.e. its inequality false.
Also, the floor before it (which is either $0$ or $1$) cannot be but $0$.

Thus we can conclude that the Domain of definition (y real) is given by $$\bbox[lightyellow] { \left\{ \matrix{ \left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \left\{ {\sqrt 2 \left\{ x \right\}} \right\} < 1 \hfill \cr \left\lfloor {\sqrt 2 \left\{ x \right\}} \right\rfloor = 0 \hfill \cr} \right.\quad \Rightarrow \quad \left\{ \matrix{ \left( {0 \le } \right)\left\{ x \right\} < 1/\sqrt 2 \hfill \cr \left( {0 \le } \right)\left\{ {\sqrt 2 \left\lfloor x \right\rfloor } \right\} + \sqrt 2 \left\{ x \right\} < 1 \hfill \cr} \right. } \tag {7.a}$$ and the Codomain is $$\bbox[lightyellow] { 0 \le y < 1 } \tag {7.b}$$

Because of the irrationality of $\sqrt{2}$ inequality (7.a) does not add much to the original (4), and cannot be further simplified.

At first I tried some manipulation but could not complete it. If we take $x=n+\sqrt{p}$ where $0 \leq p<1$ we obtain $$\sqrt{2}n-[\sqrt{2}n+\sqrt{2p}]$$ we can deduce that $p<0.5$.

Now if we take $x=n+p$ and $\sqrt{2}=1+p_1$ (where $p_1$ is about $0.41$, also this can be considered for $\sqrt{y}[x]-[\sqrt{y}x]$ with $y=m+q$ where $0\leq q<1$) we have $$(1+p_1)\times[n+p]\geq [(1+p1)\times(n+p)]$$ $$n+np_1\geq[n+np_1+p+pp_1]$$ $$np_1\geq[np_1+p(1+p_1)] \quad or \quad [p_1(n+p)+p]$$ from inequalities above $$[np_1+p(1+p_1)]=[np_1]$$ if we take $[np_1]=m$ and $r=np_1-m$ we can obtain $$p(1+p_1)<1-r=1-np_1+[np_1]$$ So that $$p<\frac{1-np_1+[np_1]}{1+p_1}$$ For example for $n=1$ we have: $$0\leq p<\sqrt{2}-1$$

For $n=2$, $0\leq p<\frac{3-2\sqrt{2}}{\sqrt{2}}$ which is about $0.1213$. The domain is: $$\bigcup {[n,n+p]},\quad p<\frac{1-np_1+[np_1]}{1+p_1}$$

I tried both with MATLAB and it is true. The domain depends on the number $n$ and also the decimals of $\sqrt{2}$, $p_1$ which are known. This can be generalized to domain of $\sqrt{\sqrt{y}[x]-[\sqrt{y}x]}$.