🦚
Collatz Prefixes
  • Collatz Prefixes
  • Theory
    • Introduction
    • Trajectory & Sequence
    • Exponential Canonical Form
    • Inverse Canonical Form
    • Recursive Index-Parity Tree
    • Path-Indexed Prefix Tree
      • Finding Nature
      • Parent & Child
    • Operation Table
      • Navigating
      • Testing an ECF
      • Shrinking Numbers
    • Iterative Method
Powered by GitBook
On this page
  1. Theory

Path-Indexed Prefix Tree

Classifying numbers with respect to their path

PreviousRecursive Index-Parity TreeNextFinding Nature

Last updated 2 years ago

CtrlK
  • Numbers
  • Prefixes

We will now consider yet another binary tree, called Path-Indexed Prefix Tree (PIPTree).

PIPTree(4) top: prefix, mid: number, bottom: path (index)

A PIPTree for a natural number kkk is defined as follows:

  • Nodes are indexed, with the root index as 1.

  • For a node with index iii, the left child has index 2i2i2i and right child has index 2i+12i + 12i+1.

  • Each node represents the following:

    • A path ppp that is the binary representation of node index iii. The length of path is kkk.

    • A number nnn at path ppp, that is n=P−1(p)n = P^{-1}(p)n=P−1(p).

    • A prefix defined by the ECFs of sequences of and the next number at that path, calculated as .

In a PIPTree for paths of length kkk, there will be 2k−12^k-12k−1 nodes.

Notice that path with all zeros is not considered here, which would be a problem as we have previously mentioned powers of two have path of all zeros. Instead, we append 1 to their path, assigning them to the root.

Numbers

Due to path indexing and the nature of P−1(p)P^{-1}(p)P−1(p), we get the following property: for a node with number nnn:

  • the left child has number n/2+rn/2+rn/2+r where the root number is rrr

  • right child has number n/2n/2n/2

It is quite a neat property that this way, you will obtain all numbers from 111 to 2k−12^{k}-12k−1. Furthermore, the leaf nodes will all be odd numbers, and the rightmost branch of the tree will all be powers of two.

Prefixes

When we examine the prefix of each node, we notice a pattern. Consider a node with prefix {p0,p1,…,pm}\{p_0, p_1, \ldots, p_m\}{p0​,p1​,…,pm​}, and root prefix {pr}\{p_r\}{pr​}. There are two observed cases:

🟢 The good case:

  • Left child has prefix {p0−1,p1−1,…,pm−1,pr}\{p_0-1, p_1-1, \ldots, p_m-1, p_r\}{p0​−1,p1​−1,…,pm​−1,pr​}

  • Right child has prefix {p0−1,p1−1,…,pm−1}\{p_0-1, p_1-1, \ldots, p_m-1\}{p0​−1,p1​−1,…,pm​−1}

🔴 The bad case:

  • Left child has prefix {p0−1,p1−1,…,pm−1}\{p_0-1, p_1-1, \ldots, p_m-1\}{p0​−1,p1​−1,…,pm​−1}

  • Right child has prefix {p0−1,p1−1,…,pm−1,pr}\{p_0-1, p_1-1, \ldots, p_m-1, p_r\}{p0​−1,p1​−1,…,pm​−1,pr​}

We will refer to this property as the nature of a node, i.e. a node can have good nature or bad nature. The good case is named so because the bijective map of prefix behaves exactly the same as the number does. It is the opposite for the bad case.

As you might guess, this is the source of colors we can see in our tree example. It is really hard to come up with any pattern regarding the nature of a node; nothing seemed evident to the author nevertheless.

Computationally, one can calculate the children and check the prefix to find the nature, but that is not satisfactory. We would like to find the nature of any node, just by looking at that node! There is a way to do so. 🎉

ρ\rhoρ
nnn
P−1(p)+2∣p∣P^{-1}(p) + 2^{|p|}P−1(p)+2∣p∣
Finding Nature