Papers
Topics
Authors
Recent
Search
2000 character limit reached

FracBits Algorithm Overview

Updated 17 May 2026
  • FracBits algorithm is a computational method defined by a real-valued Collatz-type iteration that generalizes classical integer dynamics to reveal unique cyclic behavior.
  • It incorporates an entropy-efficient coin-flip protocol that simulates fair n-sided die rolls while achieving minimal per-roll entropy loss.
  • The method demonstrates practical efficiency with O(1) iteration time and applications ranging from rigorous mathematical proofs to optimized FPGA implementations.

The FracBits algorithm refers to several technically distinct but nomenclaturally related approaches in computational mathematics and computer science. Most notably, "FracBits" has been used as (1) the name for a real-valued Collatz-type iterative dynamical system, (2) a practical entropy-efficient code for simulating fair die rolls with minimal entropy wastage, and (3) an FPGA-oriented binary neural network (FracBNN) design employing fractional activations. This entry provides an in-depth exposition of the first two algorithmic families—the fractional $3n+1$ iteration and the entropy-efficient coin-flip–based die simulation—explicitly following their published definitions, properties, and computational behavior.

1. Fractional Collatz-Type Iteration: Mathematical Definition and Motivation

The "FracBits" algorithm, as introduced in the context of the fractional $3n+1$ conjecture, generalizes the celebrated integer Collatz sequence to real numbers via a real-valued dynamical system defined by the map Δ:RR\Delta : \mathbb{R} \to \mathbb{R} (Brier et al., 2020). For xRx \in \mathbb{R},

frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor

where x\lfloor x \rfloor denotes the greatest integer less than or equal to xx. The iteration rule is

Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}

with strict branching at $1/2$ in the first clause (fractional part <1/2<1/2) and inclusive in the second ($3n+1$0). For any initial value $3n+1$1, the sequence is given recursively by $3n+1$2.

This extension is reminiscent of the integer Collatz iteration but exhibits fundamentally different—or at least richer—cycle structures due to real-valued branching.

2. Dynamical Behavior and Main Conjecture

The main conjecture (Conjecture 2.2 in (Brier et al., 2020)) concerning the real-valued $3n+1$3-orbit is that for every real seed $3n+1$4,

  • Either the trajectory $3n+1$5 converges monotonically to $3n+1$6 (i.e., after finitely many steps $3n+1$7),
  • Or the orbit is eventually periodic, falling into a unique 29-cycle of real numbers, with integer parts of the repeating sequence given (listed here as a periodic sequence of length 29):

$3n+1$8

This behavior is fully proven for $3n+1$9 via a contraction argument and a constructive interval-coverage procedure (see Section 4).

3. Implementation: Explicit Iteration and Pseudocode

Given the branching rule of Δ:RR\Delta : \mathbb{R} \to \mathbb{R}0, the FracBits iteration is readily implementable with only basic arithmetic operations and a conditional:

Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}7

This stepwise construction ensures exact reproducibility of orbits for any seed.

4. Cycle Analysis, Fixed Points, and Proof Structure

The proof of the main conjecture on Δ:RR\Delta : \mathbb{R} \to \mathbb{R}1 proceeds by the following stages (Brier et al., 2020):

  1. Kernel Interval and Contractivity: Define Δ:RR\Delta : \mathbb{R} \to \mathbb{R}2. The map Δ:RR\Delta : \mathbb{R} \to \mathbb{R}3 acts as a strict contraction on Δ:RR\Delta : \mathbb{R} \to \mathbb{R}4, with unique fixed point Δ:RR\Delta : \mathbb{R} \to \mathbb{R}5 such that Δ:RR\Delta : \mathbb{R} \to \mathbb{R}6.
  2. Backwards-Reachability: By iterative branching, construct a sequence of intervals Δ:RR\Delta : \mathbb{R} \to \mathbb{R}7 with the property that any Δ:RR\Delta : \mathbb{R} \to \mathbb{R}8 reaches Δ:RR\Delta : \mathbb{R} \to \mathbb{R}9 in finitely many xRx \in \mathbb{R}0-steps, and thus is attracted into the 29-cycle.
  3. Interval Covering: Computer-assisted expansion shows that all xRx \in \mathbb{R}1 eventually enter xRx \in \mathbb{R}2. For xRx \in \mathbb{R}3, repeated iterations (bounded by 6) move the orbit into xRx \in \mathbb{R}4.
  4. Extension: Automated interval extension (e.g., via Mathematica) confirms that xRx \in \mathbb{R}5 exceeds 100 after 3626 iterations, establishing the conjecture for all real xRx \in \mathbb{R}6.

Beyond this, the proof requires only computational resources to extend coverage further. Importantly, no new theoretical issues arise with higher xRx \in \mathbb{R}7, though plateau regions in coverage growth suggest computational bottlenecks.

5. Entropy-Efficient Coin-Flipping for Fair Random Rolls

Independently, the “FracBits algorithm” as named by Ömer & Pacher refers to a distinct entropy-recycling protocol for simulating fair xRx \in \mathbb{R}8-sided die rolls using unbiased coin flips, achieving minimal per-roll entropy loss (Ömer et al., 2014). The state is parametrized by xRx \in \mathbb{R}9:

  • frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor0: current pool size (think frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor1 "faces"),
  • frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor2: uniformly random current value.

To roll a fair frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor3-sided die, the procedure:

  • Carves out frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor4 disjoint blocks of frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor5 faces each (with frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor6 faces left unused),
  • Accepts frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor7 (majority of the pool): emits frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor8, sets frac(x)=xx\mathrm{frac}(x) = x - \lfloor x \rfloor9,
  • If x\lfloor x \rfloor0: sets x\lfloor x \rfloor1 ("reject"), and repeats,
  • When x\lfloor x \rfloor2, refills by shifting in x\lfloor x \rfloor3 unbiased bits (e.g., x\lfloor x \rfloor4, x\lfloor x \rfloor5).

No entropy is lost except for the decision bit "accept/reject" at x\lfloor x \rfloor6. Over many trials, total entropy loss per roll is strictly x\lfloor x \rfloor7, where x\lfloor x \rfloor8 and x\lfloor x \rfloor9 denotes binary entropy. This approaches zero for large xx0, achieving nearly the theoretical minimum xx1 coin flips per roll.

6. Algorithmic Properties and Practical Considerations

  • Time Complexity: Each iteration is xx2; the number of iterations per roll is geometrically distributed with mean xx3.
  • Space Complexity: xx4 to store the state; in practice, xx5 is chosen as a machine word (e.g., 64 bits).
  • Entropy Efficiency: As xx6, xx7, waste xx8. For practical values (e.g., xx9 for Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}0, Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}1), entropy waste per roll is empirically Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}2 bits, far below alternatives.
  • Assumptions: Input bits are unbiased and independent; any bias directly propagates.
  • Extensions: Vectorized draws (multiple dice from one pool), adaptive refill block sizes, and dynamic reservoir thresholds are straightforward.

Empirically, this method delivers per-roll entropy costs asymptotically indistinguishable from the theoretical minimum, with all but the acceptance test information content recycled (Ömer et al., 2014).

Although the identifier "FracBits" appears in further literature describing neural architectures with fractional activations ("FracBNN") (Zhang et al., 2020), the dynamical-iteration and entropy-coding usages are logically and technically unrelated. The fractional Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}3 system is a mathematical generalization of integer recurrence, while the entropy-efficient FracBits scheme is an optimal coding protocol for fair, unbiased random number drawing with minimal entropy loss and maximal reuse.

Both algorithms are characterized by provable extremal properties: the Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}4 real-valued system features a unique global attractor/cycle under empirically exhausted regions, and the FracBits entropy-coder achieves strictly minimal entropy waste per die roll. However, they unfold in disparate theoretical contexts and should not be conflated beyond the superficial name overlap.


References:

  • Fractional Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}5 iteration and conjecture: "A Fractional Δ(x)={x2if frac(x)<12 3x+12if frac(x)12\Delta(x) = \begin{cases} \dfrac{x}{2} & \mathrm{if}\ \mathrm{frac}(x) < \dfrac{1}{2} \ \dfrac{3x + 1}{2} & \mathrm{if}\ \mathrm{frac}(x) \geq \dfrac{1}{2} \end{cases}6 Conjecture" (Brier et al., 2020)
  • Entropy-efficient die simulation: "Saving fractional bits: A practical entropy efficient code for fair die rolls" (Ömer et al., 2014)
  • FPGA-efficient binary neural networks with fractional activation: "FracBNN: Accurate and FPGA-Efficient Binary Neural Networks with Fractional Activations" (Zhang et al., 2020)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to FracBits Algorithm.