Multi-Seed Empirical Validation of State Write-Back and Bit-Selection Strategies in a Xorshift-Inspired Python Randomizer for Clinical Trials

Authors
  • Budi Santoso

    Department of Informatics, Faculty of Science and Mathematics, Universitas Diponegoro, Semarang 50275, Indonesia
    Author
  • I Ketut Gede Darma Putra

    Department of Information Technology, Faculty of Engineering, Universitas Udayana, Jimbaran, Badung, Bali 80361, Indonesia
    Author
  • Achmad Basuki

    Department of Informatics Engineering, Faculty of Computer Science, Universitas Brawijaya, Malang, East Java 65145, Indonesia
    Author
Abstract

Simple binary randomization algorithms deployed in clinical research must guarantee strict arm balance, statistical independence, and evidentiary auditability without introducing cryptographic overhead or operational obscurity. While canonical linear feedback shift registers and scrambled xorshift generators possess well-characterized algebraic periods, lightweight bespoke implementations frequently modify internal state transition cascades and bit-selection rules to facilitate bedside inspection. In an open-source clinical allocation prototype, an uncompiled 107-line Python randomizer was introduced relying on a recursive multiplicative write-back step within a xorshift pipeline and assigning treatment arms via least-significant-bit parity; however, multi-seed empirical validation across large sample spaces remained a critical evidentiary gap. In this investigation, we execute an exhaustive multi-seed empirical validation benchmarking this Python-native RawXORShiftPRNG against canonical xorshift64* across 1,000 independent sessions of 10,000 binary draws (totaling 10,000,000 allocations per generator architecture). We evaluate four factorial configurations crossing state write-back (recursive multiplicative update versus canonical linear shift update) with bit-selection tap (least significant bit versus most significant bit). Across 10 million allocations, the baseline RawXORShiftPRNG yielded an empirical Arm 1 allocation proportion of 0.500288 (95% empirical percentile interval: [0.4905, 0.5097]), with two-proportion inferential testing demonstrating that the observed departure from theoretical 1:1 balance is statistically indistinguishable from stochastic expectation (z = 1.818, p = 0.069, Cohen’s h = 0.000575, achieving post-hoc power of 0.444). Conversely, canonical xorshift64* paired with LSB extraction demonstrated a subtle but statistically detectable linear artifact (z = −2.782, p = 0.0054, Cohen’s h = −0.000880, power = 0.794), confirming theoretical assertions regarding low-order bit defects in shift-register algorithms. Serial independence testing via Wald-Wolfowitz runs distributions demonstrated an empirical false rejection rate of 4.9% at α = 0.05, with lag-1 through lag-50 autocorrelations residing strictly within ±1.96/ √ N Bartlett envelopes. State space trajectory audits confirmed that the recursive multiplication step does not induce short-period limit cycles or fixed-point attractors across small, power-of-two, or timestamp-derived seed spaces. These findings demonstrate that while canonical most-significant-bit extraction provides optimal theoretical period guarantees, the lightweight state write-back architecture provides robust empirical randomness and arm balance across practical clinical trial horizons

Cover Image
Downloads
Published
2026-07-04
Section
Articles