Introduction
Additive manufacturing uses digital three dimensional (3D) models to produce physical parts, from prototypes to aerospace components and medical devices [1 ] . As their geometry may disclose proprietary information, protecting design data is part of securing the manufacturing process, in which theft of technical data is a principal threat [2 ] . STL represents the geometry as a triangulated surface and remains a common exchange format in this workflow [1 , 3 ] .
The statistical evaluation of encryption methods for 3D models commonly uses measures adapted from image encryption. Our foundational work [4 ] examined this transfer for NPCR and UACI and showed that their conventional reference values require adjustment for STL validity constraints. The same issue arises for Shannon entropy [5 ] : its reference values must reflect the admissible ciphertext encodings.
Global entropy is computed from the byte histogram of the entire ciphertext, whereas local entropy [6 ] averages the same measure over disjoint blocks of fixed size and is also sensitive to departures from randomness confined to parts of the ciphertext. The conventional reference values for both measures assume independent and uniformly distributed bytes.
In practice, however, evaluations of the global measure often report values close to the theoretical maximum of 8 bits, without specifying acceptance bounds for the given sample size. Such proximity alone does not establish consistency with the assumed null model. A two-sided hypothesis test provides a more rigorous assessment because it rejects values that are either unusually low or unusually high.
Even under the uniform model, the expected entropy is strictly below the theoretical maximum for every finite sample size — classical estimation results quantify the bias and variability [7 , 8 , 9 ] .
As established in [4 ] , a valid STL file does not satisfy the assumption of independent uniform bytes because each triangle record is composed mostly of IEEE-754 single-precision floats [10 ] , for which the validity constraint excludes NaN and ± ∞ \pm\infty ± ∞ . Consequently, the valid-STL (VSTL) distribution is uniform over admissible encodings and has nonuniform byte probabilities that vary by position, together with dependence between the exponent bytes of each float.
This paper therefore introduces a hypothesis test for the global entropy of valid STL files, adjusts the established local test, and provides reference values and acceptance bounds appropriate to the assumed distribution and sample size for both measures.
We derive exact global and local entropy moments from the individual and joint laws of byte counts in triangle records under the VSTL model. For global entropy, second-order expansions make the reference moments efficiently computable for large files. For local entropy, we determine the optimal block size under the VSTL model by adapting the capacity energy criterion [6 ] . Normal approximations provide two-sided acceptance bounds for both tests.
Although the validity constraint induces seemingly small shifts in the entropy references, these differences become practically relevant for both tests as their acceptance intervals narrow. For local entropy, the change in block size further accentuates this effect.
The remainder of the paper is organized as follows. § 2 defines the notation used throughout the paper and recalls the VSTL distribution from our foundational work. § 3 derives the exact block entropy moments. § 4 develops the global entropy test, while § 5 adapts the local test; both examine their practical significance and validate their corresponding reference values through Monte-Carlo simulations. Finally, § 6 concludes the paper.
Preliminaries and Notation
Most of the notation and structural facts in this section follow our foundational work [4 ] ; we restate only those needed for the entropy analysis.
The Byte Alphabet and Its Named Subsets
Write V = { 0 , … , 255 } \mathcal{V} = \{0,\ldots,255\} V = { 0 , … , 255 } for the byte alphabet, so that V k \mathcal{V}^{k} V k is the set of k k k -byte sequences. Two pairs of subsets of V \mathcal{V} V recur throughout, the halves and the majority sets:
V l o = { 0 , … , 127 } , V l o ∗ = V l o ∖ { 127 } , \mathcal{V}_{lo}=\{0,\ldots,127\}, \qquad\mathcal{V}_{lo}^{*}=\mathcal{V}_{lo}\setminus\{127\}, V l o = { 0 , … , 127 } , V l o ∗ = V l o ∖ { 127 } ,
V h i = { 128 , … , 255 } , V h i ∗ = V h i ∖ { 255 } . (1) \mathcal{V}_{hi}=\{128,\ldots,255\}, \qquad\mathcal{V}_{hi}^{*}=\mathcal{V}_{hi}\setminus\{255\}. \tag*{(1)} V hi = { 128 , … , 255 } , V hi ∗ = V hi ∖ { 255 } . (1)
The two majority sets drop 127 and 255, respectively; these values are the minority bytes .
Validity Constraint
A valid float is any finite IEEE-754 single-precision 32-bit number [10 ] whose exponent field is not 0xFF; subnormals and signed zeros are retained, NaN and ± ∞ \pm\infty ± ∞ excluded. The set F ⊂ { 0 , 1 } 32 F \subset\{0,1\}^{32} F ⊂ { 0 , 1 } 32 of valid encodings has cardinality ∣ F ∣ = 2 32 − 2 24 = 4278190080 |F|=2^{32}-2^{24}=4278190080 ∣ F ∣ = 2 32 − 2 24 = 4278190080 .
Each float ( s , e 0 … e 7 , m 0 … m 22 ) (s,e_0\ldots e_7,m_0\ldots m_{22}) ( s , e 0 … e 7 , m 0 … m 22 ) splits into four bytes, from most to least significant:
B 0 = s ∥ e 0 … 6 , B 1 = e 7 ∥ m 0 … 6 , B 2 = m 7 … 14 , B 3 = m 15 … 22 . (2) B_0=s\mathbin{\|}e_{0\ldots6}, \qquad B_1=e_7\mathbin{\|}m_{0\ldots6}, \qquad B_2=m_{7\ldots14}, \qquad B_3=m_{15\ldots22}. \tag*{(2)} B 0 = s ∥ e 0 … 6 , B 1 = e 7 ∥ m 0 … 6 , B 2 = m 7 … 14 , B 3 = m 15 … 22 . (2)
Since e ≠ e\ne e = 0xFF reads ¬ ( e 0 … 6 = 0x7F ∧ e 7 = 1 ) \neg(e_{0\ldots6}= \text{0x7F}\land e_7=1) ¬ ( e 0 … 6 = 0x7F ∧ e 7 = 1 ) , the validity constraint only restricts B 0 B_0 B 0 and B 1 B_1 B 1 jointly, while the other bytes remain unaffected. Accordingly, bytes fall into three classes based on their position — U U U , B 0 B_0 B 0 and B 1 B_1 B 1 , as defined in [4 Sec. 2.3] .
The Valid-STL (VSTL) Distribution
The STL file format allows representing triangulated surfaces in a readable ASCII encoding or a compact binary encoding. We treat these representations as semantically equivalent and use the binary encoding for the subsequent analysis, converting ASCII content when necessary [4 Sec. 2.1] .
Each triangle record contains a normal vector (3 floats, 12 bytes), three vertices (9 floats, 36 bytes), and an attribute word (2 bytes), for a total of 50 bytes. Throughout the rest of the paper a block is a string of triangle records.
We adopt assumptions (A1) and (A2) of [4 Sec. 2.3] . Assumption (A1) concerns format-preserving encryption [11 ] , while (A2) confines dependence to the exponent pair ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) within each float.
We restrict our attention to the triangle records of the ciphertext; file metadata is outside the scope of the presented analysis.
Definition 1. For a fixed number of triangles T T T , the valid-STL (VSTL) distribution assigns equal probability to every valid STL file. Floats and attribute words are sampled independently and uniformly over their respective admissible encodings, giving 26 T 26T 26 T unconstrained bytes and 12 T 12T 12 T exponent pairs that form mutually independent groups.
Marginal and Joint Byte Distributions
The marginals for the three byte classes [4 Sec. 3] are
P B U ( v ) = 1 256 , (3) P_{B_U}(v)=\frac{1}{256}, \tag*{(3)} P B U ( v ) = 256 1 , (3)
P B 1 ( v ) = { P l o B 1 = 1 / 255 , v ∈ V l o , P h i B 1 = 127 / 32640 , v ∈ V h i , (4) P_{B_1}(v)=
\begin{cases}
P_{loB_1}=1/255, & v\in V_{lo},\\
P_{hiB_1}=127/32640, & v\in V_{hi},
\end{cases} \tag*{(4)} P B 1 ( v ) = { P l o B 1 = 1/255 , P hi B 1 = 127/32640 , v ∈ V l o , v ∈ V hi , (4)
P B 0 ( v ) = { P B 0 ∗ = 1 / 255 , v ∈ V l o ∗ ∪ V h i ∗ , 1 / 510 , v ∈ { 127 , 255 } . (5) P_{B_0}(v)=
\begin{cases}
P_{B_0^*}=1/255, & v\in V_{lo}^*\cup V_{hi}^*,\\
1/510, & v\in\{127,255\}.
\end{cases} \tag*{(5)} P B 0 ( v ) = { P B 0 ∗ = 1/255 , 1/510 , v ∈ V l o ∗ ∪ V hi ∗ , v ∈ { 127 , 255 } . (5)
The admissible exponent pairs form
X = { ( v 0 , v 1 ) ∈ V 2 : v 0 ∈ V l o ∗ ∪ V h i ∗ ∨ v 1 ∈ V l o } , (6) \mathcal{X}=\left\{(v_0,v_1)\in\mathcal{V}^2:v_0\in V_{lo}^*\cup V_{hi}^*\lor v_1\in V_{lo}\right\}, \tag*{(6)} X = { ( v 0 , v 1 ) ∈ V 2 : v 0 ∈ V l o ∗ ∪ V hi ∗ ∨ v 1 ∈ V l o } , (6)
on which ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) is uniform:
P B 0 , B 1 ( v 0 , v 1 ) = { 1 65280 , ( v 0 , v 1 ) ∈ X , 0 , ( v 0 , v 1 ) ∉ X . (7) P_{B_0,B_1}(v_0,v_1)=
\begin{cases}
\frac{1}{65280}, & (v_0,v_1)\in\mathcal{X},\\
0, & (v_0,v_1)\notin\mathcal{X}.
\end{cases} \tag*{(7)} P B 0 , B 1 ( v 0 , v 1 ) = { 65280 1 , 0 , ( v 0 , v 1 ) ∈ X , ( v 0 , v 1 ) ∈ / X . (7)
The joint law makes explicit the dependence imposed by the validity constraint of § 2.2 and permitted by (A2), since P B 0 , B 1 ≠ P B 0 P B 1 P_{B_0,B_1}\ne P_{B_0}P_{B_1} P B 0 , B 1 = P B 0 P B 1 .
Entropy Measures
For a sequence S ∈ V n S\in\mathcal{V}^n S ∈ V n in which the value v v v occurs # ( v ) \#(v) # ( v ) times, the Shannon entropy [5 ] is
H ( S ) = ∑ v ∈ V φ ( # ( v ) N ) , (8) H(S)=\sum_{v\in\mathcal{V}}\varphi\left(\frac{\#(v)}{N}\right), \tag*{(8)} H ( S ) = v ∈ V ∑ φ ( N # ( v ) ) , (8)
φ ( x ) = x λ ( x ) , \varphi(x)=x\lambda(x), φ ( x ) = x λ ( x ) ,
λ ( x ) = { 0 , x = 0 , − log 2 ( x ) , x > 0. \lambda(x)=
\begin{cases}
0, & x=0,\\
-\log_2(x), & x>0.
\end{cases} λ ( x ) = { 0 , − log 2 ( x ) , x = 0 , x > 0.
We reserve H ∞ H_\infty H ∞ for the limiting value of H H H as the string length grows. For a source of independent uniform bytes H ∞ u n i f o r m = log 2 ∣ V ∣ = 8 H_\infty^{\mathrm{uniform}}=\log_2|\mathcal{V}|=8 H ∞ uniform = log 2 ∣ V ∣ = 8 bits. § 4.2 quantifies the reduction imposed by the validity constraint and establishes the corresponding entropy ceiling for the VSTL model.
This paper considers two entropy measures used to evaluate cryptographic systems. The global measure evaluates (8) on the entire ciphertext. The local measure [6 ] averages (8) over k k k non-overlapping blocks of N B N_B N B bytes each. § 4 and § 5 , respectively, provide reference values, acceptance bounds and test procedures specific to the VSTL format.
Exact Entropy Statistics of a Valid STL File
This section derives the exact mean and variance of the block entropy under the VSTL distribution, accounting for the dependence within each exponent pair.
The Block Entropy as a Function of Its Histogram
The moments of the block entropy can be expressed in terms of the byte counts:
μ V S T L ( T ) = ∑ v ∈ V E [ φ ( # ( v ) N ) ] . (9) \mu^{\mathrm{VSTL}}(T) = \sum_{v \in\mathcal{V}} E\left[\varphi\left(\frac{\#(v)}{N}\right)\right]. \tag*{(9)} μ VSTL ( T ) = v ∈ V ∑ E [ φ ( N # ( v ) ) ] . (9)
[ σ V S T L ( T ) ] 2 = ∑ v ∈ V E [ φ ( # ( v ) N ) 2 ] + ∑ v 0 , v 1 ∈ V v 0 ≠ v 1 E [ φ ( # ( v 0 ) N ) φ ( # ( v 1 ) N ) ] − ( ∑ v ∈ V E [ φ ( # ( v ) N ) ] ) 2 . (10) \begin{aligned}
\left[\sigma^{\mathrm{VSTL}}(T)\right]^2
={}& \sum_{v \in\mathcal{V}} E\left[\varphi\left(\frac{\#(v)}{N}\right)^2\right] \\
&+ \sum_{\substack{v_0,v_1 \in\mathcal{V}\\v_0 \ne v_1}} E\left[\varphi\left(\frac{\#(v_0)}{N}\right)\varphi\left(\frac{\#(v_1)}{N}\right)\right] \\
&- \left(\sum_{v \in\mathcal{V}} E\left[\varphi\left(\frac{\#(v)}{N}\right)\right]\right)^2. \tag*{(10)}
\end{aligned} [ σ VSTL ( T ) ] 2 = v ∈ V ∑ E [ φ ( N # ( v ) ) 2 ] + v 0 , v 1 ∈ V v 0 = v 1 ∑ E [ φ ( N # ( v 0 ) ) φ ( N # ( v 1 ) ) ] − ( v ∈ V ∑ E [ φ ( N # ( v ) ) ] ) 2 . (10)
Since H H H is additive over byte values, only the one-dimensional and two-dimensional marginals of # \# # ever appear. The counts are dependent — their sum is fixed at N N N and the validity constraint couples the two exponent bytes within every float — so the off-diagonal terms of (10) call for the joint law of ( # ( v 0 ) , # ( v 1 ) ) (\#(v_0),\#(v_1)) ( # ( v 0 ) , # ( v 1 )) and not for the product of their individual marginals. It remains to establish, under the VSTL model, how likely it is for a given value to appear a specified number of times in a block, and for two distinct values to appear specified numbers of times jointly.
Distributions of Individual and Joint Byte Counts
To count the occurrence of a given byte v v v at an unconstrained position, we define
Z U , v ( b U ) = { 1 , b U = v , 0 , b U ≠ v , b U ∈ V . (11) Z_{U,v}(b_U) =
\begin{cases}
1, & b_U = v,\\
0, & b_U \ne v,
\end{cases}
\qquad b_U \in\mathcal{V}. \tag*{(11)} Z U , v ( b U ) = { 1 , 0 , b U = v , b U = v , b U ∈ V . (11)
Z U , v Z_{U,v} Z U , v without an argument stands for Z U , v ( B U ) Z_{U,v}(B_U) Z U , v ( B U ) , where B U B_U B U is randomly drawn according to (3) . Hence, Z U , v ∼ Bernoulli ( P B U ) Z_{U,v} \sim\operatorname{Bernoulli}(P_{B_U}) Z U , v ∼ Bernoulli ( P B U ) .
Likewise, to count the occurrences of a given byte v v v in an exponent pair, we define
Z X , v ( b 0 , b 1 ) = { 2 , b 0 = b 1 = v , 1 , b 0 ≠ b 1 ∧ ( b 0 = v ∨ b 1 = v ) , 0 , b 0 ≠ v ∧ b 1 ≠ v , ( b 0 , b 1 ) ∈ X . (12) Z_{\mathcal{X},v}(b_0,b_1) =
\begin{cases}
2, & b_0=b_1=v,\\
1, & b_0\ne b_1 \land(b_0=v \lor b_1=v),\\
0, & b_0\ne v \land b_1\ne v,
\end{cases}
\qquad(b_0,b_1)\in\mathcal{X}. \tag*{(12)} Z X , v ( b 0 , b 1 ) = ⎩ ⎨ ⎧ 2 , 1 , 0 , b 0 = b 1 = v , b 0 = b 1 ∧ ( b 0 = v ∨ b 1 = v ) , b 0 = v ∧ b 1 = v , ( b 0 , b 1 ) ∈ X . (12)
Z X , v Z_{\mathcal{X},v} Z X , v without arguments stands for Z X , v ( B 0 , B 1 ) Z_{\mathcal{X},v}(B_0,B_1) Z X , v ( B 0 , B 1 ) , where ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) is randomly drawn according to (7) .
Let Λ X , v ( m ) \Lambda_{\mathcal{X},v}(m) Λ X , v ( m ) denote the probability that exactly m ∈ { 0 , 1 , 2 } m\in\{0,1,2\} m ∈ { 0 , 1 , 2 } bytes of an exponent pair are equal to v v v . Its expression follows by inclusion–exclusion on the events B 0 = v B_0=v B 0 = v and B 1 = v B_1=v B 1 = v :
Λ X , v ( m ) = Pr [ Z X , v = m ] , Λ X , v ( 0 ) = 1 − P B 0 ( v ) − P B 1 ( v ) + P B 0 , 1 ( v , v ) , Λ X , v ( 1 ) = P B 0 ( v ) + P B 1 ( v ) − 2 P B 0 , 1 ( v , v ) , Λ X , v ( 2 ) = P B 0 , 1 ( v , v ) . (13) \begin{aligned}
\Lambda_{\mathcal{X},v}(m) &= \Pr[Z_{\mathcal{X},v}=m],\\
\Lambda_{\mathcal{X},v}(0) &= 1-P_{B_0}(v)-P_{B_1}(v)+P_{B_{0,1}}(v,v),\\
\Lambda_{\mathcal{X},v}(1) &= P_{B_0}(v)+P_{B_1}(v)-2P_{B_{0,1}}(v,v),\\
\Lambda_{\mathcal{X},v}(2) &= P_{B_{0,1}}(v,v). \tag*{(13)}
\end{aligned} Λ X , v ( m ) Λ X , v ( 0 ) Λ X , v ( 1 ) Λ X , v ( 2 ) = Pr [ Z X , v = m ] , = 1 − P B 0 ( v ) − P B 1 ( v ) + P B 0 , 1 ( v , v ) , = P B 0 ( v ) + P B 1 ( v ) − 2 P B 0 , 1 ( v , v ) , = P B 0 , 1 ( v , v ) . (13)
An additional argument generalizes the law to any number of independent groups. Specifically, Λ X , v ( n , m ) \Lambda_{\mathcal{X},v}(n,m) Λ X , v ( n , m ) is the probability that n n n independent exponent pairs contribute a total of m m m occurrences of v v v . The n n n -fold convolution of (13) therefore admits the closed form
Λ X , v ( n , m ) = ∑ i ≥ 0 2 i ≤ m i ≥ m − n ( n i , m − 2 i , n − m + i ) [ Λ X , v ( 2 ) ] i [ Λ X , v ( 1 ) ] m − 2 i [ Λ X , v ( 0 ) ] n − m + i . (14) \Lambda_{\mathcal{X},v}(n,m)=
\sum_{\substack{i\ge0\\2i\le m\\i\ge m-n}}
\binom{n}{i,m-2i,n-m+i}
[\Lambda_{\mathcal{X},v}(2)]^i
[\Lambda_{\mathcal{X},v}(1)]^{m-2i}
[\Lambda_{\mathcal{X},v}(0)]^{n-m+i}. \tag*{(14)} Λ X , v ( n , m ) = i ≥ 0 2 i ≤ m i ≥ m − n ∑ ( i , m − 2 i , n − m + i n ) [ Λ X , v ( 2 ) ] i [ Λ X , v ( 1 ) ] m − 2 i [ Λ X , v ( 0 ) ] n − m + i . (14)
We extend this idea to the unconstrained positions and define Λ U , v ( n , m ) \Lambda_{U,v}(n,m) Λ U , v ( n , m ) as the probability that n n n of them contribute a total of m m m occurrences of v v v . These contributions are independent and identically distributed Bernoulli variables (11) , so Λ U , v ( n , m ) \Lambda_{U,v}(n,m) Λ U , v ( n , m ) admits the binomial form
Λ U , v ( n , m ) = ( n m ) [ P B U ] m [ 1 − P B U ] n − m . (15) \Lambda_{U,v}(n,m)=\binom{n}{m}[P_{B_U}]^m[1-P_{B_U}]^{n-m}. \tag*{(15)} Λ U , v ( n , m ) = ( m n ) [ P B U ] m [ 1 − P B U ] n − m . (15)
Lemma 1. For every v ∈ V v\in\mathcal{V} v ∈ V and every block of T T T records, the count # ( v ) \#(v) # ( v ) is distributed as the convolution of Λ U , v \Lambda_{U,v} Λ U , v over the 26 T 26T 26 T unconstrained positions with Λ X , v \Lambda_{\mathcal{X},v} Λ X , v over the 12 T 12T 12 T exponent pairs.
Pr [ # ( v ) = m ] = [ Λ U , v ( 26 T , ⋅ ) ∗ Λ X , v ( 12 T , ⋅ ) ] ( m ) = ∑ u Λ U , v ( 26 T , u ) Λ X , v ( 12 T , m − u ) . (16) \Pr[\#(v)=m]=[\Lambda_{U,v}(26T,\cdot)*\Lambda_{X,v}(12T,\cdot)](m)
=\sum_u \Lambda_{U,v}(26T,u)\Lambda_{X,v}(12T,m-u). \tag*{(16)} Pr [ # ( v ) = m ] = [ Λ U , v ( 26 T , ⋅ ) ∗ Λ X , v ( 12 T , ⋅ )] ( m ) = u ∑ Λ U , v ( 26 T , u ) Λ X , v ( 12 T , m − u ) . (16)
To count the joint occurrences of two distinct bytes v 0 ≠ v 1 v_0\ne v_1 v 0 = v 1 , we evaluate (11) and (12) at each of the two values, accounting for the constraints a single group imposes on their co-occurrence.
Let Λ X , v 0 , v 1 ( m 0 , m 1 ) \Lambda_{X,v_0,v_1}(m_0,m_1) Λ X , v 0 , v 1 ( m 0 , m 1 ) be the probability that a single exponent pair contributes m 0 m_0 m 0 occurrences of v 0 v_0 v 0 and m 1 m_1 m 1 occurrences of v 1 v_1 v 1 . Each exponent pair holds only two bytes, so it is necessary that m 0 + m 1 ≤ 2 m_0+m_1\le2 m 0 + m 1 ≤ 2 . Thus,
Λ X , v 0 , v 1 ( m 0 , m 1 ) = Pr [ Z X , v 0 = m 0 , Z X , v 1 = m 1 ] , Λ X , v 0 , v 1 ( 2 , 0 ) = Λ X , v 0 ( 2 ) , Λ X , v 0 , v 1 ( 0 , 2 ) = Λ X , v 1 ( 2 ) , Λ X , v 0 , v 1 ( 1 , 1 ) = P B 0 , 1 ( v 0 , v 1 ) + P B 0 , 1 ( v 1 , v 0 ) , Λ X , v 0 , v 1 ( 1 , 0 ) = Λ X , v 0 ( 1 ) − Λ X , v 0 , v 1 ( 1 , 1 ) , Λ X , v 0 , v 1 ( 0 , 1 ) = Λ X , v 1 ( 1 ) − Λ X , v 0 , v 1 ( 1 , 1 ) , Λ X , v 0 , v 1 ( 0 , 0 ) = 1 − ∑ ( a , b ) ≠ ( 0 , 0 ) Λ X , v 0 , v 1 ( a , b ) . (17) \begin{aligned}
\Lambda_{X,v_0,v_1}(m_0,m_1)&=\Pr[Z_{X,v_0}=m_0,Z_{X,v_1}=m_1],\\
\Lambda_{X,v_0,v_1}(2,0)&=\Lambda_{X,v_0}(2),\\
\Lambda_{X,v_0,v_1}(0,2)&=\Lambda_{X,v_1}(2),\\
\Lambda_{X,v_0,v_1}(1,1)&=P_{B_{0,1}}(v_0,v_1)+P_{B_{0,1}}(v_1,v_0),\\
\Lambda_{X,v_0,v_1}(1,0)&=\Lambda_{X,v_0}(1)-\Lambda_{X,v_0,v_1}(1,1),\\
\Lambda_{X,v_0,v_1}(0,1)&=\Lambda_{X,v_1}(1)-\Lambda_{X,v_0,v_1}(1,1),\\
\Lambda_{X,v_0,v_1}(0,0)&=1-\sum_{(a,b)\ne(0,0)}\Lambda_{X,v_0,v_1}(a,b). \tag*{(17)}
\end{aligned} Λ X , v 0 , v 1 ( m 0 , m 1 ) Λ X , v 0 , v 1 ( 2 , 0 ) Λ X , v 0 , v 1 ( 0 , 2 ) Λ X , v 0 , v 1 ( 1 , 1 ) Λ X , v 0 , v 1 ( 1 , 0 ) Λ X , v 0 , v 1 ( 0 , 1 ) Λ X , v 0 , v 1 ( 0 , 0 ) = Pr [ Z X , v 0 = m 0 , Z X , v 1 = m 1 ] , = Λ X , v 0 ( 2 ) , = Λ X , v 1 ( 2 ) , = P B 0 , 1 ( v 0 , v 1 ) + P B 0 , 1 ( v 1 , v 0 ) , = Λ X , v 0 ( 1 ) − Λ X , v 0 , v 1 ( 1 , 1 ) , = Λ X , v 1 ( 1 ) − Λ X , v 0 , v 1 ( 1 , 1 ) , = 1 − ( a , b ) = ( 0 , 0 ) ∑ Λ X , v 0 , v 1 ( a , b ) . (17)
An additional argument again generalizes the law to any number of independent groups. Specifically, Λ X , v 0 , v 1 ( n , m 0 , m 1 ) \Lambda_{X,v_0,v_1}(n,m_0,m_1) Λ X , v 0 , v 1 ( n , m 0 , m 1 ) is the probability that n n n independent exponent pairs contribute a total of m 0 m_0 m 0 occurrences of v 0 v_0 v 0 and m 1 m_1 m 1 occurrences of v 1 v_1 v 1 . The n n n -fold convolution of (17) therefore admits the closed form
Λ X , v 0 , v 1 ( n , m 0 , m 1 ) = ∑ i , j , k ≥ 0 2 i + k ≤ m 0 2 j + k ≤ m 1 i + j + k ≥ m 0 + m 1 − n ( n i , j , k , m 0 − 2 i − k , m 1 − 2 j − k , n − m 0 − m 1 + i + j + k ) × [ Λ X , v 0 , v 1 ( 2 , 0 ) ] i [ Λ X , v 0 , v 1 ( 0 , 2 ) ] j [ Λ X , v 0 , v 1 ( 1 , 1 ) ] k × [ Λ X , v 0 , v 1 ( 1 , 0 ) ] m 0 − 2 i − k [ Λ X , v 0 , v 1 ( 0 , 1 ) ] m 1 − 2 j − k × [ Λ X , v 0 , v 1 ( 0 , 0 ) ] n − m 0 − m 1 + i + j + k . (18) \begin{aligned}
\Lambda_{X,v_0,v_1}(n,m_0,m_1)={}&
\sum_{\substack{i,j,k\ge0\\2i+k\le m_0\\2j+k\le m_1\\i+j+k\ge m_0+m_1-n}}
\binom{n}{i,j,k,m_0-2i-k,m_1-2j-k,n-m_0-m_1+i+j+k}\\
&\times[\Lambda_{X,v_0,v_1}(2,0)]^i[\Lambda_{X,v_0,v_1}(0,2)]^j[\Lambda_{X,v_0,v_1}(1,1)]^k\\
&\times[\Lambda_{X,v_0,v_1}(1,0)]^{m_0-2i-k}[\Lambda_{X,v_0,v_1}(0,1)]^{m_1-2j-k}\\
&\times[\Lambda_{X,v_0,v_1}(0,0)]^{n-m_0-m_1+i+j+k}. \tag*{(18)}
\end{aligned} Λ X , v 0 , v 1 ( n , m 0 , m 1 ) = i , j , k ≥ 0 2 i + k ≤ m 0 2 j + k ≤ m 1 i + j + k ≥ m 0 + m 1 − n ∑ ( i , j , k , m 0 − 2 i − k , m 1 − 2 j − k , n − m 0 − m 1 + i + j + k n ) × [ Λ X , v 0 , v 1 ( 2 , 0 ) ] i [ Λ X , v 0 , v 1 ( 0 , 2 ) ] j [ Λ X , v 0 , v 1 ( 1 , 1 ) ] k × [ Λ X , v 0 , v 1 ( 1 , 0 ) ] m 0 − 2 i − k [ Λ X , v 0 , v 1 ( 0 , 1 ) ] m 1 − 2 j − k × [ Λ X , v 0 , v 1 ( 0 , 0 ) ] n − m 0 − m 1 + i + j + k . (18)
We extend this idea to the unconstrained positions as well and define Λ U , v 0 , v 1 ( n , m 0 , m 1 ) \Lambda_{U,v_0,v_1}(n,m_0,m_1) Λ U , v 0 , v 1 ( n , m 0 , m 1 ) as the probability that n n n of them contribute a total of $m_0 occurrences of v 0 v_0 v 0 and m 1 m_1 m 1 occurrences of v 1 v_1 v 1 . A single unconstrained position carries only one value, so Z U , v 0 Z U , v 1 = 0 Z_{U,v_0}Z_{U,v_1}=0 Z U , v 0 Z U , v 1 = 0 . The binomial form (15) therefore becomes trinomial over two equiprobable outcomes (3) and their complement:
Λ U , v 0 , v 1 ( n , m 0 , m 1 ) = ( n m 0 , m 1 , n − m 0 − m 1 ) [ P B U ] m 0 + m 1 [ 1 − 2 P B U ] n − m 0 − m 1 . (19) \Lambda_{U,v_0,v_1}(n,m_0,m_1)=\binom{n}{m_0,m_1,n-m_0-m_1}[P_{BU}]^{m_0+m_1}[1-2P_{BU}]^{n-m_0-m_1}. \tag*{(19)} Λ U , v 0 , v 1 ( n , m 0 , m 1 ) = ( m 0 , m 1 , n − m 0 − m 1 n ) [ P B U ] m 0 + m 1 [ 1 − 2 P B U ] n − m 0 − m 1 . (19)
Convolving the two families over their respective group counts gives the two-dimensional counterpart of Lemma 1.
Lemma 2. For all distinct v 0 , v 1 ∈ V v_0,v_1\in\mathcal{V} v 0 , v 1 ∈ V and every block of T T T records, the pair of counts ( # ( v 0 ) , # ( v 1 ) ) (\#(v_0),\#(v_1)) ( # ( v 0 ) , # ( v 1 )) is jointly distributed as the two-dimensional convolution of Λ U , v 0 , v 1 \Lambda_{U,v_0,v_1} Λ U , v 0 , v 1 over the 26 T 26T 26 T unconstrained positions with Λ X , v 0 , v 1 \Lambda_{X,v_0,v_1} Λ X , v 0 , v 1 over the 12 T 12T 12 T exponent pairs.
Pr [ # ( v 0 ) = m 0 , # ( v 1 ) = m 1 ] = [ Λ U , v 0 , v 1 ( 26 T , ⋅ , ⋅ ) ∗ Λ X , v 0 , v 1 ( 12 T , ⋅ , ⋅ ) ] ( m 0 , m 1 ) = ∑ u 0 , u 1 Λ U , v 0 , v 1 ( 26 T , u 0 , u 1 ) Λ X , v 0 , v 1 ( 12 T , m 0 − u 0 , m 1 − u 1 ) . (20) \begin{aligned}
\Pr[\#(v_0)=m_0,\#(v_1)=m_1]=[\Lambda_{U,v_0,v_1}(26T,\cdot,\cdot)*\Lambda_{X,v_0,v_1}(12T,\cdot,\cdot)](m_0,m_1) \\
&=\sum_{u_0,u_1}\Lambda_{U,v_0,v_1}(26T,u_0,u_1)\Lambda_{X,v_0,v_1}(12T,m_0-u_0,m_1-u_1). \tag*{(20)}
\end{aligned} Pr [ # ( v 0 ) = m 0 , # ( v 1 ) = m 1 ] = [ Λ U , v 0 , v 1 ( 26 T , ⋅ , ⋅ ) ∗ Λ X , v 0 , v 1 ( 12 T , ⋅ , ⋅ )] ( m 0 , m 1 ) = u 0 , u 1 ∑ Λ U , v 0 , v 1 ( 26 T , u 0 , u 1 ) Λ X , v 0 , v 1 ( 12 T , m 0 − u 0 , m 1 − u 1 ) . (20)
The Exact Moments
The count laws of Lemmas 1 and 2 involve v v v , respectively ( v 0 , v 1 ) (v_0,v_1) ( v 0 , v 1 ) , only through the marginals (3) , (4) , (5) and (7) . The coarsest partition of V \mathcal{V} V on which all four are constant is the set of categories
Γ = { V l o ∗ , { 127 } , V h i ∗ , { 255 } } . (21) \Gamma=\{\mathcal{V}_{lo}^{*},\{127\},\mathcal{V}_{hi}^{*},\{255\}\}. \tag*{(21)} Γ = { V l o ∗ , { 127 } , V hi ∗ , { 255 }} . (21)
Any two bytes from the same category thus contribute equal terms to (9) and (10) , as do any two pairs drawn from the same categories. The sums over individual bytes are therefore rewritten as sums over Γ \Gamma Γ , with each category weighted by its cardinality: 127 for either majority set, 1 for either minority byte.
For an arbitrary v ∈ γ v\in\gamma v ∈ γ , the two single-count moments of the category are
θ γ = E [ φ ( # ( v ) N ) ] = ∑ m φ ( m N ) Pr [ # ( v ) = m ] . (22) \begin{aligned}
\theta_\gamma=E\left[\varphi\left(\frac{\#(v)}{N}\right)\right] \\
&=\sum_m\varphi\left(\frac{m}{N}\right)\Pr[\#(v)=m]. \tag*{(22)}
\end{aligned} θ γ = E [ φ ( N # ( v ) ) ] = m ∑ φ ( N m ) Pr [ # ( v ) = m ] . (22)
θ γ ( 2 ) = E [ φ ( # ( v ) N ) 2 ] = ∑ m φ ( m N ) 2 Pr [ # ( v ) = m ] . (23) \theta_{\gamma}^{(2)} = E\left[\varphi\left(\frac{\#(v)}{N}\right)^2\right]
= \sum_m \varphi\left(\frac{m}{N}\right)^2 \Pr[\#(v)=m]. \tag*{(23)} θ γ ( 2 ) = E [ φ ( N # ( v ) ) 2 ] = m ∑ φ ( N m ) 2 Pr [ # ( v ) = m ] . (23)
For arbitrary v 0 ∈ γ 0 v_0 \in\gamma_0 v 0 ∈ γ 0 and v 1 ∈ γ 1 v_1 \in\gamma_1 v 1 ∈ γ 1 with v 0 ≠ v 1 v_0 \ne v_1 v 0 = v 1 , the joint moment of the two categories is
θ γ 0 γ 1 = E [ φ ( # ( v 0 ) N ) φ ( # ( v 1 ) N ) ] = ∑ m 0 , m 1 φ ( m 0 N ) φ ( m 1 N ) Pr [ # ( v 0 ) = m 0 , # ( v 1 ) = m 1 ] . (24) \theta_{\gamma_0\gamma_1}
= E\left[\varphi\left(\frac{\#(v_0)}{N}\right)\varphi\left(\frac{\#(v_1)}{N}\right)\right]
= \sum_{m_0,m_1}\varphi\left(\frac{m_0}{N}\right)\varphi\left(\frac{m_1}{N}\right)\Pr[\#(v_0)=m_0,\#(v_1)=m_1]. \tag*{(24)} θ γ 0 γ 1 = E [ φ ( N # ( v 0 ) ) φ ( N # ( v 1 ) ) ] = m 0 , m 1 ∑ φ ( N m 0 ) φ ( N m 1 ) Pr [ # ( v 0 ) = m 0 , # ( v 1 ) = m 1 ] . (24)
Proposition 1. For every triangle count T T T , the block entropy has mean (9) and variance (10) given by the cardinality-weighted sums over Γ \Gamma Γ
μ S T L ( T ) = ∑ γ ∈ Γ ∣ γ ∣ θ γ , (25) \mu^{\mathrm{STL}}(T)=\sum_{\gamma\in\Gamma}|\gamma|\theta_\gamma, \tag*{(25)} μ STL ( T ) = γ ∈ Γ ∑ ∣ γ ∣ θ γ , (25) [ σ S T L ( T ) ] 2 = ∑ γ ∈ Γ ∣ γ ∣ θ γ ( 2 ) + ∑ γ ∈ Γ ∣ γ ∣ ≥ 2 ∣ γ ∣ ( ∣ γ ∣ − 1 ) θ γ γ + ∑ γ 0 , γ 1 ∈ Γ γ 0 ≠ γ 1 ∣ γ 0 ∣ ∣ γ 1 ∣ θ γ 0 γ 1 − [ μ S T L ( T ) ] 2 . (26) \left[\sigma^{\mathrm{STL}}(T)\right]^2
=\sum_{\gamma\in\Gamma}|\gamma|\theta_\gamma^{(2)}
+\sum_{\substack{\gamma\in\Gamma\\|\gamma|\ge2}}|\gamma|(|\gamma|-1)\theta_{\gamma\gamma}
+\sum_{\substack{\gamma_0,\gamma_1\in\Gamma\\\gamma_0\ne\gamma_1}}|\gamma_0||\gamma_1|\theta_{\gamma_0\gamma_1}
-\left[\mu^{\mathrm{STL}}(T)\right]^2. \tag*{(26)} [ σ STL ( T ) ] 2 = γ ∈ Γ ∑ ∣ γ ∣ θ γ ( 2 ) + γ ∈ Γ ∣ γ ∣ ≥ 2 ∑ ∣ γ ∣ ( ∣ γ ∣ − 1 ) θ γ γ + γ 0 , γ 1 ∈ Γ γ 0 = γ 1 ∑ ∣ γ 0 ∣∣ γ 1 ∣ θ γ 0 γ 1 − [ μ STL ( T ) ] 2 . (26)
Consistency with the Uniform Model
Corollary 1. Under the uniform byte model, with L = ∣ V ∣ = 256 L=|\mathcal{V}|=256 L = ∣ V ∣ = 256 , Proposition 1 reduces to
μ u n i f o r m ( T ) = L θ V , \mu^{\mathrm{uniform}}(T)=L\theta_{\mathcal{V}}, μ uniform ( T ) = L θ V , [ σ u n i f o r m ( T ) ] 2 = L θ V ( 2 ) + L ( L − 1 ) θ V V − [ μ u n i f o r m ( T ) ] 2 . (27) \left[\sigma^{\mathrm{uniform}}(T)\right]^2
=L\theta_{\mathcal{V}}^{(2)}+L(L-1)\theta_{\mathcal{V}\mathcal{V}}
-\left[\mu^{\mathrm{uniform}}(T)\right]^2. \tag*{(27)} [ σ uniform ( T ) ] 2 = L θ V ( 2 ) + L ( L − 1 ) θ VV − [ μ uniform ( T ) ] 2 . (27)
Proof. Assuming uniformity drops the validity constraint on the exponent pairs. All byte values are then equivalent, so the partition Γ \Gamma Γ reduces to a set of one category, that category being the alphabet V \mathcal{V} V itself. Substituting this partition into (25) and (26) yields (27) .
Equation (27) therefore reproduces the mean and variance of [6 Sec. 3.3] .
The VSTL Global Entropy Test
Throughout this section we assume N N N grows without bound. Practical STL files justify this assumption: meshes usually run from thousands of triangles upwards, at fifty bytes per triangle. Although Proposition 1 provides exact reference moments at every file size, their direct evaluation through the nested sums in (22) –(24) becomes unnecessarily costly for large files.
What the global measure needs instead is the shape [4 ] gives to the differential statistics: a reference mean and a reference deviation in closed form, assembled in O ( 1 ) O(1) O ( 1 ) arithmetic operations at a fixed numerical precision, and turned into a critical value by a single quantile. This section derives both VSTL references in second-order asymptotic form, with an explicit O ( N − 3 ) O(N^{-3}) O ( N − 3 ) error bound.
The Cross-Entropy Decomposition
The entropy (8) of a block is a function of its empirical byte distribution
Q S ( v ) = # ( v ) N , v ∈ V , (28) Q_S(v) = \frac{\#(v)}{N}, \qquad v \in\mathcal{V}, \tag*{(28)} Q S ( v ) = N # ( v ) , v ∈ V , (28)
so that H ( S ) = ∑ v ∈ V φ ( Q S ( v ) ) H(S) = \sum_{v \in\mathcal{V}} \varphi(Q_S(v)) H ( S ) = ∑ v ∈ V φ ( Q S ( v )) .
Measured against a fixed probability law, the entropy splits into a cross-entropy and a divergence. The cross-entropy is linear in Q S Q_S Q S , hence a sum of T T T independent per-record terms, so its mean and its variance follow from the moments of a single record, in closed form and at every file size. The divergence, by contrast, holds the entire logarithmic nonlinearity in one nonnegative term; its moments cannot be obtained in closed form, and § 4.3 approximates them by a Taylor expansion.
The law we measure against, and later expand around, is the record-average marginal
P ˉ = 26 P B U + 12 P B 0 + 12 P B 1 50 . (29) \bar{P} = \frac{26P_{BU} + 12P_{B_0} + 12P_{B_1}}{50}. \tag*{(29)} P ˉ = 50 26 P B U + 12 P B 0 + 12 P B 1 . (29)
It is the average of the fifty per-position marginals of a record (3) –(5) and constant on the four categories (21) :
P ˉ ( v ) = { 2129 / 544000 , v ∈ V l o ∗ , 1873 / 544000 , v = 127 , 1 / 256 , v ∈ V h i ∗ , 1869 / 544000 , v = 255. (30) \bar{P}(v) =
\begin{cases}
2129/544000, & v \in\mathcal{V}^{*}_{lo},\\
1873/544000, & v = 127,\\
1/256, & v \in\mathcal{V}^{*}_{hi},\\
1869/544000, & v = 255.
\end{cases} \tag*{(30)} P ˉ ( v ) = ⎩ ⎨ ⎧ 2129/544000 , 1873/544000 , 1/256 , 1869/544000 , v ∈ V l o ∗ , v = 127 , v ∈ V hi ∗ , v = 255. (30)
For an arbitrary v ∈ γ v \in\gamma v ∈ γ , we write P ˉ ( γ ) = P ˉ ( v ) \bar{P}(\gamma)=\bar{P}(v) P ˉ ( γ ) = P ˉ ( v ) for the common value of the law on the category. Likewise for P B U P_{BU} P B U , P B 0 P_{B_0} P B 0 and P B 1 P_{B_1} P B 1 .
P ˉ ( v ) \bar{P}(v) P ˉ ( v ) is the probability that a uniformly random position of a record holds the value v v v , and P ˉ \bar{P} P ˉ is also the centre of the empirical distribution Q S Q_S Q S : linearity of expectation over the fifty positions of each record gives E [ # ( v ) ] = N P ˉ ( v ) E[\#(v)]=N\bar{P}(v) E [ # ( v )] = N P ˉ ( v ) , and hence E [ Q S ] = P ˉ E[Q_S]=\bar{P} E [ Q S ] = P ˉ exactly, at every T T T . This is precisely what qualifies P ˉ \bar{P} P ˉ as the point to expand around: relative to it, the divergence measures how far Q S Q_S Q S strays from the centre of its own fluctuations.
Lemma 3. Every block S S S of T T T records satisfies the identity
H ( S ) = ∑ v ∈ V Q S ( v ) λ ( P ˉ ( v ) ) − D ( Q S ∥ P ˉ ) , (31) H(S)=\sum_{v\in\mathcal{V}}Q_S(v)\lambda\left(\bar{P}(v)\right)-D(Q_S\mathbin\Vert\bar{P}), \tag*{(31)} H ( S ) = v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v ) ) − D ( Q S ∥ P ˉ ) , (31) where
D ( Q S ∥ P ˉ ) = − ∑ v ∈ V Q S ( v ) λ ( Q S ( v ) P ˉ ( v ) ) , (32) D(Q_S\mathbin\Vert\bar{P})=-\sum_{v\in\mathcal{V}}Q_S(v)\lambda\left(\frac{Q_S(v)}{\bar{P}(v)}\right), \tag*{(32)} D ( Q S ∥ P ˉ ) = − v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v ) Q S ( v ) ) , (32) is the Kullback–Leibler divergence in bits [12 Sec. 2.3] .
Proof. It is convenient to note a property of the surprisal function (8) first: the quotient rule of the underlying logarithm carries over, so differences of surprisals collapse to ratios of their arguments. For positive x x x and y y y ,
λ ( x ) − λ ( y ) = − ( log 2 ( x ) − log 2 ( y ) ) = − log 2 ( x y ) = λ ( x y ) . (33) \lambda(x)-\lambda(y)=-(\log_2(x)-\log_2(y))=-\log_2\left(\frac{x}{y}\right)=\lambda\left(\frac{x}{y}\right). \tag*{(33)} λ ( x ) − λ ( y ) = − ( log 2 ( x ) − log 2 ( y )) = − log 2 ( y x ) = λ ( y x ) . (33)
By (30), ∀ v ∈ V , P ˉ ( v ) > 0 \forall v\in\mathcal{V},\bar{P}(v)>0 ∀ v ∈ V , P ˉ ( v ) > 0 ; hence λ ( P ˉ ( v ) ) \lambda(\bar{P}(v)) λ ( P ˉ ( v )) is finite, and the ratio Q S ( v ) / P ˉ ( v ) Q_S(v)/\bar{P}(v) Q S ( v ) / P ˉ ( v ) is well defined. Adding and subtracting λ ( P ˉ ( v ) ) \lambda(\bar{P}(v)) λ ( P ˉ ( v )) inside each summand of (8) then gives
H ( S ) = ∑ v ∈ V φ ( Q S ( v ) ) = ∑ v ∈ V Q S ( v ) [ λ ( Q S ( v ) ) + λ ( P ˉ ( v ) ) − λ ( P ˉ ( v ) ) ] = ∑ v ∈ V Q S ( v ) λ ( P ˉ ( v ) ) + ∑ v ∈ V Q S ( v ) λ ( Q S ( v ) P ˉ ( v ) ) = ∑ v ∈ V Q S ( v ) λ ( P ˉ ( v ) ) − D ( Q S ∥ P ˉ ) . (34) \begin{aligned}
H(S)&=\sum_{v\in\mathcal{V}}\varphi(Q_S(v))\\
&=\sum_{v\in\mathcal{V}}Q_S(v)\left[\lambda(Q_S(v))+\lambda(\bar{P}(v))-\lambda(\bar{P}(v))\right]\\
&=\sum_{v\in\mathcal{V}}Q_S(v)\lambda(\bar{P}(v))+\sum_{v\in\mathcal{V}}Q_S(v)\lambda\left(\frac{Q_S(v)}{\bar{P}(v)}\right)\\
&=\sum_{v\in\mathcal{V}}Q_S(v)\lambda(\bar{P}(v))-D(Q_S\mathbin\Vert\bar{P}). \tag*{(34)}
\end{aligned} H ( S ) = v ∈ V ∑ φ ( Q S ( v )) = v ∈ V ∑ Q S ( v ) [ λ ( Q S ( v )) + λ ( P ˉ ( v )) − λ ( P ˉ ( v )) ] = v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v )) + v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v ) Q S ( v ) ) = v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v )) − D ( Q S ∥ P ˉ ) . (34)
Terms with Q S ( v ) = 0 Q_S(v)=0 Q S ( v ) = 0 contribute nothing to H ( S ) H(S) H ( S ) , since φ ( 0 ) = 0 \varphi(0)=0 φ ( 0 ) = 0 ; in the chain above, they likewise vanish because Q S ( v ) Q_S(v) Q S ( v ) multiplies every summand and carries its zero through. The identity is therefore applied only where both of its arguments are positive.
Write C r C_r C r for the score of the r r r -th record, namely, the surprisal its fifty bytes carry under P ˉ \bar{P} P ˉ :
C r = ∑ i = 1 50 λ ( P ˉ ( S r , i ) ) , r = 1 , … , T . (35) C_r=\sum_{i=1}^{50}\lambda\bigl(\bar{P}(S_{r,i})\bigr),\qquad r=1,\ldots,T. \tag*{(35)} C r = i = 1 ∑ 50 λ ( P ˉ ( S r , i ) ) , r = 1 , … , T . (35)
By Definition 1, the T T T records are i.i.d., and hence so are their scores. We denote the score of a generic record by C C C .
Averaged per byte over the block, the scores give back the cross-entropy term of (31), which we denote by C ˉ S \bar{C}_S C ˉ S ,
C ˉ S = ∑ v ∈ V Q S ( v ) λ ( P ˉ ( v ) ) = 1 N ∑ v ∈ V # ( v ) λ ( P ˉ ( v ) ) = 1 N ∑ r = 1 T ∑ i = 1 50 λ ( P ˉ ( S r , i ) ) = 1 N ∑ r = 1 T C r . (36) \begin{aligned}
\bar{C}_S&=\sum_{v\in\mathcal{V}}Q_S(v)\lambda\bigl(\bar{P}(v)\bigr)\\
&=\frac{1}{N}\sum_{v\in\mathcal{V}}\#(v)\lambda\bigl(\bar{P}(v)\bigr)\\
&=\frac{1}{N}\sum_{r=1}^{T}\sum_{i=1}^{50}\lambda\bigl(\bar{P}(S_{r,i})\bigr)\\
&=\frac{1}{N}\sum_{r=1}^{T}C_r. \tag*{(36)}
\end{aligned} C ˉ S = v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v ) ) = N 1 v ∈ V ∑ # ( v ) λ ( P ˉ ( v ) ) = N 1 r = 1 ∑ T i = 1 ∑ 50 λ ( P ˉ ( S r , i ) ) = N 1 r = 1 ∑ T C r . (36)
Lemma 4. The two moments of the record score are
E [ C ] = 26 E [ λ ( P ˉ ( B U ) ) ] + 12 E [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] = 50 H ( P ˉ ) , Var [ C ] = 26 Var [ λ ( P ˉ ( B U ) ) ] + 12 Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] . (37) \begin{aligned}
\mathbb{E}[C]&=26\mathbb{E}\bigl[\lambda(\bar{P}(B_U))\bigr]+12\mathbb{E}\bigl[\lambda(\bar{P}(B_0))+\lambda(\bar{P}(B_1))\bigr]=50H(\bar{P}),\\
\operatorname{Var}[C]&=26\operatorname{Var}\bigl[\lambda(\bar{P}(B_U))\bigr]+12\operatorname{Var}\bigl[\lambda(\bar{P}(B_0))+\lambda(\bar{P}(B_1))\bigr]. \tag*{(37)}
\end{aligned} E [ C ] Var [ C ] = 26 E [ λ ( P ˉ ( B U )) ] + 12 E [ λ ( P ˉ ( B 0 )) + λ ( P ˉ ( B 1 )) ] = 50 H ( P ˉ ) , = 26 Var [ λ ( P ˉ ( B U )) ] + 12 Var [ λ ( P ˉ ( B 0 )) + λ ( P ˉ ( B 1 )) ] . (37) Consequently, the moments of the block average score are
E [ C ˉ S ] = E [ C ] 50 = H ( P ˉ ) , \mathbb{E}[\bar{C}_S]=\frac{\mathbb{E}[C]}{50}=H(\bar{P}), E [ C ˉ S ] = 50 E [ C ] = H ( P ˉ ) , Var [ C ˉ S ] = Var [ C ] 50 N , (38) \operatorname{Var}[\bar{C}_S]=\frac{\operatorname{Var}[C]}{50N}, \tag*{(38)} Var [ C ˉ S ] = 50 N Var [ C ] , (38) exactly and at every T T T .
Proof. Write B U , r B_{U,r} B U , r for the multiset of the unconstrained bytes and B X , r B_{X,r} B X , r for the multiset of its exponent pairs of the r r r -th record. Regrouping the fifty terms of (35) along this split leaves the sum unchanged,
C r = ∑ b U ∈ B U , r λ ( P ˉ ( b U ) ) + ∑ ( b 0 , b 1 ) ∈ B X , r ( λ ( P ˉ ( b 0 ) ) + λ ( P ˉ ( b 1 ) ) ) . (39) C_r=\sum_{b_U\in B_{U,r}}\lambda\left(\bar{P}(b_U)\right)+\sum_{(b_0,b_1)\in B_{X,r}}\left(\lambda\left(\bar{P}(b_0)\right)+\lambda\left(\bar{P}(b_1)\right)\right). \tag*{(39)} C r = b U ∈ B U , r ∑ λ ( P ˉ ( b U ) ) + ( b 0 , b 1 ) ∈ B X , r ∑ ( λ ( P ˉ ( b 0 ) ) + λ ( P ˉ ( b 1 ) ) ) . (39)
Under (A2) the 38 summands are mutually independent.
Mean. Linearity of expectation in (39) gives
E [ C ] = 26 E [ λ ( P ˉ ( B U ) ) ] + 12 E [ λ ( P ˉ ( B 0 ) ) ] + 12 E [ λ ( P ˉ ( B 1 ) ) ] = 26 ∑ v ∈ V P B U ( v ) λ ( P ˉ ( v ) ) + 12 ∑ v ∈ V P B 0 ( v ) λ ( P ˉ ( v ) ) + 12 ∑ v ∈ V P B 1 ( v ) λ ( P ˉ ( v ) ) = ∑ v ∈ V [ 26 P B U + 12 P B 0 + 12 P B 1 ] ( v ) λ ( P ˉ ( v ) ) = 50 ∑ v ∈ V φ ( P ˉ ( v ) ) = 50 H ( P ˉ ) . (40) \begin{aligned}
E[C]&=26E\left[\lambda\left(\bar{P}(B_U)\right)\right]+12E\left[\lambda\left(\bar{P}(B_0)\right)\right]+12E\left[\lambda\left(\bar{P}(B_1)\right)\right]\\
&=26\sum_{v\in\mathcal{V}}P_{B_U}(v)\lambda\left(\bar{P}(v)\right)+12\sum_{v\in\mathcal{V}}P_{B_0}(v)\lambda\left(\bar{P}(v)\right)+12\sum_{v\in\mathcal{V}}P_{B_1}(v)\lambda\left(\bar{P}(v)\right)\\
&=\sum_{v\in\mathcal{V}}\left[26P_{B_U}+12P_{B_0}+12P_{B_1}\right](v)\lambda\left(\bar{P}(v)\right)\\
&=50\sum_{v\in\mathcal{V}}\varphi\left(\bar{P}(v)\right)=50H(\bar{P}). \tag*{(40)}
\end{aligned} E [ C ] = 26 E [ λ ( P ˉ ( B U ) ) ] + 12 E [ λ ( P ˉ ( B 0 ) ) ] + 12 E [ λ ( P ˉ ( B 1 ) ) ] = 26 v ∈ V ∑ P B U ( v ) λ ( P ˉ ( v ) ) + 12 v ∈ V ∑ P B 0 ( v ) λ ( P ˉ ( v ) ) + 12 v ∈ V ∑ P B 1 ( v ) λ ( P ˉ ( v ) ) = v ∈ V ∑ [ 26 P B U + 12 P B 0 + 12 P B 1 ] ( v ) λ ( P ˉ ( v ) ) = 50 v ∈ V ∑ φ ( P ˉ ( v ) ) = 50 H ( P ˉ ) . (40)
The same contribution can be computed while keeping the exponent pair ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) intact and evaluating it under its joint law P B 0 , 1 P_{B_{0,1}} P B 0 , 1 . This approach uses the fact that (5) and (4) are the marginals of (7) , which Table 1 verifies. By extending the sum to V 2 \mathcal{V}^2 V 2 —with no change in value, since P B 0 , 1 P_{B_{0,1}} P B 0 , 1 vanishes off X \mathcal{X} X —and rearranging the resulting terms, we obtain the same expression:
Table 1. Verification that (5) and (4) are the marginals of (7) . Each interior cell gives the probability mass contributed by the indicated partner categories. Zero indicates that (6) excludes every pair in that block. The entries in each row therefore sum directly to the stated marginal probability.
∑ ( v 0 , v 1 ) ∈ X P B 0 , 1 ( v 0 , v 1 ) ( λ ( P ˉ ( v 0 ) ) + λ ( P ˉ ( v 1 ) ) ) = ∑ v 0 , v 1 ∈ V P B 0 , 1 ( v 0 , v 1 ) λ ( P ˉ ( v 0 ) ) + ∑ v 0 , v 1 ∈ V P B 0 , 1 ( v 0 , v 1 ) λ ( P ˉ ( v 1 ) ) = ∑ v 0 ∈ V λ ( P ˉ ( v 0 ) ) ∑ v 1 ∈ V P B 0 , 1 ( v 0 , v 1 ) + ∑ v 1 ∈ V λ ( P ˉ ( v 1 ) ) ∑ v 0 ∈ V P B 0 , 1 ( v 0 , v 1 ) = ∑ v ∈ V P B 0 ( v ) λ ( P ˉ ( v ) ) + ∑ v ∈ V P B 1 ( v ) λ ( P ˉ ( v ) ) . (41) \begin{aligned}
\sum_{(v_0,v_1)\in\mathcal{X}}P_{B_{0,1}}(v_0,v_1)\left(\lambda\left(\bar{P}(v_0)\right)+\lambda\left(\bar{P}(v_1)\right)\right)
&=\sum_{v_0,v_1\in\mathcal{V}}P_{B_{0,1}}(v_0,v_1)\lambda\left(\bar{P}(v_0)\right)+\sum_{v_0,v_1\in\mathcal{V}}P_{B_{0,1}}(v_0,v_1)\lambda\left(\bar{P}(v_1)\right)\\
&=\sum_{v_0\in\mathcal{V}}\lambda\left(\bar{P}(v_0)\right)\sum_{v_1\in\mathcal{V}}P_{B_{0,1}}(v_0,v_1)+\sum_{v_1\in\mathcal{V}}\lambda\left(\bar{P}(v_1)\right)\sum_{v_0\in\mathcal{V}}P_{B_{0,1}}(v_0,v_1)\\
&=\sum_{v\in\mathcal{V}}P_{B_0}(v)\lambda\left(\bar{P}(v)\right)+\sum_{v\in\mathcal{V}}P_{B_1}(v)\lambda\left(\bar{P}(v)\right). \tag*{(41)}
\end{aligned} ( v 0 , v 1 ) ∈ X ∑ P B 0 , 1 ( v 0 , v 1 ) ( λ ( P ˉ ( v 0 ) ) + λ ( P ˉ ( v 1 ) ) ) = v 0 , v 1 ∈ V ∑ P B 0 , 1 ( v 0 , v 1 ) λ ( P ˉ ( v 0 ) ) + v 0 , v 1 ∈ V ∑ P B 0 , 1 ( v 0 , v 1 ) λ ( P ˉ ( v 1 ) ) = v 0 ∈ V ∑ λ ( P ˉ ( v 0 ) ) v 1 ∈ V ∑ P B 0 , 1 ( v 0 , v 1 ) + v 1 ∈ V ∑ λ ( P ˉ ( v 1 ) ) v 0 ∈ V ∑ P B 0 , 1 ( v 0 , v 1 ) = v ∈ V ∑ P B 0 ( v ) λ ( P ˉ ( v ) ) + v ∈ V ∑ P B 1 ( v ) λ ( P ˉ ( v ) ) . (41)
Thus, for the mean, evaluating the pair jointly gives the same result as evaluating its two components through their marginal laws.
Since the T T T record scores in (36) have the common mean E [ C ] E[C] E [ C ] , the expected value of the block-average score is
E [ C ˉ S ] = T E [ C ] N = E [ C ] 50 = H ( P ˉ ) . (42) E\left[\bar{C}_S\right]=\frac{TE[C]}{N}=\frac{E[C]}{50}=H(\bar{P}). \tag*{(42)} E [ C ˉ S ] = N T E [ C ] = 50 E [ C ] = H ( P ˉ ) . (42)
Variance. The 38 groups of (39) are the finest partition of a record into independent parts, and variances add over them and over no coarser split. Because validity couples the two bytes of every exponent pair, they must be treated jointly, with their contribution given by the variance of λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) \lambda(\bar{P}(B_0))+\lambda(\bar{P}(B_1)) λ ( P ˉ ( B 0 )) + λ ( P ˉ ( B 1 )) , which does not equal the sum of the corresponding single-byte variances, as shown in (50) below. By the per-position marginals of § 2.3 , the 26 unconstrained groups and the 12 exponent pairs are identically distributed under (3) and (7) , respectively, giving
Var [ C ] = 26 Var [ λ ( P ˉ ( B U ) ) ] + 12 Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] . (43) \operatorname{Var}[C] = 26\operatorname{Var}\left[\lambda\left(\bar{P}(B_U)\right)\right] + 12\operatorname{Var}\left[\lambda\left(\bar{P}(B_0)\right)+\lambda\left(\bar{P}(B_1)\right)\right]. \tag*{(43)} Var [ C ] = 26 Var [ λ ( P ˉ ( B U ) ) ] + 12 Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] . (43)
Expanding each of the two terms leaves
Var [ λ ( P ˉ ( B U ) ) ] = E [ λ ( P ˉ ( B U ) ) 2 ] − ( E [ λ ( P ˉ ( B U ) ) ] ) 2 , \operatorname{Var}\left[\lambda\left(\bar{P}(B_U)\right)\right] = E\left[\lambda\left(\bar{P}(B_U)\right)^2\right]-\left(E\left[\lambda\left(\bar{P}(B_U)\right)\right]\right)^2, Var [ λ ( P ˉ ( B U ) ) ] = E [ λ ( P ˉ ( B U ) ) 2 ] − ( E [ λ ( P ˉ ( B U ) ) ] ) 2 ,
Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] = E [ ( λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ) 2 ] − ( E [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] ) 2 . (44) \begin{aligned}
\operatorname{Var}\left[\lambda\left(\bar{P}(B_0)\right)+\lambda\left(\bar{P}(B_1)\right)\right]
&= E\left[\left(\lambda\left(\bar{P}(B_0)\right)+\lambda\left(\bar{P}(B_1)\right)\right)^2\right] \\
&\quad-\left(E\left[\lambda\left(\bar{P}(B_0)\right)+\lambda\left(\bar{P}(B_1)\right)\right]\right)^2. \tag*{(44)}
\end{aligned} Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] = E [ ( λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ) 2 ] − ( E [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] ) 2 . (44)
Unlike the mean, the variance cannot be expressed in terms of P ˉ \bar{P} P ˉ alone. The squared means in (44) are not linear in the three class marginals, so (29) cannot fold them into P ˉ \bar{P} P ˉ as it did in (40) . Moreover, expanding the exponent pair’s second moment introduces the cross term E [ λ ( P ˉ ( B 0 ) ) λ ( P ˉ ( B 1 ) ) ] E[\lambda(\bar{P}(B_0))\lambda(\bar{P}(B_1))] E [ λ ( P ˉ ( B 0 )) λ ( P ˉ ( B 1 ))] , which depends on the joint law (7), not on its marginals. The evaluation of the variance therefore requires computing the per-class moments and the moments of the exponent pair under its joint law.
By (3)–(5) and (30), the three marginals and the surprisal under P ˉ \bar{P} P ˉ are constant on the categories (21), the values of the latter being reported in Table 2 . Hence, for B ∘ ∈ { B U , B 0 , B 1 } B_\circ\in\{B_U,B_0,B_1\} B ∘ ∈ { B U , B 0 , B 1 } and m = 1 , 2 m=1,2 m = 1 , 2 ,
Table 2. The surprisal a byte carries under P ˉ \bar{P} P ˉ , by category (21), from the probabilities (30).
E [ λ ( P ˉ ( B ∘ ) ) m ] = ∑ v ∈ V P B ∘ ( v ) λ ( P ˉ ( v ) ) m = ∑ γ ∈ Γ ∣ γ ∣ P B ∘ ( γ ) λ ( P ˉ ( γ ) ) m . (45) \begin{aligned}
E\left[\lambda\left(\bar{P}(B_\circ)\right)^m\right] &= \sum_{v\in\mathcal{V}} P_{B_\circ}(v)\lambda\left(\bar{P}(v)\right)^m \\
&= \sum_{\gamma\in\Gamma} |\gamma|P_{B_\circ}(\gamma)\lambda\left(\bar{P}(\gamma)\right)^m . \tag*{(45)}
\end{aligned} E [ λ ( P ˉ ( B ∘ ) ) m ] = v ∈ V ∑ P B ∘ ( v ) λ ( P ˉ ( v ) ) m = γ ∈ Γ ∑ ∣ γ ∣ P B ∘ ( γ ) λ ( P ˉ ( γ ) ) m . (45)
The category partitioning thus reduces each expectation to four summands since all ∣ γ ∣ |\gamma| ∣ γ ∣ bytes of a given category contribute the same term.
For the exponent pair the weights must instead come from the joint law P B 0 , 1 P_{B_{0,1}} P B 0 , 1 . It is uniform on X \mathcal{X} X by (7), and the surprisal depends on ( v 0 , v 1 ) (v_0,v_1) ( v 0 , v 1 ) only through their categories, so, to compute a pair moment, only the number of admissible pairs in each cell of Γ × Γ \Gamma\times\Gamma Γ × Γ is needed:
n γ 0 γ 1 = γ 0 \ γ 1 V l o ∗ { 127 } V h i ∗ { 255 } V l o ∗ 16129 127 16129 127 { 127 } 127 1 0 0 V h i ∗ 16129 127 16129 127 { 255 } 127 1 0 0 (46) n_{\gamma_0\gamma_1} =
\begin{array}{c|cccc}
\gamma_0 \backslash\gamma_1 & \mathcal{V}^{*}_{lo} & \{127\} & \mathcal{V}^{*}_{hi} & \{255\} \\
\mathcal{V}^{*}_{lo} & 16129 & 127 & 16129 & 127 \\
\{127\} & 127 & 1 & 0 & 0 \\
\mathcal{V}^{*}_{hi} & 16129 & 127 & 16129 & 127 \\
\{255\} & 127 & 1 & 0 & 0
\end{array} \tag*{(46)} n γ 0 γ 1 = γ 0 \ γ 1 V l o ∗ { 127 } V hi ∗ { 255 } V l o ∗ 16129 127 16129 127 { 127 } 127 1 127 1 V hi ∗ 16129 0 16129 0 { 255 } 127 0 127 0 (46)
Every cell holds all ∣ γ 0 ∣ ∣ γ 1 ∣ |\gamma_0||\gamma_1| ∣ γ 0 ∣∣ γ 1 ∣ pairs of γ 0 × γ 1 \gamma_0\times\gamma_1 γ 0 × γ 1 , except the four that the IEEE-754 validity constraint discards.
A moment of the exponent pair therefore reduces to a sixteen-term sum over Γ × Γ \Gamma\times\Gamma Γ × Γ . For m = 1 , 2 m=1,2 m = 1 , 2 ,
Table 3. First two moments and variances of the byte and exponent-pair surprisal variables under P ˉ \bar{P} P ˉ .
E [ ( λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ) m ] = ∑ ( v 0 , v 1 ) ∈ X P B 0 , 1 ( v 0 , v 1 ) ( λ ( P ˉ ( v 0 ) ) + λ ( P ˉ ( v 1 ) ) ) m = 1 65280 ∑ γ 0 , γ 1 ∈ Γ n γ 0 γ 1 ( λ ( P ˉ ( γ 0 ) ) + λ ( P ˉ ( γ 1 ) ) ) m , (47) \begin{aligned}
E\left[\left(\lambda(\bar{P}(B_0))+\lambda(\bar{P}(B_1))\right)^m\right]
&= \sum_{(v_0,v_1)\in\mathcal{X}} P_{B_0,1}(v_0,v_1)\left(\lambda(\bar{P}(v_0))+\lambda(\bar{P}(v_1))\right)^m \\
&= \frac{1}{65280}\sum_{\gamma_0,\gamma_1\in\Gamma}n_{\gamma_0\gamma_1}\left(\lambda(\bar{P}(\gamma_0))+\lambda(\bar{P}(\gamma_1))\right)^m, \tag*{(47)}
\end{aligned} E [ ( λ ( P ˉ ( B 0 )) + λ ( P ˉ ( B 1 )) ) m ] = ( v 0 , v 1 ) ∈ X ∑ P B 0 , 1 ( v 0 , v 1 ) ( λ ( P ˉ ( v 0 )) + λ ( P ˉ ( v 1 )) ) m = 65280 1 γ 0 , γ 1 ∈ Γ ∑ n γ 0 γ 1 ( λ ( P ˉ ( γ 0 )) + λ ( P ˉ ( γ 1 )) ) m , (47)
The common denominator factors out, while n γ 0 γ 1 n_{\gamma_0\gamma_1} n γ 0 γ 1 gives the multiplicity of each category pair.
Table 3 reports the first and second moments of the unconstrained-byte and exponent-pair surprisals, required by the two variances in (44) and evaluated using (45) and (47) . Substitution into (43) then gives
Var [ C ] ≈ 0.011755404409. (48) \operatorname{Var}[C]\approx0.011755404409. \tag*{(48)} Var [ C ] ≈ 0.011755404409. (48)
Since the T T T record scores in (36) are independent and have the common variance Var [ C ] \operatorname{Var}[C] Var [ C ] , the variance of the block-average score is
Var [ C ˉ S ] = T Var [ C ] N 2 = Var [ C ] 50 N . (49) \operatorname{Var}[\bar{C}_S]=\frac{T\operatorname{Var}[C]}{N^2}=\frac{\operatorname{Var}[C]}{50N}. \tag*{(49)} Var [ C ˉ S ] = N 2 T Var [ C ] = 50 N Var [ C ] . (49)
Together with (42) , this establishes (38) .
Covariance within the exponent pair. To quantify the dependence within the exponent pair, we compute the covariance of its two byte-surprisal contributions:
Cov [ λ ( P ˉ ( B 0 ) ) , λ ( P ˉ ( B 1 ) ) ] = Var [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] 2 − Var [ λ ( P ˉ ( B 0 ) ) ] + Var [ λ ( P ˉ ( B 1 ) ) ] 2 (50) \operatorname{Cov}\left[\lambda(\bar{P}(B_0)),\lambda(\bar{P}(B_1))\right]
=\frac{\operatorname{Var}\left[\lambda(\bar{P}(B_0))+\lambda(\bar{P}(B_1))\right]}{2}
-\frac{\operatorname{Var}\left[\lambda(\bar{P}(B_0))\right]+\operatorname{Var}\left[\lambda(\bar{P}(B_1))\right]}{2} \tag*{(50)} Cov [ λ ( P ˉ ( B 0 )) , λ ( P ˉ ( B 1 )) ] = 2 Var [ λ ( P ˉ ( B 0 )) + λ ( P ˉ ( B 1 )) ] − 2 Var [ λ ( P ˉ ( B 0 )) ] + Var [ λ ( P ˉ ( B 1 )) ] (50)
Cov [ λ ( P ˉ ( B 0 ) ) , λ ( P ˉ ( B 1 ) ) ] ≈ − 0.000000981412. \operatorname{Cov}\left[\lambda(\bar{P}(B_0)),\lambda(\bar{P}(B_1))\right]\approx-0.000000981412. Cov [ λ ( P ˉ ( B 0 )) , λ ( P ˉ ( B 1 )) ] ≈ − 0.000000981412.
Although the covariance is small, omitting it would overestimate Var [ C ] \operatorname{Var}[C] Var [ C ] by approximately 0.000023553883, or 0.2%.
The Entropy Ceiling
Section 2 defines H ∞ H_{\infty} H ∞ as the limit the block entropy attains as the string grows and gives H ∞ = 8 H_{\infty}=8 H ∞ = 8 bits for independent uniform bytes. For the VSTL source, if Q S = P ˉ Q_S=\bar{P} Q S = P ˉ , then (31) reduces to H ( S ) = H ( P ˉ ) H(S)=H(\bar{P}) H ( S ) = H ( P ˉ ) , with D ( Q S ∥ P ˉ ) = 0 D(Q_S\mathbin\Vert\bar{P})=0 D ( Q S ∥ P ˉ ) = 0 . Lemma 4 shows that H ( P ˉ ) H(\bar{P}) H ( P ˉ ) is also the exact mean of the cross-entropy term for every T T T , making it the candidate value of H ∞ V S T L H_{\infty}^{\mathrm{VSTL}} H ∞ VSTL . The following proposition establishes it.
Proposition 2. Let
H ∞ V S T L = H ( P ˉ ) ≈ 7.99991479609. (51) H_{\infty}^{\mathrm{VSTL}}=H(\bar{P})\approx7.99991479609. \tag*{(51)} H ∞ VSTL = H ( P ˉ ) ≈ 7.99991479609. (51) Then H ( S ) → H ∞ V S T L H(S)\to H_{\infty}^{\mathrm{VSTL}} H ( S ) → H ∞ VSTL almost surely as T → ∞ T\to\infty T → ∞ . Moreover, at every T T T ,
μ V S T L ( T ) = H ∞ V S T L − E [ D ( Q S ∥ P ˉ ) ] < H ∞ V S T L . (52) \mu^{\mathrm{VSTL}}(T)=H_{\infty}^{\mathrm{VSTL}}-\mathbb{E}\left[D(Q_S\mathbin\Vert\bar{P})\right]<H_{\infty}^{\mathrm{VSTL}}. \tag*{(52)} μ VSTL ( T ) = H ∞ VSTL − E [ D ( Q S ∥ P ˉ ) ] < H ∞ VSTL . (52) The deficit from H ∞ H_{\infty} H ∞ , the entropy ceiling under the uniform-byte model, is
Δ = H ∞ − H ∞ V S T L ≈ 0.00008520391 bits . (53) \Delta=H_{\infty}-H_{\infty}^{\mathrm{VSTL}}\approx0.00008520391\ \text{bits}. \tag*{(53)} Δ = H ∞ − H ∞ VSTL ≈ 0.00008520391 bits . (53)
Proof. For each v ∈ V v\in\mathcal{V} v ∈ V , its counts in the T T T records are i.i.d. by Definition 1, bounded, and have common mean 50 P ˉ ( v ) 50\bar{P}(v) 50 P ˉ ( v ) by (29) . The strong law of large numbers [13 Sec. 7.5] gives Q S ( v ) → P ˉ ( v ) Q_S(v)\to\bar{P}(v) Q S ( v ) → P ˉ ( v ) almost surely for each v v v ; since V \mathcal{V} V is finite, these coordinatewise convergences hold simultaneously, and hence Q S → P ˉ Q_S\to\bar{P} Q S → P ˉ almost surely. The continuity of H H H on the probability simplex then gives H ( S ) = H ( Q S ) → H ( P ˉ ) = H ∞ V S T L H(S)=H(Q_S)\to H(\bar{P})=H_{\infty}^{\mathrm{VSTL}} H ( S ) = H ( Q S ) → H ( P ˉ ) = H ∞ VSTL almost surely.
Taking expectations in (31) and using E [ C ˉ S ] = H ( P ˉ ) \mathbb{E}[\bar{C}_S]=H(\bar{P}) E [ C ˉ S ] = H ( P ˉ ) from Lemma 4 gives (52) . Since the divergence is nonnegative and vanishes only at Q S = P ˉ Q_S=\bar{P} Q S = P ˉ , its expectation is strictly positive, proving the inequality. Indeed, for every finite T T T , the empirical byte distribution is not fixed at P ˉ \bar{P} P ˉ and therefore differs from it with positive probability.
Finally, P ˉ \bar{P} P ˉ is nonuniform, so H ( P ˉ ) = H ∞ V S T L < H ∞ H(\bar{P})=H_{\infty}^{\mathrm{VSTL}}<H_{\infty} H ( P ˉ ) = H ∞ VSTL < H ∞ , and (53) follows.
One distinction remains: H ∞ V S T L H_{\infty}^{\mathrm{VSTL}} H ∞ VSTL is the limiting entropy of the empirical byte distribution, not the entropy rate of the VSTL source. Each record consists of the 26 uniform bytes and 12 exponent pairs in (39) , so its entropy is
26 λ ( 1 ∣ V ∣ ) + 12 λ ( 1 ∣ X ∣ ) = 12 λ ( 1 ∣ F ∣ ) + 2 λ ( 1 ∣ V ∣ ) . (54) 26\lambda\left(\frac{1}{|\mathcal{V}|}\right)+12\lambda\left(\frac{1}{|\mathcal{X}|}\right)=12\lambda\left(\frac{1}{|\mathcal{F}|}\right)+2\lambda\left(\frac{1}{|\mathcal{V}|}\right). \tag*{(54)} 26 λ ( ∣ V ∣ 1 ) + 12 λ ( ∣ X ∣ 1 ) = 12 λ ( ∣ F ∣ 1 ) + 2 λ ( ∣ V ∣ 1 ) . (54)
The source entropy rate is therefore
h V S T L : = 26 H ( P B U ) + 12 H ( P B 0 , 1 ) 50 . (55) h^{\mathrm{VSTL}} := \frac{26H(P_{B_U}) + 12H(P_{B_{0,1}})}{50}. \tag*{(55)} h VSTL := 50 26 H ( P B U ) + 12 H ( P B 0 , 1 ) . (55)
The marginal and joint entropies are reported in Table 4 . Two standard inequalities then give
Table 4. Entropies of the three byte marginals and the joint law of an exponent pair.
H ∞ V S T L ≥ 26 H ( P B U ) + 12 ( H ( P B 0 ) + H ( P B 1 ) ) 50 ≥ h V S T L . (56) H_{\infty}^{\mathrm{VSTL}} \ge\frac{26H(P_{B_U}) + 12\left(H(P_{B_0}) + H(P_{B_1})\right)}{50} \ge h^{\mathrm{VSTL}}. \tag*{(56)} H ∞ VSTL ≥ 50 26 H ( P B U ) + 12 ( H ( P B 0 ) + H ( P B 1 ) ) ≥ h VSTL . (56)
The first inequality is the concavity of H H H [12 Thm. 2.7.3] , applied to P ˉ \bar{P} P ˉ ; the difference is approximately 0.000331457193 bits per byte. The second inequality is the independence bound [12 Thm. 2.6.6] . For each exponent pair, the difference between the sum of the marginal entropies and the joint entropy is the mutual information
I ( B 0 ; B 1 ) = H ( P B 0 ) + H ( P B 1 ) − H ( P B 0 , 1 ) ≈ 0.003910475212 bits . (57) I(B_0; B_1) = H(P_{B_0}) + H(P_{B_1}) - H(P_{B_{0,1}}) \approx0.003910475212\ \text{bits}. \tag*{(57)} I ( B 0 ; B 1 ) = H ( P B 0 ) + H ( P B 1 ) − H ( P B 0 , 1 ) ≈ 0.003910475212 bits . (57)
Accumulated over all exponent pairs and normalized per byte, this gives the difference of approximately 0.000938514051 bits per byte between the two sides of the second inequality. Overall, the total gap is 0.001269971244 bits per byte, about fifteen times Δ \Delta Δ .
These two differences explain why the limiting entropy of the empirical byte distribution differs from the source entropy rate. Reading (56) from right to left, the independence bound first replaces the joint law P B 0 , 1 P_{B_{0,1}} P B 0 , 1 in h V S T L h^{\mathrm{VSTL}} h VSTL with its two marginals. Concavity then replaces the position-dependent marginals with their average P ˉ \bar{P} P ˉ . Accordingly, h V S T L h^{\mathrm{VSTL}} h VSTL reflects both the dependence within exponent pairs and the differences among positional marginals, whereas H ∞ V S T L H_{\infty}^{\mathrm{VSTL}} H ∞ VSTL is the entropy of their pooled byte law P ˉ \bar{P} P ˉ .
Because the global entropy statistic operates at this aggregate level, the analysis below uses H ∞ V S T L H_{\infty}^{\mathrm{VSTL}} H ∞ VSTL as its reference value rather than h V S T L h^{\mathrm{VSTL}} h VSTL .
Second-Order Expansions of the Reference Values
A Taylor expansion of H ( S ) H(S) H ( S ) about P ˉ \bar{P} P ˉ relates fluctuations of the empirical byte distribution to the reference mean and variance. The decomposition established in Lemma 3 separates a linear cross-entropy score, whose moments are given by Lemma 4, from a divergence, which is expanded coordinatewise with a remainder that quantifies the approximation error. Each coordinate of the whole-file empirical distribution averages contributions from independent, identically distributed records, so the required expectations and covariances can be calculated from the joint moments for a single record.
The difference between the empirical byte distribution and its mean recurs throughout the expansion. For brevity, this fluctuation at any v ∈ V v \in\mathcal{V} v ∈ V is abbreviated as
δ S , v = Q S ( v ) − P ˉ ( v ) . (58) \delta_{S,v}=Q_S(v)-\bar{P}(v). \tag*{(58)} δ S , v = Q S ( v ) − P ˉ ( v ) . (58)
For a given K ≥ 2 K \ge2 K ≥ 2 and a function f f f with K + 1 K+1 K + 1 continuous derivatives between a a a and x x x , Taylor’s formula with an integral remainder is
f ( x ) = ∑ k = 0 K f ( k ) ( a ) k ! ( x − a ) k + ∫ a x ( x − t ) K K ! f ( K + 1 ) ( t ) d t , (59) f(x)=\sum_{k=0}^{K}\frac{f^{(k)}(a)}{k!}(x-a)^k+\int_a^x\frac{(x-t)^K}{K!}f^{(K+1)}(t)\,\mathrm{d}t, \tag*{(59)} f ( x ) = k = 0 ∑ K k ! f ( k ) ( a ) ( x − a ) k + ∫ a x K ! ( x − t ) K f ( K + 1 ) ( t ) d t , (59)
This identity follows from the fundamental theorem of calculus after K K K integrations by parts [14 Ch. 7] .
Entropy is separable across byte values: each summand involves a single coordinate, so its Taylor expansion requires only the univariate derivatives of φ \varphi φ given by
φ ′ ( x ) = λ ( x ) − 1 ln ( 2 ) , \varphi'(x)=\lambda(x)-\frac{1}{\ln(2)}, φ ′ ( x ) = λ ( x ) − ln ( 2 ) 1 ,
φ ( k ) ( x ) = ( − 1 ) k − 1 ( k − 2 ) ! ln ( 2 ) x k − 1 , k ≥ 2. (60) \varphi^{(k)}(x)=\frac{(-1)^{k-1}(k-2)!}{\ln(2)x^{k-1}},\qquad k\ge2. \tag*{(60)} φ ( k ) ( x ) = ln ( 2 ) x k − 1 ( − 1 ) k − 1 ( k − 2 )! , k ≥ 2. (60)
The formula for φ ( k ) \varphi^{(k)} φ ( k ) is used in the classical entropy expansion of Basharin [8 Eq. (5)] .
Applying (59) to each coordinate, with a = P ˉ ( v ) a=\bar{P}(v) a = P ˉ ( v ) and x = Q S ( v ) x=Q_S(v) x = Q S ( v ) , gives
H ( S ) = ∑ v ∈ V φ ( P ˉ ( v ) ) + ∑ v ∈ V φ ′ ( P ˉ ( v ) ) δ S , v + ∑ k = 2 K ∑ v ∈ V δ S , v k φ ( k ) ( P ˉ ( v ) ) k ! + ∑ v ∈ V R K , v , (61) \begin{aligned}
H(S)={}&\sum_{v\in\mathcal{V}}\varphi\left(\bar{P}(v)\right)+\sum_{v\in\mathcal{V}}\varphi'\left(\bar{P}(v)\right)\delta_{S,v}\\
&+\sum_{k=2}^{K}\sum_{v\in\mathcal{V}}\frac{\delta_{S,v}^{k}\varphi^{(k)}\left(\bar{P}(v)\right)}{k!}+\sum_{v\in\mathcal{V}}R_{K,v}, \tag*{(61)}
\end{aligned} H ( S ) = v ∈ V ∑ φ ( P ˉ ( v ) ) + v ∈ V ∑ φ ′ ( P ˉ ( v ) ) δ S , v + k = 2 ∑ K v ∈ V ∑ k ! δ S , v k φ ( k ) ( P ˉ ( v ) ) + v ∈ V ∑ R K , v , (61)
where R K , v R_{K,v} R K , v is the coordinatewise remainder
R K , v = ∫ P ˉ ( v ) Q S ( v ) ( Q S ( v ) − t ) K K ! φ ( K + 1 ) ( t ) d t . (62) R_{K,v}=\int_{\bar{P}(v)}^{Q_S(v)}\frac{\left(Q_S(v)-t\right)^K}{K!}\varphi^{(K+1)}(t)\,\mathrm{d}t. \tag*{(62)} R K , v = ∫ P ˉ ( v ) Q S ( v ) K ! ( Q S ( v ) − t ) K φ ( K + 1 ) ( t ) d t . (62)
As established earlier, the expansion point is the exact mean of the empirical byte distribution, so the deviations δ S , v \delta_{S,v} δ S , v are centred. Furthermore, since every P ˉ ( v ) \bar{P}(v) P ˉ ( v ) is positive, all derivatives in (61) are finite at the expansion point.
The linear term in (61) can now be simplified by substituting the expression for φ ′ ( x ) \varphi'(x) φ ′ ( x ) from (60) :
∑ v ∈ V δ S , v φ ′ ( P ˉ ( v ) ) = ∑ v ∈ V Q S ( v ) λ ( P ˉ ( v ) ) − ∑ v ∈ V φ ( P ˉ ( v ) ) \sum_{v\in\mathcal{V}}\delta_{S,v}\varphi'(\bar{P}(v))=\sum_{v\in\mathcal{V}}Q_{S}(v)\lambda(\bar{P}(v))-\sum_{v\in\mathcal{V}}\varphi(\bar{P}(v)) v ∈ V ∑ δ S , v φ ′ ( P ˉ ( v )) = v ∈ V ∑ Q S ( v ) λ ( P ˉ ( v )) − v ∈ V ∑ φ ( P ˉ ( v ))
− 1 ln ( 2 ) ( ∑ v ∈ V Q S ( v ) − ∑ v ∈ V P ˉ ( v ) ) = C ˉ S − H ∞ V S T L . (63) \begin{aligned}
\qquad-\frac{1}{\ln(2)}\left(\sum_{v\in\mathcal{V}}Q_{S}(v)-\sum_{v\in\mathcal{V}}\bar{P}(v)\right) \\
&= \bar{C}_{S}-H_{\infty}^{\mathrm{VSTL}}. \tag*{(63)}
\end{aligned} − ln ( 2 ) 1 ( v ∈ V ∑ Q S ( v ) − v ∈ V ∑ P ˉ ( v ) ) = C ˉ S − H ∞ VSTL . (63)
Histogram normalization gives ∑ v ∈ V Q S ( v ) = ∑ v ∈ V P ˉ ( v ) = 1 \sum_{v\in\mathcal{V}}Q_{S}(v)=\sum_{v\in\mathcal{V}}\bar{P}(v)=1 ∑ v ∈ V Q S ( v ) = ∑ v ∈ V P ˉ ( v ) = 1 ; therefore, the constant term in φ ′ ( x ) \varphi'(x) φ ′ ( x ) makes no contribution.
Substituting (63) into (61) and comparing the result with Lemma 3 isolates the divergence:
− D ( Q S ∥ P ˉ ) = ∑ k = 2 K ( − 1 ) k − 1 ln ( 2 ) k ( k − 1 ) ∑ v ∈ V δ S , v k P ˉ ( v ) k − 1 + ∑ v ∈ V R K , v . (64) -D(Q_{S}\Vert\bar{P})=\sum_{k=2}^{K}\frac{(-1)^{k-1}}{\ln(2)k(k-1)}\sum_{v\in\mathcal{V}}\frac{\delta_{S,v}^{k}}{\bar{P}(v)^{k-1}}+\sum_{v\in\mathcal{V}}R_{K,v}. \tag*{(64)} − D ( Q S ∥ P ˉ ) = k = 2 ∑ K ln ( 2 ) k ( k − 1 ) ( − 1 ) k − 1 v ∈ V ∑ P ˉ ( v ) k − 1 δ S , v k + v ∈ V ∑ R K , v . (64)
The equation remains separable across byte values and expresses the nonlinear part of the entropy in powers of the per-coordinate deviations, beginning with their squares.
To determine an appropriate value for K K K so that the reference mean and variance are approximated with sufficient accuracy, we must first analyze the error left after truncating the expansion at that degree. For each coordinate, this error is R K , v R_{K,v} R K , v . In the following calculations, its magnitude is shown to be bounded by a constant multiple of ∣ δ S , v ∣ K + 1 |\delta_{S,v}|^{K+1} ∣ δ S , v ∣ K + 1 .
Substituting the formula for φ ( K + 1 ) \varphi^{(K+1)} φ ( K + 1 ) from (60) into (62) gives
R K , v = ∫ P ˉ ( v ) Q S ( v ) ( Q S ( v ) − t ) K K ! ⋅ ( − 1 ) K ( K − 1 ) ! ln ( 2 ) t K d t = ( − 1 ) K ln ( 2 ) K ∫ P ˉ ( v ) Q S ( v ) ( Q S ( v ) − t t ) K d t . (65) \begin{aligned}
R_{K,v}=\int_{\bar{P}(v)}^{Q_{S}(v)}\frac{(Q_{S}(v)-t)^{K}}{K!}\cdot\frac{(-1)^{K}(K-1)!}{\ln(2)t^{K}}\,dt \\
&=\frac{(-1)^{K}}{\ln(2)K}\int_{\bar{P}(v)}^{Q_{S}(v)}\left(\frac{Q_{S}(v)-t}{t}\right)^{K}\,dt. \tag*{(65)}
\end{aligned} R K , v = ∫ P ˉ ( v ) Q S ( v ) K ! ( Q S ( v ) − t ) K ⋅ ln ( 2 ) t K ( − 1 ) K ( K − 1 )! d t = ln ( 2 ) K ( − 1 ) K ∫ P ˉ ( v ) Q S ( v ) ( t Q S ( v ) − t ) K d t . (65)
This expression is rewritten by parametrizing the line segment from P ˉ ( v ) \bar{P}(v) P ˉ ( v ) to Q S ( v ) Q_{S}(v) Q S ( v ) . This substitution allows us to factor out a power of the deviation δ S , v \delta_{S,v} δ S , v , leaving an integral that can be bounded uniformly. The parameter runs from u = 0 u=0 u = 0 at the expansion point to u = 1 u=1 u = 1 at the empirical probability, giving
t = P ‾ ( v ) + u δ S , v , u ∈ [ 0 , 1 ] , t ∣ u = 0 = P ‾ ( v ) , t ∣ u = 1 = Q S ( v ) , d t = δ S , v d u . (66) \begin{aligned}
t &= \overline{P}(v)+u\delta_{S,v}, \qquad u\in[0,1],\\
t\big|_{u=0} &= \overline{P}(v), \qquad t\big|_{u=1}=Q_S(v),\\
dt &= \delta_{S,v}du. \tag*{(66)}
\end{aligned} t t u = 0 d t = P ( v ) + u δ S , v , u ∈ [ 0 , 1 ] , = P ( v ) , t u = 1 = Q S ( v ) , = δ S , v d u . (66)
which transforms (65) into
R K , v = ( − 1 ) K ln ( 2 ) K ∫ 0 1 ( ( 1 − u ) δ S , v P ‾ ( v ) + u δ S , v ) K δ S , v d u = ( − 1 ) K δ S , v K + 1 ln ( 2 ) K ∫ 0 1 ( 1 − u ( 1 − u ) P ‾ ( v ) + u Q S ( v ) ) K d u . (67) \begin{aligned}
R_{K,v}
&=\frac{(-1)^K}{\ln(2)K}\int_0^1\left(\frac{(1-u)\delta_{S,v}}{\overline{P}(v)+u\delta_{S,v}}\right)^K\delta_{S,v}du\\
&=\frac{(-1)^K\delta_{S,v}^{K+1}}{\ln(2)K}\int_0^1\left(\frac{1-u}{(1-u)\overline{P}(v)+uQ_S(v)}\right)^Kdu. \tag*{(67)}
\end{aligned} R K , v = ln ( 2 ) K ( − 1 ) K ∫ 0 1 ( P ( v ) + u δ S , v ( 1 − u ) δ S , v ) K δ S , v d u = ln ( 2 ) K ( − 1 ) K δ S , v K + 1 ∫ 0 1 ( ( 1 − u ) P ( v ) + u Q S ( v ) 1 − u ) K d u . (67)
When Q S ( v ) = 0 Q_S(v)=0 Q S ( v ) = 0 and u = 1 u=1 u = 1 , the ratio in (67) is undefined, but the integral can still be defined as an improper integral by approaching the upper integration endpoint from below [14 Sec. 10.23] . The resulting limit exists because, for Q S ( v ) = 0 Q_S(v)=0 Q S ( v ) = 0 and u ∈ [ 0 , 1 ) u\in[0,1) u ∈ [ 0 , 1 ) , the ratio is constant at 1 / P ‾ ( v ) 1/\overline{P}(v) 1/ P ( v ) . Assigning this same value at u = 1 u=1 u = 1 therefore gives a continuous extension whose ordinary integral agrees with that limit.
The preceding argument establishes the following inequalities:
( 1 − u ) P ‾ ( v ) ≤ ( 1 − u ) P ‾ ( v ) + u Q S ( v ) , 0 ≤ 1 − u ( 1 − u ) P ‾ ( v ) + u Q S ( v ) ≤ 1 P ‾ ( v ) , 0 ≤ ∫ 0 1 ( 1 − u ( 1 − u ) P ‾ ( v ) + u Q S ( v ) ) K d u ≤ ∫ 0 1 1 P ‾ ( v ) K d u = 1 P ‾ ( v ) K . (68) \begin{aligned}
(1-u)\overline{P}(v)&\le(1-u)\overline{P}(v)+uQ_S(v),\\
0\le\frac{1-u}{(1-u)\overline{P}(v)+uQ_S(v)}&\le\frac{1}{\overline{P}(v)},\\
0\le\int_0^1\left(\frac{1-u}{(1-u)\overline{P}(v)+uQ_S(v)}\right)^Kdu&\le\int_0^1\frac{1}{\overline{P}(v)^K}du=\frac{1}{\overline{P}(v)^K}. \tag*{(68)}
\end{aligned} ( 1 − u ) P ( v ) 0 ≤ ( 1 − u ) P ( v ) + u Q S ( v ) 1 − u 0 ≤ ∫ 0 1 ( ( 1 − u ) P ( v ) + u Q S ( v ) 1 − u ) K d u ≤ ( 1 − u ) P ( v ) + u Q S ( v ) , ≤ P ( v ) 1 , ≤ ∫ 0 1 P ( v ) K 1 d u = P ( v ) K 1 . (68)
Combining this result with (67) gives the error bound
∣ R K , v ∣ ≤ ∣ δ S , v ∣ K + 1 ln ( 2 ) K P ‾ ( v ) K . (69) |R_{K,v}|\le\frac{|\delta_{S,v}|^{K+1}}{\ln(2)K\overline{P}(v)^K}. \tag*{(69)} ∣ R K , v ∣ ≤ ln ( 2 ) K P ( v ) K ∣ δ S , v ∣ K + 1 . (69)
The Reference Mean
To proceed with the asymptotic analysis, we first require moments of the histogram deviations. Fix a byte v ∈ V v\in\mathcal{V} v ∈ V and denote its count in the r r r -th record by X v , r ∈ { 0 , … , 50 } X_{v,r}\in\{0,\ldots,50\} X v , r ∈ { 0 , … , 50 } . By Definition 1, these counts are i.i.d. across the T T T records, and their generic representative is denoted by X v X_v X v . Using the multisets B U , r B_{U,r} B U , r and B χ , r B_{\chi,r} B χ , r introduced in (39) and the counting functions Z U , v Z_{U,v} Z U , v and Z χ , v Z_{\chi,v} Z χ , v , defined in (11) and (12), we obtain
X v , r = ∑ b U ∈ B U , r Z U , v ( b U ) + ∑ ( b 0 , b 1 ) ∈ B χ , r Z χ , v ( b 0 , b 1 ) , Q S ( v ) = # ( v ) N = 1 N ∑ r = 1 T X v , r , E [ X v ] = 50 P ‾ ( v ) . (70) \begin{aligned}
X_{v,r} &= \sum_{b_U\in B_{U,r}} Z_{U,v}(b_U)+\sum_{(b_0,b_1)\in B_{\chi,r}} Z_{\chi,v}(b_0,b_1),\\
Q_S(v) &= \frac{\#(v)}{N}=\frac{1}{N}\sum_{r=1}^{T}X_{v,r},\\
E[X_v] &= 50\overline{P}(v). \tag*{(70)}
\end{aligned} X v , r Q S ( v ) E [ X v ] = b U ∈ B U , r ∑ Z U , v ( b U ) + ( b 0 , b 1 ) ∈ B χ , r ∑ Z χ , v ( b 0 , b 1 ) , = N # ( v ) = N 1 r = 1 ∑ T X v , r , = 50 P ( v ) . (70)
Thus, although Q S ( v ) Q_S(v) Q S ( v ) is computed over the entire block, it is a normalized sum of independent record-level counts.
The corresponding centred record count is therefore
X ~ v : = X v − E [ X v ] . (71) \widetilde{X}_v := X_v-E[X_v]. \tag*{(71)} X v := X v − E [ X v ] . (71)
By construction, E [ X ~ v ] = 0 E[\widetilde{X}_v]=0 E [ X v ] = 0 [13 Def. (3.3.5)] , but for every higher order the central moment follows from the binomial expansion [15 Sec. 5-4]
E [ X ~ v k ] = ∑ i = 0 k ( − 1 ) k − i ( k i ) E [ X v ] k − i E [ X v i ] . (72) E\left[\widetilde{X}_v^k\right]=\sum_{i=0}^{k}(-1)^{k-i}\binom{k}{i}E[X_v]^{k-i}E\left[X_v^i\right]. \tag*{(72)} E [ X v k ] = i = 0 ∑ k ( − 1 ) k − i ( i k ) E [ X v ] k − i E [ X v i ] . (72)
Proposition 3. As T → ∞ T\to\infty T → ∞ , the V S T L VSTL V S T L reference mean admits the following second-order expansion:
μ V S T L ( T ) = H ∞ V S T L − 1 100 ln ( 2 ) N ∑ v ∈ V E [ X ~ v 2 ] P ‾ ( v ) − 1 100 ln ( 2 ) N 2 ∑ v ∈ V [ E [ X ~ v 2 ] 2 100 P ‾ ( v ) 3 − E [ X ~ v 3 ] 3 P ‾ ( v ) 2 ] + O ( N − 3 ) . (73) \begin{aligned}
\mu^{\mathrm{VSTL}}(T) &= H_{\infty}^{\mathrm{VSTL}}-\frac{1}{100\ln(2)N}\sum_{v\in\mathcal{V}}\frac{E[\widetilde{X}_v^2]}{\overline{P}(v)}\\
&\quad-\frac{1}{100\ln(2)N^2}\sum_{v\in\mathcal{V}}\left[\frac{E[\widetilde{X}_v^2]^2}{100\overline{P}(v)^3}-\frac{E[\widetilde{X}_v^3]}{3\overline{P}(v)^2}\right]+O(N^{-3}). \tag*{(73)}
\end{aligned} μ VSTL ( T ) = H ∞ VSTL − 100 ln ( 2 ) N 1 v ∈ V ∑ P ( v ) E [ X v 2 ] − 100 ln ( 2 ) N 2 1 v ∈ V ∑ [ 100 P ( v ) 3 E [ X v 2 ] 2 − 3 P ( v ) 2 E [ X v 3 ] ] + O ( N − 3 ) . (73)
Proof. By Proposition 2 and (52), it suffices to expand E [ D ( Q S ∥ P ‾ ) ] E[D(Q_S\Vert\overline{P})] E [ D ( Q S ∥ P )] .
Equations (70) and (71) show that each histogram deviation is a normalized sum of centred i.i.d. record counts:
δ S , v = 1 N ∑ r = 1 T X v , r − P ‾ ( v ) = 1 N ∑ r = 1 T ( X v , r − 50 P ‾ ( v ) ) = 1 N ∑ r = 1 T X ~ v , r . (74) \begin{aligned}
\delta_{S,v} &= \frac{1}{N}\sum_{r=1}^{T}X_{v,r}-\overline{P}(v)\\
&= \frac{1}{N}\sum_{r=1}^{T}\left(X_{v,r}-50\overline{P}(v)\right)\\
&= \frac{1}{N}\sum_{r=1}^{T}\widetilde{X}_{v,r}. \tag*{(74)}
\end{aligned} δ S , v = N 1 r = 1 ∑ T X v , r − P ( v ) = N 1 r = 1 ∑ T ( X v , r − 50 P ( v ) ) = N 1 r = 1 ∑ T X v , r . (74)
Consequently, the moments of the histogram deviations can be expressed through moments of the centred record counts.
Raising the final identity in (74) to the k k k -th power yields a sum over k k k -tuples ( r 1 , … , r k ) (r_1,\ldots,r_k) ( r 1 , … , r k ) of not necessarily distinct record indices, where each summand is a product of the form X ~ v , r 1 ⋯ X ~ v , r k \widetilde{X}_{v,r_1}\cdots\widetilde{X}_{v,r_k} X v , r 1 ⋯ X v , r k . Independence factorizes the expectation of each term, with each represented record contributing a centred moment of order equal to its multiplicity. Since E [ X ~ v ] = 0 E[\widetilde{X}_v]=0 E [ X v ] = 0 , a term vanishes unless each of its constituent records has multiplicity at least two. For k ≥ 2 k\ge2 k ≥ 2 ,
E [ δ S , v k ] = 1 N k ∑ r 1 = 1 T ⋯ ∑ r k = 1 T E [ X ~ v , r 1 ⋯ X ~ v , r k ] = 1 N k ∑ ℓ = 1 ⌊ k / 2 ⌋ ( T ℓ ) ∑ a 1 , … , a ℓ ≥ 2 a 1 + ⋯ + a ℓ = k ( k a 1 , … , a ℓ ) ∏ i = 1 ℓ E [ X ~ v a i ] . (75) \begin{aligned}
E\left[\delta_{S,v}^{k}\right]
&=\frac{1}{N^k}\sum_{r_1=1}^{T}\cdots\sum_{r_k=1}^{T}E\left[\widetilde{X}_{v,r_1}\cdots\widetilde{X}_{v,r_k}\right]\\
&=\frac{1}{N^k}\sum_{\ell=1}^{\lfloor k/2\rfloor}\binom{T}{\ell}
\sum_{\substack{a_1,\ldots,a_\ell\ge2\\a_1+\cdots+a_\ell=k}}
\binom{k}{a_1,\ldots,a_\ell}\prod_{i=1}^{\ell}E\left[\widetilde{X}_v^{a_i}\right]. \tag*{(75)}
\end{aligned} E [ δ S , v k ] = N k 1 r 1 = 1 ∑ T ⋯ r k = 1 ∑ T E [ X v , r 1 ⋯ X v , r k ] = N k 1 ℓ = 1 ∑ ⌊ k /2 ⌋ ( ℓ T ) a 1 , … , a ℓ ≥ 2 a 1 + ⋯ + a ℓ = k ∑ ( a 1 , … , a ℓ k ) i = 1 ∏ ℓ E [ X v a i ] . (75)
The integer ℓ \ell ℓ is the number of distinct records represented in a surviving k k k -tuple, and the binomial coefficient ( T ℓ ) \binom{T}{\ell} ( ℓ T ) counts the ways to select these ℓ \ell ℓ records from the block. The integer a i a_i a i is the multiplicity of the i i i -th selected record, and the multinomial coefficient ( k a 1 , … , a ℓ ) \binom{k}{a_1,\ldots,a_\ell} ( a 1 , … , a ℓ k ) counts the corresponding arrangements.
Since every a i ≥ 2 a_i\ge2 a i ≥ 2 and a 1 + ⋯ + a ℓ = k a_1+\cdots+a_\ell=k a 1 + ⋯ + a ℓ = k , at most ⌊ k / 2 ⌋ \lfloor k/2\rfloor ⌊ k /2 ⌋ distinct records can be represented in an arrangement of the k k k factors. Consequently, the upper limit on ℓ \ell ℓ in (75) also determines the asymptotic order
E [ δ S , v k ] = O ( N − ⌊ k / 2 ⌋ ) . (76) E\left[\delta_{S,v}^{k}\right]=O\left(N^{-\lfloor k/2\rfloor}\right). \tag*{(76)} E [ δ S , v k ] = O ( N − ⌊ k /2 ⌋ ) . (76)
Therefore, the deviation moments contributing through O ( N − 2 ) O(N^{-2}) O ( N − 2 ) in the Taylor expansion are
E [ δ S , v 2 ] = E [ X ~ v 2 ] 50 N , E [ δ S , v 3 ] = E [ X ~ v 3 ] 50 N 2 , E [ δ S , v 4 ] = 3 E [ X ~ v 2 ] 2 2500 N 2 + E [ X ~ v 4 ] − 3 E [ X ~ v 2 ] 2 50 N 3 . (77) \begin{aligned}
E\left[\delta_{S,v}^{2}\right]&=\frac{E\left[\widetilde{X}_v^{2}\right]}{50N},\\
E\left[\delta_{S,v}^{3}\right]&=\frac{E\left[\widetilde{X}_v^{3}\right]}{50N^{2}},\\
E\left[\delta_{S,v}^{4}\right]&=\frac{3E\left[\widetilde{X}_v^{2}\right]^{2}}{2500N^{2}}+\frac{E\left[\widetilde{X}_v^{4}\right]-3E\left[\widetilde{X}_v^{2}\right]^{2}}{50N^{3}}. \tag*{(77)}
\end{aligned} E [ δ S , v 2 ] E [ δ S , v 3 ] E [ δ S , v 4 ] = 50 N E [ X v 2 ] , = 50 N 2 E [ X v 3 ] , = 2500 N 2 3 E [ X v 2 ] 2 + 50 N 3 E [ X v 4 ] − 3 E [ X v 2 ] 2 . (77)
Equations (69) and (76) now provide everything needed to choose an appropriate value for K K K so that the remainder bound has the required asymptotic order. The first equation involves an absolute moment and the second, a signed one; for odd K + 1 K+1 K + 1 , the two are conceptually different: positive and negative deviations can cancel in the signed moment, whereas both contribute positively to the absolute moment. However, the two coincide when K + 1 K+1 K + 1 is even, so we choose the smallest such power whose moment is O ( N − 3 ) O(N^{-3}) O ( N − 3 ) , namely K + 1 = 6 K+1=6 K + 1 = 6 , and hence fix K = 5 K=5 K = 5 . For this choice, the resulting bound is
∑ v ∈ V ∣ E [ R 5 , v ] ∣ ≤ ∑ v ∈ V E [ δ S , v 6 ] 5 ln ( 2 ) P ( v ) 5 ∑ v ∈ V ∣ E [ R 5 , v ] ∣ = O ( N − 3 ) . (78) \begin{aligned}
\sum_{v\in\mathcal{V}}\left|E[R_{5,v}]\right| &\leq\sum_{v\in\mathcal{V}}\frac{E\left[\delta_{S,v}^{6}\right]}{5\ln(2)P(v)^{5}} \\
\sum_{v\in\mathcal{V}}\left|E[R_{5,v}]\right| &= O(N^{-3}). \tag*{(78)}
\end{aligned} v ∈ V ∑ ∣ E [ R 5 , v ] ∣ v ∈ V ∑ ∣ E [ R 5 , v ] ∣ ≤ v ∈ V ∑ 5 ln ( 2 ) P ( v ) 5 E [ δ S , v 6 ] = O ( N − 3 ) . (78)
Substituting (77) into (64) determines the leading terms, while O ( N − 3 ) O(N^{-3}) O ( N − 3 ) absorbs all remaining terms and, by (78), the remainder. Equation (52) then gives (73).
To compute the leading terms in (73), the moments of X ~ v \widetilde{X}_v X v must be evaluated. For the two group counts in (70), define the centred variables
Z ~ U , v : = Z U , v − E [ Z U , v ] , Z ~ X , v : = Z X , v − E [ Z X , v ] . (79) \begin{aligned}
\widetilde{Z}_{U,v} &:= Z_{U,v}-E[Z_{U,v}], \\
\widetilde{Z}_{X,v} &:= Z_{X,v}-E[Z_{X,v}]. \tag*{(79)}
\end{aligned} Z U , v Z X , v := Z U , v − E [ Z U , v ] , := Z X , v − E [ Z X , v ] . (79)
Taking expectations in (70) and subtracting the resulting identity from the original decomposition writes X ~ v \widetilde{X}_v X v as a sum of mutually independent centred variables. Squaring this sum and taking expectations leaves only the diagonal terms: every cross term vanishes because independence factorizes it into a product of zero means. Cubing the sum likewise leaves only the pure-cube terms: every mixed term contains at least one centred variable to the first power and therefore has zero expectation. Thus,
E [ X ~ v 2 ] = 26 E [ Z ~ U , v 2 ] + 12 E [ Z ~ X , v 2 ] , E [ X ~ v 3 ] = 26 E [ Z ~ U , v 3 ] + 12 E [ Z ~ X , v 3 ] . (80) \begin{aligned}
E\left[\widetilde{X}_v^{2}\right] &= 26E\left[\widetilde{Z}_{U,v}^{2}\right]+12E\left[\widetilde{Z}_{X,v}^{2}\right], \\
E\left[\widetilde{X}_v^{3}\right] &= 26E\left[\widetilde{Z}_{U,v}^{3}\right]+12E\left[\widetilde{Z}_{X,v}^{3}\right]. \tag*{(80)}
\end{aligned} E [ X v 2 ] E [ X v 3 ] = 26 E [ Z U , v 2 ] + 12 E [ Z X , v 2 ] , = 26 E [ Z U , v 3 ] + 12 E [ Z X , v 3 ] . (80)
Equivalently, these identities express the additivity of cumulants over independent summands [15 Sec. 5-5] .
For the Bernoulli count Z U , v Z_{U,v} Z U , v , its indicator definition in (11) implies the standard idempotence property
Z U , v k = Z U , v , E [ Z U , v k ] = P B U , k ≥ 1. (81) \begin{aligned}
Z_{U,v}^{k} &= Z_{U,v},\\
E\left[Z_{U,v}^{k}\right] &= P_{B_U}, \qquad k \ge1. \tag*{(81)}
\end{aligned} Z U , v k E [ Z U , v k ] = Z U , v , = P B U , k ≥ 1. (81)
Applying the same binomial expansion as in (72) to Z ~ U , v \widetilde{Z}_{U,v} Z U , v for k = 2 , 3 k=2,3 k = 2 , 3 therefore yields
E [ Z ~ U , v 2 ] = E [ Z U , v 2 ] − E [ Z U , v ] 2 = P B U ( 1 − P B U ) , E [ Z ~ U , v 3 ] = E [ Z U , v 3 ] − 3 E [ Z U , v ] E [ Z U , v 2 ] + 2 E [ Z U , v ] 3 = P B U ( 1 − P B U ) ( 1 − 2 P B U ) . (82) \begin{aligned}
E\left[\widetilde{Z}_{U,v}^{2}\right] &= E\left[Z_{U,v}^{2}\right]-E\left[Z_{U,v}\right]^{2}\\
&=P_{B_U}(1-P_{B_U}),\\
E\left[\widetilde{Z}_{U,v}^{3}\right] &= E\left[Z_{U,v}^{3}\right]-3E\left[Z_{U,v}\right]E\left[Z_{U,v}^{2}\right]+2E\left[Z_{U,v}\right]^{3}\\
&=P_{B_U}(1-P_{B_U})(1-2P_{B_U}). \tag*{(82)}
\end{aligned} E [ Z U , v 2 ] E [ Z U , v 3 ] = E [ Z U , v 2 ] − E [ Z U , v ] 2 = P B U ( 1 − P B U ) , = E [ Z U , v 3 ] − 3 E [ Z U , v ] E [ Z U , v 2 ] + 2 E [ Z U , v ] 3 = P B U ( 1 − P B U ) ( 1 − 2 P B U ) . (82)
The moment of order k k k of Z χ , v Z_{\chi,v} Z χ , v under its law Λ χ , v \Lambda_{\chi,v} Λ χ , v , (13) is
E [ Z χ , v k ] = Λ χ , v ( 1 ) + 2 k Λ χ , v ( 2 ) , k ≥ 1. (83) E\left[Z_{\chi,v}^{k}\right]=\Lambda_{\chi,v}(1)+2^{k}\Lambda_{\chi,v}(2), \qquad k\ge1. \tag*{(83)} E [ Z χ , v k ] = Λ χ , v ( 1 ) + 2 k Λ χ , v ( 2 ) , k ≥ 1. (83)
The same binomial expansion as in (72) , now applied to Z ~ χ , v \widetilde{Z}_{\chi,v} Z χ , v for k = 2 , 3 k=2,3 k = 2 , 3 , gives
E [ Z ~ χ , v 2 ] = E [ Z χ , v 2 ] − E [ Z χ , v ] 2 = Λ χ , v ( 1 ) + 4 Λ χ , v ( 2 ) − ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) 2 , E [ Z ~ χ , v 3 ] = E [ Z χ , v 3 ] − 3 E [ Z χ , v ] E [ Z χ , v 2 ] + 2 E [ Z χ , v ] 3 = Λ χ , v ( 1 ) + 8 Λ χ , v ( 2 ) − 3 ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) ( Λ χ , v ( 1 ) + 4 Λ χ , v ( 2 ) ) + 2 ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) 3 . (84) \begin{aligned}
E\left[\widetilde{Z}_{\chi,v}^{2}\right] &= E\left[Z_{\chi,v}^{2}\right]-E\left[Z_{\chi,v}\right]^{2}\\
&=\Lambda_{\chi,v}(1)+4\Lambda_{\chi,v}(2)-\left(\Lambda_{\chi,v}(1)+2\Lambda_{\chi,v}(2)\right)^{2},\\
E\left[\widetilde{Z}_{\chi,v}^{3}\right] &= E\left[Z_{\chi,v}^{3}\right]-3E\left[Z_{\chi,v}\right]E\left[Z_{\chi,v}^{2}\right]+2E\left[Z_{\chi,v}\right]^{3}\\
&=\Lambda_{\chi,v}(1)+8\Lambda_{\chi,v}(2)-3\left(\Lambda_{\chi,v}(1)+2\Lambda_{\chi,v}(2)\right)\left(\Lambda_{\chi,v}(1)+4\Lambda_{\chi,v}(2)\right)\\
&\quad+2\left(\Lambda_{\chi,v}(1)+2\Lambda_{\chi,v}(2)\right)^{3}. \tag*{(84)}
\end{aligned} E [ Z χ , v 2 ] E [ Z χ , v 3 ] = E [ Z χ , v 2 ] − E [ Z χ , v ] 2 = Λ χ , v ( 1 ) + 4 Λ χ , v ( 2 ) − ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) 2 , = E [ Z χ , v 3 ] − 3 E [ Z χ , v ] E [ Z χ , v 2 ] + 2 E [ Z χ , v ] 3 = Λ χ , v ( 1 ) + 8 Λ χ , v ( 2 ) − 3 ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) ( Λ χ , v ( 1 ) + 4 Λ χ , v ( 2 ) ) + 2 ( Λ χ , v ( 1 ) + 2 Λ χ , v ( 2 ) ) 3 . (84)
Substituting (80) , (82) , and (84) into (73) gives
1 100 ln ( 2 ) ∑ v ∈ V E [ X ~ v 2 ] P ‾ ( v ) ≈ 183.943323730404 1 100 ln ( 2 ) ∑ v ∈ V [ E [ X ~ v 2 ] 2 100 P ‾ ( v ) 3 − E [ X ~ v 3 ] 3 P ‾ ( v ) 2 ] ≈ 7879.931052184461 (85) \begin{aligned}
\frac{1}{100\ln(2)}\sum_{v\in\mathcal{V}}\frac{E\left[\widetilde{X}_{v}^{2}\right]}{\overline{P}(v)} &\approx183.943323730404\\
\frac{1}{100\ln(2)}\sum_{v\in\mathcal{V}}\left[\frac{E\left[\widetilde{X}_{v}^{2}\right]^{2}}{100\overline{P}(v)^{3}}-\frac{E\left[\widetilde{X}_{v}^{3}\right]}{3\overline{P}(v)^{2}}\right] &\approx7879.931052184461 \tag*{(85)}
\end{aligned} 100 ln ( 2 ) 1 v ∈ V ∑ P ( v ) E [ X v 2 ] 100 ln ( 2 ) 1 v ∈ V ∑ 100 P ( v ) 3 E [ X v 2 ] 2 − 3 P ( v ) 2 E [ X v 3 ] ≈ 183.943323730404 ≈ 7879.931052184461 (85)
The numerical expansion of the reference mean therefore is
μ V S T L ( T ) = 7.99991479609 − 183.943323730404 N − 7879.931052184461 N 2 + O ( N − 3 ) . (86) \mu^{\mathrm{VSTL}}(T)=7.99991479609-\frac{183.943323730404}{N}-\frac{7879.931052184461}{N^2}+O\left(N^{-3}\right). \tag*{(86)} μ VSTL ( T ) = 7.99991479609 − N 183.943323730404 − N 2 7879.931052184461 + O ( N − 3 ) . (86)
The Reference Variance
From the cross-entropy decomposition and the established expansion, the reference mean has been determined by taking expectations; taking variances instead expresses the reference variance as
[ σ V S T L ( T ) ] 2 = Var [ C ~ S ] − 2 Cov [ C ~ S , D ( Q S ∥ P ‾ ) ] + Var [ D ( Q S ∥ P ‾ ) ] . (87) \left[\sigma^{\mathrm{VSTL}}(T)\right]^2=\operatorname{Var}\left[\widetilde{C}_S\right]-2\operatorname{Cov}\left[\widetilde{C}_S,D(Q_S\|\overline{P})\right]+\operatorname{Var}\left[D(Q_S\|\overline{P})\right]. \tag*{(87)} [ σ VSTL ( T ) ] 2 = Var [ C S ] − 2 Cov [ C S , D ( Q S ∥ P ) ] + Var [ D ( Q S ∥ P ) ] . (87)
The first term in (87) follows from Lemma 4. The covariance term is obtained from (64) with K = 5 K=5 K = 5 by linearity of covariance, thereby separating the contributions of the polynomial part of the Taylor expansion from its remainder:
Cov [ C ~ S , D ( Q S ∥ P ‾ ) ] = − Cov [ C ~ S , ∑ k = 2 5 ( − 1 ) k − 1 ln ( 2 ) k ( k − 1 ) ∑ v ∈ V δ S , v k P ‾ ( v ) k − 1 + ∑ v ∈ V R 5 , v ] = − ∑ k = 2 5 ( − 1 ) k − 1 ln ( 2 ) k ( k − 1 ) ∑ v ∈ V Cov [ C ~ S , δ S , v k ] P ‾ ( v ) k − 1 − ∑ v ∈ V Cov [ C ~ S , R 5 , v ] . (88) \begin{aligned}
\operatorname{Cov}\left[\widetilde{C}_S,D(Q_S\|\overline{P})\right]
&=-\operatorname{Cov}\left[\widetilde{C}_S,\sum_{k=2}^{5}\frac{(-1)^{k-1}}{\ln(2)k(k-1)}\sum_{v\in\mathcal{V}}\frac{\delta_{S,v}^{k}}{\overline{P}(v)^{k-1}}+\sum_{v\in\mathcal{V}}R_{5,v}\right]\\
&=-\sum_{k=2}^{5}\frac{(-1)^{k-1}}{\ln(2)k(k-1)}\sum_{v\in\mathcal{V}}\frac{\operatorname{Cov}\left[\widetilde{C}_S,\delta_{S,v}^{k}\right]}{\overline{P}(v)^{k-1}}-\sum_{v\in\mathcal{V}}\operatorname{Cov}\left[\widetilde{C}_S,R_{5,v}\right]. \tag*{(88)}
\end{aligned} Cov [ C S , D ( Q S ∥ P ) ] = − Cov [ C S , k = 2 ∑ 5 ln ( 2 ) k ( k − 1 ) ( − 1 ) k − 1 v ∈ V ∑ P ( v ) k − 1 δ S , v k + v ∈ V ∑ R 5 , v ] = − k = 2 ∑ 5 ln ( 2 ) k ( k − 1 ) ( − 1 ) k − 1 v ∈ V ∑ P ( v ) k − 1 Cov [ C S , δ S , v k ] − v ∈ V ∑ Cov [ C S , R 5 , v ] . (88)
Analogously, the variance of the divergence is obtained from the same expansion by bilinearity of covariance:
Var [ D ( Q S ∥ P ‾ ) ] = Var [ ∑ k = 2 5 ( − 1 ) k − 1 ln ( 2 ) k ( k − 1 ) ∑ v ∈ V δ S , v k P ‾ ( v ) k − 1 + ∑ v ∈ V R 5 , v ] = 1 ln ( 2 ) 2 ∑ k 0 , k 1 = 2 5 ( − 1 ) k 0 − 1 k 0 ( k 0 − 1 ) ( − 1 ) k 1 − 1 k 1 ( k 1 − 1 ) ∑ v 0 , v 1 ∈ V Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] P ‾ ( v 0 ) k 0 − 1 P ‾ ( v 1 ) k 1 − 1 + 2 ln ( 2 ) ∑ k = 2 5 ( − 1 ) k − 1 k ( k − 1 ) ∑ v 0 , v 1 ∈ V Cov [ δ S , v 0 k , R 5 , v 1 ] P ‾ ( v 0 ) k − 1 + Var [ ∑ v ∈ V R 5 , v ] . (89) \begin{aligned}
\operatorname{Var}\left[D(Q_S\|\overline{P})\right]
&=\operatorname{Var}\left[\sum_{k=2}^{5}\frac{(-1)^{k-1}}{\ln(2)k(k-1)}\sum_{v\in\mathcal{V}}\frac{\delta_{S,v}^{k}}{\overline{P}(v)^{k-1}}+\sum_{v\in\mathcal{V}}R_{5,v}\right]\\
&=\frac{1}{\ln(2)^2}\sum_{k_0,k_1=2}^{5}\frac{(-1)^{k_0-1}}{k_0(k_0-1)}\frac{(-1)^{k_1-1}}{k_1(k_1-1)}\sum_{v_0,v_1\in\mathcal{V}}\frac{\operatorname{Cov}\left[\delta_{S,v_0}^{k_0},\delta_{S,v_1}^{k_1}\right]}{\overline{P}(v_0)^{k_0-1}\overline{P}(v_1)^{k_1-1}}\\
&\quad+\frac{2}{\ln(2)}\sum_{k=2}^{5}\frac{(-1)^{k-1}}{k(k-1)}\sum_{v_0,v_1\in\mathcal{V}}\frac{\operatorname{Cov}\left[\delta_{S,v_0}^{k},R_{5,v_1}\right]}{\overline{P}(v_0)^{k-1}}+\operatorname{Var}\left[\sum_{v\in\mathcal{V}}R_{5,v}\right]. \tag*{(89)}
\end{aligned} Var [ D ( Q S ∥ P ) ] = Var [ k = 2 ∑ 5 ln ( 2 ) k ( k − 1 ) ( − 1 ) k − 1 v ∈ V ∑ P ( v ) k − 1 δ S , v k + v ∈ V ∑ R 5 , v ] = ln ( 2 ) 2 1 k 0 , k 1 = 2 ∑ 5 k 0 ( k 0 − 1 ) ( − 1 ) k 0 − 1 k 1 ( k 1 − 1 ) ( − 1 ) k 1 − 1 v 0 , v 1 ∈ V ∑ P ( v 0 ) k 0 − 1 P ( v 1 ) k 1 − 1 Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] + ln ( 2 ) 2 k = 2 ∑ 5 k ( k − 1 ) ( − 1 ) k − 1 v 0 , v 1 ∈ V ∑ P ( v 0 ) k − 1 Cov [ δ S , v 0 k , R 5 , v 1 ] + Var [ v ∈ V ∑ R 5 , v ] . (89)
Denote the centred score of the r r r -th record by
C ~ r : = C r − E [ C ] . (90) \widetilde{C}_r:=C_r-E[C]. \tag*{(90)} C r := C r − E [ C ] . (90)
By Definition 1, these centred scores are i.i.d. across the T T T records; write C ~ \widetilde{C} C for a generic representative.
Taking expectations in the final line of (36) and subtracting the resulting identity from the original gives
C ‾ S − E [ C ‾ S ] = 1 N ∑ r = 1 T C ~ r . (91) \overline{C}_S-E[\overline{C}_S]=\frac{1}{N}\sum_{r=1}^{T}\widetilde{C}_r. \tag*{(91)} C S − E [ C S ] = N 1 r = 1 ∑ T C r . (91)
Proposition 4. As T → ∞ T \to\infty T → ∞ , the VSTL reference variance admits the following second-order expansion:
[ σ V S T L ( T ) ] 2 = Var [ C ] 50 N − 1 50 ln ( 2 ) N 2 ∑ v ∈ V E [ C ~ X ~ v 2 ] P ‾ ( v ) + 1 2500 ln ( 2 ) N 2 ∑ v ∈ V E [ C ~ X ~ v ] E [ X ~ v 2 ] P ‾ ( v ) 2 + 1 5000 ln ( 2 ) 2 N 2 ∑ v 0 , v 1 ∈ V E [ X ~ v 0 X ~ v 1 ] 2 P ‾ ( v 0 ) P ‾ ( v 1 ) + O ( N − 3 ) . (92) \begin{aligned}
[\sigma^{\mathrm{VSTL}}(T)]^2={}&\frac{\operatorname{Var}[C]}{50N}-\frac{1}{50\ln(2)N^2}\sum_{v\in\mathcal{V}}\frac{E[\widetilde{C}\widetilde{X}_v^2]}{\overline{P}(v)}\\
&+\frac{1}{2500\ln(2)N^2}\sum_{v\in\mathcal{V}}\frac{E[\widetilde{C}\widetilde{X}_v]E[\widetilde{X}_v^2]}{\overline{P}(v)^2}\\
&+\frac{1}{5000\ln(2)^2N^2}\sum_{v_0,v_1\in\mathcal{V}}\frac{E[\widetilde{X}_{v_0}\widetilde{X}_{v_1}]^2}{\overline{P}(v_0)\overline{P}(v_1)}+O(N^{-3}). \tag*{(92)}
\end{aligned} [ σ VSTL ( T ) ] 2 = 50 N Var [ C ] − 50 ln ( 2 ) N 2 1 v ∈ V ∑ P ( v ) E [ C X v 2 ] + 2500 ln ( 2 ) N 2 1 v ∈ V ∑ P ( v ) 2 E [ C X v ] E [ X v 2 ] + 5000 ln ( 2 ) 2 N 2 1 v 0 , v 1 ∈ V ∑ P ( v 0 ) P ( v 1 ) E [ X v 0 X v 1 ] 2 + O ( N − 3 ) . (92)
Proof. We evaluate in turn all covariances and variances appearing in (88) and (89), retaining every contribution through order N − 2 N^{-2} N − 2 .
We begin with the covariance between the score fluctuation and powers of the deviations of the empirical byte distribution. By (91), the score fluctuation is an average of centred record scores and therefore has expectation zero. Consequently, the covariance reduces to the product moment
Cov [ C ‾ S , δ S , v k ] = E [ δ S , v k ( C ‾ S − E [ C ‾ S ] ) ] . (93) \operatorname{Cov}[\overline{C}_S,\delta_{S,v}^{k}]=E[\delta_{S,v}^{k}(\overline{C}_S-E[\overline{C}_S])]. \tag*{(93)} Cov [ C S , δ S , v k ] = E [ δ S , v k ( C S − E [ C S ])] . (93)
Substituting (74) and (91) into (93) yields a sum over ( k + 1 ) (k+1) ( k + 1 ) -tuples ( r 0 , r 1 , … , r k ) (r_0,r_1,\ldots,r_k) ( r 0 , r 1 , … , r k ) of not necessarily distinct record indices, where each summand is a product of the form C ~ r 0 X ~ v , r 1 ⋯ X ~ v , r k \widetilde{C}_{r_0}\widetilde{X}_{v,r_1}\cdots\widetilde{X}_{v,r_k} C r 0 X v , r 1 ⋯ X v , r k . Independence factorizes the expectation of each term; a record of multiplicity m m m contributes E [ C ~ X ~ v m − 1 ] E[\widetilde{C}\widetilde{X}_v^{m-1}] E [ C X v m − 1 ] when it is indexed by r 0 r_0 r 0 , and E [ X ~ v m ] E[\widetilde{X}_v^m] E [ X v m ] otherwise. Since E [ C ~ ] = E [ X ~ v ] = 0 E[\widetilde{C}]=E[\widetilde{X}_v]=0 E [ C ] = E [ X v ] = 0 , a term vanishes unless r 0 r_0 r 0 coincides with at least one of r 1 , … , r k r_1,\ldots,r_k r 1 , … , r k and every other represented record occurs at least twice. For k ≥ 2 k \ge2 k ≥ 2 ,
E [ δ S , v k ( C ˉ S − E [ C ~ ] ) ] = 1 N k + 1 ∑ r 0 = 1 T ∑ r 1 = 1 T ⋯ ∑ r k = 1 T E [ C ~ r 0 X ~ v , r 1 ⋯ X ~ v , r k ] = 1 50 N k ∑ ℓ = 0 ⌊ ( k − 1 ) / 2 ⌋ ( T − 1 ℓ ) ∑ a 1 , … , a ℓ ≥ 2 , b ≥ 1 a 1 + ⋯ + a ℓ + b = k ( k a 1 , … , a ℓ , b ) E [ C ~ X ~ v b ] ∏ i = 1 ℓ E [ X ~ v a i ] . (94) \begin{aligned}
E\left[\delta_{S,v}^{k}\left(\bar{C}_{S}-E[\widetilde{C}]\right)\right]=\frac{1}{N^{k+1}}\sum_{r_{0}=1}^{T}\sum_{r_{1}=1}^{T}\cdots\sum_{r_{k}=1}^{T}E\left[\widetilde{C}_{r_{0}}\widetilde{X}_{v,r_{1}}\cdots\widetilde{X}_{v,r_{k}}\right] \\
&=\frac{1}{50N^{k}}\sum_{\ell=0}^{\lfloor(k-1)/2\rfloor}\binom{T-1}{\ell}\sum_{\substack{a_{1},\ldots,a_{\ell}\ge2,\ b\ge1\\a_{1}+\cdots+a_{\ell}+b=k}}\binom{k}{a_{1},\ldots,a_{\ell},b}E\left[\widetilde{C}\widetilde{X}_{v}^{b}\right]\prod_{i=1}^{\ell}E\left[\widetilde{X}_{v}^{a_{i}}\right]. \tag*{(94)}
\end{aligned} E [ δ S , v k ( C ˉ S − E [ C ] ) ] = N k + 1 1 r 0 = 1 ∑ T r 1 = 1 ∑ T ⋯ r k = 1 ∑ T E [ C r 0 X v , r 1 ⋯ X v , r k ] = 50 N k 1 ℓ = 0 ∑ ⌊( k − 1 ) /2 ⌋ ( ℓ T − 1 ) a 1 , … , a ℓ ≥ 2 , b ≥ 1 a 1 + ⋯ + a ℓ + b = k ∑ ( a 1 , … , a ℓ , b k ) E [ C X v b ] i = 1 ∏ ℓ E [ X v a i ] . (94)
The index r 0 r_{0} r 0 identifies the record contributing C ~ \widetilde{C} C . The integer ℓ \ell ℓ is the number of additional distinct records represented among the k k k deviation factors, and the binomial coefficient ( T − 1 ℓ ) \binom{T-1}{\ell} ( ℓ T − 1 ) counts the ways to select them from the remaining records. The integer b b b is the multiplicity of r 0 r_{0} r 0 among those factors, while a i a_{i} a i is the multiplicity of the i i i -th additional record; the multinomial coefficient ( k a 1 , … , a ℓ , b ) \binom{k}{a_{1},\ldots,a_{\ell},b} ( a 1 , … , a ℓ , b k ) counts the corresponding arrangements.
Since b ≥ 1 b\ge1 b ≥ 1 and every a i ≥ 2 a_{i}\ge2 a i ≥ 2 , at most ⌊ ( k − 1 ) / 2 ⌋ \lfloor(k-1)/2\rfloor ⌊( k − 1 ) /2 ⌋ additional records can be represented among the k k k deviation factors. Consequently, the upper limit on ℓ \ell ℓ in (94) determines the asymptotic order
Cov [ C ˉ S , δ S , v k ] = O ( N − ⌊ k / 2 ⌋ − 1 ) . (95) \operatorname{Cov}\left[\bar{C}_{S},\delta_{S,v}^{k}\right]=O\left(N^{-\lfloor k/2\rfloor-1}\right). \tag*{(95)} Cov [ C ˉ S , δ S , v k ] = O ( N − ⌊ k /2 ⌋ − 1 ) . (95)
Therefore, the covariance terms contributing through O ( N − 2 ) O(N^{-2}) O ( N − 2 ) in (88) are
Cov [ C ˉ S , δ S , v 2 ] = E [ C ~ X ~ v 2 ] 50 N 2 , \operatorname{Cov}\left[\bar{C}_{S},\delta_{S,v}^{2}\right]=\frac{E\left[\widetilde{C}\widetilde{X}_{v}^{2}\right]}{50N^{2}}, Cov [ C ˉ S , δ S , v 2 ] = 50 N 2 E [ C X v 2 ] ,
Cov [ C ˉ S , δ S , v 3 ] = 3 E [ C ~ X ~ v ] E [ X ~ v 2 ] 2500 N 2 + E [ C ~ X ~ v 3 ] − 3 E [ C ~ X ~ v ] E [ X ~ v 2 ] 50 N 3 . (96) \operatorname{Cov}\left[\bar{C}_{S},\delta_{S,v}^{3}\right]=\frac{3E\left[\widetilde{C}\widetilde{X}_{v}\right]E\left[\widetilde{X}_{v}^{2}\right]}{2500N^{2}}+\frac{E\left[\widetilde{C}\widetilde{X}_{v}^{3}\right]-3E\left[\widetilde{C}\widetilde{X}_{v}\right]E\left[\widetilde{X}_{v}^{2}\right]}{50N^{3}}. \tag*{(96)} Cov [ C ˉ S , δ S , v 3 ] = 2500 N 2 3 E [ C X v ] E [ X v 2 ] + 50 N 3 E [ C X v 3 ] − 3 E [ C X v ] E [ X v 2 ] . (96)
We next consider the covariance between powers of the deviations at two byte values v 0 v_{0} v 0 and v 1 v_{1} v 1 . The covariance is obtained by subtracting the product of the two marginal moments from their joint moment:
Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] = E [ δ S , v 0 k 0 δ S , v 1 k 1 ] − E [ δ S , v 0 k 0 ] E [ δ S , v 1 k 1 ] . (97) \operatorname{Cov}\left[\delta_{S,v_{0}}^{k_{0}},\delta_{S,v_{1}}^{k_{1}}\right]=E\left[\delta_{S,v_{0}}^{k_{0}}\delta_{S,v_{1}}^{k_{1}}\right]-E\left[\delta_{S,v_{0}}^{k_{0}}\right]E\left[\delta_{S,v_{1}}^{k_{1}}\right]. \tag*{(97)} Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] = E [ δ S , v 0 k 0 δ S , v 1 k 1 ] − E [ δ S , v 0 k 0 ] E [ δ S , v 1 k 1 ] . (97)
It remains only to evaluate the joint moment, since equations (75) –(77) already determine the product of the marginal moments in (97) .
Substituting (74) for both deviations in E [ δ S , v 0 k 0 δ S , v 1 k 1 ] E\left[\delta_{S,v_{0}}^{k_{0}}\delta_{S,v_{1}}^{k_{1}}\right] E [ δ S , v 0 k 0 δ S , v 1 k 1 ] yields a sum over ( k 0 + k 1 ) (k_{0}+k_{1}) ( k 0 + k 1 ) -tuples of not necessarily distinct record indices, where each summand contains k 0 k_{0} k 0 factors associated with v 0 v_{0} v 0 and k 1 k_{1} k 1 factors associated with v 1 v_1 v 1 . Independence factorizes the expectation of each term: a record represented a a a times among the factors associated with v 0 v_0 v 0 and b b b times among those associated with v 1 v_1 v 1 contributes the joint centred moment E [ X ~ v 0 a X ~ v 1 b ] E[\widetilde{X}_{v_0}^{a}\widetilde{X}_{v_1}^{b}] E [ X v 0 a X v 1 b ] . Since E [ X ~ v 0 ] = E [ X ~ v 1 ] = 0 E[\widetilde{X}_{v_0}]=E[\widetilde{X}_{v_1}]=0 E [ X v 0 ] = E [ X v 1 ] = 0 , a term vanishes unless every represented record carries at least two factors in total. For k 0 , k 1 ≥ 2 k_0,k_1\ge2 k 0 , k 1 ≥ 2 , we have
E [ δ S , v 0 k 0 δ S , v 1 k 1 ] = 1 N k 0 + k 1 ∑ r 1 = 1 T ⋯ ∑ r k 0 + k 1 = 1 T E [ ∏ i = 1 k 0 X ~ v 0 , r i ∏ i = 1 k 1 X ~ v 1 , r k 0 + i ] = 1 N k 0 + k 1 ∑ ℓ = 1 ⌊ ( k 0 + k 1 ) / 2 ⌋ ( T ℓ ) ∑ a 1 + ⋯ + a ℓ = k 0 b 1 + ⋯ + b ℓ = k 1 a i , b i ≥ 0 a i + b i ≥ 2 ( k 0 a 1 , … , a ℓ ) ( k 1 b 1 , … , b ℓ ) ∏ i = 1 ℓ E [ X ~ v 0 a i X ~ v 1 b i ] . (98) \begin{aligned}
E[\delta_{S,v_0}^{k_0}\delta_{S,v_1}^{k_1}]&=\frac{1}{N^{k_0+k_1}}\sum_{r_1=1}^{T}\cdots\sum_{r_{k_0+k_1}=1}^{T}E\left[\prod_{i=1}^{k_0}\widetilde{X}_{v_0,r_i}\prod_{i=1}^{k_1}\widetilde{X}_{v_1,r_{k_0+i}}\right]\\
&=\frac{1}{N^{k_0+k_1}}\sum_{\ell=1}^{\lfloor(k_0+k_1)/2\rfloor}\binom{T}{\ell}\sum_{\substack{a_1+\cdots+a_\ell=k_0\\ b_1+\cdots+b_\ell=k_1\\ a_i,b_i\ge0\\ a_i+b_i\ge2}}\binom{k_0}{a_1,\ldots,a_\ell}\binom{k_1}{b_1,\ldots,b_\ell}\prod_{i=1}^{\ell}E[\widetilde{X}_{v_0}^{a_i}\widetilde{X}_{v_1}^{b_i}]. \tag*{(98)}
\end{aligned} E [ δ S , v 0 k 0 δ S , v 1 k 1 ] = N k 0 + k 1 1 r 1 = 1 ∑ T ⋯ r k 0 + k 1 = 1 ∑ T E [ i = 1 ∏ k 0 X v 0 , r i i = 1 ∏ k 1 X v 1 , r k 0 + i ] = N k 0 + k 1 1 ℓ = 1 ∑ ⌊( k 0 + k 1 ) /2 ⌋ ( ℓ T ) a 1 + ⋯ + a ℓ = k 0 b 1 + ⋯ + b ℓ = k 1 a i , b i ≥ 0 a i + b i ≥ 2 ∑ ( a 1 , … , a ℓ k 0 ) ( b 1 , … , b ℓ k 1 ) i = 1 ∏ ℓ E [ X v 0 a i X v 1 b i ] . (98)
The integer ℓ \ell ℓ is the number of distinct records represented in a surviving ( k 0 + k 1 ) (k_0+k_1) ( k 0 + k 1 ) -tuple, and the binomial coefficient ( T ℓ ) \binom{T}{\ell} ( ℓ T ) counts the ways to select them from the block. The integers a i a_i a i and b i b_i b i are the multiplicities of the i i i -th selected record among the factors associated with v 0 v_0 v 0 and v 1 v_1 v 1 , respectively; the two multinomial coefficients count the corresponding arrangements within the two groups.
Since every a i + b i ≥ 2 a_i+b_i\ge2 a i + b i ≥ 2 and their sum over all represented records is k 0 + k 1 k_0+k_1 k 0 + k 1 , at most ⌊ ( k 0 + k 1 ) / 2 ⌋ \lfloor(k_0+k_1)/2\rfloor ⌊( k 0 + k 1 ) /2 ⌋ distinct records can appear. Consequently, the upper limit on ℓ \ell ℓ in (98) determines the asymptotic order
E [ δ S , v 0 k 0 δ S , v 1 k 1 ] = O ( N − ⌈ ( k 0 + k 1 ) / 2 ⌉ ) (99) E[\delta_{S,v_0}^{k_0}\delta_{S,v_1}^{k_1}]=O\left(N^{-\lceil(k_0+k_1)/2\rceil}\right) \tag*{(99)} E [ δ S , v 0 k 0 δ S , v 1 k 1 ] = O ( N − ⌈( k 0 + k 1 ) /2 ⌉ ) (99)
It follows from (76) and (99) that the product of the marginal moments is of no greater asymptotic order than the joint moment. Their difference (97) therefore obeys the same bound:
Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] = O ( N − ⌈ ( k 0 + k 1 ) / 2 ⌉ ) (100) \operatorname{Cov}[\delta_{S,v_0}^{k_0},\delta_{S,v_1}^{k_1}]=O\left(N^{-\lceil(k_0+k_1)/2\rceil}\right) \tag*{(100)} Cov [ δ S , v 0 k 0 , δ S , v 1 k 1 ] = O ( N − ⌈( k 0 + k 1 ) /2 ⌉ ) (100)
The only joint moment required through O ( N − 2 ) O(N^{-2}) O ( N − 2 ) is
E [ δ S , v 0 2 δ S , v 1 2 ] = E [ X ~ v 0 2 ] E [ X ~ v 1 2 ] + 2 E [ X ~ v 0 X ~ v 1 ] 2 2500 N 2 + E [ X ~ v 0 2 X ~ v 1 2 ] − E [ X ~ v 0 2 ] E [ X ~ v 1 2 ] − 2 E [ X ~ v 0 X ~ v 1 ] 2 50 N 3 . (101) \begin{aligned}
E[\delta_{S,v_0}^{2}\delta_{S,v_1}^{2}]
&=\frac{E[\widetilde{X}_{v_0}^{2}]E[\widetilde{X}_{v_1}^{2}]+2E[\widetilde{X}_{v_0}\widetilde{X}_{v_1}]^{2}}{2500N^{2}}\\
&\quad+\frac{E[\widetilde{X}_{v_0}^{2}\widetilde{X}_{v_1}^{2}]-E[\widetilde{X}_{v_0}^{2}]E[\widetilde{X}_{v_1}^{2}]-2E[\widetilde{X}_{v_0}\widetilde{X}_{v_1}]^{2}}{50N^{3}}. \tag*{(101)}
\end{aligned} E [ δ S , v 0 2 δ S , v 1 2 ] = 2500 N 2 E [ X v 0 2 ] E [ X v 1 2 ] + 2 E [ X v 0 X v 1 ] 2 + 50 N 3 E [ X v 0 2 X v 1 2 ] − E [ X v 0 2 ] E [ X v 1 2 ] − 2 E [ X v 0 X v 1 ] 2 . (101)
All remaining terms involve the Taylor remainder, whose variance provides the common bound needed for their analysis. Since R 5 , v R_{5,v} R 5 , v is square-integrable, we may use the standard identity Var [ Y ] = E [ Y 2 ] − E [ Y ] 2 \operatorname{Var}[Y]=E[Y^2]-E[Y]^2 Var [ Y ] = E [ Y 2 ] − E [ Y ] 2 , which implies Var [ Y ] ≤ E [ Y 2 ] \operatorname{Var}[Y]\le E[Y^2] Var [ Y ] ≤ E [ Y 2 ] . Squaring (69) at K = 5 K=5 K = 5 , taking expectations, and applying (76) with k = 12 k=12 k = 12 therefore determines the asymptotic order of Var [ R 5 , v ] \operatorname{Var}[R_{5,v}] Var [ R 5 , v ] :
Var [ R 5 , v ] ≤ E [ R 5 , v 2 ] ≤ E [ δ S , v 12 ] 25 ln ( 2 ) 2 P ‾ ( v ) 10 , (102) \operatorname{Var}[R_{5,v}]\le E[R_{5,v}^{2}]\le\frac{E[\delta_{S,v}^{12}]}{25\ln(2)^2\overline{P}(v)^{10}}, \tag*{(102)} Var [ R 5 , v ] ≤ E [ R 5 , v 2 ] ≤ 25 ln ( 2 ) 2 P ( v ) 10 E [ δ S , v 12 ] , (102)
Var [ R 5 , v ] = O ( N − 6 ) . \operatorname{Var}[R_{5,v}]=O(N^{-6}). Var [ R 5 , v ] = O ( N − 6 ) .
The next term to be analyzed is the covariance between the score fluctuation and the remainder. The Cauchy–Schwarz inequality bounds the absolute value of the covariance between two random variables by the square root of the product of their variances [15 App. 10B] . Lemma 4 shows that Var [ C ‾ S ] = O ( N − 1 ) \operatorname{Var}[\overline{C}_S]=O(N^{-1}) Var [ C S ] = O ( N − 1 ) ; combining this with the bound for R 5 , v R_{5,v} R 5 , v in (102) gives
∣ Cov [ C ‾ S , R 5 , v ] ∣ ≤ Var [ C ‾ S ] Var [ R 5 , v ] ≤ Var [ C ‾ S ] E [ R 5 , v 2 ] , (103) \left|\operatorname{Cov}[\overline{C}_S,R_{5,v}]\right|\le\sqrt{\operatorname{Var}[\overline{C}_S]\operatorname{Var}[R_{5,v}]}\le\sqrt{\operatorname{Var}[\overline{C}_S]E[R_{5,v}^{2}]}, \tag*{(103)} Cov [ C S , R 5 , v ] ≤ Var [ C S ] Var [ R 5 , v ] ≤ Var [ C S ] E [ R 5 , v 2 ] , (103)
∣ Cov [ C ‾ S , R 5 , v ] ∣ = O ( N − 7 / 2 ) . \left|\operatorname{Cov}[\overline{C}_S,R_{5,v}]\right|=O(N^{-7/2}). Cov [ C S , R 5 , v ] = O ( N − 7/2 ) .
Likewise, the same Cauchy–Schwarz inequality is applied to Cov [ δ S , v 0 k , R 5 , v 1 ] \operatorname{Cov}[\delta_{S,v_0}^{k},R_{5,v_1}] Cov [ δ S , v 0 k , R 5 , v 1 ] , with v 0 v_0 v 0 indexing the deviation and v 1 v_1 v 1 the remainder [15 App. 10B] . Equation (76) , together with the general variance bound established above, shows that Var [ δ S , v 0 k ] ≤ E [ δ S , v 0 2 k ] = O ( N − k ) \operatorname{Var}[\delta_{S,v_0}^{k}]\le E[\delta_{S,v_0}^{2k}]=O(N^{-k}) Var [ δ S , v 0 k ] ≤ E [ δ S , v 0 2 k ] = O ( N − k ) ; combining this with the bound for R 5 , v 1 R_{5,v_1} R 5 , v 1 in (102) gives
∣ Cov [ δ S , v 0 k , R 5 , v 1 ] ∣ ≤ Var [ δ S , v 0 k ] Var [ R 5 , v 1 ] , (104) \left|\operatorname{Cov}[\delta_{S,v_0}^{k},R_{5,v_1}]\right|\le\sqrt{\operatorname{Var}[\delta_{S,v_0}^{k}]\operatorname{Var}[R_{5,v_1}]}, \tag*{(104)} Cov [ δ S , v 0 k , R 5 , v 1 ] ≤ Var [ δ S , v 0 k ] Var [ R 5 , v 1 ] , (104)
∣ Cov [ δ S , v 0 k , R 5 , v 1 ] ∣ = O ( N − k / 2 − 3 ) . \left|\operatorname{Cov}[\delta_{S,v_0}^{k},R_{5,v_1}]\right|=O(N^{-k/2-3}). Cov [ δ S , v 0 k , R 5 , v 1 ] = O ( N − k /2 − 3 ) .
The final remainder contribution in (89) is the variance of the sum of R 5 , v R_{5,v} R 5 , v over all byte values. The finite-dimensional Cauchy–Schwarz inequality [14 Thm. 1.41] then bounds the squared sum before the expectation is taken:
Var [ ∑ v ∈ V R 5 , v ] ≤ E [ ( ∑ v ∈ V R 5 , v ) 2 ] ≤ ∣ V ∣ ∑ v ∈ V E [ R 5 , v 2 ] , (105) \operatorname{Var}\left[\sum_{v\in\mathcal{V}}R_{5,v}\right]\le E\left[\left(\sum_{v\in\mathcal{V}}R_{5,v}\right)^2\right]\le|\mathcal{V}|\sum_{v\in\mathcal{V}}E[R_{5,v}^{2}], \tag*{(105)} Var [ v ∈ V ∑ R 5 , v ] ≤ E ( v ∈ V ∑ R 5 , v ) 2 ≤ ∣ V ∣ v ∈ V ∑ E [ R 5 , v 2 ] , (105)
Var [ ∑ v ∈ V R 5 , v ] = O ( N − 6 ) . \operatorname{Var}\left[\sum_{v\in\mathcal{V}}R_{5,v}\right]=O(N^{-6}). Var [ v ∈ V ∑ R 5 , v ] = O ( N − 6 ) .
Substituting the results from (96) , (97) , (77) , and (101) into the expansions (88) and (89) determines all contributions through order N − 2 N^{-2} N − 2 . Equations (95) , (100) , and (102) –(105) show that every remaining contribution is O ( N − 3 ) O(N^{-3}) O ( N − 3 ) or smaller. Equation (87) , together with Lemma 4, then gives (92) .
To evaluate the mixed moments in (92) , we first decompose the centred score C ~ r \widetilde{C}_r C r into contributions from the unconstrained bytes and exponent pairs of the r r r -th record, by analogy with (39) and (70) :
C ~ r = ∑ b U ∈ B U , r C ~ U ( b U ) + ∑ ( b 0 , b 1 ) ∈ B X , r C ~ X ( b 0 , b 1 ) , C ~ U ( b U ) ≔ λ ( P ‾ ( b U ) ) − E [ λ ( P ‾ ( B U ) ) ] , C ~ X ( b 0 , b 1 ) ≔ λ ( P ‾ ( b 0 ) ) + λ ( P ‾ ( b 1 ) ) − E [ λ ( P ‾ ( B 0 ) ) + λ ( P ‾ ( B 1 ) ) ] . (106) \begin{aligned}
\widetilde{C}_r &= \sum_{b_U \in B_{U,r}} \widetilde{C}_U(b_U) + \sum_{(b_0,b_1) \in B_{X,r}} \widetilde{C}_X(b_0,b_1), \\
\widetilde{C}_U(b_U) &\coloneqq\lambda\left(\overline{P}(b_U)\right) - E\left[\lambda\left(\overline{P}(B_U)\right)\right], \\
\widetilde{C}_X(b_0,b_1) &\coloneqq\lambda\left(\overline{P}(b_0)\right) + \lambda\left(\overline{P}(b_1)\right) - E\left[\lambda\left(\overline{P}(B_0)\right) + \lambda\left(\overline{P}(B_1)\right)\right]. \tag*{(106)}
\end{aligned} C r C U ( b U ) C X ( b 0 , b 1 ) = b U ∈ B U , r ∑ C U ( b U ) + ( b 0 , b 1 ) ∈ B X , r ∑ C X ( b 0 , b 1 ) , : = λ ( P ( b U ) ) − E [ λ ( P ( B U ) ) ] , : = λ ( P ( b 0 ) ) + λ ( P ( b 1 ) ) − E [ λ ( P ( B 0 ) ) + λ ( P ( B 1 ) ) ] . (106)
C ~ U \widetilde{C}_U C U without an argument stands for C ~ U ( B U ) \widetilde{C}_U(B_U) C U ( B U ) , where B U B_U B U is randomly drawn according to (3). Likewise, C ~ X \widetilde{C}_X C X without arguments stands for C ~ X ( B 0 , B 1 ) \widetilde{C}_X(B_0,B_1) C X ( B 0 , B 1 ) , where ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) is randomly drawn according to (7). As a consequence,
E [ C ~ ] = 26 E [ C ~ U ] + 12 E [ C ~ X ] . (107) E\left[\widetilde{C}\right] = 26E\left[\widetilde{C}_U\right] + 12E\left[\widetilde{C}_X\right]. \tag*{(107)} E [ C ] = 26 E [ C U ] + 12 E [ C X ] . (107)
Together with the centred count decomposition from (79) , this gives:
E [ X ~ v 0 X ~ v 1 ] = 26 E [ Z ~ U , v 0 Z ~ U , v 1 ] + 12 E [ Z ~ X , v 0 Z ~ X , v 1 ] , E [ C ~ X ~ v ] = 26 E [ C ~ U Z ~ U , v ] + 12 E [ C ~ X Z ~ X , v ] , E [ C ~ X ~ v 2 ] = 26 E [ C ~ U Z ~ U , v 2 ] + 12 E [ C ~ X Z ~ X , v 2 ] . (108) \begin{aligned}
E\left[\widetilde{X}_{v_0}\widetilde{X}_{v_1}\right] &= 26E\left[\widetilde{Z}_{U,v_0}\widetilde{Z}_{U,v_1}\right] + 12E\left[\widetilde{Z}_{X,v_0}\widetilde{Z}_{X,v_1}\right], \\
E\left[\widetilde{C}\widetilde{X}_v\right] &= 26E\left[\widetilde{C}_U\widetilde{Z}_{U,v}\right] + 12E\left[\widetilde{C}_X\widetilde{Z}_{X,v}\right], \\
E\left[\widetilde{C}\widetilde{X}_v^2\right] &= 26E\left[\widetilde{C}_U\widetilde{Z}_{U,v}^2\right] + 12E\left[\widetilde{C}_X\widetilde{Z}_{X,v}^2\right]. \tag*{(108)}
\end{aligned} E [ X v 0 X v 1 ] E [ C X v ] E [ C X v 2 ] = 26 E [ Z U , v 0 Z U , v 1 ] + 12 E [ Z X , v 0 Z X , v 1 ] , = 26 E [ C U Z U , v ] + 12 E [ C X Z X , v ] , = 26 E [ C U Z U , v 2 ] + 12 E [ C X Z X , v 2 ] . (108)
Independence factorizes moments combining contributions from unconstrained bytes with contributions from exponent pairs, and centring makes them vanish: for example, E [ C ~ U Z ~ X , v ] = E [ C ~ U ] E [ Z ~ X , v ] = 0 E\left[\widetilde{C}_U\widetilde{Z}_{X,v}\right] = E\left[\widetilde{C}_U\right]E\left[\widetilde{Z}_{X,v}\right] = 0 E [ C U Z X , v ] = E [ C U ] E [ Z X , v ] = 0 .
For a single unconstrained byte, the product of the occurrence indicators is given by
[ Z U , v 0 Z U , v 1 ] ( b U ) = { 1 , v 0 = v 1 = b U , 0 , v 0 ≠ b U ∨ v 1 ≠ b U , b U ∈ V . (109) [Z_{U,v_0}Z_{U,v_1}](b_U) =
\begin{cases}
1, & v_0 = v_1 = b_U, \\
0, & v_0 \ne b_U \lor v_1 \ne b_U,
\end{cases}
\qquad b_U \in\mathcal{V}. \tag*{(109)} [ Z U , v 0 Z U , v 1 ] ( b U ) = { 1 , 0 , v 0 = v 1 = b U , v 0 = b U ∨ v 1 = b U , b U ∈ V . (109)
The two indicators coincide only when v 0 = v 1 = v v_0=v_1=v v 0 = v 1 = v , in which case Z U , v 0 Z U , v 1 = Z U , v Z_{U,v_0}Z_{U,v_1}=Z_{U,v} Z U , v 0 Z U , v 1 = Z U , v , consistently with (81) ; when v 0 ≠ v 1 v_0\ne v_1 v 0 = v 1 , they are mutually exclusive and their product is zero. Taking expectations gives
E [ Z U , v 0 Z U , v 1 ] = { P B U , v 0 = v 1 , 0 , v 0 ≠ v 1 . (110) E[Z_{U,v_0}Z_{U,v_1}]=
\begin{cases}
P_{B_U}, & v_0=v_1,\\
0, & v_0\ne v_1.
\end{cases} \tag*{(110)} E [ Z U , v 0 Z U , v 1 ] = { P B U , 0 , v 0 = v 1 , v 0 = v 1 . (110)
It follows that the centred product has expectation
E [ Z ~ U , v 0 Z ~ U , v 1 ] = E [ Z U , v 0 Z U , v 1 ] − E [ Z U , v 0 ] E [ Z U , v 1 ] = E [ Z U , v 0 Z U , v 1 ] − P B U 2 . (111) \begin{aligned}
E\left[\widetilde{Z}_{U,v_0}\widetilde{Z}_{U,v_1}\right]
&=E[Z_{U,v_0}Z_{U,v_1}]-E[Z_{U,v_0}]E[Z_{U,v_1}]\\
&=E[Z_{U,v_0}Z_{U,v_1}]-P_{B_U}^{2}. \tag*{(111)}
\end{aligned} E [ Z U , v 0 Z U , v 1 ] = E [ Z U , v 0 Z U , v 1 ] − E [ Z U , v 0 ] E [ Z U , v 1 ] = E [ Z U , v 0 Z U , v 1 ] − P B U 2 . (111)
When evaluating the double sum over ( v 0 , v 1 ) (v_0,v_1) ( v 0 , v 1 ) in (92) , the two cases from (110) , implicitly inherited by (111) , apply as follows: the first on the diagonal, for equal target byte values, and the second off the diagonal, for distinct target byte values.
For an exponent pair, the product of the occurrence counts is given by
[ Z X , v 0 Z X , v 1 ] ( b 0 , b 1 ) = { 4 , b 0 = b 1 = v 0 = v 1 , 1 , b 0 ≠ b 1 ∧ ( b 0 = v 0 ∨ b 1 = v 0 ) ∧ ( b 0 = v 1 ∨ b 1 = v 1 ) , 0 , ( b 0 ≠ v 0 ∧ b 1 ≠ v 0 ) ∨ ( b 0 ≠ v 1 ∧ b 1 ≠ v 1 ) . (112) [Z_{X,v_0}Z_{X,v_1}](b_0,b_1)=
\begin{cases}
4, & b_0=b_1=v_0=v_1,\\
1, & b_0\ne b_1\land(b_0=v_0\lor b_1=v_0)\land(b_0=v_1\lor b_1=v_1),\\
0, & (b_0\ne v_0\land b_1\ne v_0)\lor(b_0\ne v_1\land b_1\ne v_1).
\end{cases} \tag*{(112)} [ Z X , v 0 Z X , v 1 ] ( b 0 , b 1 ) = ⎩ ⎨ ⎧ 4 , 1 , 0 , b 0 = b 1 = v 0 = v 1 , b 0 = b 1 ∧ ( b 0 = v 0 ∨ b 1 = v 0 ) ∧ ( b 0 = v 1 ∨ b 1 = v 1 ) , ( b 0 = v 0 ∧ b 1 = v 0 ) ∨ ( b 0 = v 1 ∧ b 1 = v 1 ) . (112)
Taking expectations gives
E [ Z X , v 0 Z X , v 1 ] = { E [ Z X , v 2 ] = Λ X , v ( 1 ) + 4 Λ X , v ( 2 ) , v 0 = v 1 = v , Λ X , v 0 , v 1 ( 1 , 1 ) , v 0 ≠ v 1 . (113) E[Z_{X,v_0}Z_{X,v_1}]=
\begin{cases}
E[Z_{X,v}^{2}]=\Lambda_{X,v}(1)+4\Lambda_{X,v}(2), & v_0=v_1=v,\\
\Lambda_{X,v_0,v_1}(1,1), & v_0\ne v_1.
\end{cases} \tag*{(113)} E [ Z X , v 0 Z X , v 1 ] = { E [ Z X , v 2 ] = Λ X , v ( 1 ) + 4 Λ X , v ( 2 ) , Λ X , v 0 , v 1 ( 1 , 1 ) , v 0 = v 1 = v , v 0 = v 1 . (113)
The corresponding centred moment is then
E [ Z ~ X , v 0 Z ~ X , v 1 ] = E [ Z X , v 0 Z X , v 1 ] − E [ Z X , v 0 ] E [ Z X , v 1 ] = E [ Z X , v 0 Z X , v 1 ] − [ P B 0 + P B 1 ] ( v 0 ) [ P B 0 + P B 1 ] ( v 1 ) . (114) \begin{aligned}
E\left[\widetilde{Z}_{X,v_0}\widetilde{Z}_{X,v_1}\right]
&=E[Z_{X,v_0}Z_{X,v_1}]-E[Z_{X,v_0}]E[Z_{X,v_1}]\\
&=E[Z_{X,v_0}Z_{X,v_1}]-[P_{B_0}+P_{B_1}](v_0)[P_{B_0}+P_{B_1}](v_1). \tag*{(114)}
\end{aligned} E [ Z X , v 0 Z X , v 1 ] = E [ Z X , v 0 Z X , v 1 ] − E [ Z X , v 0 ] E [ Z X , v 1 ] = E [ Z X , v 0 Z X , v 1 ] − [ P B 0 + P B 1 ] ( v 0 ) [ P B 0 + P B 1 ] ( v 1 ) . (114)
Again, in the double sum over ( v 0 , v 1 ) (v_0,v_1) ( v 0 , v 1 ) in (92) , the two cases from (113) , implicitly inherited by (114) , apply on and off the diagonal, respectively.
To evaluate the second identity of (108) , we derive its two mixed moments separately:
E [ C ~ U Z ~ U , v ] = E [ C ~ U Z U , v ] − E [ C ~ U ] E [ Z U , v ] = P B U ( λ ( P ˉ ( v ) ) − E [ λ ( P ˉ ( B U ) ) ] ) , E [ C ~ X Z ~ X , v ] = E [ C ~ X Z X , v ] − E [ C ~ X ] E [ Z X , v ] = P B 0 ( v ) E [ λ ( P ˉ ( B 1 ) ) ∣ B 0 = v ] + P B 1 ( v ) E [ λ ( P ˉ ( B 0 ) ) ∣ B 1 = v ] + [ P B 0 + P B 1 ] ( v ) ( λ ( P ˉ ( v ) ) − E [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] ) . (115) \begin{aligned}
E\left[\tilde{C}_U\tilde{Z}_{U,v}\right] &= E\left[\tilde{C}_U Z_{U,v}\right]-E\left[\tilde{C}_U\right]E\left[Z_{U,v}\right]\\
&=P_{B_U}\left(\lambda\left(\bar{P}(v)\right)-E\left[\lambda\left(\bar{P}(B_U)\right)\right]\right),\\
E\left[\tilde{C}_X\tilde{Z}_{X,v}\right] &= E\left[\tilde{C}_X Z_{X,v}\right]-E\left[\tilde{C}_X\right]E\left[Z_{X,v}\right]\\
&=P_{B_0}(v)E\left[\lambda\left(\bar{P}(B_1)\right)\mid B_0=v\right]+P_{B_1}(v)E\left[\lambda\left(\bar{P}(B_0)\right)\mid B_1=v\right]\\
&+\left[P_{B_0}+P_{B_1}\right](v)\left(\lambda\left(\bar{P}(v)\right)-E\left[\lambda\left(\bar{P}(B_0)\right)+\lambda\left(\bar{P}(B_1)\right)\right]\right). \tag*{(115)}
\end{aligned} E [ C ~ U Z ~ U , v ] E [ C ~ X Z ~ X , v ] = E [ C ~ U Z U , v ] − E [ C ~ U ] E [ Z U , v ] = P B U ( λ ( P ˉ ( v ) ) − E [ λ ( P ˉ ( B U ) ) ] ) , = E [ C ~ X Z X , v ] − E [ C ~ X ] E [ Z X , v ] = P B 0 ( v ) E [ λ ( P ˉ ( B 1 ) ) ∣ B 0 = v ] + P B 1 ( v ) E [ λ ( P ˉ ( B 0 ) ) ∣ B 1 = v ] + [ P B 0 + P B 1 ] ( v ) ( λ ( P ˉ ( v ) ) − E [ λ ( P ˉ ( B 0 ) ) + λ ( P ˉ ( B 1 ) ) ] ) . (115)
With one component of the exponent pair fixed, each conditional expectation in (115) averages the surprisal of the admissible values of the other component under P ˉ \bar{P} P ˉ . The relevant row or column of (46) then supplies the required weights:
E [ λ ( P ˉ ( B 1 ) ) ∣ B 0 = v ] = ∑ γ 1 ∈ Γ n γ 0 γ 1 λ ( P ˉ ( γ 1 ) ) ∑ γ 1 ∈ Γ n γ 0 γ 1 , E [ λ ( P ˉ ( B 0 ) ) ∣ B 1 = v ] = ∑ γ 0 ∈ Γ n γ 0 γ 1 λ ( P ˉ ( γ 0 ) ) ∑ γ 0 ∈ Γ n γ 0 γ 1 . (116) \begin{aligned}
E\left[\lambda\left(\bar{P}(B_1)\right)\mid B_0=v\right]&=\frac{\sum_{\gamma_1\in\Gamma}n_{\gamma_0\gamma_1}\lambda\left(\bar{P}(\gamma_1)\right)}{\sum_{\gamma_1\in\Gamma}n_{\gamma_0\gamma_1}},\\
E\left[\lambda\left(\bar{P}(B_0)\right)\mid B_1=v\right]&=\frac{\sum_{\gamma_0\in\Gamma}n_{\gamma_0\gamma_1}\lambda\left(\bar{P}(\gamma_0)\right)}{\sum_{\gamma_0\in\Gamma}n_{\gamma_0\gamma_1}}. \tag*{(116)}
\end{aligned} E [ λ ( P ˉ ( B 1 ) ) ∣ B 0 = v ] E [ λ ( P ˉ ( B 0 ) ) ∣ B 1 = v ] = ∑ γ 1 ∈ Γ n γ 0 γ 1 ∑ γ 1 ∈ Γ n γ 0 γ 1 λ ( P ˉ ( γ 1 ) ) , = ∑ γ 0 ∈ Γ n γ 0 γ 1 ∑ γ 0 ∈ Γ n γ 0 γ 1 λ ( P ˉ ( γ 0 ) ) . (116)
Here γ v ∈ Γ \gamma_v\in\Gamma γ v ∈ Γ denotes the category containing v v v .
Finally, the third identity of (108) reduces to the following expansions:
E [ C ~ U Z ~ U , v 2 ] = E [ C ~ U Z U , v 2 ] − 2 E [ C ~ U Z U , v ] E [ Z U , v ] + E [ C ~ U ] E [ Z U , v ] 2 = ( 1 − 2 P B U ) E [ C ~ U Z ~ U , v ] , E [ C ~ X Z ~ X , v 2 ] = E [ C ~ X Z X , v 2 ] − 2 E [ C ~ X Z X , v ] E [ Z X , v ] + E [ C ~ X ] E [ Z X , v ] 2 = λ X , v ( 1 ) E [ C ~ X ∣ Z X , v = 1 ] + 4 λ X , v ( 2 ) E [ C ~ X ∣ Z X , v = 2 ] − 2 [ P B 0 + P B 1 ] ( v ) E [ C ~ X Z ~ X , v ] = ( 1 − 2 [ P B 0 + P B 1 ] ( v ) ) E [ C ~ X Z ~ X , v ] + 2 λ X , v ( 2 ) C ~ X ( v , v ) . (117) \begin{aligned}
E\left[\tilde{C}_U\tilde{Z}_{U,v}^{2}\right]&=E\left[\tilde{C}_U Z_{U,v}^{2}\right]-2E\left[\tilde{C}_U Z_{U,v}\right]E\left[Z_{U,v}\right]+E\left[\tilde{C}_U\right]E\left[Z_{U,v}\right]^{2}\\
&=(1-2P_{B_U})E\left[\tilde{C}_U\tilde{Z}_{U,v}\right],\\
E\left[\tilde{C}_X\tilde{Z}_{X,v}^{2}\right]&=E\left[\tilde{C}_X Z_{X,v}^{2}\right]-2E\left[\tilde{C}_X Z_{X,v}\right]E\left[Z_{X,v}\right]+E\left[\tilde{C}_X\right]E\left[Z_{X,v}\right]^{2}\\
&=\lambda_{X,v}(1)E\left[\tilde{C}_X\mid Z_{X,v}=1\right]+4\lambda_{X,v}(2)E\left[\tilde{C}_X\mid Z_{X,v}=2\right]\\
&\quad-2\left[P_{B_0}+P_{B_1}\right](v)E\left[\tilde{C}_X\tilde{Z}_{X,v}\right]\\
&=(1-2\left[P_{B_0}+P_{B_1}\right](v))E\left[\tilde{C}_X\tilde{Z}_{X,v}\right]+2\lambda_{X,v}(2)\tilde{C}_X(v,v). \tag*{(117)}
\end{aligned} E [ C ~ U Z ~ U , v 2 ] E [ C ~ X Z ~ X , v 2 ] = E [ C ~ U Z U , v 2 ] − 2 E [ C ~ U Z U , v ] E [ Z U , v ] + E [ C ~ U ] E [ Z U , v ] 2 = ( 1 − 2 P B U ) E [ C ~ U Z ~ U , v ] , = E [ C ~ X Z X , v 2 ] − 2 E [ C ~ X Z X , v ] E [ Z X , v ] + E [ C ~ X ] E [ Z X , v ] 2 = λ X , v ( 1 ) E [ C ~ X ∣ Z X , v = 1 ] + 4 λ X , v ( 2 ) E [ C ~ X ∣ Z X , v = 2 ] − 2 [ P B 0 + P B 1 ] ( v ) E [ C ~ X Z ~ X , v ] = ( 1 − 2 [ P B 0 + P B 1 ] ( v )) E [ C ~ X Z ~ X , v ] + 2 λ X , v ( 2 ) C ~ X ( v , v ) . (117)
Substituting (48), (108), (111), (114), (115), and (117) into (92) gives
Var [ C ] 50 ≈ 0.000235108088 , 1 50 ln ( 2 ) ∑ v ∈ V E [ C ~ X ~ v 2 ] P ‾ ( v ) ≈ 0.063911197090 , 1 2500 ln ( 2 ) ∑ v ∈ V E [ C ~ X ~ v ] E [ X ~ v 2 ] P ‾ ( v ) 2 ≈ 0.064022119277 , 1 5000 ln ( 2 ) 2 ∑ v 0 , v 1 ∈ V E [ X ~ v 0 X ~ v 1 ] 2 P ‾ ( v 0 ) P ‾ ( v 1 ) ≈ 265.373964301715. (118) \begin{aligned}
\frac{\operatorname{Var}[C]}{50} &\approx0.000235108088,\\
\frac{1}{50\ln(2)}\sum_{v\in\mathcal{V}}\frac{E\left[\widetilde{C}\widetilde{X}_v^2\right]}{\overline{P}(v)} &\approx0.063911197090,\\
\frac{1}{2500\ln(2)}\sum_{v\in\mathcal{V}}\frac{E\left[\widetilde{C}\widetilde{X}_v\right]E\left[\widetilde{X}_v^2\right]}{\overline{P}(v)^2} &\approx0.064022119277,\\
\frac{1}{5000\ln(2)^2}\sum_{v_0,v_1\in\mathcal{V}}\frac{E\left[\widetilde{X}_{v_0}\widetilde{X}_{v_1}\right]^2}{\overline{P}(v_0)\overline{P}(v_1)} &\approx265.373964301715. \tag*{(118)}
\end{aligned} 50 Var [ C ] 50 ln ( 2 ) 1 v ∈ V ∑ P ( v ) E [ C X v 2 ] 2500 ln ( 2 ) 1 v ∈ V ∑ P ( v ) 2 E [ C X v ] E [ X v 2 ] 5000 ln ( 2 ) 2 1 v 0 , v 1 ∈ V ∑ P ( v 0 ) P ( v 1 ) E [ X v 0 X v 1 ] 2 ≈ 0.000235108088 , ≈ 0.063911197090 , ≈ 0.064022119277 , ≈ 265.373964301715. (118)
After assembling these coefficients accordingly, we obtain the numerical expansion of the reference variance
[ σ V S T L ( T ) ] 2 = 0.000235108088 N + 265.374075223902 N 2 + O ( N − 3 ) . (119) \left[\sigma^{\mathrm{VSTL}}(T)\right]^2=\frac{0.000235108088}{N}+\frac{265.374075223902}{N^2}+O\left(N^{-3}\right). \tag*{(119)} [ σ VSTL ( T ) ] 2 = N 0.000235108088 + N 2 265.374075223902 + O ( N − 3 ) . (119)
Consistency with the Uniform Model
Corollary 2. Under the uniform byte model, with L = ∣ V ∣ = 256 L=|\mathcal{V}|=256 L = ∣ V ∣ = 256 , Propositions 3 and 4 reduce to
μ u n i f o r m ( T ) = 8 − L − 1 2 N ln ( 2 ) − L 2 − 1 12 N 2 ln ( 2 ) + O ( N − 3 ) , [ σ u n i f o r m ( T ) ] 2 = L − 1 2 N 2 ln ( 2 ) 2 + O ( N − 3 ) . (120) \begin{aligned}
\mu^{\mathrm{uniform}}(T)&=8-\frac{L-1}{2N\ln(2)}-\frac{L^2-1}{12N^2\ln(2)}+O\left(N^{-3}\right),\\
\left[\sigma^{\mathrm{uniform}}(T)\right]^2&=\frac{L-1}{2N^2\ln(2)^2}+O\left(N^{-3}\right). \tag*{(120)}
\end{aligned} μ uniform ( T ) [ σ uniform ( T ) ] 2 = 8 − 2 N ln ( 2 ) L − 1 − 12 N 2 ln ( 2 ) L 2 − 1 + O ( N − 3 ) , = 2 N 2 ln ( 2 ) 2 L − 1 + O ( N − 3 ) . (120)
Proof. Assume uniformity — then the validity constraint no longer couples the exponent bytes B 0 B_0 B 0 and B 1 B_1 B 1 in each float, so they become independent, while every byte marginal, along with P ‾ \overline{P} P , coincides with P B U = 1 L P_{BU}=\frac{1}{L} P B U = L 1 . Thus, a block consists of N N N independent uniform bytes, and its entropy converges to H ∞ u n i f o r m = log 2 L = 8 H_\infty^{\mathrm{uniform}}=\log_2 L=8 H ∞ uniform = log 2 L = 8 . For finite N N N , however, concavity makes the plug-in entropy biased downward [12 Thm. 2.7.3] , so its reference mean requires a correction, while its reference variance is determined by fluctuations in the byte counts.
Under this uniform model, for any v ∈ V v\in\mathcal{V} v ∈ V , X v ∼ Binomial ( 50 , P B U ) X_v\sim\operatorname{Binomial}(50,P_{BU}) X v ∼ Binomial ( 50 , P B U ) , so E [ X v ] = 50 P B U E[X_v]=50P_{BU} E [ X v ] = 50 P B U . Moreover, every byte contributes the constant surprisal λ ( P B U ) \lambda(P_{BU}) λ ( P B U ) , giving C = 50 H ∞ u n i f o r m = E [ C ] C=50H_{\infty}^{\mathrm{uniform}}=E[C] C = 50 H ∞ uniform = E [ C ] . It follows that Var [ C ] = 0 \operatorname{Var}[C]=0 Var [ C ] = 0 and C ~ = 0 \widetilde{C}=0 C = 0 ; therefore, all moments containing C ~ \widetilde{C} C vanish.
Substituting the binomial moments of X v X_v X v into (73) yields the mean in (120). This expansion agrees, at the corresponding orders, with the results of Miller [7 ] , Basharin [8 Eq. (3)] , and, after conversion to bits, Harris [9 Eq. (14)] .
For distinct byte values v 0 ≠ v 1 v_0\ne v_1 v 0 = v 1 , independence of the 50 uniform bytes gives the record-count covariance E [ X ~ v 0 X ~ v 1 ] = − 50 P B U 2 E[\widetilde{X}_{v_0}\widetilde{X}_{v_1}]=-50P_{BU}^{2} E [ X v 0 X v 1 ] = − 50 P B U 2 . Substituting this covariance and the binomial moments of X v X_v X v into (92) yields the variance in (120). After conversion to bits, this expansion agrees with Harris [9 Eq. (23)] ; Basharin [8 Eq. (4)] likewise notes that the N − 1 N^{-1} N − 1 term vanishes for equiprobable symbols.
Normal Approximation and Acceptance Bounds
Corollary 3. As T → ∞ T\to\infty T → ∞ ,
H ( S ) − μ V S T L ( T ) σ V S T L ( T ) ⟶ D N ( 0 , 1 ) , (121) \frac{H(S)-\mu^{\mathrm{VSTL}}(T)}{\sigma^{\mathrm{VSTL}}(T)} \mathrel{\mathop{\longrightarrow}^{D}} N(0,1), \tag*{(121)} σ VSTL ( T ) H ( S ) − μ VSTL ( T ) ⟶ D N ( 0 , 1 ) , (121) so, with Φ \Phi Φ the standard normal distribution function, the two-sided acceptance interval for the global measure at significance level α \alpha α is
μ V S T L ( T ) ± Φ − 1 ( 1 − α 2 ) σ V S T L ( T ) , (122) \mu^{\mathrm{VSTL}}(T)\pm\Phi^{-1}\left(1-\frac{\alpha}{2}\right)\sigma^{\mathrm{VSTL}}(T), \tag*{(122)} μ VSTL ( T ) ± Φ − 1 ( 1 − 2 α ) σ VSTL ( T ) , (122) where μ V S T L ( T ) \mu^{\mathrm{VSTL}}(T) μ VSTL ( T ) and σ V S T L ( T ) \sigma^{\mathrm{VSTL}}(T) σ VSTL ( T ) are the reference values of Propositions 3 and 4.
Proof. Collect the centred record counts into the vector X ~ ⟨ r ⟩ = ⟨ X ~ v , r ⟩ v ∈ V \widetilde{X}_{\langle r\rangle}=\langle\widetilde{X}_{v,r}\rangle_{v\in\mathcal{V}} X ⟨ r ⟩ = ⟨ X v , r ⟩ v ∈ V . These vectors are i.i.d. across records by Definition 1, and equation (74) holds simultaneously in all L = ∣ V ∣ L=|\mathcal{V}| L = ∣ V ∣ coordinates. The central limit theorem for i.i.d. summands [16 ] , [13 Thm. (5.10.4)] , in its multivariate form in R L \mathbb{R}^{L} R L [17 Ex. 2.18] , therefore gives
N δ ~ S = 1 N ∑ r = 1 T X ~ ⟨ r ⟩ ⟶ D N L ( 0 , Σ ) , (123) \sqrt{N}\widetilde{\delta}_S=\frac{1}{\sqrt{N}}\sum_{r=1}^{T}\widetilde{X}_{\langle r\rangle}\mathrel{\mathop{\longrightarrow}^{D}}\mathcal{N}_{L}(0,\Sigma), \tag*{(123)} N δ S = N 1 r = 1 ∑ T X ⟨ r ⟩ ⟶ D N L ( 0 , Σ ) , (123)
Σ = ⟨ E [ X ~ v 0 X ~ v 1 ] 50 ⟩ v 0 , v 1 ∈ V , (124) \Sigma=\left\langle\frac{E\left[\widetilde{X}_{v_0}\widetilde{X}_{v_1}\right]}{50}\right\rangle_{v_0,v_1\in\mathcal{V}}, \tag*{(124)} Σ = ⟨ 50 E [ X v 0 X v 1 ] ⟩ v 0 , v 1 ∈ V , (124)
where Σ \Sigma Σ is the finite limiting covariance matrix formed from the per-record moments (108) already evaluated for Proposition 4.
For each v ∈ V v \in\mathcal{V} v ∈ V , P ˉ ( v ) > 0 \bar{P}(v)>0 P ˉ ( v ) > 0 and lies in the domain on which φ \varphi φ is smooth; therefore, entropy is differentiable at the expansion point. Since entropy is separable across byte values, the L L L entries of its gradient are the L L L evaluations of the one-variable derivative (60) , exactly as in (61) . Thus,
∇ H ( P ˉ ) = ⟨ φ ′ ( P ˉ ( v ) ) ⟩ v ∈ V = ⟨ λ ( P ˉ ( v ) ) − 1 ln ( 2 ) ⟩ v ∈ V . (125) \nabla H(\bar{P})=\left\langle\varphi'(\bar{P}(v))\right\rangle_{v\in\mathcal{V}}=\left\langle\lambda(\bar{P}(v))-\frac{1}{\ln(2)}\right\rangle_{v\in\mathcal{V}} . \tag*{(125)} ∇ H ( P ˉ ) = ⟨ φ ′ ( P ˉ ( v )) ⟩ v ∈ V = ⟨ λ ( P ˉ ( v )) − ln ( 2 ) 1 ⟩ v ∈ V . (125)
Because H H H is differentiable at P ˉ \bar{P} P ˉ , the delta method [17, Thm. 3.1 transforms the multivariate convergence in (123) into a univariate normal limit. Its variance is the quadratic form ∇ H ( P ˉ ) T Σ ∇ H ( P ˉ ) \nabla H(\bar{P})^{T}\Sigma\nabla H(\bar{P}) ∇ H ( P ˉ ) T Σ∇ H ( P ˉ ) , which projects the histogram covariance along the entropy gradient. Since H ( S ) = H ( Q S ) H(S)=H(QS) H ( S ) = H ( QS ) and H ( P ˉ ) = H ∞ V S T L H(\bar{P})=H_{\infty}^{\mathrm{VSTL}} H ( P ˉ ) = H ∞ VSTL by Proposition 2, this gives
N ( H ( S ) − H ∞ V S T L ) → D N ( 0 , ∇ H ( P ˉ ) T Σ ∇ H ( P ˉ ) ) . (126) \sqrt{N}\left(H(S)-H_{\infty}^{\mathrm{VSTL}}\right)\xrightarrow{D}\mathcal{N}\left(0,\nabla H(\bar{P})^{T}\Sigma\nabla H(\bar{P})\right). \tag*{(126)} N ( H ( S ) − H ∞ VSTL ) D N ( 0 , ∇ H ( P ˉ ) T Σ∇ H ( P ˉ ) ) . (126)
To evaluate the limiting variance in (126) , consider the inner product of the gradient (125) with the centred byte counts X ~ v \widetilde{X}_{v} X v for a generic record. This calculation follows an approach similar to (63) :
∑ v ∈ V φ ′ ( P ˉ ( v ) ) X ~ v = ∑ v ∈ V ( λ ( P ˉ ( v ) ) − 1 ln ( 2 ) ) X ~ v = ∑ v ∈ V λ ( P ˉ ( v ) ) X ~ v − 1 ln ( 2 ) ∑ v ∈ V X ~ v = ∑ v ∈ V λ ( P ˉ ( v ) ) X v − E [ ∑ v ∈ V λ ( P ˉ ( v ) ) X v ] = C − E [ C ] = C ~ . (127) \begin{aligned}
\sum_{v\in\mathcal{V}}\varphi'(\bar{P}(v))\widetilde{X}_{v}
&=\sum_{v\in\mathcal{V}}\left(\lambda(\bar{P}(v))-\frac{1}{\ln(2)}\right)\widetilde{X}_{v}\\
&=\sum_{v\in\mathcal{V}}\lambda(\bar{P}(v))\widetilde{X}_{v}-\frac{1}{\ln(2)}\sum_{v\in\mathcal{V}}\widetilde{X}_{v}\\
&=\sum_{v\in\mathcal{V}}\lambda(\bar{P}(v))X_{v}-E\left[\sum_{v\in\mathcal{V}}\lambda(\bar{P}(v))X_{v}\right]\\
&=C-E[C]=\widetilde{C}. \tag*{(127)}
\end{aligned} v ∈ V ∑ φ ′ ( P ˉ ( v )) X v = v ∈ V ∑ ( λ ( P ˉ ( v )) − ln ( 2 ) 1 ) X v = v ∈ V ∑ λ ( P ˉ ( v )) X v − ln ( 2 ) 1 v ∈ V ∑ X v = v ∈ V ∑ λ ( P ˉ ( v )) X v − E [ v ∈ V ∑ λ ( P ˉ ( v )) X v ] = C − E [ C ] = C . (127)
The constant term in φ ′ ( x ) \varphi'(x) φ ′ ( x ) is eliminated because ∑ v ∈ V X v = ∑ v ∈ V E [ X v ] = 50 \sum_{v\in\mathcal{V}}X_{v}=\sum_{v\in\mathcal{V}}E[X_{v}]=50 ∑ v ∈ V X v = ∑ v ∈ V E [ X v ] = 50 and therefore ∑ v ∈ V X ~ v = 0 \sum_{v\in\mathcal{V}}\widetilde{X}_{v}=0 ∑ v ∈ V X v = 0 .
Substituting the entries of Σ \Sigma Σ from (123) into the quadratic form and applying bilinearity allows it to be written in terms of the inner product in (126):
∇ H ( P ‾ ) T Σ ∇ H ( P ‾ ) = 1 50 ∑ v 0 ∈ V ∑ v 1 ∈ V φ ′ ( P ‾ ( v 0 ) ) E [ X ~ v 0 X ~ v 1 ] φ ′ ( P ‾ ( v 1 ) ) = 1 50 E [ ( ∑ v 0 ∈ V φ ′ ( P ‾ ( v 0 ) ) X ~ v 0 ) ( ∑ v 1 ∈ V φ ′ ( P ‾ ( v 1 ) ) X ~ v 1 ) ] = E [ C ~ 2 ] 50 = Var [ C ] 50 . (128) \begin{aligned}
\nabla H(\overline{P})^{T}\Sigma\nabla H(\overline{P}) &= \frac{1}{50}\sum_{v_0\in\mathcal{V}}\sum_{v_1\in\mathcal{V}}\varphi'(\overline{P}(v_0))E\left[\widetilde{X}_{v_0}\widetilde{X}_{v_1}\right]\varphi'(\overline{P}(v_1))\\
&= \frac{1}{50}E\left[\left(\sum_{v_0\in\mathcal{V}}\varphi'(\overline{P}(v_0))\widetilde{X}_{v_0}\right)\left(\sum_{v_1\in\mathcal{V}}\varphi'(\overline{P}(v_1))\widetilde{X}_{v_1}\right)\right]\\
&= \frac{E\left[\widetilde{C}^{2}\right]}{50}=\frac{\operatorname{Var}[C]}{50}. \tag*{(128)}
\end{aligned} ∇ H ( P ) T Σ∇ H ( P ) = 50 1 v 0 ∈ V ∑ v 1 ∈ V ∑ φ ′ ( P ( v 0 )) E [ X v 0 X v 1 ] φ ′ ( P ( v 1 )) = 50 1 E [ ( v 0 ∈ V ∑ φ ′ ( P ( v 0 )) X v 0 ) ( v 1 ∈ V ∑ φ ′ ( P ( v 1 )) X v 1 ) ] = 50 E [ C 2 ] = 50 Var [ C ] . (128)
Equation (125) therefore becomes
N ( H ( S ) − H ∞ V S T L ) → D N ( 0 , Var [ C ] 50 ) . (129) \sqrt{N}\left(H(S)-H_{\infty}^{\mathrm{VSTL}}\right)\xrightarrow{D}\mathcal{N}\left(0,\frac{\operatorname{Var}[C]}{50}\right). \tag*{(129)} N ( H ( S ) − H ∞ VSTL ) D N ( 0 , 50 Var [ C ] ) . (129)
Rewriting the left-hand side of (121) in terms of the N \sqrt{N} N -scaled convergence about H ∞ V S T L H_{\infty}^{\mathrm{VSTL}} H ∞ VSTL in (128) gives
H ( S ) − μ V S T L ( T ) σ V S T L ( T ) = N ( H ( S ) − H ∞ V S T L ) − N ( μ V S T L ( T ) − H ∞ V S T L ) N σ V S T L ( T ) . (130) \frac{H(S)-\mu^{\mathrm{VSTL}}(T)}{\sigma^{\mathrm{VSTL}}(T)}
=
\frac{\sqrt{N}\left(H(S)-H_{\infty}^{\mathrm{VSTL}}\right)-\sqrt{N}\left(\mu^{\mathrm{VSTL}}(T)-H_{\infty}^{\mathrm{VSTL}}\right)}
{\sqrt{N}\sigma^{\mathrm{VSTL}}(T)}. \tag*{(130)} σ VSTL ( T ) H ( S ) − μ VSTL ( T ) = N σ VSTL ( T ) N ( H ( S ) − H ∞ VSTL ) − N ( μ VSTL ( T ) − H ∞ VSTL ) . (130)
The first term in the numerator converges in distribution by (128); the mean expansion (73) with the coefficients (85) shows that the second term in the numerator is O ( N − 1 / 2 ) O(N^{-1/2}) O ( N − 1/2 ) and therefore vanishes as T → ∞ T\to\infty T → ∞ ; the leading term of (92) shows that the denominator converges to a positive constant:
N ( H ( S ) − H ∞ V S T L ) → D N ( 0 , Var [ C ] 50 ) , \sqrt{N}\left(H(S)-H_{\infty}^{\mathrm{VSTL}}\right)\xrightarrow{D}\mathcal{N}\left(0,\frac{\operatorname{Var}[C]}{50}\right), N ( H ( S ) − H ∞ VSTL ) D N ( 0 , 50 Var [ C ] ) ,
N ( μ V S T L ( T ) − H ∞ V S T L ) = O ( N − 1 / 2 ) → 0 , \sqrt{N}\left(\mu^{\mathrm{VSTL}}(T)-H_{\infty}^{\mathrm{VSTL}}\right)=O(N^{-1/2})\to0, N ( μ VSTL ( T ) − H ∞ VSTL ) = O ( N − 1/2 ) → 0 ,
N [ σ V S T L ( T ) ] 2 = Var [ C ] 50 + O ( N − 1 ) → Var [ C ] 50 , N\left[\sigma^{\mathrm{VSTL}}(T)\right]^2=\frac{\operatorname{Var}[C]}{50}+O(N^{-1})\to\frac{\operatorname{Var}[C]}{50}, N [ σ VSTL ( T ) ] 2 = 50 Var [ C ] + O ( N − 1 ) → 50 Var [ C ] ,
∴ N σ V S T L ( T ) → Var [ C ] 50 . (131) \therefore\sqrt{N}\sigma^{\mathrm{VSTL}}(T)\to\sqrt{\frac{\operatorname{Var}[C]}{50}}. \tag*{(131)} ∴ N σ VSTL ( T ) → 50 Var [ C ] . (131)
Slutsky’s theorem [18 ] , [13 Exercise (7.2.5)] , applied to the numerator and denominator of (129), together with the scaling rule for normal distributions [13 ] , Example (4.4.4), therefore yields
H ( S ) − μ V S T L ( T ) σ V S T L ( T ) → D N ( 0 , Var [ C ] 50 ) ∼ N ( 0 , 1 ) . (132) \frac{H(S)-\mu^{\mathrm{VSTL}}(T)}{\sigma^{\mathrm{VSTL}}(T)} \xrightarrow{D} \mathcal{N}\left(0,\frac{\operatorname{Var}[C]}{50}\right) \sim\mathcal{N}(0,1). \tag*{(132)} σ VSTL ( T ) H ( S ) − μ VSTL ( T ) D N ( 0 , 50 Var [ C ] ) ∼ N ( 0 , 1 ) . (132)
This proves (121) . The central 1 − α 1-\alpha 1 − α region of N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) is bounded by ± Φ − 1 ( 1 − α / 2 ) \pm\Phi^{-1}(1-\alpha/2) ± Φ − 1 ( 1 − α /2 ) ; applying these bounds to (121) gives (122) .
The Test Procedure
The second-order expansion and the normal approximation become increasingly accurate as T T T grows. At small triangle counts, however, the remainder of the expansions is too large to neglect. Figure 1 shows the resulting errors decreasing over 1 ≤ T ≤ 200 1 \le T \le200 1 ≤ T ≤ 200 , motivating a finite lower limit for the test that neither asymptotic result specifies.
Figure 1. Exact moments compared with the second-order VSTL expansions: (a) means; (b) variances; (c) absolute errors.
Figure 2 compares intervals centred on the exact and second-order reference means and bounded at one respective standard deviation on either side. The ratio of their intersection length to their union length equals approximately 99.1% at T = 100 T = 100 T = 100 and continues to increase, reaching 99.6% at T = 200 T = 200 T = 200 . We therefore adopt T ≥ 100 T \ge100 T ≥ 100 as an operational lower limit for the test.
Figure 2. Comparison of the exact and second-order VSTL references: (a) intervals centred on the respective means, with dashed bounds at one standard deviation on either side; (b) percentage overlap between the intervals of (a).
Corollary 3 turns the reference values of Propositions 3 and 4 into a two-sided test for the entropy of a single ciphertext. Table 5 lists the resulting mean, variance and acceptance bounds at three significance levels for selected numbers of triangles.
Table 5. Second-order reference moments and two-sided acceptance bounds for the VSTL global entropy test.
Algorithm 1 applies the reference expansions of Propositions 3 and 4 and the acceptance interval of Corollary 3 to a single ciphertext.
Practical Significance
As T T T grows, the difference between the uniform and VSTL reference means approaches the deficit Δ \Delta Δ of (53) , while their variability decreases. We measure this separation in units of the uniform deviation to determine when the uniform reference becomes unreliable in practice. The crossing condition is
μ u n i f o r m ( T ) − μ V S T L ( T ) = z σ u n i f o r m ( T ) . (133) \mu^{\mathrm{uniform}}(T)-\mu^{\mathrm{VSTL}}(T)=z\sigma^{\mathrm{uniform}}(T). \tag*{(133)} μ uniform ( T ) − μ VSTL ( T ) = z σ uniform ( T ) . (133)
Algorithm 1 VSTL global entropy test
Require: ciphertext S S S consisting of T T T triangles, with N = 50 T N=50T N = 50 T data bytes S 1 , … , S N S_1,\ldots,S_N S 1 , … , S N ; significance level α \alpha α
Ensure: global entropy acceptance verdict under the VSTL reference
# ( v ) ← 0 \#(v)\leftarrow0 # ( v ) ← 0 for all v ∈ V v\in\mathcal{V} v ∈ V
for k ← 1 k\leftarrow1 k ← 1 to N N N do
# ( S k ) ← # ( S k ) + 1 \#(S_k)\leftarrow\#(S_k)+1 # ( S k ) ← # ( S k ) + 1
end for
H ← 0 H\leftarrow0 H ← 0
for v ∈ V v\in\mathcal{V} v ∈ V such that # ( v ) > 0 \#(v)>0 # ( v ) > 0 do
H ← H − # ( v ) N log 2 # ( v ) N H\leftarrow H-\frac{\#(v)}{N}\log_2\frac{\#(v)}{N} H ← H − N # ( v ) log 2 N # ( v ) (8)
end for
μ ← 7.999914796090 − 183.943323730404 N − 7879.931052184461 N 2 \mu\leftarrow7.999914796090-\frac{183.943323730404}{N}-\frac{7879.931052184461}{N^2} μ ← 7.999914796090 − N 183.943323730404 − N 2 7879.931052184461 (86)
σ ← 0.000235108088 N + 265.374075223902 N 2 \sigma\leftarrow\sqrt{\frac{0.000235108088}{N}+\frac{265.374075223902}{N^2}} σ ← N 0.000235108088 + N 2 265.374075223902 (119)
H − ← μ − Φ − 1 ( 1 − α / 2 ) σ ; H + ← μ + Φ − 1 ( 1 − α / 2 ) σ H^{-}\leftarrow\mu-\Phi^{-1}(1-\alpha/2)\sigma;\quad H^{+}\leftarrow\mu+\Phi^{-1}(1-\alpha/2)\sigma H − ← μ − Φ − 1 ( 1 − α /2 ) σ ; H + ← μ + Φ − 1 ( 1 − α /2 ) σ (122)
return H − ≤ H ≤ H + H^{-}\le H\le H^{+} H − ≤ H ≤ H +
Solving (133) for T T T shows that the mean gap first exceeds one uniform standard deviation at T = 3824 T=3824 T = 3824 and the two-sided α = 0.05 \alpha=0.05 α = 0.05 acceptance half-width at T = 7495 T=7495 T = 7495 . Both thresholds lie within practically relevant file size ranges.
Monte-Carlo Validation
Following the simulation procedure of [4 ] , we check whether samples from the VSTL distribution recover the global entropy reference moments.
For a fixed triangle count T T T , one trial draws a VSTL file according to Definition 1. Each of its 12 T 12T 12 T floats is sampled independently and uniformly from F \mathcal{F} F , and each attribute word independently and uniformly from { 0 , … , 2 16 − 1 } \{0,\ldots,2^{16}-1\} { 0 , … , 2 16 − 1 } . We compute the global entropy using (8) over the bytes of the triangle records. For each of the selected file sizes spanning 500 ≤ T ≤ 1000000 500\le T\le1000000 500 ≤ T ≤ 1000000 , n = 10000 n=10000 n = 10000 independent trials are performed.
The resulting observations H 1 , … , H n H_1,\ldots,H_n H 1 , … , H n give the sample mean and unbiased sample variance,
μ ^ = 1 n ∑ i = 1 n H i , σ ^ 2 = 1 n − 1 ∑ i = 1 n ( H i − μ ^ ) 2 . (134) \hat{\mu} = \frac{1}{n}\sum_{i=1}^{n} H_i, \\
\hat{\sigma}^{2} = \frac{1}{n-1}\sum_{i=1}^{n}(H_i-\hat{\mu})^{2}. \tag*{(134)} μ ^ = n 1 i = 1 ∑ n H i , σ ^ 2 = n − 1 1 i = 1 ∑ n ( H i − μ ^ ) 2 . (134)
These estimators converge to the true moments as n n n grows, providing a numerical check on the second-order reference values of Propositions 3 and 4.
To compare the reference values and Monte-Carlo estimates on a common scale, we use the standardized displacement
ζ ( x ) = x − μ V S T L ( T ) σ V S T L ( T ) , (135) \zeta(x) = \frac{x-\mu^{\mathrm{VSTL}}(T)}{\sigma^{\mathrm{VSTL}}(T)}, \tag*{(135)} ζ ( x ) = σ VSTL ( T ) x − μ VSTL ( T ) , (135)
which expresses the difference between any x x x and the reference mean in reference standard deviations.
Figure 3 confirms agreement between the simulated and predicted VSTL reference values — the mean and standard deviation follow their theoretical curves within sampling error at every tested size. It also reveals the consequences of wrongly relying on the uniform byte null model for VSTL ciphertexts. The vertical lines at T = 3824 T = 3824 T = 3824 and T = 7495 T = 7495 T = 7495 mark the crossings derived in § 4.6 , where the mean difference equals one uniform standard deviation and the uniform 95% acceptance half-width, respectively. Beyond the second threshold, the lower acceptance bound of the conventional test, based on the uniform byte null model, exceeds the VSTL reference mean, making the test unsuitable even at practically relevant file sizes and reinforcing the need for the format-specific test proposed in this paper.
Figure 3. Global entropy under the VSTL and uniform null models: (a) reference values from the second-order expansions and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ \zeta ζ -units.
Figure 4 shows the absolute differences between the reference values and their estimates on a logarithmic scale; both decrease towards zero over the tested range, with no apparent persistent discrepancy.
Figure 4. Absolute difference between the reference values of the VSTL global entropy test and their corresponding Monte-Carlo estimates: ∣ μ V S T L ( T ) − μ ^ ∣ \lvert\mu^{\mathrm{VSTL}}(T)-\hat{\mu}\rvert ∣ μ VSTL ( T ) − μ ^ ∣ (red stars) and ∣ σ V S T L ( T ) − σ ^ ∣ \lvert\sigma^{\mathrm{VSTL}}(T)-\hat{\sigma}\rvert ∣ σ VSTL ( T ) − σ ^ ∣ (blue circles).
The VSTL Local Entropy Test
The ( k , N B ) (k,N_B) ( k , N B ) -local test selects k k k non-overlapping blocks of T B T_B T B consecutive records from a ciphertext S S S , denoted by S 1 , … , S k ∈ V N B S_1,\ldots,S_k \in\mathcal{V}^{N_B} S 1 , … , S k ∈ V N B , and averages their Shannon entropies:
H ‾ k , N B ( S ) = 1 k ∑ i = 1 k H ( S i ) . (136) \overline{H}_{k,N_B}(S) = \frac{1}{k}\sum_{i=1}^{k} H(S_i). \tag*{(136)} H k , N B ( S ) = k 1 i = 1 ∑ k H ( S i ) . (136)
The conventional local entropy test evaluates the observed average against reference values derived under the uniform null model, which treats each block as a string of N B N_B N B i.i.d. uniform bytes. The VSTL local entropy test, however, requires reference values that account for the validity constraint. This section adapts the capacity energy criterion of [6 ] to determine the optimal block size N B ∗ N_B^* N B ∗ for the VSTL local entropy test and then derives the exact reference mean and variance of H ˉ k , N B ∗ \bar{H}_{k,N_B^*} H ˉ k , N B ∗ at that block size.
Lemma 5. Let S 1 , … , S k S_1,\ldots,S_k S 1 , … , S k be pairwise disjoint blocks of T B T_B T B consecutive records from a VSTL ciphertext. The average of their entropies has mean and variance
E [ H ˉ k , N B ( S ) ] = μ V S T L ( T B ) , \mathbb{E}\left[\bar{H}_{k,N_B}(S)\right]=\mu^{\mathrm{VSTL}}(T_B), E [ H ˉ k , N B ( S ) ] = μ VSTL ( T B ) , Var [ H ˉ k , N B ( S ) ] = [ σ V S T L ( T B ) ] 2 k . (137) \operatorname{Var}\left[\bar{H}_{k,N_B}(S)\right]=\frac{\left[\sigma^{\mathrm{VSTL}}(T_B)\right]^2}{k}. \tag*{(137)} Var [ H ˉ k , N B ( S ) ] = k [ σ VSTL ( T B ) ] 2 . (137)
Proof. Under Definition 1, records are independent, so blocks containing disjoint sets of records have independent entropies. Every block contains the T B T_B T B records drawn from the same distribution, so its entropy has mean μ V S T L ( T B ) \mu^{\mathrm{VSTL}}(T_B) μ VSTL ( T B ) and variance [ σ V S T L ( T B ) ] 2 \left[\sigma^{\mathrm{VSTL}}(T_B)\right]^2 [ σ VSTL ( T B ) ] 2 . Averaging the k k k entropies preserves this mean and divides the variance by k k k , giving (136).
The Optimal Block Size
The block size is determined by maximizing the capacity energy criterion of [6 Eq. (28)] . This criterion is the probability that every byte value occurs in a random block, divided by the block size N B N_B N B :
f ( N B ) = Pr [ ⋂ v ∈ V { # ( v ) > 0 } ] N B . (138) f(N_B)=\frac{\Pr\left[\bigcap_{v\in\mathcal{V}}\{\#(v)>0\}\right]}{N_B}. \tag*{(138)} f ( N B ) = N B Pr [ ⋂ v ∈ V { # ( v ) > 0 } ] . (138)
For the VSTL local entropy test, each block consists of T B T_B T B triangle records, so N B = 50 T B N_B=50T_B N B = 50 T B . The probability that every byte value occurs at least once in a random block of size N B N_B N B is calculated by inclusion–exclusion over the events of absence. All values in a subset A ⊆ V \mathcal{A}\subseteq\mathcal{V} A ⊆ V are absent from the block if and only if every byte lies outside A \mathcal{A} A :
Pr [ ⋂ v ∈ V { # ( v ) > 0 } ] = ∑ A ⊆ V ( − 1 ) ∣ A ∣ Pr [ ⋂ v ∈ A { # ( v ) = 0 } ] = ∑ A ⊆ V ( − 1 ) ∣ A ∣ Pr [ B U ∈ ( V ∖ A ) ] 26 T B Pr [ ( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] 12 T B . (139) \begin{aligned}
\Pr\left[\bigcap_{v\in\mathcal{V}}\{\#(v)>0\}\right]
&=\sum_{\mathcal{A}\subseteq\mathcal{V}}(-1)^{|\mathcal{A}|}\Pr\left[\bigcap_{v\in\mathcal{A}}\{\#(v)=0\}\right]\\
&=\sum_{\mathcal{A}\subseteq\mathcal{V}}(-1)^{|\mathcal{A}|}\Pr\left[B_U\in(\mathcal{V}\setminus\mathcal{A})\right]^{26T_B}\Pr\left[(B_0,B_1)\in(\mathcal{V}\setminus\mathcal{A})^2\right]^{12T_B}. \tag*{(139)}
\end{aligned} Pr [ v ∈ V ⋂ { # ( v ) > 0 } ] = A ⊆ V ∑ ( − 1 ) ∣ A ∣ Pr [ v ∈ A ⋂ { # ( v ) = 0 } ] = A ⊆ V ∑ ( − 1 ) ∣ A ∣ Pr [ B U ∈ ( V ∖ A ) ] 26 T B Pr [ ( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] 12 T B . (139)
Since B U B_U B U is uniform on V \mathcal{V} V and ( B 0 , B 1 ) (B_0,B_1) ( B 0 , B 1 ) is uniform on X \mathcal{X} X , the two factors of (139) can be expressed directly in terms of set cardinalities:
Pr [ B U ∈ ( V ∖ A ) ] = ∣ V ∖ A ∣ ∣ V ∣ = 256 − ∣ A ∣ 256 , Pr [ ( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] = ∣ X ∩ ( V ∖ A ) 2 ∣ ∣ X ∣ = ∣ X ∩ ( V ∖ A ) 2 ∣ 65280 . (140) \begin{aligned}
\Pr[B_U\in(\mathcal{V}\setminus\mathcal{A})]
&=\frac{|\mathcal{V}\setminus\mathcal{A}|}{|\mathcal{V}|}
=\frac{256-|\mathcal{A}|}{256},\\
\Pr[(B_0,B_1)\in(\mathcal{V}\setminus\mathcal{A})^2]
&=\frac{|\mathcal{X}\cap(\mathcal{V}\setminus\mathcal{A})^2|}{|\mathcal{X}|}
=\frac{|\mathcal{X}\cap(\mathcal{V}\setminus\mathcal{A})^2|}{65280}. \tag*{(140)}
\end{aligned} Pr [ B U ∈ ( V ∖ A )] Pr [( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] = ∣ V ∣ ∣ V ∖ A ∣ = 256 256 − ∣ A ∣ , = ∣ X ∣ ∣ X ∩ ( V ∖ A ) 2 ∣ = 65280 ∣ X ∩ ( V ∖ A ) 2 ∣ . (140)
To evaluate the numerator in the second line, we rewrite the intersection as a difference of products whose cardinalities can be calculated directly:
X ∩ ( V ∖ A ) 2 = [ V 2 ∖ ( { 127 , 255 } × V h i ) ] ∩ ( V ∖ A ) 2 = ( V ∖ A ) 2 ∖ [ ( { 127 , 255 } ∖ A ) × ( V h i ∖ A ) ] , (141) \begin{aligned}
\mathcal{X}\cap(\mathcal{V}\setminus\mathcal{A})^2
&=\left[\mathcal{V}^2\setminus\left(\{127,255\}\times\mathcal{V}_{hi}\right)\right]\cap(\mathcal{V}\setminus\mathcal{A})^2\\
&=(\mathcal{V}\setminus\mathcal{A})^2\setminus\left[(\{127,255\}\setminus\mathcal{A})\times(\mathcal{V}_{hi}\setminus\mathcal{A})\right], \tag*{(141)}
\end{aligned} X ∩ ( V ∖ A ) 2 = [ V 2 ∖ ( { 127 , 255 } × V hi ) ] ∩ ( V ∖ A ) 2 = ( V ∖ A ) 2 ∖ [ ({ 127 , 255 } ∖ A ) × ( V hi ∖ A ) ] , (141)
∴ Pr [ ( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] = ( 256 − ∣ A ∣ ) 2 − ∣ { 127 , 255 } ∖ A ∣ ⋅ ∣ V h i ∖ A ∣ 65280 . \therefore\Pr[(B_0,B_1)\in(\mathcal{V}\setminus\mathcal{A})^2]
=\frac{(256-|\mathcal{A}|)^2-|\{127,255\}\setminus\mathcal{A}|\cdot|\mathcal{V}_{hi}\setminus\mathcal{A}|}{65280}. ∴ Pr [( B 0 , B 1 ) ∈ ( V ∖ A ) 2 ] = 65280 ( 256 − ∣ A ∣ ) 2 − ∣ { 127 , 255 } ∖ A ∣ ⋅ ∣ V hi ∖ A ∣ .
Equations (139) , (140) and (141) show that the contribution of A \mathcal{A} A depends only on the number of its elements belonging to each of the four categories. in (21) . The capacity energy criterion of (138) can thus be written as:
f ( N B ) = 1 N B ∑ 0 ≤ n l o , n h i ≤ 127 ε 127 , ε 255 ∈ { 0 , 1 } ( − 1 ) n l o + n h i + ε 127 + ε 255 ( 127 n l o ) ( 127 n h i ) f U 26 T B f X 12 T B , f U = 256 − n l o − n h i − ε 127 − ε 255 256 , f X = ( 256 − n l o − n h i − ε 127 − ε 255 ) 2 − ( 2 − ε 127 − ε 255 ) ( 128 − n h i − ε 255 ) 65280 , (142) \begin{aligned}
f(N_B) &= \frac{1}{N_B}\sum_{\substack{0\le n_{\mathrm{lo}},n_{\mathrm{hi}}\le127\\ \varepsilon_{127},\varepsilon_{255}\in\{0,1\}}}(-1)^{n_{\mathrm{lo}}+n_{\mathrm{hi}}+\varepsilon_{127}+\varepsilon_{255}}\binom{127}{n_{\mathrm{lo}}}\binom{127}{n_{\mathrm{hi}}}f_U^{26T_B}f_{\mathcal{X}}^{12T_B},\\
f_U &= \frac{256-n_{\mathrm{lo}}-n_{\mathrm{hi}}-\varepsilon_{127}-\varepsilon_{255}}{256},\\
f_{\mathcal{X}} &= \frac{(256-n_{\mathrm{lo}}-n_{\mathrm{hi}}-\varepsilon_{127}-\varepsilon_{255})^2-(2-\varepsilon_{127}-\varepsilon_{255})(128-n_{\mathrm{hi}}-\varepsilon_{255})}{65280}, \tag*{(142)}
\end{aligned} f ( N B ) f U f X = N B 1 0 ≤ n lo , n hi ≤ 127 ε 127 , ε 255 ∈ { 0 , 1 } ∑ ( − 1 ) n lo + n hi + ε 127 + ε 255 ( n lo 127 ) ( n hi 127 ) f U 26 T B f X 12 T B , = 256 256 − n lo − n hi − ε 127 − ε 255 , = 65280 ( 256 − n lo − n hi − ε 127 − ε 255 ) 2 − ( 2 − ε 127 − ε 255 ) ( 128 − n hi − ε 255 ) , (142)
where f U f_U f U and f X f_{\mathcal{X}} f X are the probabilities that an unconstrained byte lies outside A \mathcal{A} A and that both bytes of an exponent pair lie outside A \mathcal{A} A , respectively. The variables n l o n_{\mathrm{lo}} n lo , ε 127 \varepsilon_{127} ε 127 , n h i n_{\mathrm{hi}} n hi and ε 255 \varepsilon_{255} ε 255 specify how many values from each category of Γ \Gamma Γ belong to A \mathcal{A} A . The binomial coefficients count the selections from the majority sets.
Following [6 Eq. (31)] , the optimal block size is obtained by maximizing the criterion of (138) , evaluated using (142) :
T B ∗ = argmax T B ≥ 1 f ( 50 T B ) = 39 , N B ∗ = 50 T B ∗ = 1950. (143) \begin{aligned}
T_B^* &= \underset{T_B\ge1}{\operatorname{argmax}} f(50T_B)=39,\\
N_B^* &= 50T_B^*=1950. \tag*{(143)}
\end{aligned} T B ∗ N B ∗ = T B ≥ 1 argmax f ( 50 T B ) = 39 , = 50 T B ∗ = 1950. (143)
The capacity energy criterion is presented numerically near the maximum in Table 6 and graphically over a wider range in Figure 5 .
Table 6. The VSTL capacity energy criterion around the optimum. The underlined value marks the maximum at T B ∗ = 39 T_B^*=39 T B ∗ = 39 .
Figure 5. The VSTL capacity energy criterion over 1 ≤ T B ≤ 100 1 \leq T_B \leq100 1 ≤ T B ≤ 100 , evaluated at integer triangle counts. The vertical line marks the maximum at T B ∗ = 39 T_B^* = 39 T B ∗ = 39 .
The Reference Values
The second-order expansions of Propositions 3 and 4 become increasingly accurate as T → ∞ T\to\infty T → ∞ . However, the optimal local block size T B ∗ = 39 T_B^*=39 T B ∗ = 39 lies well below the operational lower limit T ≥ 100 T \geq100 T ≥ 100 adopted for the global test in § 4.5 . We therefore evaluate the exact count laws of Lemmas 1 and 2 once for T B ∗ T_B^* T B ∗ ; the resulting mean and variance determine the reference values for every admissible k k k , avoiding the truncation errors of the global reference approximations.
Proposition 1 is evaluated at T B ∗ = 39 T_B^* = 39 T B ∗ = 39 , with 26 T B ∗ = 1014 26T_B^* = 1014 26 T B ∗ = 1014 unconstrained bytes and 12 T B ∗ = 468 12T_B^* = 468 12 T B ∗ = 468 exponent pairs. The count law of Lemma 1, (22) and (23) then give the following moments:
θ γ θ γ ( 2 ) ν l o ∗ 0.030920079164 0.001042319790 { 127 } 0.027790753117 0.000852720838 ν h i ∗ 0.030871842363 0.001039250977 { 255 } 0.027741945918 0.000849747236 (144) \begin{array}{c|cc}
& \theta_\gamma& \theta_\gamma^{(2)} \\
\nu_{lo}^* & 0.030920079164 & 0.001042319790 \\
\{127\} & 0.027790753117 & 0.000852720838 \\
\nu_{hi}^* & 0.030871842363 & 0.001039250977 \\
\{255\} & 0.027741945918 & 0.000849747236 \tag*{(144)}
\end{array} ν l o ∗ { 127 } ν hi ∗ { 255 } θ γ 0.030920079164 0.027790753117 0.030871842363 0.027741945918 θ γ ( 2 ) 0.001042319790 0.000852720838 0.001039250977 0.000849747236 (144)
Likewise, the count law of Lemma 2 and (24) give the joint moments for v 0 ≠ v 1 v_0 \ne v_1 v 0 = v 1 , with rows indexed by γ 0 \gamma_0 γ 0 and columns by γ 1 \gamma_1 γ 1 :
θ γ 0 γ 1 ν l o ∗ { 127 } ν h i ∗ { 255 } ν l o ∗ 0.000955712851 0.000859027963 0.000954222497 0.000857520016 { 127 } 0.000859027963 − 0.000857604860 0.000770677417 ν h i ∗ 0.000954222497 0.000857604860 0.000952734466 0.000856099227 { 255 } 0.000857520016 0.000770677417 0.000856099227 − (145) \begin{array}{c|cccc}
\theta_{\gamma_0\gamma_1} & \nu_{lo}^* & \{127\} & \nu_{hi}^* & \{255\} \\
\nu_{lo}^* & 0.000955712851 & 0.000859027963 & 0.000954222497 & 0.000857520016 \\
\{127\} & 0.000859027963 & - & 0.000857604860 & 0.000770677417 \\
\nu_{hi}^* & 0.000954222497 & 0.000857604860 & 0.000952734466 & 0.000856099227 \\
\{255\} & 0.000857520016 & 0.000770677417 & 0.000856099227 & - \tag*{(145)}
\end{array} θ γ 0 γ 1 ν l o ∗ { 127 } ν hi ∗ { 255 } ν l o ∗ 0.000955712851 0.000859027963 0.000954222497 0.000857520016 { 127 } 0.000859027963 − 0.000857604860 0.000770677417 ν hi ∗ 0.000954222497 0.000857604860 0.000952734466 0.000856099227 { 255 } 0.000857520016 0.000770677417 0.000856099227 − (145)
The table is symmetric, and its two singleton diagonal entries are empty because a singleton category admits no pair of distinct values.
Equations (25) and (26) assemble these moments into the exact block mean and variance. By Lemma 5 , averaging over k k k blocks gives the VSTL counterparts of the reference values of [6 Tab. 3] :
μ H ˉ V S T L ≈ 7.903106732975 σ H ˉ V S T L ≈ 0.008635732664 k . (146) \begin{aligned}
\mu_{\bar{H}}^{\mathrm{VSTL}} &\approx7.903106732975 \\
\sigma_{\bar{H}}^{\mathrm{VSTL}} &\approx\frac{0.008635732664}{\sqrt{k}}. \tag*{(146)}
\end{aligned} μ H ˉ VSTL σ H ˉ VSTL ≈ 7.903106732975 ≈ k 0.008635732664 . (146)
Consistency with the Uniform Model
Corollary 4. Under the uniform byte model, with L = ∣ V ∣ = 256 L = \lvert\mathcal{V} \rvert= 256 L = ∣ V ∣ = 256 , Lemma 5 reduces to
μ H ˉ u n i f o r m = L θ V , \mu_{\bar{H}}^{\mathrm{uniform}} = L\theta_{\mathcal{V}}, μ H ˉ uniform = L θ V , [ σ H ˉ u n i f o r m ] 2 = L θ V ( 2 ) + L ( L − 1 ) θ V V − [ μ H ˉ u n i f o r m ] 2 k , (147) \left[\sigma_{\bar{H}}^{\mathrm{uniform}}\right]^2 =
\frac{L\theta_{\mathcal{V}}^{(2)} + L(L-1)\theta_{\mathcal{V}\mathcal{V}} - \left[\mu_{\bar{H}}^{\mathrm{uniform}}\right]^2}{k}, \tag*{(147)} [ σ H ˉ uniform ] 2 = k L θ V ( 2 ) + L ( L − 1 ) θ VV − [ μ H ˉ uniform ] 2 , (147) where the θ \theta θ moments are evaluated at N = N B N = N_B N = N B .
Proof. Assume uniformity — then Corollary 1 gives the exact mean and variance of each block. The k k k disjoint blocks remain independent, so averaging preserves their mean and divides their variance by k k k . Substituting (27) into (136) yields (146).
Equation (146) therefore reproduces the reference mean and variance for the local entropy statistic of [6 Secs. 3.3 and 4.3] .
Normal Approximation and Acceptance Bounds
Unlike the global normal approximation of Corollary 3, which lets the number of records in a block grow, the local approximation considers a growing number of blocks at a fixed block size.
Corollary 5. Let S 1 , … , S k S_1,\ldots,S_k S 1 , … , S k be pairwise disjoint blocks of T B ∗ T_B^* T B ∗ consecutive records from a VSTL ciphertext. Their average entropy has reference mean μ H ˉ V S T L \mu_{\bar{H}}^{\mathrm{VSTL}} μ H ˉ VSTL and standard deviation σ H ˉ V S T L \sigma_{\bar{H}}^{\mathrm{VSTL}} σ H ˉ VSTL given in (146) . Then, as the block count k k k grows,
H ˉ k , N B ∗ ( S ) − μ H ˉ V S T L σ H ˉ V S T L → D N ( 0 , 1 ) , (148) \frac{\bar{H}_{k,N_B^*}(S)-\mu_{\bar{H}}^{\mathrm{VSTL}}}{\sigma_{\bar{H}}^{\mathrm{VSTL}}}
\xrightarrow{D} \mathcal{N}(0,1), \tag*{(148)} σ H ˉ VSTL H ˉ k , N B ∗ ( S ) − μ H ˉ VSTL D N ( 0 , 1 ) , (148) so the two-sided acceptance interval at level α \alpha α is
μ H ˉ V S T L ± Φ − 1 ( 1 − α 2 ) σ H ˉ V S T L . (149) \mu_{\bar{H}}^{\mathrm{VSTL}} \pm\Phi^{-1}\left(1-\frac{\alpha}{2}\right)\sigma_{\bar{H}}^{\mathrm{VSTL}}. \tag*{(149)} μ H ˉ VSTL ± Φ − 1 ( 1 − 2 α ) σ H ˉ VSTL . (149)
Proof. By Lemma 5, the block entropies are independent and share the same distribution. Since the variance in (146) is finite and positive, the central limit theorem [16], [13, Thm. (5.10.4)] gives (148) .
The central 1 − α 1-\alpha 1 − α region of N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) is bounded by ± Φ − 1 ( 1 − α / 2 ) \pm\Phi^{-1}(1-\alpha/2) ± Φ − 1 ( 1 − α /2 ) ; applying these bounds to (148) gives (149) .
The Test Procedure
The block count may be chosen within 30 ≤ k ≤ ⌊ T T B ∗ ⌋ 30 \le k \le\left\lfloor\frac{T}{T_{B}^{*}} \right\rfloor 30 ≤ k ≤ ⌊ T B ∗ T ⌋ . The lower bound follows the convention of [6 ] for the normal approximation, while the upper bound is the number of complete non-overlapping blocks available in a file of T T T triangles. By (137) , increasing k k k reduces the standard deviation of the average, without changing its reference mean.
Corollary 5 turns the reference values of (146) into a two-sided test for the average entropy of k k k non-overlapping blocks from a single ciphertext. Table 7 lists the resulting mean, standard deviation and acceptance bounds at three significance levels for selected block counts.
Table 7. Exact reference moments and two-sided acceptance bounds for the VSTL local entropy test at T B ∗ = 39 T_{B}^{*}=39 T B ∗ = 39 , N B ∗ = 1950 N_{B}^{*}=1950 N B ∗ = 1950 .
Algorithm 2 applies the reference moments of (146) and the acceptance interval of Corollary 5 to a single ciphertext.
Algorithm 2 VSTL ( k , N B ) (k,N_B) ( k , N B ) -local entropy test
Require: ciphertext S S S consisting of T T T triangles, with N = 50 T N=50T N = 50 T data bytes S 1 , … , S N S_1,\ldots,S_N S 1 , … , S N ; block count 30 ≤ k ≤ ⌊ T 39 ⌋ 30\le k\le\left\lfloor\frac{T}{39}\right\rfloor 30 ≤ k ≤ ⌊ 39 T ⌋ ; significance level α \alpha α
Ensure: ( k , 1950 ) (k,1950) ( k , 1950 ) -local entropy acceptance verdict under the VSTL reference
R ← \mathcal{R}\leftarrow R ← the starting positions of k k k non-overlapping and uniformly selected 1950-byte blocks
H ˉ ← 0 \bar{H}\leftarrow0 H ˉ ← 0
for i ∈ R i\in\mathcal{R} i ∈ R do
H i ← 0 H_i\leftarrow0 H i ← 0
# ( v ) ← 0 \#(v)\leftarrow0 # ( v ) ← 0 for all v ∈ V v\in\mathcal{V} v ∈ V
for j ← 0 j\leftarrow0 j ← 0 to 1949 1949 1949 do
# ( S i + j ) ← # ( S i + j ) + 1 \#(S_{i+j})\leftarrow\#(S_{i+j})+1 # ( S i + j ) ← # ( S i + j ) + 1
end for
for v ∈ V v\in\mathcal{V} v ∈ V such that # ( v ) > 0 \#(v)>0 # ( v ) > 0 do
H i ← H i − # ( v ) 1950 log 2 # ( v ) 1950 H_i\leftarrow H_i-\frac{\#(v)}{1950}\log_2\frac{\#(v)}{1950} H i ← H i − 1950 # ( v ) log 2 1950 # ( v ) ▷ (8)
end for
H ˉ ← H ˉ + H i k \bar{H}\leftarrow\bar{H}+\frac{H_i}{k} H ˉ ← H ˉ + k H i ▷ (135)
end for
μ ← 7.903106732975 \mu\leftarrow7.903106732975 μ ← 7.903106732975 ▷ (145)
σ ← 0.008635732664 k \sigma\leftarrow\frac{0.008635732664}{\sqrt{k}} σ ← k 0.008635732664 ▷ (145)
H ˉ − ← μ − Φ − 1 ( 1 − α / 2 ) σ \bar{H}^{-}\leftarrow\mu-\Phi^{-1}(1-\alpha/2)\sigma H ˉ − ← μ − Φ − 1 ( 1 − α /2 ) σ ; H ˉ + ← μ + Φ − 1 ( 1 − α / 2 ) σ \bar{H}^{+}\leftarrow\mu+\Phi^{-1}(1-\alpha/2)\sigma H ˉ + ← μ + Φ − 1 ( 1 − α /2 ) σ ▷ (148)
return H ˉ − ≤ H ˉ ≤ H ˉ + \bar{H}^{-}\le\bar{H}\le\bar{H}^{+} H ˉ − ≤ H ˉ ≤ H ˉ +
Practical Significance
The uniform reference of [6 Tab. 3] uses blocks of 1936 bytes, whereas the VSTL local entropy test requires blocks of 1950 bytes. We therefore compare the VSTL reference with the uniform references at both block sizes, as reported in Table 8 .
Table 8. Uniform local entropy reference values at N B = 1936 N_B=1936 N B = 1936 and N B = 1950 N_B=1950 N B = 1950 , compared with the VSTL reference, with crossing thresholds for the mean differences.
We express each mean difference in units of the corresponding uniform standard deviation to quantify the separation from the VSTL reference and identify when the uniform reference becomes practically unsuitable:
∣ μ H ˉ V S T L − μ H ˉ u n i f o r m ( N B ) ∣ = z σ H ˉ u n i f o r m ( N B ) . (150) \left|\mu_{\bar H}^{\mathrm{VSTL}}-\mu_{\bar H}^{\mathrm{uniform}}(N_B)\right|=z\sigma_{\bar H}^{\mathrm{uniform}}(N_B). \tag*{(150)} μ H ˉ VSTL − μ H ˉ uniform ( N B ) = z σ H ˉ uniform ( N B ) . (150)
Solving (150) for k k k with z = 1 z=1 z = 1 gives the crossing at one uniform standard deviation, while with z = Φ − 1 ( 0.975 ) z=\Phi^{-1}(0.975) z = Φ − 1 ( 0.975 ) it gives the crossing at the two-sided 95% acceptance half-width. The mean differences and corresponding crossings are also listed in Table 8 .
Against the uniform reference at N B = 1936 N_B=1936 N B = 1936 , both crossings occur at block counts attainable within practically relevant file sizes; at N B = 1950 N_B=1950 N B = 1950 , the crossings occur at substantially larger block counts.
Monte-Carlo Validation
Following the simulation procedure of [4 ] and § 4.7 , we check whether samples from the VSTL distribution recover the local entropy reference moments.
For a fixed k k k , one trial draws a VSTL file according to Definition 1, consisting of k k k blocks of T B ∗ T_B^* T B ∗ triangle records each. We compute their average entropy using (136) . By Lemma 5 , this procedure is equivalent in distribution to selecting k k k disjoint blocks from a longer VSTL file. We use n = 10000 n=10000 n = 10000 independent trials at each of the selected block counts spanning 30 ≤ k ≤ 5000 30 \le k \le5000 30 ≤ k ≤ 5000 .
The trial averages give the sample mean μ ^ H ˉ \hat{\mu}_{\bar H} μ ^ H ˉ and unbiased sample variance σ ^ H ˉ 2 \hat{\sigma}_{\bar H}^{2} σ ^ H ˉ 2 through (134) . Standardization follows (135) , using the exact local reference values μ H ˉ V S T L \mu_{\bar H}^{\mathrm{VSTL}} μ H ˉ VSTL and σ H ˉ V S T L \sigma_{\bar H}^{\mathrm{VSTL}} σ H ˉ VSTL of (146) .
The simulated mean and standard deviation agree with the exact VSTL predictions within sampling error across all tested block counts, as illustrated in Figure 6 and Figure 7 . In the comparison with the uniform reference at
Figure 6. Local entropy under the VSTL model, compared with the conventional uniform reference at N B = 1936 N_B = 1936 N B = 1936 : (a) exact reference values and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ \zeta ζ -units.
Figure 7. Local entropy under the VSTL model, compared with the uniform reference at N B = 1950 N_B = 1950 N B = 1950 : (a) exact reference values and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ \zeta ζ -units.
N B = 1936 N_B=1936 N B = 1936 , the fixed difference between the means becomes increasingly pronounced as the acceptance intervals narrow for larger k k k . The vertical lines in Figure 6 mark the crossings derived in § 5.6 and listed in Table 8 ; beyond the second crossing, the VSTL reference mean lies above the upper bound of the uniform 95% acceptance interval. For the uniform reference evaluated at the optimal block size for the VSTL local entropy test N B ∗ N_B^* N B ∗ , the mean difference is smaller and the curves are substantially closer, as shown in Figure 7 , with both crossing thresholds lying beyond the tested range.
Figure 8 shows the absolute differences between the reference values and their Monte-Carlo estimates on a logarithmic scale; both show an overall downward trend towards zero as the block count grows.
Figure 8. Absolute difference between the reference values of the VSTL local entropy test and their corresponding Monte-Carlo estimates: ∣ μ H ˉ V S T L − μ ^ H ˉ ∣ |\mu_{\bar{H}}^{\mathrm{VSTL}}-\hat{\mu}_{\bar{H}}| ∣ μ H ˉ VSTL − μ ^ H ˉ ∣ (red stars) and ∣ σ H ˉ V S T L − σ ^ H ˉ ∣ |\sigma_{\bar{H}}^{\mathrm{VSTL}}-\hat{\sigma}_{\bar{H}}| ∣ σ H ˉ VSTL − σ ^ H ˉ ∣ (blue circles).
Conclusions
This paper introduced a two-sided hypothesis test for the global entropy under the VSTL null model and adjusted the established local entropy test to this setting. The reference values and acceptance bounds account for the IEEE-754 validity constraint and the resulting dependence between the exponent bytes of each float. Removing this validity constraint recovers the conventional uniform model.
The global entropy converges to approximately 7.99991479609 bits, with an expected value strictly below this limit for every finite sample size. The second-order expansions provide efficiently computable reference moments and retain a nonzero N − 1 N^{-1} N − 1 term in the variance, unlike the uniform case, where this term vanishes. The difference between the reference means becomes relevant at practical file sizes — at 3824 triangles it first exceeds one uniform standard deviation, while at 7495 triangles the VSTL reference mean first falls below the lower bound of the uniform 95% acceptance interval.
For local entropy, the capacity energy criterion increased the block size from the conventional 1936 bytes to 1950 bytes, corresponding to 39 triangles. The exact moments gave a reference mean of approximately 7.903106732975 bits and a standard deviation of approximately 0.008635732664 k \frac{0.008635732664}{\sqrt{k}} k 0.008635732664 for the average over k k k disjoint blocks. The difference from the uniform reference at 1936 bytes is again practically relevant — at 187 blocks it first exceeds one uniform standard deviation, while at 715 blocks the VSTL reference mean first exceeds the upper bound of the uniform 95% acceptance interval; the reference at 1950 bytes is substantially closer, but still becomes unsuitable for larger numbers of blocks.
Monte-Carlo simulations confirm the global and local reference moments within sampling error in all tested cases.
We therefore recommend evaluating STL ciphers against the VSTL references derived in this paper. Acceptance indicates consistency with the stated null model in terms of entropy; it does not establish cryptographic security.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Funding
This work was supported by the Scientific Research Fund of Konstantin Preslavsky University of Shumen [grant number RD-08-91/02.02.2026].
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
Generative AI tools were used to assist in identifying related literature, improve the language and readability of the manuscript, proofread the text, review the mathematical derivations and validate the consistency of the reported results. The authors retain full responsibility for the correctness of this work.