Happy Moji Bee — Math Explanation Happy Moji Bee — Explication mathématique

Negative Binomial, Gamma–Poisson mixture, and the generative “Bee‑Chain”. Binomiale négative, mélange Gamma–Poisson, et la chaîne générative “Bee‑Chain”.
🌐

AbstractRésumé

This note rigorously summarizes the mathematics behind the Happy Moji Bee demo. We use a Negative Binomial (NB) model—in its Gamma–Poisson mixture form—to generate the number of combining marks per character. A linear drift of the mean across index produces the “crescendo” effect, while the use of Unicode combining marks creates a visual texture without adding horizontal advance. We provide formulas, generation steps, diagnostics, and realistic current applications.

Cette note résume rigoureusement les mathématiques derrière la démo Happy Moji Bee. Nous utilisons un modèle binomial négatif (NB)—sous forme de mélange Gamma–Poisson—pour générer le nombre de marques combinantes par caractère. Une dérive linéaire de la moyenne selon l’index produit l’effet de « crescendo », tandis que les marques combinantes Unicode créent une texture visuelle sans largeur supplémentaire. Nous fournissons formules, étapes de génération, diagnostics et applications actuelles réalistes.

Default language is English; switch above for French.L’anglais est affiché par défaut ; utilisez le sélecteur ci‑dessus pour le français.

Negative Binomial DistributionDistribution binomiale négative

ParameterizationsParamétrisations

We use the mean–shape parameterization NB(r, m) with mean E[K]=m and variance Var[K]=m + m² / r (overdispersion vs. Poisson). This is equivalent to NB(r, p) with p = r/(r+m), so that P(K=k) = C(k+r-1,k) · p^r · (1-p)^k for k=0,1,2,….

Nous utilisons la paramétrisation moyenne‑forme NB(r, m) avec E[K]=m et Var[K]=m + m² / r (sur‑dispersion par rapport à Poisson). Elle est équivalente à NB(r, p) avec p = r/(r+m), d’où P(K=k) = C(k+r-1,k) · p^r · (1-p)^k pour k=0,1,2,….

Gamma–Poisson mixtureMélange Gamma–Poisson

If λ ~ Gamma(shape=r, scale=m/r) and K | λ ~ Poisson(λ), then the marginal distribution of K is NB(r, m). This constructive view yields an efficient generator: sample a Gamma, then a Poisson.

Si λ ~ Gamma(shape=r, scale=m/r) et K | λ ~ Poisson(λ), alors la loi marginale de K est NB(r, m). Cette vue constructive donne un générateur efficace : échantillonner une Gamma puis une Poisson.

Overdispersion & diagnosticsSur‑dispersion & diagnostics

Implementation in the Bee‑ChainImplémentation dans la Bee‑Chain

Mean drift (“crescendo”)Dérive de la moyenne (« crescendo »)

For index i=0,1,…,n-1, we set a target mean mᵢ = max(0, m₀ + β·i). Given shape r, we draw Kᵢ ~ NB(r, mᵢ) via the Gamma–Poisson mixture.

Pour l’index i=0,1,…,n-1, on fixe une moyenne cible mᵢ = max(0, m₀ + β·i). Avec la forme r, on tire Kᵢ ~ NB(r, mᵢ) via le mélange Gamma–Poisson.

Generation stepsÉtapes de génération

for i in 0..n-1:
  m_i = max(0, m0 + β*i)
  λ   ~ Gamma(shape=r, scale=m_i/r)
  K_i ~ Poisson(λ)        # combining marks
  glyph_i = base[i mod |base|] + K_i combining marks
pour i = 0..n-1 :
  m_i = max(0, m0 + β*i)
  λ   ~ Gamma(shape=r, scale=m_i/r)
  K_i ~ Poisson(λ)        # marques combinantes
  glyph_i = base[i mod |base|] + K_i marques

What is (not) compressedCe qui (n’)est (pas) compressé

Scientific Applications (now)Applications scientifiques (actuelles)

These uses are established and stable; the NB’s extra parameter r controls overdispersion. Ces usages sont établis ; le paramètre r contrôle la sur‑dispersion.

Limits & PitfallsLimites & écueils

ReferencesRéférences

Formulas here match the implementation used in the demo (Gamma sampling → Poisson sampling) and the canonical NB identities. Les formules correspondent à l’implémentation de la démo (échantillon Gamma → Poisson) et aux identités canoniques de la NB.