327 Grounded Mapping of the Three‑Layer Number‑Theoretic Structure in Computing and Engineering

Bosley Zhang
Join to follow...
Follow/Unfollow Writer: Bosley Zhang
By following, you’ll receive notifications when this author publishes new articles.
Don't wait! Sign up to follow this writer.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.
43   0  
·
2026/05/24
·
6 mins read


 

Application Chapter

—— Grounded Mapping of the Three‑Layer Number‑Theoretic Structure in Computing and Engineering


Author: Zhang Suhang (Luoyang, Henan)


---


Abstract

Based on the three‑layer structure of “prime primitive – regular composites – disordered hybrid composites” and its isomorphism with fractal iteration established in the first three chapters of this volume, this paper presents three actionable application directions: pseudo‑random number generation, adaptive image texture compression, and qualitative code complexity assessment. For each direction, we explain the underlying principle, provide algorithmic ideas or workflows, and discuss practical value. No empty analogies are offered; all schemes can be prototyped and validated within one week to one month.


---


1. Pseudo‑random Number Generation: From Number‑Theoretic Stratification to Controllable Random Sequences


1.1 Underlying Principle


· Regular composites (e.g., sequences of 2^a3^b) exhibit deterministic recurrence on the integer axis, but their adjacent ratios fluctuate, appearing “random‑like” while being fully reproducible.

· Disordered hybrid composites (e.g., products of randomly chosen distinct primes) possess higher combinatorial entropy, suitable for high‑security scenarios.

· By adjusting parameters (size of the fixed prime set, exponent range, whether new primes are allowed), one can continuously tune between deterministic reproducibility and high‑entropy unpredictability.


1.2 Algorithm Pseudocode


```  

Input: seed S (to initialize prime list), mode (ordered/mixed/disordered), length L  

Output: random integer sequence R[1..L]  


Initialization:  

  Prime list P = first 20 primes [2,3,5,7,11,13,17,19,23,29,...]  

  if mode == ordered:  

    fixed prime set P0 = [2,3] // adjustable  

    generation: for i=1..L, output all power combinations of P0 in lexicographic or increasing order (deduplicate and sort)  

    return first L items (can also generate quickly via recurrence)  


  if mode == mixed:  

    fixed prime set P0 = [2,3,5]  

    each generation: randomly choose a,b,c ∈ [0..5] (exponent upper bound adjustable), compute N = 2^a * 3^b * 5^c  

    if N is duplicate, regenerate until L distinct values are obtained  


  if mode == disordered:  

    each generation: randomly select k (k∈[2..6]) distinct primes from P, for each prime randomly choose exponent ∈[1..3]  

    compute N = product  

    deduplicate and generate L values  


Output R  

```


1.3 Practical Uses


· Game drops / shuffling: “ordered” mode gives reproducible pseudo‑random sequences (convenient for debugging).

· Simulation: “mixed” mode balances randomness and stability.

· Key derivation: “disordered” mode produces high‑entropy seeds; combined with hash functions it can serve as a secure random number generator.

· Compared to traditional linear congruential generators, this method yields richer sequence structure and more interpretable parameters (prime set → structural complexity).


---


2. Image Texture Classification and Adaptive Compression


2.1 Underlying Principle


· Regular texture regions in images (sky, walls, regular patterns) are analogous to “regular composites”: local repetition, concentrated spectral energy → suitable for high compression ratios.

· Chaotic detail regions (grass, leaves, random noise) resemble “disordered hybrid composites”: high information entropy, no simple local recurrence → require preservation of fidelity.

· This paper does not map pixel values to composites; instead, it borrows the layered thinking to design a classifier: automatically grade compression levels based on the “structural regularity” of image blocks.


2.2 Algorithm Flow


```  

Input: original image I, block size B×B (e.g., 16×16)  

Output: compressed image file (including compression level for each block)  


For each block:  

  1. Compute a regularity metric (choose one):  

     - DCT coefficient energy concentration (proportion of first few coefficients)  

     - Kurtosis of local variance or gradient histogram  

     - Self‑similarity (matching error after translation)  

  2. Classify into three levels based on the metric:  

     - High regularity (like regular composites) → highest compression level (e.g., JPEG quality 30%)  

     - Medium regularity → medium compression level (quality 60%)  

     - Low regularity / disordered (like disordered composites) → lowest compression level (quality 90% or lossless)  

  3. Encode the block at its respective compression level and store the level index.  


During decoding, select the corresponding decoder using the stored index.  

```


2.3 Practical Uses


· Remote sensing / surveillance video: large areas of sky or roads can be heavily compressed while detailed areas are preserved, reducing overall volume by 30–50%.

· Medical imaging: regions of interest (lesions) use low compression, background uses high compression, saving storage.

· Real‑time transmission: dynamically adjust compression levels per block according to channel bandwidth, giving priority to important details.


2.4 Difference from Traditional Methods


Traditional JPEG applies a uniform quantization table to all blocks. Our method first classifies then applies differentiated compression, theoretically grounded in the number‑theoretic “ordered → disordered” stratification. This idea is also applicable to fractal image compression (existing research), but our layered approach provides a clearer mathematical justification.


---


3. Code Complexity Pre‑assessment: A “Number‑Theoretic Lens” in Static Analysis


3.1 Underlying Principle


The control flow structure of a program can be analogized to composite structures:


· Single‑prime power structure: simple nested loops (e.g., for i in range(n): for j in range(m):) → regular, complexity exactly calculable.

· Regular composite structure: a few fixed branching patterns (e.g., if‑else with simple conditions) → moderately regular, easy test coverage.

· Disordered composite structure: many random conditions, dynamic jumps, uncertain recursion depth → “chaotic”, prone to hidden bugs and performance glitches.


3.2 Tool Design Idea


Develop a static analysis plugin (e.g., a linter for Python or JavaScript) that scans functions/methods and outputs a “structural regularity score” (1–3).


Example decision rules:


· If the function body contains only sequential statements and fixed‑iteration loops → level 1 (regular).

· If it contains a few conditional branches (≤3) and nesting depth ≤2 → level 2 (semi‑regular).

· If it contains conditionals dependent on random numbers, recursive calls, dynamic type branching → level 3 (disordered hybrid).


The output can alert developers:


· Level 1 functions: safe to optimize, suitable for inlining.

· Level 2 functions: need normal unit testing.

· Level 3 functions: suggest refactoring or adding defensive tests.


3.3 Practical Uses

· Code review: quickly filter modules “likely to have problems”.
· Test prioritization: allocate more testing resources to level‑3 functions.
· Teaching examples: show students that “good code structure should be like regular composites, not disordered hybrids”.

3.4 Relationship with Existing Tools

Existing complexity tools (e.g., cyclomatic complexity) calculate the number of linearly independent paths – a numerical quantity. Our method provides a qualitative classification of structural type; the two are complementary. Our method is closer to “code comprehensibility” and “test‑friendliness”.

---

4. Application Priority and Implementation Roadmap

Application Prototype Difficulty Expected Deliverable Recommended Order
Pseudo‑RNG Low (2‑3 days) Python library + NIST test report 1
Image texture classification & compression Medium (1‑2 weeks) Algorithm prototype + comparison images 2
Code complexity pre‑assessment Medium (1‑2 weeks) Linter plugin or script 3

It is recommended to first implement the pseudo‑random number generator, write a short article (including algorithm and test results), and host it on GitHub as the first verifiable application outcome of this theory.

---

5. Conclusion and Outlook

This paper extracts three actionable directions from the three‑layer number‑theoretic structure, providing specific principles and algorithmic outlines for each, avoiding vague analogies. These three applications correspond respectively to:

· Generation problems (pseudo‑random numbers)
· Perception problems (image compression)
· Structural analysis problems (code complexity)

Together they validate a core idea: the structural order inherent in number theory can be directly mapped to control parameters in computer algorithms, yielding meaningful engineering outputs. Future work can proceed in two directions: (1) performance comparison of the pseudo‑RNG against existing libraries (e.g., Python’s random), and (2) implementing the image compression scheme as a usable image preprocessing tool.

This volume of Scientific Meditations completes a full cycle from theoretical axiomatization to engineering algorithms, closing the loop from mathematical axioms to practical implementations.

---

References (illustrative)

[1] Zhang, S. (2026). Number Theory–Fractal Analogy Series: Axioms and Mathematical Formulas.
[2] NIST Special Publication 800‑22: A Statistical Test Suite for Random Number Generators.
[3] Classic fractal image compression literature: Barnsley, M. F. (1988). Fractal Image Compression.

---

(End of Application Chapter)

 


WriterShelf™ is a unique multiple pen name blogging and forum platform. Protect relationships and your privacy. Take your writing in new directions. ** Join WriterShelf**
WriterShelf™ is an open writing platform. The views, information and opinions in this article are those of the author.


Article info

This article is part of:
分類於:
合計:1277字


Share this article:
About the Author

I love science as much as art, logic as deeply as emotion.

I write the softest human stories beneath the hardest sci-fi.

May words bridge us to kindred spirits across the world.




Join the discussion now!
Don't wait! Sign up to join the discussion.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.