2

The context, from Enumerating the Rationals:

My favourite enumeration of the (non-negative) rationals was discovered by Moshe Newman, and is a simple recurrence relation. More specifically, it is a very basic function f such that the sequence {0, f(0), f(f(0)), f(f(f(0))), …} contains each non-negative rational precisely once.

$f(x) = \dfrac{1}{2 \lfloor x \rfloor - x + 1}$

If you’re not amazed by this, you should be. It generates the sequence {0/1, 1/1, 1/2, 2/1, 1/3, 3/2, 2/3, 3/1, 1/4, 4/3, 3/5, 5/2, 2/5, 5/3, …}, which can be proved to hit every non-negative rational exactly once...

How does this work? I am not familiar with the use of the left and right floor symbols and can't find an explanation online.


EDIT

Alternatively we could recursively define the sequence of rational numbers $q: \mathbb{N}\to \mathbb{Q}$ such that:

$q(0) = 0/1$

$\forall x \in \mathbb{N}:[q(x+1) = \dfrac{1}{2 \lfloor q(x) \rfloor - q(x) + 1}]$

Then we would have:

$q(0) = 0/1$

$q(1) = 1/1$

$q(2) = 1/2$

$q(3) = 2/1$

$q(4) = 1/3$

$\vdots$

  • 1
    The operation $\lfloor x\rfloor$ is the greatest integer function, which returns the largest integer less than or equal to $x$. – Plutoro Oct 19 '15 at 15:09
  • 1
    So starting from the initial 0, f(0)= 1/(0- 0+ 1)= 1, f(1)= 1/(2- 1+ 1)= 1/2, f(12)= 1/(0- 1/2+ 1)= 1/(1/2)= 2, f(2)= 1/(4- 2+ 1)= 1/3, f(1/3)= 1/(0- 1/3+ 1)= 1/(2/3)= 3/2, f(3/2)= 1/(2- 3/2+ 1)= 1/(3/2)= 2/3, etc. – user247327 Oct 19 '15 at 15:26

1 Answers1

3

The notation $\lfloor x \rfloor$ (known as ‘the floor function’) denotes the largest integer less than or equal to $x \in \mathbb{R}$. Examples include $\lfloor7\rfloor$ = $7$, $\lfloor2.5\rfloor$ = $2$, $\lfloor\pi\rfloor$= $3$ and $\lfloor−2.5\rfloor$ = $-3$.

I'll mention this anyway even though it isn't part of your question. There is another similar function that is the 'counterpart' to the floor function:

The notation $\lceil x \rceil$ (known as ‘the ceiling function’) denotes the smallest integer greater than or equal to $x \in \mathbb{R}$. So using the same examples as before $\lceil7$⌉ = $7$, $\lceil2.5\rceil$ = $3$, $\lceil\pi\rceil$= $4$ and $\lceil−2.5\rceil$ = $-2$.

BLAZE
  • 8,458