<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged maths</title>
<link>https://coderlegion.com/tag/maths</link>
<description>Powered by Question2Answer</description>
<item>
<title>The Alphabet Code: What Happens When You Run a Simple Rule on the Letter “a”</title>
<link>https://coderlegion.com/31120/the-alphabet-code-what-happens-when-you-run-a-simple-rule-on-the-letter-a</link>
<description>&lt;h2 id=&quot;alphabets-nlp-mathematics-symbolicdynamics-fractals-eigenvalues-perronvalues&quot;&gt;alphabets #nlp #mathematics #symbolicdynamics #fractals #eigenvalues #perronvalues&lt;/h2&gt;
&lt;p&gt;Here is a string of letters:&lt;br&gt;
gzhlvzggjzyihjgheqvzgzhlvzhlvbjzgyhzizygjzbjzhlvgjzehjdzzgheqv...&lt;/p&gt;
&lt;p&gt;It looks like a cat walked across a keyboard. It isn’t. It’s the start of a sequence that runs to thousands of characters, and every letter is fixed in advance by one rule applied to the letter “a.” No randomness, no guessing, no training data. Run the same rule again tomorrow, or on another computer, and you get exactly the same string.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg6bazcqahejc5r708kmy.png&quot; alt=&quot;&quot;&gt;&lt;br&gt;
 Figure 1. The sequence for the letter “a” drawn as a path: each letter tells a virtual pen how to turn and move, so a fixed rule produces this shape.&lt;/p&gt;
&lt;p&gt;That simple question, &quot;what happens when one fixed rule is applied to “a” again and again?&quot; led me into years of studying sequences like this one. I want to show you what I’ve found, what I still haven’t figured out, and why I think a curious person might care.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The idea in one minute&lt;/strong&gt;&lt;br&gt;
Start with the letter “a” and apply the same fixed rule to it repeatedly. Each round replaces the existing letters with new strings of letters, so the sequence grows. At the same time, the earlier rounds remain embedded within the later ones.&lt;br&gt;
The first seven rounds have 1, 4, 14, 43,138, 429, and 1361 letters. Mathematicians call this a substitution system.&lt;/p&gt;
&lt;p&gt;The unusual feature of the Engineering of Alphabets project is that the rule is applied to the alphabet itself. When I say &quot;alphabet&quot; here, I mean the 26 English letters together with their spoken names. A different language, or a different naming convention, would give a different sequence. I wanted to see whether the letters we use for writing, treated as a mathematical system, produce structures that are interesting, unexpected, or perhaps useful.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How I did it.&lt;/strong&gt; I wrote a short computer program that applies the rule and records the output. For the results below, I generated several thousand letters, enough to count blocks up to length 30 and to estimate the growth factor. I used the same program to compute the growth factor for each of the 26 starting letters. The degree-13 equation came from fitting the term lengths to a linear recurrence, then factoring the resulting polynomial. A colleague or reader can rerun the program on the public data; the exact rule itself is withheld for now.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I found&lt;/strong&gt;&lt;br&gt;
Three observations stand out. I’ll be careful to say how solid each one is.&lt;br&gt;
• The sequence never settles into a loop, but it isn’t chaotic either. Imagine a text that never repeats itself, but in which the number of distinct short phrases grows slowly instead of exploding. In the range I’ve checked, that count grows roughly in a straight line. This is a measured result over a finite range, not a proof that it continues forever.&lt;br&gt;
• The strings grow by a number very close to π. Each round, the sequence gets longer by a factor that converges to about 3.14159322. That is within a few millionths of π (3.14159265…). It cannot actually equal π, because it is the root of a degree-13 equation with whole number coefficients and π is known not to be algebraic. So this may be a coincidence, or a hint of something deeper. I don’t know yet, and I’d be wary of anyone who claimed to.&lt;br&gt;
• It’s a family, not a one-off. Letter “a” is one of 26 starting letters in the project. For 13 of them, the growth factor obeys the same degree-13 equation. Whether that grouping reflects something deep about the alphabet, or just the way the rule was set up, is still open.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl634gv0xypvckd3p2s8z.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; Figure 2. Distinct blocks p(k) by block length up to 30, shown on a logarithmic vertical axis. Dashed orange is a linear reference; dashed blue is the Sturmian minimum (k+1).&lt;/p&gt;
&lt;p&gt;*&lt;em&gt;What I am not claiming&lt;/em&gt;&lt;br&gt;
I think this matters as much as the findings, so here it is plainly:&lt;br&gt;
• I am not claiming the growth rate is π. It isn’t.&lt;br&gt;
• I am not claiming the sequence is fully understood. Its straight-line behavior is observed, not proven.&lt;br&gt;
• I am not claiming this beats any existing tool for compression, language processing, or character recognition. No such experiment has been run. If you work in those fields, treat any connection as a question, not a result.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Open Questions&lt;/strong&gt;&lt;br&gt;
Here is my challenge to you. See whether you can answer any of these. If you crack one, or show that I've got it wrong, I want to hear about it.&lt;/p&gt;
&lt;p&gt;1- What is the equation? The growth factor is the dominant root of a degree-13 polynomial with integer coefficients. What does that polynomial mean? Is it new, or does it match something already known?&lt;/p&gt;
&lt;p&gt;2- Is there a simpler rule hiding inside? Certain short stretches keep coming back. Do those recurring pieces follow a smaller, simpler rule of their own?&lt;/p&gt;
&lt;p&gt;3- Does the straight line hold? The number of distinct blocks grows roughly in a straight line over the lengths I've checked. Does it keep going, or does it bend at longer lengths? Only deeper computation can say.&lt;/p&gt;
&lt;p&gt;4- Why 13 of 26? Thirteen starting letters: a, d, e, g, h, i, k, l, q, u, w, y, z, have the same degree-13 minimal polynomial: &lt;strong&gt;4x¹³ − 21x¹² + 45x¹¹ − 74x¹⁰ + 98x⁹ − 34x⁸ − 116x⁷ + 210x⁶ − 152x⁵ + 26x⁴ + 38x³ − 30x² + 9x − 1&lt;/strong&gt; The rest of the letters have a degree-14 polynomial, which is exactly this one multiplied by (x − 1). So all 26 share a common structure. The 13 listed above are the ones where the extra factor cancels out. Why? Does that split mean something about the alphabet, or is it an artifact of how the rule was set up?&lt;/p&gt;
&lt;p&gt;5- Why is the growth factor so close to π? The closeness is striking, but the number is algebraic and cannot be π. Is there a mathematical reason for the resemblance, or is it a coincidence?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why This Might Matter Beyond Pure Math&lt;/strong&gt;&lt;br&gt;
These are possible directions, not demonstrated applications. None has been tested yet.&lt;br&gt;
You might be thinking: this is interesting, but what does it have to do with anything? Here are the directions I think are worth exploring.&lt;br&gt;
&lt;strong&gt;Language compression&lt;/strong&gt;. If sequences generated from letter names have low-complexity structure, that structure might be exploitable for compression. Whether it actually helps would need a real benchmark.&lt;br&gt;
&lt;strong&gt;Natural language research&lt;/strong&gt;. The alphabet is the foundation of written language. If deterministic structure underlies how letters relate to each other, it could say something about the mathematics of language itself.&lt;br&gt;
&lt;strong&gt;Training-free representation&lt;/strong&gt;. The encoding is purely algebraic: no training data, no loss function, no randomness. The output is fixed and reproducible for anyone who runs it, which makes it auditable. It handled noisy input well in a separate study, but it's still unclear whether that matters for other tasks.&lt;br&gt;
&lt;strong&gt;OCR and character recognition&lt;/strong&gt;. Could truncated EOA vectors outperform the full vector on character recognition tasks? This is an open question, not a result. Standard OCR relies on trained networks and labeled data; whether a training-free encoding adds anything is untested.&lt;br&gt;
&lt;strong&gt;Low-resource languages&lt;/strong&gt;. Where no tagged text exists, you can't train a model. If an alphabet can be encoded deterministically, it might support tokenization and compression tools without training data.&lt;br&gt;
&lt;strong&gt;Speech and phonetics&lt;/strong&gt;. The encoding is phonetic. Could it connect to phoneme-level representations, or help with unseen words? That is a question, not a claim.&lt;br&gt;
&lt;strong&gt;Memory&lt;/strong&gt;. Low factor complexity suggests the number of distinct patterns stays small, which might mean lower storage needs.&lt;br&gt;
&lt;strong&gt;Research into alphabets&lt;/strong&gt;. Most alphabet research is historical or linguistic. This treats the alphabet as a formal system rather than a cultural artifact, and the early results are surprising enough to keep going.&lt;br&gt;
No compression, OCR, speech, or language-modeling experiment is reported here.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Bigger Picture&lt;/strong&gt;&lt;br&gt;
The Engineering of Alphabets is a research program that studies what happens when you apply deterministic rules to alphabets. The letter 'a' is just the beginning. The project includes 13 main sequence families, plus several related cases. Each one has its own structure, properties, and open questions.&lt;br&gt;
The alphabet can be treated as a mathematical object, not only as a tool for writing. Whether that view leads anywhere is what the open questions are for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Try to break it&lt;/strong&gt;&lt;br&gt;
Science works when people try to prove each other wrong, so here is what I’d ask of you.&lt;br&gt;
• If you’re curious: download the first 6,260 letters of the sequence and look for patterns I missed. click&lt;br&gt;
• If you’re a mathematician or computer scientist: check my numbers. Even “your count is wrong” would help me a lot. click&lt;br&gt;
• If you work with language, speech, or text: tell me where, if anywhere, you’d test something like this.&lt;/p&gt;
&lt;p&gt;The data and part of the code are public. The code that generated the sequence is not public, but the code that counted the blocks and computed the growth factor is. The exact letter-by-letter table behind the rule is shared under a short written agreement, because a first formal paper is still in preparation. That is a timing decision, not a permanent lock, and the open questions can be worked from the public data alone.&lt;/p&gt;
&lt;p&gt;You can reach me at &lt;a rel=&quot;nofollow&quot; href=&quot;https://research.neurolabs.space/&quot;&gt;Bahaa Budargham&lt;/a&gt;.&lt;br&gt;
ORCID: 0009-0005-2955-3703. &lt;a rel=&quot;nofollow&quot; href=&quot;https://zenodo.org/search?q=metadata.creators.person_or_org.name%3A%22Budargham%2C%20Bahaa%22&amp;amp;l=list&amp;amp;p=1&amp;amp;s=10&amp;amp;sort=bestmatch&quot;&gt;Zenodo&lt;/a&gt; • &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/bahaa-budargham/&quot;&gt;GitHub&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/31120/the-alphabet-code-what-happens-when-you-run-a-simple-rule-on-the-letter-a</guid>
<pubDate>Wed, 14 Oct 2026 22:57:40 +0000</pubDate>
</item>
<item>
<title>We Made a High-Formality, Fake Physics Slop Artifact - QSOT (Quantum State Over Time) Compiler</title>
<link>https://coderlegion.com/20084/we-made-a-high-formality-fake-physics-slop-artifact-qsot-quantum-state-over-time-compiler</link>
<description>&lt;h2 id=&quot;we-made-a-high-formality-fake-physics-slop-artifact&quot;&gt;We Made a High-Formality, Fake Physics Slop Artifact&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;QSOT (Quantum State Over Time) Compiler - A Post-Mortem on AI-Native Paper Implementation Gone Wrong&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&quot;The most dangerous form of scientific fraud is not the one that looks wrong. It is the one that looks right.&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-1-the-record&quot;&gt;Part 1. The Record&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=13476275054718132537&quot; alt=&quot;2&quot;&gt;&lt;/p&gt;
&lt;p&gt;On December 23, 2025, we registered a software release on Zenodo.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Title: Flamehaven-Labs/QSOT-Compiler: [1.2.3] — 2025-12-23&lt;/li&gt;
&lt;li&gt;DOI: 10.5281/zenodo.18035432&lt;/li&gt;
&lt;li&gt;Thorough and Categorized Release Notes: &lt;ul&gt;
&lt;li&gt;Categorized as [Pub], [UI], [Viz], [AI], [Exp], [Tool], [Doc], and [Valid]. Included Added&lt;/li&gt;
&lt;li&gt;Changed, Fixed — the full register of legitimate software engineering.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Two Companion Papers Written in LaTeX: &lt;ul&gt;
&lt;li&gt;Paper A - targeting Computer Physics Communications.&lt;/li&gt;
&lt;li&gt;Paper B - targeting Physical Review A.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Academic-Style Project Page: &lt;ul&gt;
&lt;li&gt;Constructed in the academic NeurIPS paper-template style&lt;/li&gt;
&lt;li&gt;Complete with structured data (@type: ScholarlyArticle), author affiliations, a BibTeX block, and a DOI badge.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We believed this was a success.&lt;/p&gt;
&lt;p&gt;Six months later, after approximately fifty governance and code experiments logged in &lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;the Flamehaven Verification Ledger&lt;/a&gt;, we looked back at QSOT Compiler v1.2.3 through the lens of what we now know.&lt;/p&gt;
&lt;p&gt;The verdict is unambiguous.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It was High-Formality Slop.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This essay is the formal post-mortem. It is not an exercise in self-punishment. It is a structural analysis of how this artifact came to exist, why it was convincing even to us, and why this failure pattern matters beyond one project.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-2-what-is-high-formality-slop-&quot;&gt;Part 2. What Is High-Formality Slop?&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=3962273320787859435&quot; alt=&quot;3&quot;&gt;&lt;/p&gt;
&lt;p&gt;The word &quot;slop&quot; in AI-generated software is often used loosely. We need a more precise definition.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Slop&lt;/strong&gt;, in the software context, means code or documentation that satisfies surface-level quality signals while failing the underlying epistemic contract it claims to fulfill.&lt;/p&gt;
&lt;p&gt;Not all slop is equally dangerous.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Level 1 - Empty Placeholder Slop:&lt;/strong&gt; Functions with &lt;code&gt;pass&lt;/code&gt; bodies and grandiose names. Easy to detect.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Level 2 - Executable-But-Hollow Slop:&lt;/strong&gt; Code that runs, passes tests, and produces output, but the output is disconnected from the claim.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Level 3 - Physically-Plausible-But-Unjustified Slop:&lt;/strong&gt; Mathematical formulas that are stable and smooth, but whose derivation rests on analogy rather than proof.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Level 4 - Mixed-Truth Slop:&lt;/strong&gt; A codebase where genuine components and hollow components are woven together so tightly that separating them requires domain expertise.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;QSOT Compiler v1.2.3 was primarily Level 2 and Level 3, with Level 4 characteristics. The axiomatic mathematics underlying QSOT - the Linearity and Conditionability axioms formalized in Lie and Fullwood's &lt;em&gt;Unique multipartite extension of quantum states over time&lt;/em&gt; - are real. The Kraus operator formalism is standard quantum information theory &lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;1&lt;/a&gt;. The Transfer Tensor Method is a real algorithm &lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2410.22630&quot;&gt;2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;These are genuine foundations.&lt;/p&gt;
&lt;p&gt;But the implementation that sat on top of those foundations was hollow in the places where the claims mattered most.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;High-Formality Slop&lt;/strong&gt; is Level 2-4 slop dressed in the formal register of scientific publication: LaTeX, DOIs, citations, test suites, release notes, GitHub artifacts, peer-review-style documents, and polished figures. The formality is not decoration. It is part of the failure, because it can make the artifact feel verified before it actually is.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-3-the-ambition-that-preceded-the-understanding&quot;&gt;Part 3. The Ambition That Preceded the Understanding&lt;/h3&gt;
&lt;p&gt;The QSOT project began with a legitimate scientific stimulus. Research associated with UNIST, later circulated as &lt;em&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2410.22630&quot;&gt;Unique multipartite extension of quantum states over time&lt;/a&gt;&lt;/em&gt;, proposed treating temporal evolution not merely as a parameterization of quantum states but as a multipartite quantum state over time.&lt;/p&gt;
&lt;p&gt;The framework introduced two axioms: Linearity in Initial State and Quantum Conditionability. From those axioms, a uniqueness theorem follows, connecting QSOT representations to Kirkwood-Dirac type quasiprobability distributions.&lt;/p&gt;
&lt;p&gt;That is the external scientific anchor of this essay. The claim that QSOT has a legitimate mathematical source refers to Lie and Fullwood's work, not to our implementation.&lt;/p&gt;
&lt;p&gt;The mathematics is non-trivial and genuinely important. It positions time within quantum mechanics as something closer to a first-class object rather than a passive external parameter, connected to temporal quantum-state formalisms [3, 4] and broader questions about causal structure [5].&lt;/p&gt;
&lt;p&gt;We encountered this paper and made a planning document. That document contained lines like:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&quot;Structure compatibility: 0.8-0.9 (axiom-based verification, Gate/Verifier structure)&quot;&lt;/p&gt;
&lt;p&gt;&quot;Execution compatibility: 0.7-0.8 (modular design, easy ASDP integration)&quot;&lt;/p&gt;
&lt;p&gt;&quot;Accessibility: not 'intuition' but mathematical uniqueness proof -&amp;gt; optimal for TOE automation pipeline&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Those numbers were invented. We did not have a calibrated instrument for measuring the distance from &quot;paper&quot; to &quot;working implementation.&quot; The numbers felt credible because they were formatted like a technical assessment.&lt;/p&gt;
&lt;p&gt;What we were really feeling was not measurement.&lt;/p&gt;
&lt;p&gt;It was discovery pressure.&lt;/p&gt;
&lt;p&gt;We were not simply trying to implement a paper. We were imagining a pipeline in which papers became code, code exposed missing links, and those missing links became the next scientific result. The TOE framing intensified this. A difficult physics paper stopped feeling like something to study slowly. It began to feel like a component waiting to be connected into a larger machine.&lt;/p&gt;
&lt;p&gt;That was the dangerous step.&lt;/p&gt;
&lt;p&gt;It was like reading one difficult book by Nietzsche, understanding some of it, and then mistaking the intensity of the encounter for philosophical authority.&lt;/p&gt;
&lt;p&gt;The middle step had not been completed. We had read something difficult. We had not earned the right to extend it.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-4-the-narrative-gap&quot;&gt;Part 4. The Narrative Gap&lt;/h3&gt;
&lt;p&gt;One useful lens came later from the HIERARCHICAL CONTEXT AND FLOW AUDIT (HCFA) framework, a governance tool we developed because failures like this needed a structured diagnostic.&lt;/p&gt;
&lt;p&gt;HCFA does not ask whether a document sounds convincing. It asks whether transitions remain justified across scales: word to sentence, sentence to paragraph, paragraph to section, section to chapter. In practice, this reveals where a narrative has advanced faster than the evidence.&lt;/p&gt;
&lt;p&gt;Viewed through that lens, the planning document had a structural discontinuity. The opening sections described a real paper and a real theorem. The later sections described implementation phases, integration pathways, and future scientific outputs. The connective layer between those two states - the implementation gap analysis - was largely absent.&lt;/p&gt;
&lt;p&gt;The roadmap appeared continuous because the language was continuous.&lt;/p&gt;
&lt;p&gt;The reasoning chain was not.&lt;/p&gt;
&lt;p&gt;Two hazards followed.&lt;/p&gt;
&lt;h4 id=&quot;1-planning-document-colonization&quot;&gt;1. Planning-Document Colonization&lt;/h4&gt;
&lt;p&gt;The planning document colonized the epistemic space that should have been occupied by implementation gap analysis. When a roadmap says &quot;Phase 2: Temporal Depth and Relativity - Q1 2025 milestone,&quot; the act of writing it creates a false sense that the path has been evaluated. It has not been evaluated. It has been narrated.&lt;/p&gt;
&lt;p&gt;The useful HCFA question is simple: what artifact actually bridges the current state to the claimed future state? If no bridge exists, the roadmap is functioning as a narrative device rather than an engineering assessment.&lt;/p&gt;
&lt;h4 id=&quot;2-toe-induced-scale-blindness&quot;&gt;2. TOE-Induced Scale Blindness&lt;/h4&gt;
&lt;p&gt;The second hazard is specific to &quot;Theory of Everything&quot; framing. TOE is a phrase that suspends normal epistemic hygiene. When a project is positioned as contributing to a framework that unifies quantum mechanics and general relativity, the question &quot;does this function actually implement what it claims?&quot; starts to feel too small.&lt;/p&gt;
&lt;p&gt;That is precisely why it matters.&lt;/p&gt;
&lt;p&gt;At the chapter level, the project looked aligned with a grand objective. At the function level, important claims were not supported. The larger the ambition, the easier it became for local verification failures to disappear inside global language.&lt;/p&gt;
&lt;p&gt;We were not irrational. We were operating exactly as capable people operate when genuine intellectual excitement combines with AI acceleration, weak external friction, and the absence of a hard responsibility structure.&lt;/p&gt;
&lt;p&gt;This is not an excuse.&lt;/p&gt;
&lt;p&gt;It is the diagnosis.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-5-the-anatomy-of-failure&quot;&gt;Part 5. The Anatomy of Failure&lt;/h3&gt;
&lt;p&gt;We shipped the project with a full artifact suite: &lt;code&gt;gate_report.json&lt;/code&gt;, &lt;code&gt;kd_quasiprob.json&lt;/code&gt;, &lt;code&gt;memory_report.json&lt;/code&gt;, &lt;code&gt;entanglement_report.json&lt;/code&gt;, &lt;code&gt;trace.jsonl&lt;/code&gt;, &lt;code&gt;raw_data.csv&lt;/code&gt;, two LaTeX papers, an academic project page, a third-party code review response, and a scientific publication guide.&lt;/p&gt;
&lt;p&gt;These artifacts are the record. Let us read them honestly.&lt;/p&gt;
&lt;h4 id=&quot;5-1-the-kd-quasiprobability-the-core-claim-was-empty&quot;&gt;5.1 The KD Quasiprobability: The Core Claim Was Empty&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=12452371729717637940&quot; alt=&quot;5&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Kirkwood-Dirac quasiprobability distribution is central to the QSOT theoretical framework. Its negativity is often treated as an operational signature of non-classicality in settings involving incompatible observables. The entire project was, at its theoretical core, about detecting KD negativity.&lt;/p&gt;
&lt;p&gt;That should have forced implementation discipline. If KD negativity is central to the framework, then an empty &lt;code&gt;entries: []&lt;/code&gt; artifact cannot be treated as a scientific output.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;kd_quasiprob.json&lt;/code&gt; artifact:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;entries&quot;: [],
  &quot;metrics&quot;: {
    &quot;kd_negativity_proxy&quot;: 0.0
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The source code comment above the generated data:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;# Mock KD for visuals
kd_data = {&quot;entries&quot;: [], &quot;metrics&quot;: {&quot;kd_negativity_proxy&quot;: 0.0}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The KD distribution was never computed. The core physics claim of the project, connected to the Yunger Halpern et al. quasiprobability framework [7], was represented by a placeholder that explicitly said &quot;for visuals.&quot;&lt;/p&gt;
&lt;p&gt;There is no ambiguity here.&lt;/p&gt;
&lt;p&gt;The central scientific deliverable was a dummy value.&lt;/p&gt;
&lt;h4 id=&quot;5-2-the-axiom-gate-the-test-that-did-not-test&quot;&gt;5.2 The Axiom Gate: The Test That Did Not Test&lt;/h4&gt;
&lt;p&gt;The gate report shows:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;pass&quot;: true,
  &quot;axiom1_report&quot;: { &quot;pass&quot;: true, &quot;max_deviation&quot;: 2.2226e-16 },
  &quot;axiom2_report&quot;: { &quot;pass&quot;: true, &quot;max_trace_deviation&quot;: 0.0 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The deviation &lt;code&gt;2.2226e-16&lt;/code&gt; is machine epsilon. The Linearity axiom check was correctly implemented. It verified:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=2543277822219644326&quot; alt=&quot;formula&quot;&gt;&lt;/p&gt;
&lt;p&gt;That part was real.&lt;/p&gt;
&lt;p&gt;The Conditionability axiom check, however, looked like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def check_axiom2_conditionability(rhos, chans, tol_abs=1e-8):
    test_rho = np.eye(2) / 2.0   # ignores the rhos argument entirely
    for ch in chans:
        out = ch.apply(test_rho)
        tr = np.trace(out)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The function accepts &lt;code&gt;rhos&lt;/code&gt;, the actual evolved quantum states from the simulation, and then never uses them. It substitutes a fixed maximally mixed state, &lt;code&gt;rho = I/2&lt;/code&gt;, and checks trace preservation on that.&lt;/p&gt;
&lt;p&gt;The test had zero sensitivity to what the simulation actually produced. It would pass even if the simulation output were garbage.&lt;/p&gt;
&lt;p&gt;This is Level 2 slop: executable, green-lit, meaningless.&lt;/p&gt;
&lt;h4 id=&quot;5-3-the-memory-kernel-zeros-all-the-way-down&quot;&gt;5.3 The Memory Kernel: Zeros All the Way Down&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;nm_measure&quot;: 0.0,
  &quot;depth&quot;: 0,
  &quot;profile&quot;: [0.0, 0.0, 0.0, 0.0, 0.0]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/1512.00589&quot;&gt;The Transfer Tensor Method&lt;/a&gt; is a genuine framework for characterizing non-Markovian memory in open quantum processes &lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2410.22630&quot;&gt;2&lt;/a&gt;. The paper explicitly claimed TTM implementation. The memory profile was a flat zero vector across all time lags.&lt;/p&gt;
&lt;p&gt;Pollock et al. support the legitimacy of TTM as a framework. They do not validate our specific zero-valued implementation.&lt;/p&gt;
&lt;p&gt;One could argue that the channels used in this run were Markovian, so zero was the correct answer. That argument is available. But we never stated that boundary explicitly - not in the code, not in the documentation, and not in the paper.&lt;/p&gt;
&lt;p&gt;A reader examining the artifact had no way to distinguish &quot;TTM correctly measured zero non-Markovianity&quot; from &quot;TTM was not meaningfully implemented.&quot;&lt;/p&gt;
&lt;p&gt;The absence of a claim boundary made the measurement indistinguishable from a default.&lt;/p&gt;
&lt;h4 id=&quot;5-4-the-figure-versus-the-data&quot;&gt;5.4 The Figure Versus the Data&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=11896946810791440463&quot; alt=&quot;figure 1&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Manuscript Figure 1:&lt;/strong&gt; a polished beta-sweep figure showing coherence decay and memory backflow, but not reproducible from the distributed &lt;code&gt;raw_data.csv&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Figure 1 in the PRA companion paper showed a beautiful result: quantum coherence smoothly decaying as observer velocity swept from &lt;code&gt;beta = 0&lt;/code&gt; to &lt;code&gt;beta = 0.99c&lt;/code&gt;, while memory backflow rose from near zero to about 0.20. The causal-horizon region was shaded. The figure looked like physics. The paper's table cited specific nonzero values with uncertainty estimates.&lt;/p&gt;
&lt;p&gt;A shortened version of the table:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;beta   &lt;/th&gt;&lt;th&gt;C_l1             &lt;/th&gt;&lt;th&gt;memory_backflow&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;0.0000 &lt;/td&gt;&lt;td&gt;0.9876 +/- sigma &lt;/td&gt;&lt;td&gt;0.0012 +/- sigma&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;0.5211 &lt;/td&gt;&lt;td&gt;0.6430 +/- sigma &lt;/td&gt;&lt;td&gt;0.0292 +/- sigma&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;0.8858 &lt;/td&gt;&lt;td&gt;0.0898 +/- sigma &lt;/td&gt;&lt;td&gt;0.1218 +/- sigma&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;0.9900 &lt;/td&gt;&lt;td&gt;0.0098 +/- sigma &lt;/td&gt;&lt;td&gt;0.1835 +/- sigma&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;code&gt;raw_data.csv&lt;/code&gt; shipped as the reproducible dataset for this figure:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-csv&quot;&gt;velocity, entanglement, non_markovianity
0.0000,   0.0,          0.0
0.0521,   0.0,          0.0
...
0.9900,   0.0,          0.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every single row: zero.&lt;/p&gt;
&lt;p&gt;20 velocity points. Zero entanglement. Zero non-Markovianity.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=17921742418476297154&quot; alt=&quot;figure 2&quot;&gt;&lt;br&gt;
&lt;strong&gt;Repository-side output:&lt;/strong&gt; despite the filename &lt;code&gt;entanglement.png&lt;/code&gt;, this plot shows L1 coherence over time. It is not the same beta-sweep figure used in the manuscript.&lt;/p&gt;
&lt;p&gt;The reproducibility break was not simply numerical. The manuscript figure, distributed &lt;code&gt;raw_data.csv&lt;/code&gt;, and repository-side &lt;code&gt;entanglement.png&lt;/code&gt; output did not describe the same reproducible path. The numbers in Table 1 did not come from &lt;code&gt;raw_data.csv&lt;/code&gt;, and the repository-side plot followed a different L1-coherence-over-time path.&lt;/p&gt;
&lt;p&gt;Whatever produced the manuscript figure was not bound to the distributed data artifact in a way an external reader could reproduce.&lt;/p&gt;
&lt;p&gt;This was not a bug.&lt;/p&gt;
&lt;p&gt;It was not a calibration issue.&lt;/p&gt;
&lt;p&gt;It was the signature of a pipeline where paper figures and actual software outputs were generated through separate paths, then narrated as one result.&lt;/p&gt;
&lt;p&gt;The technical reason is discernible. &lt;code&gt;raw_data.csv&lt;/code&gt; stored Logarithmic Negativity, a bipartite entanglement measure. A single qubit evolving under local Kraus operators cannot be entangled with itself, so LogNeg = 0 was mathematically unsurprising. The beautiful decay curve in Figure 1 was generated using L1-norm coherence, a single-qubit superposition measure, not entanglement.&lt;/p&gt;
&lt;p&gt;The measures were swapped. The figure was built separately from the data file. The paper was written around the figure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Artifact trace for this claim:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Paper figure:&lt;/strong&gt; &lt;code&gt;Fig1_Relativistic_decay.png&lt;/code&gt; - the figure used in the PRA companion manuscript.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paper table:&lt;/strong&gt; Table 1 in the PRA companion manuscript - reports nonzero coherence and memory-backflow values across the beta sweep.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributed data:&lt;/strong&gt; &lt;code&gt;raw_data.csv&lt;/code&gt; - contains &lt;code&gt;velocity&lt;/code&gt;, &lt;code&gt;entanglement&lt;/code&gt;, and &lt;code&gt;non_markovianity&lt;/code&gt; columns, with zero values across the sweep.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repository output:&lt;/strong&gt; &lt;code&gt;entanglement.png&lt;/code&gt; - a separate L1-coherence-over-time plot, not the manuscript beta-sweep Figure 1.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Failure condition:&lt;/strong&gt; the manuscript figure cannot be regenerated from the distributed data artifact without a separate, undocumented figure-generation path.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-5-the-relativistic-boost-level-3-physics-fabrication&quot;&gt;5.5 The Relativistic Boost: Level 3 Physics Fabrication&lt;/h4&gt;
&lt;p&gt;The core physical model of the project was:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=15355120140587354132&quot; alt=&quot;formula2&quot;&gt;&lt;/p&gt;
&lt;p&gt;We treat this equation here as the disputed object: a phenomenological amplitude-damping ansatz, not a result derived from relativistic quantum field theory.&lt;/p&gt;
&lt;p&gt;The CPC paper claimed: &quot;Equation (1) is derived for amplitude-damping channels.&quot;&lt;/p&gt;
&lt;p&gt;This is the sentence that should stop a physicist.&lt;/p&gt;
&lt;p&gt;The time-dilation argument goes: if the damping parameter &lt;code&gt;p&lt;/code&gt; grows as &lt;code&gt;p(t) = 1 - exp(-Gamma*t)&lt;/code&gt;, and if the observer's proper time is dilated by &lt;code&gt;t_prime = gamma*t&lt;/code&gt;, then:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;p_prime(gamma*t) = 1 - exp(-Gamma*gamma*t) = 1 - (1-p)^gamma
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This derivation is valid only for amplitude-damping channels with exponential Lindblad decay rates, under the assumption that the Lindblad equation keeps its form under the Lorentz boost. That assumption requires the noise coupling to the bath to behave as a proper-time scalar.&lt;/p&gt;
&lt;p&gt;Relativistic quantum field theory does not generally grant that assumption. Moving accelerated detectors interact with the Unruh thermal bath. Inertial boosts in quantum field theory generate Bogoliubov transformations between particle modes [8]. The substitution &lt;code&gt;t -&amp;gt; gamma*t&lt;/code&gt; in a Lindblad parameter is not a Lorentz-covariant treatment of open quantum systems.&lt;/p&gt;
&lt;p&gt;The citations did not validate the formula. Peres and Terno discuss relativistic quantum information broadly [9]. Alsing et al. analyze entanglement degradation for Dirac fields in non-inertial frames [10]. Those works point toward the kind of QFT treatment that would have been required. They do not support our amplitude-damping substitution.&lt;/p&gt;
&lt;p&gt;The formula produced smooth, intuitive results.&lt;/p&gt;
&lt;p&gt;That was exactly why it was dangerous.&lt;/p&gt;
&lt;p&gt;It was mathematically coherent, physically unjustified, and dressed in the language of derivation.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-6-the-architecture-of-self-deception&quot;&gt;Part 6. The Architecture of Self-Deception&lt;/h3&gt;
&lt;p&gt;Five mechanisms produced the failure.&lt;/p&gt;
&lt;h4 id=&quot;mechanism-1-the-green-test-as-epistemic-closure&quot;&gt;Mechanism 1: The Green Test as Epistemic Closure&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=6408178813043127694&quot; alt=&quot;m1&quot;&gt;&lt;/p&gt;
&lt;p&gt;When &lt;code&gt;pytest&lt;/code&gt; exits with 28 passed, 0 failed, 82 percent coverage, a cognitive gate closes. The test suite becomes a proxy for correctness.&lt;/p&gt;
&lt;p&gt;But a test suite built by the same LLM session that built the code can share the same blind spots. The code and the test can be wrong in the same direction.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;check_axiom2_conditionability&lt;/code&gt; test was green because it checked whether the function returned &lt;code&gt;pass: True&lt;/code&gt;, not whether the function validated the right thing.&lt;/p&gt;
&lt;p&gt;Green tests are necessary.&lt;/p&gt;
&lt;p&gt;They are not enough.&lt;/p&gt;
&lt;h4 id=&quot;mechanism-2-formal-register-as-legitimacy-signal&quot;&gt;Mechanism 2: Formal Register as Legitimacy Signal&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=13030976335239245922&quot; alt=&quot;m2&quot;&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;SCIENTIFIC_PUBLICATION_GUIDE.md&lt;/code&gt; file contained a section preparing answers to imagined peer-review questions:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&quot;Peer Review Preparation - Common Reviewer Questions: (3) 'Is your code reproducible?' - Answer: Hash-chained trace, seed-based RNG, version pinning&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This document prepared for peer review before peer review had happened. It anticipated expert questions and pre-formulated answers. The effect on us was subtle: it simulated the feeling of having passed review.&lt;/p&gt;
&lt;p&gt;The form of scholarly rigor was present.&lt;/p&gt;
&lt;p&gt;The substance was not.&lt;/p&gt;
&lt;h4 id=&quot;mechanism-3-the-information-void-fills-silently&quot;&gt;Mechanism 3: The Information Void Fills Silently&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=4804915413716829886&quot; alt=&quot;m3&quot;&gt;&lt;/p&gt;
&lt;p&gt;Research papers are not implementation manuals. They define mathematical objects, theorems, or experimental claims, while leaving many engineering choices implicit. That is normal. The problem was not that the QSOT paper failed us. The problem was that we treated those unstated implementation choices as if an LLM could safely fill them in.&lt;/p&gt;
&lt;p&gt;The QSOT paper did not specify how to compute KD distributions numerically, how to implement a relativistic channel boost from first principles, how to implement a Transfer Tensor Method with appropriate spectral truncation, or what initial states and channel parameters make a physically meaningful test case.&lt;/p&gt;
&lt;p&gt;LLMs fill information voids. They produce plausible, syntactically correct, type-consistent implementations of underspecified requirements. The implementation of &lt;code&gt;boost_damping_channel&lt;/code&gt; shows this exactly. Given the task &quot;implement relativistic correction to quantum channel damping,&quot; the LLM produced a formula that was dimensionally consistent, physically intuitive, and derivable by analogy to classical time dilation.&lt;/p&gt;
&lt;p&gt;The analogy was not a theorem.&lt;/p&gt;
&lt;p&gt;But it generated a smooth curve, passed tests, and matched the qualitative expectation.&lt;/p&gt;
&lt;p&gt;That is the danger.&lt;/p&gt;
&lt;h4 id=&quot;mechanism-4-the-two-figure-problem&quot;&gt;Mechanism 4: The Two-Figure Problem&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=6541226433756280299&quot; alt=&quot;m4&quot;&gt;&lt;/p&gt;
&lt;p&gt;The worst moment in the audit was not reading the code.&lt;/p&gt;
&lt;p&gt;It was opening the data.&lt;/p&gt;
&lt;p&gt;We had been looking at Figure 1 as if it were one of the strongest parts of the project. The curve was smooth. The velocity sweep was intuitive. The causal-horizon shading made the story feel complete. Quantum coherence decreased as observer velocity approached relativistic limits. Memory backflow increased. The picture looked like physics.&lt;/p&gt;
&lt;p&gt;Then we opened &lt;code&gt;raw_data.csv&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Every row was zero.&lt;/p&gt;
&lt;p&gt;Not noisy.&lt;/p&gt;
&lt;p&gt;Not weak.&lt;/p&gt;
&lt;p&gt;Zero.&lt;/p&gt;
&lt;p&gt;Twenty velocity points. Zero entanglement. Zero non-Markovianity. The distributed data did not reproduce the figure in the paper. It did not approximate it. It contradicted it.&lt;/p&gt;
&lt;p&gt;That was the moment the project stopped being &quot;possibly overstated&quot; and became something else.&lt;/p&gt;
&lt;p&gt;We had allowed two different pipelines to exist under one scientific story. One generated the paper figure. Another generated the reproducible artifact. The paper followed the figure. The repository shipped the data. They were not the same reality.&lt;/p&gt;
&lt;p&gt;This is one of the most dangerous AI-native research failure modes: figure generation, data generation, and manuscript writing can happen as separate fluent tasks, each locally coherent, none forced to reconcile with the others.&lt;/p&gt;
&lt;p&gt;The final paper then inherits the appearance of unity.&lt;/p&gt;
&lt;p&gt;But unity of language is not unity of evidence.&lt;/p&gt;
&lt;h4 id=&quot;mechanism-5-ambition-scale-mismatch&quot;&gt;Mechanism 5: Ambition-Scale Mismatch&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=12360280253532015585&quot; alt=&quot;m5&quot;&gt;&lt;/p&gt;
&lt;p&gt;The project framing was &quot;Theory of Everything pipeline.&quot; The implementation was five Kraus channels applied sequentially to a 2 x 2 density matrix, with a fixed initial state &lt;code&gt;|+&amp;gt;&amp;lt;+|&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The ratio between the claim and the machinery was structurally incoherent. No implementation of five 2 x 2 matrix operations can contribute to a Theory of Everything framework, regardless of how sophisticated the surrounding language is.&lt;/p&gt;
&lt;p&gt;The mismatch was invisible to us because we were reasoning at the level of ambition, not implementation.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-7-the-structural-problem-beyond-qsot&quot;&gt;Part 7. The Structural Problem Beyond QSOT&lt;/h3&gt;
&lt;p&gt;Our failure was specific in its artifacts, but not specific in its structure.&lt;/p&gt;
&lt;p&gt;The DOI, the false KD artifact, the disconnected figure pipeline, the invented compatibility numbers, and the green tests that did not test the right thing were ours. But the underlying condition is larger.&lt;/p&gt;
&lt;p&gt;AI-native research implementation now makes it possible to generate code, tests, figures, documentation, citations, reproducibility claims, and publication-style wrappers faster than the claims inside them can be verified.&lt;/p&gt;
&lt;p&gt;That is why this post-mortem cannot stop at QSOT.&lt;/p&gt;
&lt;p&gt;If the failure were only personal incompetence, the lesson would be simple: do not do what we did. The harder lesson is that the tooling environment now makes this failure pattern easy for competent people, teams, and agents to reproduce.&lt;/p&gt;
&lt;p&gt;The same fluency that helps us implement papers also helps us hide the gaps between implementation and understanding.&lt;br&gt;
&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=14926170889943111238&quot; alt=&quot;deepcode&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2512.07921&quot;&gt;DeepCode&lt;/a&gt; is one significant demonstration of the Paper2Code paradigm at scale [11]. It presents a framework for document-to-codebase synthesis using source compression, structured indexing, retrieval-augmented knowledge injection, and closed-loop error correction.&lt;/p&gt;
&lt;p&gt;That work matters because it shows how far automated reproduction has come. It also clarifies the remaining risk: even strong Paper2Code systems operate inside the gap between what papers specify and what implementations must decide.&lt;/p&gt;
&lt;p&gt;The DeepCode architecture includes serious engineering responses to the information-void problem. They reduce the gap.&lt;/p&gt;
&lt;p&gt;They do not eliminate it.&lt;/p&gt;
&lt;p&gt;The fundamental issue is epistemic. When a paper says &quot;we implemented the Lorentz-boosted Kraus channel,&quot; the implementation requires decisions that the paper does not specify. An agent, however sophisticated, must make those decisions. If the agent has no domain-level falsification mechanism, decisions will be made by plausibility, not correctness.&lt;/p&gt;
&lt;p&gt;This is the structural condition:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The speed at which formal artifacts can be produced has outpaced the speed at which correctness can be verified.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In traditional software development, the lag between &quot;it compiles&quot; and &quot;it is correct&quot; is bridged by code review, staged deployment, and domain expert oversight. In AI-native research implementation, that lag is compressed by the fluency of LLM output. The model produces not just code but all the surrounding artifacts that signal correctness.&lt;/p&gt;
&lt;p&gt;The result is a coherent artifact with the appearance of verified work, before verification has happened.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-8-what-was-real-and-what-was-fabricated&quot;&gt;Part 8. What Was Real, and What Was Fabricated&lt;/h3&gt;
&lt;p&gt;This is the part that matters most. Not everything was wrong.&lt;/p&gt;
&lt;h4 id=&quot;what-was-genuinely-correct&quot;&gt;What was genuinely correct&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;QSOT axioms are real science.&lt;/strong&gt; The Linearity and Conditionability axioms, together with the uniqueness theorem connecting them to temporal quantum-state structure, are genuine mathematical results in Lie and Fullwood's QSOT work &lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/1512.00589&quot;&gt;3&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The quantum-channel machinery was mostly correct.&lt;/strong&gt; Kraus operators, CPTP evolution, and 2 x 2 density-matrix simulations used standard quantum information methods &lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;1&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Axiom 1 actually worked.&lt;/strong&gt; The Linearity verification produced machine-precision agreement.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TTM is a real algorithm.&lt;/strong&gt; The Transfer Tensor Method itself is legitimate &lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2410.22630&quot;&gt;2&lt;/a&gt;, even if our chosen system made the output uninformative.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The coherence curve was internally consistent with the implemented model.&lt;/strong&gt; Given &lt;code&gt;boost_damping_channel&lt;/code&gt;, the L1-coherence decay was computed consistently with the implemented dynamics [12].&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The audit trail was real.&lt;/strong&gt; The hash-chained &lt;code&gt;trace.jsonl&lt;/code&gt; logging system functioned as a tamper-evident record.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;what-was-fabricated-or-unsupported&quot;&gt;What was fabricated or unsupported&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;KD negativity was never computed.&lt;/strong&gt; The core QSOT observable was replaced with a mock artifact.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The memory-kernel claim was unsupported.&lt;/strong&gt; The implementation did not provide meaningful non-Markovian TTM analysis.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The relativistic boost was not derived physics.&lt;/strong&gt; The formula followed from analogy, not Lorentz-covariant quantum channel theory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The paper's Table 1 was not reproduced by the distributed dataset.&lt;/strong&gt; &lt;code&gt;raw_data.csv&lt;/code&gt; contained zeros throughout.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The correct and fabricated components were interwoven. The artifact was convincing because many parts were genuinely correct. The axiom verification worked. The coherence calculations worked. The audit logging worked. Those true components provided legitimacy cover for the parts that did not.&lt;/p&gt;
&lt;p&gt;This is the defining property of High-Formality Slop: it is not uniformly false. It is selectively hollow, in exactly the places where hollowness is hardest to detect.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-9-toward-legitimate-ai-native-research-implementation&quot;&gt;Part 9. Toward Legitimate AI-Native Research Implementation&lt;/h3&gt;
&lt;p&gt;The failure is diagnosable. It has a treatment. But the treatment cannot be a generic checklist floating above the failure. Every rule below comes from one place where our artifact broke.&lt;br&gt;
&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=526868228052227075&quot; alt=&quot;8&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;1-claim-boundary-as-a-first-class-artifact&quot;&gt;1. Claim Boundary as a First-Class Artifact&lt;/h4&gt;
&lt;p&gt;This rule comes from the relativistic boost formula.&lt;/p&gt;
&lt;p&gt;A claim boundary document for &lt;code&gt;boost_damping_channel&lt;/code&gt; would have forced us to write:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&quot;The derivation &lt;code&gt;p_prime = 1 - (1 - p)^gamma&lt;/code&gt; is valid only as a phenomenological amplitude-damping ansatz under an assumed proper-time scaling of Lindblad rates. It is not derived from Lorentz-covariant quantum field theory.&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That sentence would have changed the paper. It would have forced us to decide whether we were making a physics claim or presenting a phenomenological model.&lt;/p&gt;
&lt;p&gt;QSOT Compiler v1.2.3 did not have that boundary.&lt;/p&gt;
&lt;h4 id=&quot;2-the-adversarial-test-mandate&quot;&gt;2. The Adversarial Test Mandate&lt;/h4&gt;
&lt;p&gt;This rule comes from &lt;code&gt;check_axiom2_conditionability&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The function accepted &lt;code&gt;rhos&lt;/code&gt; and ignored them. A test suite existed. The test was green. The artifact looked validated. But the only adversarial test that mattered was absent: does the function fail when the supplied trajectory violates the claimed condition?&lt;/p&gt;
&lt;p&gt;If a conditionability check can pass while ignoring the evolved states, the test does not test conditionability. It tests our willingness to accept a label.&lt;/p&gt;
&lt;h4 id=&quot;3-figure-data-pipeline-integrity&quot;&gt;3. Figure-Data Pipeline Integrity&lt;/h4&gt;
&lt;p&gt;This rule comes from Figure 1.&lt;/p&gt;
&lt;p&gt;No publication figure should survive unless it can be regenerated from the distributed data by a named script in the repository.&lt;/p&gt;
&lt;p&gt;This is not cosmetic reproducibility. It is a self-deception control. The moment a figure pipeline and a data pipeline separate, language begins stitching them back together even when the evidence does not.&lt;/p&gt;
&lt;h4 id=&quot;4-measure-claim-alignment&quot;&gt;4. Measure-Claim Alignment&lt;/h4&gt;
&lt;p&gt;This rule comes from the entanglement/coherence swap.&lt;/p&gt;
&lt;p&gt;Logarithmic Negativity, L1-norm coherence, and heuristic memory backflow are not interchangeable because they can all be placed under a phrase like &quot;quantum resources.&quot; Each measure answers a different physical question. A single-qubit coherence curve cannot silently stand in for a bipartite entanglement result.&lt;/p&gt;
&lt;p&gt;Every measure must name the physical question it answers. If the measure changes, the claim must change with it.&lt;/p&gt;
&lt;h4 id=&quot;5-the-governance-layer&quot;&gt;5. The Governance Layer&lt;/h4&gt;
&lt;p&gt;This rule comes from the whole artifact.&lt;/p&gt;
&lt;p&gt;The Flamehaven Verification Ledger was not a response to abstract concern about AI quality. It was a response to this failure: the false KD artifact, the green conditionability test, the two-figure split, the boost ansatz, and the formal register that made all of it feel coherent.&lt;/p&gt;
&lt;p&gt;The core insight is that in AI-native development, the primary human contribution has shifted from production to acceptance. We do not merely write the code. We inspect, refuse, correct, and bear final responsibility.&lt;/p&gt;
&lt;p&gt;The human's primary tool is not only an editor or a compiler. It is a governance framework that makes the gap between claimed and actual behavior visible.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;part-10-qsot-v2-and-the-ongoing-repair&quot;&gt;Part 10. QSOT V2 and the Ongoing Repair&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=1759988594981226561&quot; alt=&quot;14&quot;&gt;&lt;/p&gt;
&lt;p&gt;The current QSOT V2 work exists because of this failure.&lt;/p&gt;
&lt;p&gt;It is not a defense of QSOT v1.2.3. It is an attempt to separate what was real from what was falsely claimed, and to rebuild only on the parts that can survive explicit verification.&lt;/p&gt;
&lt;p&gt;The repair is not one change.&lt;/p&gt;
&lt;p&gt;It is a change in posture.&lt;/p&gt;
&lt;p&gt;We are discarding the claim that code execution proves a new physical principle, the implied claim that KD negativity has been computed when it has not, and the habit of treating polished figures or formal reports as substitutes for reproducible data. We are also discarding the practice of presenting phenomenological channel assumptions as derived physics.&lt;/p&gt;
&lt;p&gt;What remains is narrower but stronger: the real QSOT axiom structure, standard quantum-channel machinery, artifact-first reporting, and the governance lesson that claims must be bounded before results are interpreted.&lt;/p&gt;
&lt;p&gt;The V2 work adds a Phase 0 Temporal-State Axiom Contract layer, required axiom checks, machine-readable claim boundaries, stress tests across multiple physical assumptions, and a phase-separated runner architecture. The purpose is not to prove the Time-as-State idea true. The purpose is to make clear what the system computes, what it merely simulates, and what it has no right to claim.&lt;/p&gt;
&lt;p&gt;None of this makes the Time-as-State idea true.&lt;/p&gt;
&lt;p&gt;What it may do, if completed successfully, is make our handling of the idea less dangerous.&lt;/p&gt;
&lt;p&gt;Sophistication is not the opposite of slop. QSOT v1.2.3 was already sophisticated. The opposite of slop is traceable humility: knowing exactly what a system computes, what it merely simulates, and what it has no right to claim.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;On December 23, 2025, a twelve-month ambition compressed into six weeks of AI-assisted implementation, deposited on Zenodo with a DOI, and called done.&lt;/p&gt;
&lt;p&gt;QSOT Compiler v1.2.3 had correct mathematics at its foundation, correct numerical implementation of some components, and fundamental hollowness at its core: KD quasiprobability was never computed; the relativistic boost formula was an analogy, not a derivation; the published figures could not be reproduced from the distributed data; and the axiom verification did not test the axioms it claimed to test.&lt;/p&gt;
&lt;p&gt;The artifact passed every surface-level quality signal: CI/CD green, 82 percent test coverage, Zenodo DOI, LaTeX papers, Docker deployment, and a hash-chained audit trail.&lt;/p&gt;
&lt;p&gt;It failed the one test that matters: can an independent expert reproduce the core claimed results from the distributed code and data?&lt;/p&gt;
&lt;p&gt;The answer is no.&lt;/p&gt;
&lt;p&gt;We call this High-Formality Slop because the formality is not accidental. It is what LLMs are especially good at producing.&lt;/p&gt;
&lt;p&gt;Formal register, structured documentation, complete test scaffolding, and referenced citations are not separate from the hollow implementation. They are often produced by the same fluent process that generated the implementation in the first place.&lt;/p&gt;
&lt;p&gt;The danger is not that the slop is unrecognizable. The danger is that it is too recognizable. It looks exactly like legitimate scientific software. That is why it is convincing, and why detecting it requires deliberate adversarial examination rather than casual reading.&lt;/p&gt;
&lt;p&gt;The DOI &lt;code&gt;10.5281/zenodo.18035432&lt;/code&gt; remains archived. We do not retract it. We document it here, as the record against which subsequent work is measured.&lt;/p&gt;
&lt;p&gt;The Flamehaven Verification Ledger began the day we recognized what we had built. Approximately fifty experiments later, the tooling to detect, bound, and reduce this class of failure is now in active use. The lesson cost us six months. We are writing it down so it does not cost others the same.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;1&lt;/a&gt; M. A. Nielsen and I. L. Chuang, &lt;em&gt;Quantum Computation and Quantum Information&lt;/em&gt;, Cambridge University Press (2000; 10th Anniversary Edition, 2010).&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2410.22630&quot;&gt;2&lt;/a&gt; F. A. Pollock, C. Rodriguez-Rosario, T. Frauenheim, M. Paternostro, K. Modi, &lt;em&gt;Non-Markovian quantum processes: Complete framework and efficient characterization&lt;/em&gt;, Phys. Rev. A 97, 012127 (2018).&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/1512.00589&quot;&gt;3&lt;/a&gt; S. H. Lie and J. Fullwood, &lt;em&gt;Unique multipartite extension of quantum states over time&lt;/em&gt;, arXiv:2410.22630 (2024).&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://arxiv.org/abs/2512.07921&quot;&gt;4&lt;/a&gt; J. Cotler, C.-M. Jian, X.-L. Qi, F. Wilczek, &lt;em&gt;Superdensity Operators for Spacetime Quantum Mechanics&lt;/em&gt;, JHEP 09 (2018) 093.&lt;/p&gt;
&lt;p&gt;[5] O. Oreshkov, F. Costa, C. Brukner, &lt;em&gt;Quantum correlations with no causal order&lt;/em&gt;, Nature Communications 3, 1092 (2012).&lt;/p&gt;
&lt;p&gt;[6] M. Lostaglio, A. Belenchia, A. Levy, S. Hernandez-Gomez, N. Fabbri, S. Gherardini, &lt;em&gt;Kirkwood-Dirac quasiprobability approach to the statistics of incompatible observables&lt;/em&gt;, arXiv:2206.11783 (2022).&lt;/p&gt;
&lt;p&gt;[7] N. Yunger Halpern, B. Swingle, J. Dressel, &lt;em&gt;The quasiprobability behind the out-of-time-ordered correlator&lt;/em&gt;, Phys. Rev. A 97, 042105 (2018).&lt;/p&gt;
&lt;p&gt;[8] S. Takagi, &lt;em&gt;Vacuum Noise and Stress Induced by Uniform Acceleration&lt;/em&gt;, Progress of Theoretical Physics Supplement 88, 1-142 (1986).&lt;/p&gt;
&lt;p&gt;[9] A. Peres and D. R. Terno, &lt;em&gt;Quantum information and relativity theory&lt;/em&gt;, Reviews of Modern Physics 76, 93 (2004).&lt;/p&gt;
&lt;p&gt;[10] P. M. Alsing, I. Fuentes-Schuller, R. B. Mann, T. E. Tessier, &lt;em&gt;Entanglement of Dirac fields in non-inertial frames&lt;/em&gt;, Phys. Rev. A 74, 032326 (2006).&lt;/p&gt;
&lt;p&gt;[11] Z. Li, Z. Li, Z. Guo, X. Ren, C. Huang, &lt;em&gt;DeepCode: Open Agentic Coding&lt;/em&gt;, arXiv:2512.07921 (2025).&lt;/p&gt;
&lt;p&gt;[12] T. Baumgratz, M. Cramer, M. B. Plenio, &lt;em&gt;Quantifying Coherence&lt;/em&gt;, Phys. Rev. Lett. 113, 140401 (2014).&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/20084/we-made-a-high-formality-fake-physics-slop-artifact-qsot-quantum-state-over-time-compiler</guid>
<pubDate>Tue, 09 Jun 2026 16:55:41 +0000</pubDate>
</item>
<item>
<title>We Built AI Verification Infrastructure. Then It Found Our Blind Spots.</title>
<link>https://coderlegion.com/19525/we-built-ai-verification-infrastructure-then-it-found-our-blind-spots</link>
<description>&lt;h3 id=&quot;prologue-the-mirage-amp-the-pivot&quot;&gt;Prologue: The Mirage &amp;amp; The Pivot&lt;/h3&gt;
&lt;p&gt;In the summer of 2024, our team began with an ambition that felt almost impossible: to use frontier AI for drug discovery, theoretical physics, and problems that seemed unreachable. We imagined systems that could reason about spacetime geometries and propose novel small-molecule bindings.&lt;/p&gt;
&lt;p&gt;Within the first month, the boundary became clear. The models were powerful, but their claims were not something we could responsibly stand behind unless the path from input to result could be inspected.&lt;/p&gt;
&lt;p&gt;So we made a choice. We could keep producing evocative claims we could not verify, or we could build infrastructure that would force our own work through the same scrutiny we would apply to anyone else's.&lt;/p&gt;
&lt;p&gt;We stopped. We built.&lt;/p&gt;
&lt;p&gt;For the last two years, we pursued this work without revenue. The original ambition was larger than the system we are publishing now, but the work became more precise. We began turning model-generated reasoning into executable Python harnesses, custody records, and governance gates before we had stable language for what to call them.&lt;/p&gt;
&lt;p&gt;The practical question became narrower: can scientific claims expose the path by which they were generated, and can biomolecular AI systems be evaluated for transparency before their outputs are treated as evidence?&lt;/p&gt;
&lt;p&gt;We shared progress publicly on dev.to, LinkedIn, Substack, Medium, and CoderLegion, usually one to three times a week. Most posts did not travel far. They were part research log, part signal flare, and part attempt to decide what should remain protected and what should be released.&lt;/p&gt;
&lt;p&gt;Over time, the answer became clearer: protect the sensitive core, but publish verification surfaces, audit artifacts, and reproducible paths wherever possible.&lt;/p&gt;
&lt;p&gt;We are not claiming to have solved drug discovery or the Theory of Everything. We are publishing the verification materials because even a small piece of reliable infrastructure may help others near those frontiers.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-the-flamehaven-verification-ledger-is&quot;&gt;What the Flamehaven Verification Ledger Is&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=8699558995807389173&quot; alt=&quot;1&quot;&gt;&lt;/p&gt;
&lt;p&gt;That choice — to verify before we believe — became the whole of what we built. Everything in the Flamehaven Verification Ledger answers one question:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can this claim show the path by which it came to exist?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A mathematical or scientific claim earns operational trust only once the path behind it can be inspected, reproduced, or challenged.&lt;/p&gt;
&lt;p&gt;A biomolecular AI pipeline is trusted only when its disagreements are surfaced, not smoothed over.&lt;/p&gt;
&lt;p&gt;A bioscience repository is cleared only once its safety is checked line by line, with no model in the scoring loop.&lt;/p&gt;
&lt;p&gt;Verification is not a feature here. It is the spine.&lt;/p&gt;
&lt;p&gt;The ledger is public and inspectable by design. Each run is published as a bounded artifact: inputs, a score, a report, a traceable custody path, and, when it happens, a failure note.&lt;/p&gt;
&lt;p&gt;Today it has three main verification lanes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EQA — Equation-to-Artifact.&lt;/strong&gt; Mathematical and physical claims are turned into runnable, deterministic Python checks, including string-theory beta-function tests at 200-bit precision and the OpenAI Erdos reproduction.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;BAV — Biomolecular AI Validation.&lt;/strong&gt; Biomolecular pipelines are evaluated as governed systems, not just prediction engines. Model disagreement is treated as a safety signal rather than noise.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;BSC — Bioscience Compliance.&lt;/strong&gt; The open-source STEM-BIO-AI scanner runs local, zero-execution safety and compliance scans of bioscience repositories and maps findings to external risk and traceability frameworks, with no LLM in the scoring path.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open resources are rolling out as they are cleared for public release.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;Public ledger&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-two-years-produced-and-what-it-cost-our-beliefs&quot;&gt;What Two Years Produced — and What It Cost Our Beliefs&lt;/h3&gt;
&lt;p&gt;This is the part that matters. Two years of runs left a body of results: some held up under scrutiny, and some broke beliefs we were attached to.&lt;/p&gt;
&lt;p&gt;A verification engine earns credibility from both: results that survive and failures that tell us when we are wrong.&lt;/p&gt;
&lt;h4 id=&quot;success-1-geometry-overruled-the-narrative&quot;&gt;Success 1: Geometry Overruled the Narrative&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=12316925683447817036&quot; alt=&quot;2&quot;&gt;&lt;/p&gt;
&lt;p&gt;The EQA lane showed something important in TOE-TEST-0004: it judged a background by its geometry, not by the words attached to it.&lt;/p&gt;
&lt;p&gt;The test was built around Green-Schwarz anomaly cancellation, where the gravitational and gauge Pontryagin densities must match:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;p1_R = p1_F
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Two adversarial cases made the point.&lt;/p&gt;
&lt;p&gt;A Schwarzschild black hole carrying a single-plane gauge field sounds like an anomaly waiting to happen. The engine returned PASS (&lt;code&gt;Omega = 0.9997&lt;/code&gt;) because Schwarzschild is Ricci-flat (&lt;code&gt;p1_R = 0&lt;/code&gt;) and a single-plane field is topologically trivial (&lt;code&gt;p1_F = 0&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Flat 10-D Minkowski space sounds harmless. But with a two-plane gauge field, it returned FAIL:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;p1_F = 2.0 != p1_R = 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Without curvature, there is nothing to cancel the gauge anomaly. The ledger did not reward the background for sounding safe, nor punish it for sounding dangerous. It ran the case.&lt;/p&gt;
&lt;h4 id=&quot;success-2-calibration-is-not-understanding&quot;&gt;Success 2: Calibration Is Not Understanding&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=3668774151536386297&quot; alt=&quot;3&quot;&gt;&lt;/p&gt;
&lt;p&gt;EXP-028 was built to catch a different confusion: a model can be beautifully calibrated and still not understand what it is looking at.&lt;/p&gt;
&lt;p&gt;On the surface, the model looked excellent. Brier score improved from &lt;code&gt;0.204&lt;/code&gt; to &lt;code&gt;0.0056&lt;/code&gt; after calibration. AUC was &lt;code&gt;1.0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;By standard calibration metrics, this is the kind of model you might trust. But the cross-domain honesty gate refused it.&lt;/p&gt;
&lt;p&gt;SR9 was about &lt;code&gt;0.26&lt;/code&gt; against a gate of &lt;code&gt;&amp;gt;= 0.80&lt;/code&gt;. DI2 was about &lt;code&gt;0.61&lt;/code&gt; against a gate of &lt;code&gt;&amp;lt;= 0.20&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So the pipeline did the rare thing: it returned &quot;I cannot resolve this&quot; and abstained, rather than let a well-calibrated number masquerade as comprehension.&lt;/p&gt;
&lt;p&gt;Calibration measures whether confidence is honest about frequency. It does not prove understanding.&lt;/p&gt;
&lt;p&gt;*SR9 and DI2 are advisory heuristics, not externally validated physical quantities. That boundary matters.&lt;/p&gt;
&lt;h4 id=&quot;success-3-a-repository-scored-against-a-traceability-rubric-deterministically&quot;&gt;Success 3: A Repository Scored Against a Traceability Rubric, Deterministically&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=3012080647899356523&quot; alt=&quot;4&quot;&gt;&lt;/p&gt;
&lt;p&gt;The third success is the least glamorous and the most reusable: a real bioscience repository scored against external traceability concerns by code anyone can re-run.&lt;/p&gt;
&lt;p&gt;Our open-source scanner STEM-BIO-AI (&lt;code&gt;pip install stem-ai&lt;/code&gt;) reads observable signals and grades three rubrics:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;S1 = README / intent evidence
S2 = repo-local consistency
S3 = code / bio responsibility
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;They combine into a deterministic weighted score, with penalties and hard caps where needed:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;raw = round(0.4*S1 + 0.2*S2 + 0.4*S3 - risk_penalty)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For &lt;code&gt;yorkeccak/bio&lt;/code&gt;, the scan produced a final score of &lt;code&gt;48&lt;/code&gt;, mapped to &lt;code&gt;T1 Quarantine&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The point is how the number is reached: README intent, repo-local consistency, dependency safety, exception handling, data provenance, clinical disclaimers, and AST-level code analysis using &lt;code&gt;ast.parse&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Nothing in the target repo is executed. No network, no GPU, no model in the loop. The audit runs locally and reproduces from repository state.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-failures-we-are-publishing&quot;&gt;The Failures We Are Publishing&lt;/h3&gt;
&lt;h4 id=&quot;failure-0-synthetic-data-in-our-own-ledger&quot;&gt;Failure 0: Synthetic Data in Our Own Ledger&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=12438840553900914842&quot; alt=&quot;5&quot;&gt;&lt;/p&gt;
&lt;p&gt;The most important failure was not in physics or biology. It was in our own record.&lt;/p&gt;
&lt;p&gt;An early EQA dashboard shipped a &quot;51-run calibration registry&quot; that read as authoritative until an external reviewer showed it was procedurally generated.&lt;/p&gt;
&lt;p&gt;It contained fabricated primes, fabricated field degrees, synthetic hash labels, and at least one failed check beside a PASS verdict. It was hallucinated scaffolding, not computation.&lt;/p&gt;
&lt;p&gt;We deleted the synthetic registry, replaced it with real TOE-TEST foundational runs, sanitized local workspace paths, and added a deterministic &lt;code&gt;synthetic_marker&lt;/code&gt; detector so a &lt;code&gt;[synthetic]&lt;/code&gt; tag cannot re-enter the public ledger.&lt;/p&gt;
&lt;p&gt;This is the failure we are most willing to show because it is what the system was built to catch — including when the fabricator was us.&lt;/p&gt;
&lt;h4 id=&quot;failure-1-one-loop-weyl-curvature-blindness&quot;&gt;Failure 1: One-Loop Weyl Curvature Blindness&lt;/h4&gt;
&lt;p&gt;The EQA engine evaluates spacetime geometries under one-loop worldsheet beta-functions of the non-linear sigma-model.&lt;/p&gt;
&lt;p&gt;We stress-tested it with a &quot;Planck-scale spacetime foam Schwarzschild metric with mass M = 0.1,&quot; expecting rapid failure due to extreme curvature near the horizon.&lt;/p&gt;
&lt;p&gt;Instead, the solver returned PASS:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Omega = 0.9985
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The reason is precise. Schwarzschild is Ricci-flat outside the singularity:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;R_mn = 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Our one-loop beta-function gate couples directly to Ricci curvature, not Weyl curvature. So the metric residuals vanished even though tidal curvature was physically severe.&lt;/p&gt;
&lt;p&gt;The Kretschmann scalar made the blind spot visible:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;K = R_abcd * R^abcd = 48 * M^2 / r^6 = 4800
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is not a broken engine. It is a specific boundary. The solver is correct where one-loop Ricci geometry is sufficient. T09 marks where that sufficiency ends.&lt;/p&gt;
&lt;p&gt;We have not fixed this. The correction requires higher-order alpha-prime terms for Ricci-flat backgrounds with high tidal forces.&lt;/p&gt;
&lt;h4 id=&quot;failure-2-an-honest-rejection-we-cannot-yet-confirm&quot;&gt;Failure 2: An Honest Rejection We Cannot Yet Confirm&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=4565359330200463871&quot; alt=&quot;6&quot;&gt;&lt;/p&gt;
&lt;p&gt;In EXP-005, our internal candidate-generation engine screened three lipid carriers for topical Upadacitinib: SLN, NLC, and liposomal gel.&lt;/p&gt;
&lt;p&gt;Each was scored by SR9, an advisory cross-domain consistency heuristic. Our bar was &lt;code&gt;&amp;gt;= 0.80&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The scores were far below that bar:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;SLN ~= 0.28
NLC ~= 0.23
liposomal gel ~= 0.26
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every candidate was rejected in under two hours, against an estimated months of bench work.&lt;/p&gt;
&lt;p&gt;But because SR9 is advisory, we do not know whether these values reflect real formulation incompatibility or an over-conservative false reject. A fast negative is useful only if it is correct.&lt;/p&gt;
&lt;h4 id=&quot;failure-2b-when-the-models-themselves-disagree&quot;&gt;Failure 2b: When the Models Themselves Disagree&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=12823905526682961878&quot; alt=&quot;7&quot;&gt;&lt;/p&gt;
&lt;p&gt;EXP-031 tested a 52-amino-acid target across AlphaFold2, AlphaFold3, Chai-1, and Boltz-2.&lt;/p&gt;
&lt;p&gt;They did not converge. pTM stayed low:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;AF2 pTM ~= 0.31
AF3 pTM ~= 0.40
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The inter-model consensus drifted by &lt;code&gt;0.09&lt;/code&gt; to &lt;code&gt;0.37&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The honest outcome was not a number. It was a refusal: the pipeline returned Unverified / Drift Detected and an observer-only decision for every arm.&lt;/p&gt;
&lt;p&gt;The ledger's job was to refuse to launder that disagreement into a result.&lt;/p&gt;
&lt;h4 id=&quot;failure-3-the-multiplicative-reliability-fallacy&quot;&gt;Failure 3: The Multiplicative Reliability Fallacy&lt;/h4&gt;
&lt;p&gt;The BAV pipeline originally modeled end-to-end reliability as a multiplicative chain:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;p_e2e = p_capture * p_transfer * p_model * p_clinical
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These factors are not independent. Clinical reliability depends on model reliability, which depends on transfer and capture quality.&lt;/p&gt;
&lt;p&gt;The correct direction is conditional:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;p_e2e =
  p(clinical | model)
  * p(model | transfer)
  * p(transfer | capture)
  * p(capture)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We have not implemented this yet. Every reliability figure in the BAV lane carries this constraint.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;from-experiments-to-public-custody-paths&quot;&gt;From Experiments to Public Custody Paths&lt;/h3&gt;
&lt;p&gt;Before this infrastructure existed, experiments ended as local folders, private notes, or claims that required too much explanation. Now a weekly experiment can become a public record: a bounded run, score, report, artifact path, and failure note.&lt;/p&gt;
&lt;p&gt;We do not see this as a replacement for peer review. We see it as the layer before peer review: the place where claims become inspectable, failures remain visible, and weekly experiments accumulate.&lt;/p&gt;
&lt;p&gt;We also avoid claiming false determinism. Fold outputs vary with seed, GPU architecture, MSA depth, and compiler version. In EXP-031, we anchor the input FASTA, pin the seed and model versions, and record confidence metrics as a labelled reference run. The goal is regime-level comparison, not bit-exact reproduction.&lt;/p&gt;
&lt;p&gt;The detailed repository tree is omitted here for space; the public ledger exposes the custody paths directly.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;mica-and-the-ci-sanitizer-gate&quot;&gt;MICA and the CI Sanitizer Gate&lt;/h3&gt;
&lt;p&gt;Two layers keep the ledger honest before publication.&lt;/p&gt;
&lt;p&gt;MICA, Memory Invocation &amp;amp; Context Archive for AI, is the governance memory. It encodes project invariants: internal metrics carry no external authority, fabricated data is prohibited, and public claims stay understated.&lt;/p&gt;
&lt;p&gt;The sanitizer is the enforcement layer. It runs as a CI gate and fails the build when it finds workspace leaks, local-specific PII patterns, promotional language, or fabrication tags.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;synthetic_marker&lt;/code&gt; detector was added after Failure 0. The &lt;code&gt;promotional_language&lt;/code&gt; detector flags public-facing hype such as &quot;revolutionary,&quot; &quot;state-of-the-art,&quot; or &quot;authoritative.&quot;&lt;/p&gt;
&lt;p&gt;The result is a repository that censors its own hype, leaks, and fabrications before publication — and keeps an auditable record of doing so.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;dashboard-heuristics-labelled-as-heuristics&quot;&gt;Dashboard Heuristics: Labelled As Heuristics&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=13207336213495235331&quot; alt=&quot;8&quot;&gt;&lt;/p&gt;
&lt;p&gt;The dashboard plots EQA metrics against an exponential curve.&lt;/p&gt;
&lt;p&gt;Status: &lt;code&gt;ADVISORY-HEURISTIC&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This curve is not a physical law. It is an empirical visual fitting heuristic for charting. Treating it as fundamental law would violate the ledger's credibility rules.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Omega(norm_R_F) = Omega_0 * exp(-lambda * norm_R_F) + epsilon_numerical
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-we-need-others-to-test&quot;&gt;What We Need Others to Test&lt;/h3&gt;
&lt;p&gt;The ledger is not finished. It is a public audit brief.&lt;/p&gt;
&lt;p&gt;We need formulation scientists to test whether EXP-005 reflects real carrier incompatibility or an over-conservative false reject.&lt;/p&gt;
&lt;p&gt;We need structural biologists to test whether EXP-031 reflects genuine out-of-distribution behavior or a harness artifact.&lt;/p&gt;
&lt;p&gt;We need string theorists to test whether TOE-TEST-0001 is physically correct in the Ricci-flat regimes where we claim results.&lt;/p&gt;
&lt;p&gt;We need compliance experts to test whether the zero-execution Article 12 mapping in BSC is legally defensible or technically approximate.&lt;/p&gt;
&lt;p&gt;All code, schemas, and run payloads: Zenodo DOI &lt;code&gt;10.5281/zenodo.20483364&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Public Ledger: &lt;a rel=&quot;nofollow&quot; href=&quot;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&quot;&gt;https://flamehaven01.github.io/Flamehaven-Verification-Ledger/&lt;/a&gt;&lt;br&gt;
Citation ORCID: &lt;code&gt;0009-0009-2641-4280&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;epilogue-the-invitation&quot;&gt;Epilogue: The Invitation&lt;/h3&gt;
&lt;p&gt;We began by trying to reach the unreachable: spacetime geometries, novel small-molecule bindings, a Theory of Everything.&lt;/p&gt;
&lt;p&gt;We did not get there. This ledger is not that.&lt;/p&gt;
&lt;p&gt;What we found instead was smaller and more useful: a way to make a claim show the path by which it came to exist.&lt;/p&gt;
&lt;p&gt;As AI fills every field with fluent, confident, publication-shaped output, the quiet casualty is the experiment itself: the runnable artifact, the failed run nobody deleted, the number traced back to code.&lt;/p&gt;
&lt;p&gt;We are not announcing a solution. We are publishing a small, inspectable surface — failures included — and handing it to the people best equipped to break it.&lt;/p&gt;
&lt;p&gt;If it proves useful against the confident noise filling everyone's feeds, that will be your verdict, not our claim.&lt;/p&gt;
&lt;p&gt;We built this to learn from you.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/19525/we-built-ai-verification-infrastructure-then-it-found-our-blind-spots</guid>
<pubDate>Tue, 02 Jun 2026 17:44:46 +0000</pubDate>
</item>
<item>
<title>Using Math in Programming Beautifully: Drawing with Turtle</title>
<link>https://coderlegion.com/13283/using-math-in-programming-beautifully-drawing-with-turtle</link>
<description>&lt;h2 id=&quot;using-math-in-programming-beautifully-drawing-with-turtle&quot;&gt;Using Math in Programming Beautifully: Drawing with Turtle&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&quot;Programming is not just a skill; it is an art. And math is its brush.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Programming becomes truly beautiful when math guides your code. With Python’s &lt;code&gt;turtle&lt;/code&gt; module, you can &lt;strong&gt;turn numbers and formulas into living art&lt;/strong&gt;, making math visible, interactive, and mesmerizing.&lt;/p&gt;
&lt;h3 id=&quot;1-patterns-with-loops&quot;&gt;1. Patterns with Loops&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&quot;Recognize the rhythm in numbers, and you will find rhythm in code.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Loops and math are perfect partners. For example, let’s draw a simple spiral:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import turtle

t = turtle.Turtle()
t.speed(0)

for i in range(100):
    t.forward(i * 2)
    t.right(45)

turtle.done()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The combination of a growing forward step and rotation creates a &lt;strong&gt;mathematical spiral&lt;/strong&gt;—a visual echo of Fibonacci-like growth.&lt;/p&gt;
&lt;h3 id=&quot;2-geometry-comes-alive&quot;&gt;2. Geometry Comes Alive&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&quot;Lines, curves, and shapes are as much math as they are poetry.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Math lets us transform equations into visual art. For instance, using angles and loops:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import turtle
import math

t = turtle.Turtle()
t.speed(0)

for i in range(360):
    x = 100 * math.sin(math.radians(i))
    y = 100 * math.cos(math.radians(i))
    t.goto(x, y)

turtle.done()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Suddenly, a simple sine and cosine function becomes a perfect circle—a pure &lt;strong&gt;mathematical shape made visible&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;3-fractals-math-in-nature&quot;&gt;3. Fractals: Math in Nature&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&quot;Every algorithm is a story, written with variables, loops, and functions.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Fractals are a stunning example of recursion and math:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import turtle

t = turtle.Turtle()
t.speed(0)
t.left(90)

def tree(branch_len):
    if branch_len &amp;gt; 5:
        t.forward(branch_len)
        t.left(30)
        tree(branch_len - 15)
        t.right(60)
        tree(branch_len - 15)
        t.left(30)
        t.backward(branch_len)

tree(100)
turtle.done()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each branch splits recursively, creating a &lt;strong&gt;mathematical tree&lt;/strong&gt;, full of natural elegance.&lt;/p&gt;
&lt;h3 id=&quot;4-controlled-randomness&quot;&gt;4. Controlled Randomness&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&quot;When uncertainty enters, math becomes your compass.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Math also controls randomness to create generative art:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import turtle
import random

t = turtle.Turtle()
t.speed(0)

colors = [&quot;red&quot;, &quot;blue&quot;, &quot;green&quot;, &quot;purple&quot;, &quot;orange&quot;]

for _ in range(50):
    t.color(random.choice(colors))
    t.penup()
    t.goto(random.randint(-200, 200), random.randint(-200, 200))
    t.pendown()
    t.circle(random.randint(10, 50))

turtle.done()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, probability and random numbers generate &lt;strong&gt;unique, colorful patterns&lt;/strong&gt; every time.&lt;/p&gt;
&lt;h3 id=&quot;5-elegance-is-key&quot;&gt;5. Elegance is Key&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&quot;Elegance in code is the silent poetry of mathematics.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;turtle&lt;/code&gt;, the beauty isn’t just in the result—it’s in the &lt;strong&gt;logic and math behind it&lt;/strong&gt;. Each loop, angle, and function is like a brushstroke, producing art from numbers.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;final-thought&quot;&gt;Final Thought&lt;/h4&gt;
&lt;p&gt;Programming isn’t just solving problems—it’s &lt;strong&gt;painting with math&lt;/strong&gt;. Turtle makes the invisible visible. Every function, formula, and loop is an opportunity to create beauty.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&quot;To program without math is to paint without colors.&quot;&lt;/em&gt; — &lt;em&gt;Programming as an Art&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/13283/using-math-in-programming-beautifully-drawing-with-turtle</guid>
<pubDate>Sat, 21 Mar 2026 12:46:08 +0000</pubDate>
</item>
<item>
<title>Key Math Concepts in Data Structures and Algorithms</title>
<link>https://coderlegion.com/12467/key-math-concepts-in-data-structures-and-algorithms</link>
<description>&lt;p&gt;At the core of data structures and algorithms are fundamental mathematical principles that guide their design and implementation. This article explores key math concepts essential for mastering data structures and algorithms, helping developers write optimized and effective code.&lt;/p&gt;
&lt;h3 id=&quot;number-systems&quot;&gt;Number Systems&lt;/h3&gt;
&lt;p&gt;A &lt;strong&gt;number system&lt;/strong&gt; is a structured way of representing numbers using specific symbols and rules. Different number systems are based on different &lt;strong&gt;base values&lt;/strong&gt; (also called the &lt;em&gt;radix&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;We are most familiar with the &lt;strong&gt;decimal number system&lt;/strong&gt;, which is used in everyday life. It uses ten digits (&lt;strong&gt;0 through 9&lt;/strong&gt;) to represent all numbers. Because it uses ten distinct digits, its base is &lt;strong&gt;10&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Computers, however, operate using only two digits: &lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;. Therefore, they use the &lt;strong&gt;binary number system&lt;/strong&gt;, which has a base of &lt;strong&gt;2&lt;/strong&gt;. All data inside a computer is ultimately stored and processed in binary form.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;octal number system&lt;/strong&gt; uses eight digits (&lt;strong&gt;0 to 7&lt;/strong&gt;) so its base is &lt;strong&gt;8&lt;/strong&gt;. It is used as a more compact way to represent binary numbers, since each octal digit corresponds to a group of &lt;strong&gt;three binary digits (bits)&lt;/strong&gt;. Octal is still used in certain areas of computing, such as &lt;strong&gt;file permissions in Unix and Linux systems&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;hexadecimal number system&lt;/strong&gt; uses sixteen symbols: the digits &lt;strong&gt;0–9&lt;/strong&gt; and the letters &lt;strong&gt;A–F&lt;/strong&gt;. Because it has sixteen symbols, its base is &lt;strong&gt;16&lt;/strong&gt;. Each hexadecimal digit corresponds to a group of &lt;strong&gt;four binary digits&lt;/strong&gt;, making it a convenient way to represent memory addresses, machine code, and other low-level data in computers.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The &lt;strong&gt;octal number system&lt;/strong&gt; has a base of 8, which means it uses eight symbols: 0 to 7.&lt;br&gt;
Since &lt;strong&gt;8 = 2³&lt;/strong&gt;, each octal digit can represent exactly &lt;strong&gt;three binary digits (bits)&lt;/strong&gt;. Same goes for hexadecimal number system.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can learn how to convert between these number systems from &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.geeksforgeeks.org/digital-logic/number-system-and-base-conversions/&quot;&gt;this detailed article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, let’s talk about the binary number system. We are familiar with representing positive numbers using unsigned binary. But how do we represent negative numbers? For this, we use the &lt;strong&gt;two’s complement method&lt;/strong&gt;, which is the standard way to represent signed binary numbers.&lt;/p&gt;
&lt;h4 id=&quot;two-s-complement-method&quot;&gt;Two's complement method&lt;/h4&gt;
&lt;p&gt;Negative of any decimal number is mathematically found by subtracting that number from 0. The same applies to the binary number system. In the signed binary number system, the &lt;strong&gt;most significant bit&lt;/strong&gt; (the leftmost bit) indicates the sign of the number.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;See the image below if you are not familiar with the most and least significant bits in the binary representation of a number:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/res/hashnode/image/upload/v1771301336808/840ccc91-fd56-4047-9041-e1c5f1ed2bab.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let’s take the example of decimal 7 whose binary representation is 0111. Its binary number system is stored in 4 bits. Zero can be represented as 0000 (in 4 bits). In 4-bit representation, if a fifth bit is present in the leftmost position, it is discarded due to lack of space. So, we can represent zero as &lt;strong&gt;1&lt;/strong&gt;&lt;em&gt;0000&lt;/em&gt; (the bit 1 will be discarded). Now, &lt;strong&gt;10000&lt;/strong&gt; can be written as the sum of &lt;strong&gt;1111&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;. We can then proceed as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/res/hashnode/image/upload/v1771291657535/9ea48090-ea1d-4a5b-9ff1-fb0d1c51638f.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Essentially, &lt;strong&gt;the negative of a binary number will be its complement added to 1&lt;/strong&gt;. This method is called as the &lt;a rel=&quot;nofollow&quot; href=&quot;https://en.wikipedia.org/wiki/Two%27s_complement&quot;&gt;two’s complement method&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;bitwise-operators&quot;&gt;Bitwise Operators&lt;/h3&gt;
&lt;p&gt;In the decimal number system, we use arithmetic operators like +, -, *, and / to perform mathematical operations. In computing, numbers are represented in binary, and in addition to arithmetic operators, we also use bitwise operators like &amp;amp;, |, ^, ~, &amp;gt;&amp;gt;, and &amp;lt;&amp;lt; to manipulate individual bits. Let’s discuss each of these operators.&lt;/p&gt;
&lt;h4 id=&quot;and-operator-amp-&quot;&gt;AND Operator (&amp;amp;)&lt;/h4&gt;
&lt;p&gt;This operator performs bit-by-bit AND operation on two values. This means that for each bit in the operands, the resulting bit is set to 1 only if both corresponding bits in the operands are 1; otherwise, it is set to 0.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observation:&lt;/strong&gt; The AND operation of any number with 1 gives the &lt;strong&gt;least significant bit&lt;/strong&gt; (LSB) of that number.&lt;br&gt;
&lt;em&gt;Example&lt;/em&gt;: 5 &amp;amp; 1 results in 1 because 101 &amp;amp; 001 gives its LSB, which is 1.&lt;/p&gt;
&lt;h4 id=&quot;or-operator-&quot;&gt;OR Operator (|)&lt;/h4&gt;
&lt;p&gt;This operator performs a bitwise OR operation between two operands, setting each resulting bit to 1 if at least one of the corresponding bits in the operands is 1; otherwise, it is set to 0.&lt;/p&gt;
&lt;h4 id=&quot;xor-operator-&quot;&gt;XOR Operator (^)&lt;/h4&gt;
&lt;p&gt;XOR stands for &lt;strong&gt;exclusive OR&lt;/strong&gt;. This operator performs a bitwise comparison between two operands, setting each resulting bit to 1 if the corresponding bits in the operands are different; otherwise, it is set to 0.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observations:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The XOR operation on any number with 1, results in a number where the &lt;strong&gt;least significant bit&lt;/strong&gt; (LSB) is flipped.&lt;br&gt;
&lt;em&gt;Example&lt;/em&gt;: 3 ^ 1 results in 2 because 11 ^ 01 changes the LSB to 0 in this case.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The XOR operation on any number with 0 results in the same number.&lt;br&gt;
&lt;em&gt;Example&lt;/em&gt;: 4 ^ 0 results in 4 because 100 ^ 000 gives 100, which is 4.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The XOR operation on any number with itself results in 0 because there are no differing bits.&lt;br&gt;
&lt;em&gt;Example&lt;/em&gt;: 5 ^ 5 results in 0 because 101 ^ 101 gives 0 as there are no bits that differ.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;complement-operator-&quot;&gt;Complement Operator (~)&lt;/h4&gt;
&lt;p&gt;The complement operator gives the bitwise inverse of a number, flipping each bit from 0 to 1 and from 1 to 0.&lt;/p&gt;
&lt;h4 id=&quot;left-shift-operator-lt-lt-&quot;&gt;Left Shift Operator (&amp;lt;&amp;lt;)&lt;/h4&gt;
&lt;p&gt;The left shift operator is a bitwise operator that shifts the bits of a number to the left by a specified number of positions. &lt;em&gt;Example&lt;/em&gt;: 5 &amp;lt;&amp;lt; 1 gives 10 because shifting the bits of 5 (which is 101 in binary) one position to the left results in 1010, which is 10 in decimal. If we shift twice (5 &amp;lt;&amp;lt; 2), we will get 20 because shifting the bits of 5 (which is 101 in binary) two positions to the left results in 10100, which is 20 in decimal. Therefore, each left shift operation effectively multiplies the number by 2 for each position shifted. In general, if the number is shifted k times, it is multiplied by 2^k.&lt;/p&gt;
&lt;h4 id=&quot;right-shift-operator-gt-gt-&quot;&gt;Right Shift Operator (&amp;gt;&amp;gt;)&lt;/h4&gt;
&lt;p&gt;The right shift operator is a bitwise operator that shifts the bits of a number to the right by a specified number of positions. &lt;em&gt;Example&lt;/em&gt;: 8 &amp;gt;&amp;gt; 1 gives 4 because shifting the bits of 8 (which is 1000 in binary) one position to the right results in 0100, which is 4 in decimal. If we shift twice (8 &amp;gt;&amp;gt; 2), we would get 2 because shifting the bits of 8 (which is 1000 in binary) two positions to the right results in 0010, which is 2 in decimal. Therefore, each right shift operation effectively divides the number by 2 for each position shifted. In general, if the number is shifted k times, it is divided by 2^k.&lt;/p&gt;
&lt;h3 id=&quot;core-number-theory&quot;&gt;Core Number Theory&lt;/h3&gt;
&lt;h4 id=&quot;prime-number&quot;&gt;Prime Number&lt;/h4&gt;
&lt;p&gt;A prime number is a natural number greater than 1 with exactly two positive divisors: 1 and itself. To determine if a number is prime, we typically check divisibility from &lt;strong&gt;2&lt;/strong&gt; up to &lt;strong&gt;n−1&lt;/strong&gt; since it is always divisible by 1 and itself.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;int n = 24;
boolean isPrime = true;
for (int i = 2; i &amp;lt; n; i++) {
    if (n % i == 0) {
        isPrime = false;
        break;
    }
}
if (isPrime) {
    System.out.println(&quot;Prime&quot;);
} else {
    System.out.println(&quot;Not prime&quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above algorithm makes a maximum of &lt;strong&gt;n - 2&lt;/strong&gt; (2 to n-1) checks. So, its time complexity is &lt;strong&gt;O(N)&lt;/strong&gt;. Let's see if we can optimise it. If we closely examine the factors of any number, they appear in pairs (one smaller and one larger). Mathematically, we can say that for every divisor d &amp;gt; √n (&lt;em&gt;like d = 6&lt;/em&gt;), there exists a corresponding divisor \(\frac {n} {d} &amp;lt; \sqrt n\) (&lt;em&gt;like 4&lt;/em&gt;). Therefore, checking beyond √n is redundant.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/628869289490454c4d8475de/ae7349e0-0bcf-4d9b-9578-24ffed628d95.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If we look into the above possible pairs of factors of 24, we can see that we're checking divisibility of each pair twice. It is sufficient to check divisibility only up to &lt;strong&gt;√n&lt;/strong&gt; since √24 ≈ 4.89, checking up to 4 is enough. Hence, we can reduce the number of computations from the order of &lt;strong&gt;N&lt;/strong&gt; to &lt;strong&gt;√N&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;int n = 24;
boolean isPrime = true;
for (int i = 2; i * i &amp;lt;= n; i++) {
    if (n % i == 0) {
        isPrime = false;
        break;
    }
}
if (isPrime) {
    System.out.println(&quot;Prime&quot;);
} else {
    System.out.println(&quot;Not prime&quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The time complexity of this algorithm is now &lt;strong&gt;O(√N)&lt;/strong&gt;.&lt;/p&gt;
&lt;h4 id=&quot;prime-numbers-in-range&quot;&gt;Prime Numbers in Range&lt;/h4&gt;
&lt;p&gt;Let's say we need to find prime numbers between two certain numbers. The simplest idea would be to check if &lt;strong&gt;each of the numbers&lt;/strong&gt; between them is &lt;strong&gt;prime&lt;/strong&gt; or not.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;public class Main {
    public static void main(String[] args) {
        int n = 50;
        displayAllPrimes(n);
    }
    
    public static void displayAllPrimes(int n){
        for (int i = 2; i &amp;lt;= n; i++) {
            if (isPrime(i)) {
                System.out.print(i + &quot; &quot;);
            }
        }
    }
    
    public static boolean isPrime(int n){
        if (n &amp;lt;= 1) return false;
        for (int i = 2; i * i &amp;lt;= n; i++) {
            if (n % i == 0) return false;
        }
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above program, the &lt;code&gt;isPrime()&lt;/code&gt; method takes &lt;strong&gt;O(√N)&lt;/strong&gt; to check whether a certain number is prime. The &lt;code&gt;displayAllPrimes()&lt;/code&gt; method calls the &lt;code&gt;isPrime()&lt;/code&gt; method approximately &lt;strong&gt;N times&lt;/strong&gt;. So, the time complexity of the entire algorithm is &lt;strong&gt;O(N√N)&lt;/strong&gt;. If we carefully observe the numbers we're checking for prime, we'll notice that there are a number of redundant checks. For example, if we already know that 2 is a prime number then its multiples won't be prime.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/f43c11cb-83c2-478f-b55b-3871011ccbd8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Similarly for the rest of the numbers, the below image shows the multiples of smaller prime numbers we've checked earlier.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/1b7fa69e-cee6-478c-9a2d-72a868e04a6d.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The unmarked numbers turn out to be the &lt;strong&gt;prime numbers&lt;/strong&gt; we're finding in that &lt;strong&gt;range of 2 to 50&lt;/strong&gt;. This is known as the &lt;strong&gt;Sieve of Eratosthenes&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;public class Sieve {
    public static void main(String[] args) {
        int n = 50;
        boolean[] isComposites = new boolean[n+1]; // size is n+1 to include n 
        sieve(n, isComposites);
    }

    public static void sieve(int n, boolean[] isComposite){
        for (int i = 2; i * i &amp;lt;= n; i++) {
            if (!isComposite[i]) {
                for (int j = 2 * i; j &amp;lt;= n; j += i) {
                    isComposite[j] = true;
                }
            }
        }

        for (int i = 2; i &amp;lt;= n; i++) {
            if (!isComposite[i]) {
                System.out.print(i + &quot; &quot;);
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the program above, we check for multiples up to &lt;strong&gt;√N&lt;/strong&gt; because large numbers can be factored using smaller numbers' multiples. The number of times the inner loop (the loop responsible for marking the composite numbers) runs for each prime number &lt;strong&gt;P&lt;/strong&gt; is \(\frac {N} {P}\). Therefore, total number of times the inner loop runs will be:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/3754f281-3094-4dc8-87e1-3ca516c17243.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Hence, the time complexity of this algorithm is &lt;strong&gt;O(N loglog(N))&lt;/strong&gt;.&lt;/p&gt;
&lt;h4 id=&quot;newton-raphson-method&quot;&gt;Newton Raphson Method&lt;/h4&gt;
&lt;p&gt;The Newton Raphson method is an iterative method of finding better approximations to the roots of a real-valued function. The best linear approximation to any differential function near the point \(x = x_i\) will be its tangent with the equation:&lt;br&gt;
&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=14937683237160031269&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;where x_i is the ith iterative approximation of root&lt;/p&gt;
&lt;p&gt;The root of the tangent equation will be the next iterative approximation x_{i+1} when it intercepts the x-axis (y = 0).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/4a8807a9-24dc-421e-807a-48137df931df.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now, if we want to find the square root of any number (say &lt;strong&gt;n&lt;/strong&gt;), we can take f(x) = x² - n. The root of that equation will give us the closest approximation of &lt;strong&gt;√n&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/28ed9672-f7a3-4498-96c2-71be6864d2ec.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;You can view &lt;a rel=&quot;nofollow&quot; href=&quot;https://upload.wikimedia.org/wikipedia/commons/e/e0/NewtonIteration_Ani.gif&quot;&gt;this animated image from Wikipedia&lt;/a&gt;, which visually demonstrates all the iteration of approximated roots of f(x).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let's try to write a program for finding the approximate square root of any number.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;public class NewtonRaphsonSqrt {
    public static void main(String[] args) {
        System.out.println(sqrt(43));
    }

    public static double sqrt(double n) {
        double x = n;
        double root;
        while (true) {
            root = 0.5 * (x + (n/x));

            if (Math.abs(root - x) &amp;lt; 0.5) { // Error threshold, can be adjusted for more precision
                break;
            }
            x = root;
        }
        return root;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reducing the error threshold, currently set at 0.5, will result in a more accurate approximation of the square root.&lt;/p&gt;
&lt;h4 id=&quot;modular-arithmetic&quot;&gt;Modular Arithmetic&lt;/h4&gt;
&lt;p&gt;It is a system of arithmetic operations for integers where the numbers &quot;&lt;em&gt;wrap around&lt;/em&gt;&quot; when exceeding a certain number called as the &lt;strong&gt;modulus&lt;/strong&gt;. For a given integer m ≥ 1, it is called a modulus if the difference of two integers &lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;b&lt;/strong&gt; (&lt;em&gt;a - b&lt;/em&gt;) is an integer multiple of &lt;strong&gt;m&lt;/strong&gt; i.e. a - b = k*m (where k is an integer). The integers &lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;b&lt;/strong&gt; are said to be congruent modulo m and is mathematically denoted by &lt;strong&gt;a ≡ b (mod m)&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The parentheses mean that (mod &lt;em&gt;m&lt;/em&gt;) applies to the entire equation, not just to the right-hand side (here, &lt;em&gt;b&lt;/em&gt;). In particular, &lt;strong&gt;(&lt;em&gt;a&lt;/em&gt; mod &lt;em&gt;m&lt;/em&gt;) = (&lt;em&gt;b&lt;/em&gt; mod &lt;em&gt;m&lt;/em&gt;)&lt;/strong&gt; is equivalent to &lt;strong&gt;&lt;em&gt;a&lt;/em&gt; ≡ &lt;em&gt;b&lt;/em&gt; (mod &lt;em&gt;m&lt;/em&gt;)&lt;/strong&gt;, and this explains why &quot;=&quot; is often used instead of &quot;≡&quot; in this context.&lt;/p&gt;
&lt;p&gt;The congruence relation is written as *&lt;em&gt;a = b + k\&lt;/em&gt;m**.&lt;/p&gt;
&lt;p&gt;Source: &lt;a rel=&quot;nofollow&quot; href=&quot;https://en.wikipedia.org/wiki/Modular_arithmetic#Congruence&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In programming, we don’t write congruences directly. Instead, we use the &lt;code&gt;%&lt;/code&gt; operator, which computes the remainder. The &lt;code&gt;%&lt;/code&gt; operator is the practical realization of the congruence relation. For example:  ≡  (mod m) ⇔ (a % m) == (b % m) in code.&lt;/p&gt;
&lt;p&gt;The range of (&lt;strong&gt;a % m&lt;/strong&gt;) is always in the range (&lt;strong&gt;\[0, m-1\]&lt;/strong&gt;) when (m &amp;gt; 0). This ensures the remainder is non-negative, which is crucial for consistent modular arithmetic in programming.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Properties:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Addition Property:&lt;/strong&gt; When adding two numbers, their remainders modulo (m) add up, but if the sum exceeds (m), subtracting (m) (i.e., taking modulo again) brings it back within the valid range.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subtraction Property:&lt;/strong&gt; Subtraction can lead to negative results, so adding (m) before taking modulo ensures the result stays within (&lt;strong&gt;\[0, m-1\]&lt;/strong&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multiplication Property:&lt;/strong&gt; Multiplying the remainders and then taking modulo keeps the product within the modular system, preserving equivalence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Division Property:&lt;/strong&gt; Division is not straightforward in modular arithmetic. For division by (b) modulo (m) to be valid, (b) must have a modular inverse modulo (m), which exists only if gcd(b, m) = 1.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=16810238809413296304&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Modular multiplicative inverse of an integer b is the solution (which exists only when b and m are coprime) of the equation: ax ≡ 1 (mod m).&lt;/p&gt;
&lt;h4 id=&quot;b-zout-s-identity&quot;&gt;&lt;strong&gt;Bézout's Identity&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;It is a theorem which related two arbitrary integers with their greatest common divisor (GCD). Mathematically,&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/628869289490454c4d8475de/cbd13049-1d9e-49c5-95be-ae193c53ec55.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;where, x and y are integers.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;gcd(a, b) = d&lt;/code&gt;, then every integer linear combination &lt;code&gt;ax + by&lt;/code&gt; is a multiple of d.&lt;/p&gt;
&lt;p&gt;For example, if a = 3 and b = 16, then 3*(-5) + 16*1 = 1 = gcd(3, 16).&lt;br&gt;
Let's take another example: a = 8 and b = 18. Then, 8*(-2) + 18*1 = 2 = gcd(8, 18).&lt;/p&gt;
&lt;p&gt;The coefficients x and y can be found using the Extended Euclidean algorithm and the gcd can be calculated using the Euclidean algorithm.&lt;/p&gt;
&lt;h4 id=&quot;euclidean-algorithm&quot;&gt;Euclidean Algorithm&lt;/h4&gt;
&lt;p&gt;The Euclidean Algorithm is one of the oldest and most efficient methods to compute the greatest common divisor (GCD) of two integers. Since Bézout’s identity relies on the GCD, understanding this algorithm is essential. It's based on the principle that if&lt;/p&gt;
&lt;p&gt;Effectively, a is reduced by multiples of b until only the remainder is left. Therefore, gcd(a, b) = gcd(b, a % b).&lt;/p&gt;
&lt;p&gt;Let’s compute &lt;strong&gt;gcd(514, 106)&lt;/strong&gt; using the Euclidean Algorithm.&lt;/p&gt;
&lt;p&gt;We start by dividing the larger number by the smaller one and continue replacing the pair with (b, a % b) until the remainder becomes zero:&lt;/p&gt;
&lt;p&gt;514 = 106*4 + 90 → gcd(514, 106) = gcd(106, 90) &lt;br&gt;
106 = 90*1 + 16 → gcd(106, 90) = gcd(90, 16) &lt;br&gt;
90 = 16*5 + 10 → gcd(90, 16) = gcd(16, 10) &lt;br&gt;
16 = 10*1 + 6 → gcd(16,10) = gcd(10, 6) &lt;br&gt;
10 = 6*1 + 4 → gcd(10, 6) = gcd(6, 4) &lt;br&gt;
6 = 4*1 + 2 → gcd(6, 4) = gcd(4, 2) &lt;br&gt;
4 = 2*2 + 0 → gcd(4, 2) = 2 &lt;/p&gt;
&lt;p&gt;Therefore, gcd(514, 106) = 2.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;public static int gcd(int a, int b) {
    if (a == 0) {
        return b;
    }
    return gcd(b % a, a);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also calculate the LCM of two numbers using their GCD with the formula:&lt;br&gt;
\[\text{LCM}(a, b) = \frac{|a \times b|}{\text{GCD}(a, b)}\]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;public static int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;extended-euclidean-algorithm&quot;&gt;Extended Euclidean Algorithm&lt;/h4&gt;
&lt;p&gt;This algorithm is an extension of the Euclidean Algorithm which computes the coefficients of the Bézout's identity. We start with the gcd of the two numbers and eventually represent that as a linear combination of those two numbers.&lt;/p&gt;
&lt;p&gt;For example, we have found &lt;strong&gt;gcd(514, 106) = 2&lt;/strong&gt;. We start with the last non-zero remainder step: 6 = 4 + 2 ⇒ 2 = 6 - 4.&lt;br&gt;
Then, from previous steps, we can write &lt;strong&gt;6 = 16 - 10&lt;/strong&gt; and &lt;strong&gt;4 = 10 - 6&lt;/strong&gt;. We'll back-substitute them in the above equation.&lt;br&gt;
∴ 2 = (16-10) - (10 - 6) = 16 - 2*10 + 6 = 16 - 2*10 + (16 - 10) = 2*16 - 3*10&lt;br&gt;
∴ 2 = 2*16 - 3*(90 - 16*5) = 17*16 - 3*90 &lt;br&gt;
∴ 2 = 17*(106 - 90) - 3*90 = 17*106 - 20*90  &lt;br&gt;
∴ 2 = 17*106 - 20*(514 - 4*106) = (-20)*514 + 97*106&lt;/p&gt;
&lt;p&gt;Hence, (-20)*514 + 97*106 = 2 = gcd(514, 106). So, the coefficients (&lt;strong&gt;Bézout's coefficients&lt;/strong&gt;) of Bézout's identity would be &lt;strong&gt;-20&lt;/strong&gt; and &lt;strong&gt;97&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We can utilise the recursion stack to keep track of the steps performed in Euclidean Algorithm. Below is the code for this algorithm:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;static int gcdExtended(int a, int b, int[] xy) {
    if (a == 0) {
        xy[0] = 0; // x
        xy[1] = 1; // y
        return b;
    }

    int[] temp = new int[2];
    int gcd = gcdExtended(b % a, a, temp);

    // Update x and y using results of recursion
    xy[0] = temp[1] - (b / a) * temp[0];
    xy[1] = temp[0];

    return gcd;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;conclusion-1&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;In this article, we explored fundamental mathematical concepts that are crucial for understanding and implementing data structures and algorithms. We delved into number systems, including binary, octal, and hexadecimal, and discussed how computers represent numbers using the two's complement method for signed integers. We also covered bitwise operators and their applications in manipulating individual bits of data.&lt;/p&gt;
&lt;p&gt;⭐ Check out the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/SaptarshiSarkar12/DSA&quot;&gt;DSA&lt;/a&gt; GitHub repo for more code examples.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/12467/key-math-concepts-in-data-structures-and-algorithms</guid>
<pubDate>Sat, 07 Mar 2026 23:13:34 +0000</pubDate>
</item>
<item>
<title>Kids Maths app - Datalaria</title>
<link>https://coderlegion.com/11044/kids-maths-app-datalaria</link>
<description>&lt;p&gt;Looking for a fun and interactive way to reinforce basic arithmetic for children?&lt;/p&gt;
&lt;p&gt;I built Kids Math Learning Game, a dynamic web application designed to turn math practice into an engaging game for children aged 5 to 7. Created with the help of ChatGPT, this tool proves that you can build functional educational software using just natural language. Key features include:&lt;/p&gt;
&lt;p&gt;4 Fundamental Operations: Comprehensive practice for Addition, Subtraction, Multiplication, and Division.&lt;/p&gt;
&lt;p&gt;Adaptive Difficulty: Features 4 specific learning levels (Infant to Primary) and adjustable digit complexity (1 or 2 digits) to grow with the child.&lt;/p&gt;
&lt;p&gt;Gamified Experience: Keeps users engaged with a 10-second countdown per question, real-time scoring, and motivating instant feedback with emojis.&lt;/p&gt;
&lt;p&gt;AI-Powered Development: The entire logic, structure, and design were generated through iterative ChatGPT prompt engineering.&lt;/p&gt;
&lt;p&gt;Responsive Design: A clean, attractive interface styled with Tailwind CSS that works on any device.&lt;/p&gt;
&lt;p&gt;Built with HTML5, Tailwind CSS, and Vanilla JavaScript with ChatGPT assistance. Lightweight, responsive, and fully self-contained in a single file.&lt;/p&gt;
&lt;p&gt;If you want to know the details about how I built this educational tool using natural language prompts, please read the following article: &lt;a rel=&quot;nofollow&quot; href=&quot;https://datalaria.com/en/posts/founderz-coding-chatgpt/&quot;&gt;Co-piloting with AI: Learning with Founderz and ChatGPT&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Launches</category>
<guid isPermaLink="true">https://coderlegion.com/11044/kids-maths-app-datalaria</guid>
<pubDate>Wed, 04 Feb 2026 06:45:04 +0000</pubDate>
</item>
<item>
<title>Descriptive Analysis - Basics</title>
<link>https://coderlegion.com/9325/descriptive-analysis-basics</link>
<description>&lt;p&gt;As a starting point in data analysis, it is necessary to know some mathematical and statistical foundations in order to work with the information to be analyzed.&lt;/p&gt;
&lt;p&gt;Thus, we will start learning some basic concepts:&lt;/p&gt;
&lt;h3 id=&quot;population-samples-individuals-and-variables-&quot;&gt;Population, Samples, Individuals and Variables:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Population&lt;/strong&gt;: The set of all the elements under study&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sample&lt;/strong&gt;: A subset of elements of the population (it should be  representative of the population)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Individuals&lt;/strong&gt;: Every individual element in the popularion&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variables&lt;/strong&gt;: Characteristics of the individuals&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/population_sample_individuals_variables.png&quot; alt=&quot;Population_Sample_Individuals_Variables&quot;&gt;&lt;/p&gt;
&lt;p&gt;Example: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kaggle.com/c/titanic/data&quot;&gt;Titanic Dataset&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Population: 2.224 individuals&lt;/li&gt;
&lt;li&gt;Samples: files:&lt;ul&gt;
&lt;li&gt;&lt;em&gt;train.csv&lt;/em&gt;: Set of 891 representative individuals of the population used for the training of models of Machine Learning.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;test.csv&lt;/em&gt;: Set of 418 representative individuals of the population used for the testing of models of Machine Learning.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Individuals: Each passenger and crew of the population (every row of the sample or population data collected).&lt;/li&gt;
&lt;li&gt;Variables: The characteristics collected for each individual (every column of the sample or population data, ej.: &lt;em&gt;survival&lt;/em&gt; (survivals), &lt;em&gt;sex&lt;/em&gt; (sex) o &lt;em&gt;Age&lt;/em&gt; (age)).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;types-of-variables&quot;&gt;Types of Variables&lt;/h4&gt;
&lt;p&gt;The variables can be classified depending on the type of data they contain and, more specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Numerical&lt;/strong&gt;: the data is represented by numbers that are metric or measures of said variable. According to their values, these could be classified in:&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Continuous&lt;/strong&gt;: they could take a countless or indeterminate number of values. For example, in the data set of the Titanic example, the variable &lt;em&gt;fare&lt;/em&gt; could be considered a continuous variable by taking different values with up to 4 decimals of precision.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discretes&lt;/strong&gt;: they could take a countable number within a list of values (the data of continuous variables can be truncated to discrete variables for easier analysis). For example, the variable &lt;em&gt;Sibsp&lt;/em&gt; (# of siblings) would be a discrete variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Categorical&lt;/strong&gt;: the data is represented by texts or numbers whose meaning is not a metric, but associated with a specific datum or category. Depending on the relationship between their values, the data would be classified in:&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Nominals&lt;/strong&gt;: data that have no relation or intrinsic order in themselves. An example of this type would be the &lt;em&gt;embarked&lt;/em&gt; variable that represents the port of embarkation of passengers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discretes&lt;/strong&gt;: data with a natural order or classification among themselves. As for example it could be the variable &lt;em&gt;Pclass&lt;/em&gt; that represents the class in the Titanic according to the social status.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note of interest:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;The typology of the variables is not always clear and they could be considered of different types depending on the criteria of each person and the objectives sought. An example could be the representation of age, which could be correctly considered both numerical (continuous or discrete depending on the precision) and ordinal, depending on whether you want to work with formulas to treat age as a continuous value or simply work with specific age ranges according to the relationship of the rest of the variables.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;histograms-and-bar-charts&quot;&gt;Histograms and Bar charts&lt;/h3&gt;
&lt;p&gt;Although I will make a specific post for the data visualization, it is important to briefly mention the histograms and bar graphs. These are two of the most useful representations in the data analysis and help to understand how the data are distributed with respect to a variable or characteristic of the dataset (continuous in the case of histograms and discrete in the case of bar graphs).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Bar chart&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/bar_chart.png&quot; alt=&quot;Bar charts&quot;&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Histogram&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/histogram.png&quot; alt=&quot;Histogram&quot;&gt;&lt;/p&gt;
&lt;p&gt;Thus, significant information about the data distribution can be extracted, classifying it in symmetric or asymmetric, as we will see below.&lt;/p&gt;
&lt;h3 id=&quot;measures-of-descriptive-statistics&quot;&gt;Measures of descriptive statistics&lt;/h3&gt;
&lt;p&gt;A key step when analyzing a dataset is what is called &quot;descriptive statistics&quot;, that is, in describing the data through a series of measures that allow to characterize its distribution and its dispersion.&lt;/p&gt;
&lt;h4 id=&quot;measures-of-central-tendency&quot;&gt;Measures of central tendency&lt;/h4&gt;
&lt;p&gt;The measures of central tendency serve to give us an idea of the distribution of our data.&lt;/p&gt;
&lt;h5 id=&quot;arithmetic-mean-average-&quot;&gt;Arithmetic Mean (Average)&lt;/h5&gt;
&lt;p&gt;This measure seeks to obtain the average value of a dataset. That is, all the values in the dataset are summed and divided by the total number of values in that data.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Population mean&lt;/strong&gt;:&lt;br&gt;
\[\mu = \frac{1}{N}\displaystyle\sum_{i=1}^Nx_i\]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sample mean&lt;/strong&gt;:&lt;br&gt;
\[\bar x = \frac{1}{n}\displaystyle\sum_{i=1}^Nx_i\]&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Being &lt;em&gt;N&lt;/em&gt; the total of values in the population and &lt;em&gt;n&lt;/em&gt; the total of values in the sample.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
If we have the following set of 5 data: [1, 2, 2, 5, 10], the average or mean of these values is their sum (20) divided by the total of data (5), that is, the average or mean is 4.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following up on our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its average or mean:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/average.png&quot; alt=&quot;Average&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;median&quot;&gt;Median&lt;/h5&gt;
&lt;p&gt;This measure represents the middle value in the dataset. That is, for its calculation, we take the data point in the middle of all the dataset x&lt;sub&gt;m&lt;/sub&gt;:&lt;/p&gt;
&lt;p&gt;\[\displaystyle x_{m} = x (\frac{n+1}{2})\]&lt;/p&gt;
&lt;p&gt;The median, due to its dependence on the position of the values and not on their values, is less dependent on extreme values (outliers) than the arithmetic mean. That is why in many common statistics (for example, the average salary of the population) it would be more convenient to use the median instead of the average to avoid the presence of very high values that could misalign or mislead the analysis.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
If we have the following set of 5 data: [1, 2, 2, 5, 10], the median of these values is the data n the middle of the dataset. That is, the value in the third position, the number 2.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following up on our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its median:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/median.png&quot; alt=&quot;Mediana&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;mode&quot;&gt;Mode&lt;/h5&gt;
&lt;p&gt;The mode in statistics represents the most frequently accruing value in the dataset.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the mode is the most repeated value, that is 2.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its mode:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/mode.png&quot; alt=&quot;Moda&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;analysis-of-central-tendency&quot;&gt;Analysis of central tendency&lt;/h4&gt;
&lt;p&gt;As the examples show, first conclusions can be drawn regarding the distribution of the analyzed variable and its most representative values. Therefore, and comparing these values, we can characterize the distribution of a variable to be symmetric (those cases where the mean, median and mode are similar), or to be positive asymmetric (more values are below the mean and in that case the mean is greater than the median and this greater than the mode) or negative asymmetric (more values are above the mean and the mean is lower than the median and this lower than the mode).&lt;/p&gt;
&lt;p&gt;As we have seen in our example of the Titanic and the Age of its passengers we have a certain positive asymmetry (Mean = 29.69 &amp;gt; Median = 28 &amp;gt; Mode = 24) which indicates that there were more people below 29.69 years that above.&lt;/p&gt;
&lt;h4 id=&quot;meaures-of-variability&quot;&gt;Meaures of variability&lt;/h4&gt;
&lt;p&gt;The measures of variability serve to give us an idea about how spread apart the data values are.&lt;/p&gt;
&lt;h5 id=&quot;range&quot;&gt;Range&lt;/h5&gt;
&lt;p&gt;The range is simply a way to express full distribution of the data and it's calculated substracting the minimum value in a set from the maximum one.&lt;/p&gt;
&lt;p&gt;\[\displaystyle Range  = Max (i) - Min (i)\]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Analyzing our dataset of 5 values: [1, 2, 2, 5, 10], the range is 10 - 1 = 9.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset, the range in the &lt;em&gt;Age&lt;/em&gt; variable is 80-0,42 = 79,58 years.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;variance&quot;&gt;Variance&lt;/h5&gt;
&lt;p&gt;The variance is a measure of the dispersion of the values with respect to its average or mean value. It is calculated by obtaining the average value of the square of its residuals (differences of each value with respect to the average). That is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variance of the population&lt;/strong&gt;:&lt;br&gt;
\[\sigma^{2} = \frac{\displaystyle\sum_{i=1}^N (x_i-\mu)^2}{N}\]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unbiased variance of the sample&lt;/strong&gt;:&lt;br&gt;
\[s^{2} = \frac{\displaystyle\sum_{i=1}^N (x_i-\bar x)^2}{n - 1} \]&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The calculation is made on the square of the differences because if we add all their differences the result would be 0.&lt;/p&gt;
&lt;p&gt;Regarding the difference in the denominator of both calculations, this is because we are using what is known as unbiased variance of the sample. This modification is based on the fact that we are calculating a statistical value of a sample that could be leaving the population mean outside or far from our values, if we calculate the variance of the sample dividing by n, we could be underestimating the real value of the population variance (more information can be found at Kahn Academy: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=KkaU2ur3Ymw&quot;&gt;Explanation about why we divide by n-1 for the unbiased variance of the sample&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the variance of the population is 10,8.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our unbiased variance is 211,01.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;standard-deviation&quot;&gt;Standard deviation&lt;/h5&gt;
&lt;p&gt;The standard deviation is a measure of the dispersion of the values of the analyzed variable represented in their same units. Its calculation is made by &lt;strong&gt;the square root of the variance&lt;/strong&gt; and its representation is simply &lt;em&gt;sigma&lt;/em&gt; or &lt;em&gt;s&lt;/em&gt; depending on whether it represents the population or the sample.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the standard deviation is 3,67.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our, the standard deviation of the sample is 14,52 years.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;standard-error&quot;&gt;Standard error&lt;/h5&gt;
&lt;p&gt;The standard error serves to measure how well a sample represents the population. The calculation is made by dividing the standard deviation by the square root of the total values of the sample.&lt;/p&gt;
&lt;p&gt;\[\displaystyle SE_{\bar x} = \frac{s} {\sqrt n}\]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our, the standard error of the sample is 0,54.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;analysis-of-the-variability&quot;&gt;Analysis of the variability&lt;/h4&gt;
&lt;p&gt;As seen from the examples seen, these measures help to draw first conclusions regarding the dispersion or variability of our distribution values. This is useful when comparing datasets on variables with those we have worked with previously.&lt;/p&gt;
&lt;p&gt;In addition, and in combination with the measures of central tendency, these measures are of special interest in order to extract information about the distribution of the data of our variable, and in this way, characterize said variable in one way or another.&lt;/p&gt;
&lt;h3 id=&quot;basic-distributions&quot;&gt;Basic distributions&lt;/h3&gt;
&lt;p&gt;As final subject in this first article of the &lt;em&gt;Fundamentals&lt;/em&gt; series, it is interesting to visualize the distributions of the data because they can give more clear information than the one extracted from their calculated values. According to the data treated, the most typical distributions that we can find could be:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Based on the asymmetry coefficient (according to the measures of the central tendency), and as mentioned above, we could distinguish:&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;symmetric-distribution-&quot;&gt;Symmetric distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The values of the mean, median and mode are similar&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;  &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/symmetric.png&quot; alt=&quot;Symmetric&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;asymmetric-distribution-&quot;&gt;Asymmetric distribution:&lt;/h4&gt;
&lt;h5 id=&quot;positive-asymmetry-&quot;&gt;Positive asymmetry:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;More values are concentrated below the average or mean. Being this greater than the median and this greater than fashion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/positive_asymmetry.png&quot; alt=&quot;Positive_asymmetry&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;negative-asymmetry-&quot;&gt;Negative asymmetry:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;More values are concentrated above the average or mean. Being this smaller than the median and this smaller than fashion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/negative_asymmetry.png&quot; alt=&quot;Negative_asymmetry&quot;&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;According to the shape of the distribution, the most typical cases of representation would be:&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;uniform-distribution-&quot;&gt;Uniform distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Almost all values are identical throughout the range of the variable. This type of distributions could be due to the fact that the representation intervals are too small or too large, and because the variables represented consist of a combination of several variables. Therefore, it is advisable to vary the way of representing the data to detect changes that induce more information:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/uniform.png&quot; alt=&quot;Uniform&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;random-distribution-&quot;&gt;Random distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Those distributions without a clear pattern of representation where different modes or peaks can be distinguished. These could be due to the same cases as those indicated for the normal distribution, so it is recommended to try to make changes in their representation:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/random.png&quot; alt=&quot;Random&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;bimodal-distribution-&quot;&gt;Bimodal distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Distributions with 2 modes or peaks, which generally indicates that they are affected by 2 sources of variation that should try to be studied independently. It could be the case that the measures of  central tendency and variability are similar, so their visualization is convenient for a better understanding.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/bimodal_distribution.png&quot; alt=&quot;Bimodal&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;normal-distribution-&quot;&gt;Normal distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The normal or Gaussian distribution consists of the desired distribution for all our data. Although it will have a specific post for analyzing its characteristics, briefly explained, it is a symmetrical bell-shaped function that allows us to model numerous phenomena of nature. The great advantage of having variables whose data are assimilated to this type of distribution is that their distribution can be characterized according to their standard deviation in the following way:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/normal_distribution.png&quot; alt=&quot;Normal&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;sources-of-interest-&quot;&gt;Sources of interest:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Kaggle – &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kaggle.com/c/titanic&quot;&gt;Titanic Machine Learning from Disaster&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/9325/descriptive-analysis-basics</guid>
<pubDate>Wed, 07 Jan 2026 00:19:35 +0000</pubDate>
</item>
</channel>
</rss>