Next Article in Journal
Wireless Communications: Signal Processing Perspectives
Previous Article in Journal
Matrix Quantum Mechanics and Entanglement Entropy: A Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The MacWilliams Identity for the m-Spotty Weight Enumerators over ZpRk

1
Department of Base Courses, Anhui Sanlian University, Hefei 230601, China
2
College of General Education, Anhui Wenda University of Information Engineering, Hefei 231201, China
3
Lab I2M (CNRS, Centrale Marseille, Aix-Marseille University), 13009 Marseilles, France
*
Author to whom correspondence should be addressed.
Entropy 2026, 28(1), 59; https://doi.org/10.3390/e28010059
Submission received: 17 November 2025 / Revised: 28 December 2025 / Accepted: 29 December 2025 / Published: 31 December 2025
(This article belongs to the Section Information Theory, Probability and Statistics)

Abstract

In this paper, we investigate the m-spotty weight enumerators over the mixed alphabet Z p R k . Specifically, we construct the Gray map from Z p α × R k β to Z p α + k β , where R k = Z p + v Z p + v 2 Z p + + v k 1 Z p with v k = 0 and k 5 . Based on this framework, we establish the MacWilliams identity for the m-spotty weight enumerators between a linear code and its dual over Z p R k , by employing the generalized Hadamard transform and the canonical additive character of Z p . Finally, an example is presented to illustrate and validate the theoretical results.

1. Introduction

In coding theory, it is customary to use generating functions that enumerate codewords by their Hamming weights to evaluate the probability of decoding errors over noisy channels. This generating function, which takes the form of a polynomial, is known as the weight enumerator. In 1963, MacWilliams established a fundamental relation between the weight enumerators of a linear code and its dual, now known as the MacWilliams identity. This identity has become one of the cornerstones of algebraic coding theory, providing a powerful connection between a code and its dual [1,2,3,4,5].
Error control codes play a vital role in enhancing the reliability of communication and data storage systems. To address more complex noise environments, spotty and m-spotty byte error models were introduced [6]. These models, which generalize the classical bit-level error model introduced by Shannon, allow for the detection and correction of localized byte errors and thus require generalized weight functions beyond the standard Hamming weight.
In recent years, many researchers have extended the MacWilliams identities to a variety of weights and algebraic structures, including finite rings. For instance, Suzuki et al. [7] derived the MacWilliams identity for binary m-spotty weight enumerators. Siap and Özen [8,9] generalized these results to finite fields and to rings such as F 2 + u F 2 with u 2 = 0 , and further to F 2 + u F 2 + + u m 1 F 2 with u m = 0 . They also established the corresponding identities for RT-weight enumerators over arbitrary finite fields [10,11]. Moreover, Siap [12] obtained the MacWilliams identity for m-spotty Lee weight enumerators over Z 4 . Subsequently, Sharma and Sharma [12] investigated m-spotty weight enumerators over integer modular rings and two-byte error control codes, deriving several applications and their associated MacWilliams identities. A general overview of such developments can be found in [13].
In this work, we continue this line of research by introducing the m-spotty weight and the associated weight enumerators over the mixed ring Z p R k , where Z p denotes the ring of integers modulo p and R k = Z p + v Z p + v 2 Z p + + v k 1 Z p with v k = 0 and k 5 . We then establish the MacWilliams identity for linear codes over this mixed alphabet and their duals. The paper is organized as follows. Section 2 recalls basic concepts and preliminaries. Section 3 presents the MacWilliams identity for m-spotty weight enumerators over Z p R k . Section 4 concludes the paper.

2. Preliminaries

Let R be a finite commutative ring. A linear code of length n over R is an R-submodule of R n . A matrix G is called a generator matrix of the linear code C if the rows of G generate C as an R-module. For any vector x = ( x 1 , x 2 , , x n ) R n , the Hamming weight of x is defined as w H ( x ) = | { i x i 0 , 1 i n } | . For any x = ( x 1 , , x n ) and y = ( y 1 , , y n ) R n , the Hamming distance between x and y is
d ( x , y ) = | { i x i y i , 1 i n } | .

2.1. The MacWilliams Identity over the Finite Field F q

Let F q denote the finite field with q elements, where q is a prime power. An [ n , k , d ]  linear code  C over F q is a k-dimensional subspace of F q n , where d is the minimum nonzero Hamming weight of C . Let A i denote the number of codewords in C with Hamming weight i, where i = 0 , 1 , , n . Then the vector ( A 0 , A 1 , , A n ) is called the weight distribution of C , and the polynomial A ( z ) = A 0 + A 1 z + + A n z n is the weight enumerator of C . The dual code of a linear code C is defined by C = { x F q n x · y = 0 , y C } , where x · y = x 1 y 1 + x 2 y 2 + + x n y n . for vectors x = ( x 1 , , x n ) and y = ( y 1 , , y n ) F q n .
The MacWilliams identity establishes the relation between the weight enumerators of a code and its dual.
Theorem 1. 
Let C be an [ n , k ] linear code over F q with weight enumerator A ( z ) . Let B ( z ) denote the weight enumerator of its dual code C . Then
B ( z ) = q k ( 1 + ( q 1 ) z ) n A 1 z 1 + ( q 1 ) z .

2.2. Codes over the Mixed Ring Z p R k

Throughout this paper, let Z p denote the ring of integers modulo p, and let R k = Z p + v Z p + v 2 Z p + + v k 1 Z p , where v k = 0 and k 5 . For any vectors x = ( x 1 , , x α x α + 1 , , x α + β ) , y = ( y 1 , , y α y α + 1 , , y α + β ) in Z p α × R k β , their inner product is defined as
x , y = v k 1 i = 1 α x i y i + i = α + 1 α + β x i y i .
For any element s = s 0 + s 1 v + + s k 1 v k 1 R k , define the projection η ( s ) = s 0 . For s R k and x Z p α × R k β , define s x = ( η ( s ) x 1 , , η ( s ) x α s x α + 1 , , s x α + β ) . A linear code C of type ( α , β ) over Z p R k is defined as a R k -submodule of Z p α × R k β under the above multiplication.
The dual code of a linear code C of type ( α , β ) over Z p R k is given by
C = { y Z p α × R k β x , y = 0 , x C } .
The Gray map  φ : Z p α × R k β Z p α + k β is defined by
φ ( a b ) = ( a 1 , , a α ϕ ( b 1 ) , , ϕ ( b β ) ) ,
where the component map ϕ : R k Z p k is given by
ϕ ( s 0 + s 1 v + + s k 1 v k 1 ) = ( s 0 + s 1 + + s k 1 , s 1 + + s k 1 , , s k 1 ) .

2.3. The m-Spotty Weight over Z p R k

Let c = ( c 11 , , c 1 b , , c n 1 , , c n b ) R n b be a codeword of length N = n b . The i-th byte of c is denoted by c i = ( c i 1 , c i 2 , , c i b ) . For a byte of length b, if at most t errors occur in that byte, then such an error is called an m-spotty byte error or a t / b -error, where 1 t b [14].
Definition 1. 
Let e R N be an error vector, and let e i R b be its i-th byte ( 1 i n ). Them-spotty weight of e is defined as
w M ( e ) = i = 1 n w H ( e i ) t ,
where x denotes the smallest integer not less than x [14]. If t = 1 , then w M ( e ) = w H ( e ) , i.e., the standard Hamming weight. If t = b , then the m-spotty Hamming weight coincides with the usual Hamming weight over F p b .
For Z p R k = { ( e 1 , e 2 ) e 1 Z p , e 2 R k } , errors may occur in both components e 1 and e 2 . Since it is difficult to compute the m-spotty weight directly on R k , we apply the mapping ϕ to convert elements in R k and then compute the m-spotty weight by counting the nonzero components.
Definition 2. 
For any element ( a α a β ) = ( a 1 , , a α a α + 1 , , a α + β ) Z p α × R k β , define w M ( a α a β ) = w M ( a α ) + w M ( a β ) . Let C be a linear code of type ( α , β ) over Z p R k and N = α + k β . Then them-spotty weight enumerator of C is defined by
W M C ( x , y ) = c C x N w M ( c ) y w M ( c ) = i = 0 N A i x N i y i ,
where ( A 0 , A 1 , , A N ) denotes the m-spotty weight distribution of C .
In Z p , let ξ = e 2 π i p . The canonical additive character of Z p is χ ( x ) = ξ x for x Z p . Any element r R k can be uniquely expressed as
r = a 0 + a 1 v + + a k 1 v k 1 , a i Z p .
Then the canonical additive character on R k is defined as
χ ( r ) = ξ a k 1 .
Consequently, for any element e = ( e 1 , e 2 ) Z p R k , where e 1 Z p and e 2 = i = 0 k 1 a i v i R k , the corresponding character is
χ ( e ) = ξ e 1 + a k 1 .

3. MacWilliams Identity for m-Spotty Weight over Z p α × R k β

In this section, we establish the MacWilliams identity for the m-spotty weight over Z p α × R k β . Based on Lemmas 2.1, 2.2, and 2.8 in [8], and by following their proof techniques, we derive the following lemmas.
Lemma 1. 
Let H { 0 } be an ideal of Z p α × R k β , and let χ be a character over Z p R k . Then the sum of the character values of all elements in H equals zero, i.e.,
h H χ ( h ) = 0 .
Lemma 2. 
For any r Z p α × R k β , let χ be a character over Z p R k . Then
z Z p α × R k β χ ( r z ) = | Z p α × R k β | , r = 0 , 0 , r 0 .
Proof. 
There are three cases to consider:
  • If r = 0 , then
    z Z p α × R k β χ ( r z ) = z χ ( 0 ) = z 1 = | Z p α × R k β | .
  • If r 0 and r = v , then by Lemma 1, we have
    z Z p α × R k β χ ( r z ) = z v χ ( z ) = 0 ,
    where v denotes the ideal generated by v.
  • If r 0 and r v , then similarly, Lemma 1 implies
    z Z p α × R k β χ ( r z ) = z χ ( z ) = 0 .
This completes the proof. □
Lemma 3. 
Let C be a linear code over Z p α × R k β , and let C denote its dual code. Let f : Z p α × R k β C be a function, and define
f ^ ( e ) = t Z p α × R k β χ ( e , t ) f ( t ) ,
called the generalized Hadamard transform of f ( t ) . Then
t C f ( t ) = 1 | C | e C f ^ ( e ) .
Proof. 
Since f ^ ( e ) = t Z p α × R k β χ ( e , t ) f ( t ) , then
e C f ^ ( e ) = e C t Z p α × R k β χ ( e , t ) f ( t )   = e C t C χ ( e , t ) f ( t ) + e C t Z p α × R k β C χ ( e , t ) f ( t ) .
For the first half to the right of the equal sign, since e C , t C , then e , t = 0 . By Lemma 2, it is easy to know that the first half is equal to
| C | t C f ( t ) .
And for the latter half, since e C , t Z p α × R k β C , then e , t 0 , From Lemma 2, we know that e C χ ( e , t ) = 0 . Therefore
e C t Z p α × R k β C χ ( e , t ) f ( t ) = t Z p α × R k β C e C χ ( e , t ) f ( t ) = 0 .
Hence
e C f ^ ( e ) = e C t Z p α × R k β χ ( e , t ) f ( t ) = | C | t C f ( t ) ,
This means that t C f ( t ) = 1 | C | e C f ^ ( e ) . □
Lemma 4. 
Let u Z p α × R k β and let χ be a character over Z p R k . Then
s Z p α × R k β χ ( u , s ) x N w M ( s ) y w M ( s ) = ( x + ( p 1 ) y ) N w M ( u ) ( x y ) w M ( u ) ,
where N = α + k β .
Proof. 
We first define N = α + k β , u α + j = u α + j 0 + v u α + j 1 + + v k 1 u α + j k 1 , s α + j = s α + j 0 + v s α + j 1 + + v k 1 s α + j k 1 , where j = 1 , 2 , , β . Then
left = s α Z p α s β R k β χ u α , s α x α w M s α y w M s α χ u β , s β x k β w M s β y w M s β   = i = 1 α s i Z p ξ u i s i x 1 w M s i y w M s i j = 1 β s α + j R k ξ u α + j s α + j x k w M s α + j y w M s α + j .
For the first half, according to the definition of m-spotty weight for any t, we have
  • If u i = 1 , then s i 0 , w M s i = 1 or s i = 0 , w M s i = 0 . After substituting these in, we can obtain
    s i Z p ξ 0 x 1 w M s i y w M s i = ξ 0 x + i = 1 p 1 ξ i y = x y .
  • If u i = 0 , then s i 0 , w M s i = 1 or s i = 0 , w M s i = 0 . After substituting these in, we can obtain
    s i Z p ξ 0 x 1 w M s i y w M s i = ξ 0 x + ( p 1 ) ξ 0 y = x + ( p 1 ) y .
Obviously the degrees of x + ( p 1 ) y and x y are 1 w M u i and w M u i , respectively. The second half of the proof is similar to the first half, then we have
left = i = 1 α ( x + ( p 1 ) y ) 1 w M ( u i ) ( x y ) w M ( u i ) j = 1 β s α + j l R k l = 0 , 1 , , k 1 ξ j = 1 β n + l = k 1 n , l Z p u α + j n s α + j l x k w M ( s α + j ) y w M ( s α + j ) = i = 1 α ( x + ( p 1 ) y ) 1 w M ( u i ) ( x y ) w M ( u i ) j = 1 β ( x + ( p 1 ) y ) k w M ( u α + j ) ( x y ) w M ( u α + j ) = ( x + ( p 1 ) y ) N w M ( u ) ( x y ) w M ( u ) .
This completes the proof. □
Theorem 2. 
Let C be a linear code over Z p α × R k β . Then the relation between the m-spotty weight enumerator of C and its dual C is
W M C ( x , y ) = 1 | C | W M C ( x + ( p 1 ) y , x y ) .
Proof. 
Let f ( t ) = x N w M ( t ) y w M ( t ) , then by Lemma 4 we have
f ^ ( e ) = t Z p α × R k β χ ( e , t ) f ( t ) = t Z p α × R k β χ ( e , t ) x N w M ( t ) y w M ( t ) = ( x + ( p 1 ) y ) N w M ( e ) ( x y ) w M ( e ) .
According to Lemma 3, for any e C , t C , we have
W M C ( x , y ) = t C x N w M ( t ) y w M ( t ) = t C f ( t ) = 1 | C | e C f ^ ( e ) = 1 | C | e C χ ( e , t ) ( x + ( p 1 ) y ) N w M ( e ) ( x y ) w M ( e ) = 1 | C | W M C ( x + ( p 1 ) y , x y ) .
This implies that W M C ( x , y ) = 1 | C | W M C ( x + ( p 1 ) y , x y ) . □
Next, we provide a specific example to illustrate our theorem. For convenience, let p = 3 and k = 2 . We consider the MacWilliams identity for the m-spotty weight of composite ring Z 3 R 2 = e 1 , e 2 e 1 Z 3 , e 2 R 2 .
Example 1. 
Let C be a linear code over Z 3 2 × R 2 2 with generation matrix
G 1 = 2 0 v 0 0 1 0 2 v .
We can verify that the row vector of the matrix is linearly independent and | C | = 9 . The m-spotty weight for codewords of C can be obtained in Table 1. From this, we can obtain the m-spotty weight distribution of C , as shown in Table 2.
Then we can easily calculate the m-spotty weight enumerators of c by the weight distribution W M ( c ) = x 6 + 4 x 4 y 2 + 4 x 2 y 4 . Therefore, by Theorem 2, we can obtain
W M C ( x , y ) = 1 | C | W M C ( x + ( p 1 ) y , x y )   = 1 9 W M C ( x + ( p 1 ) y , x y )   = 1 9 ( x + 2 y ) 6 + 4 ( x + 2 y ) 4 ( x y ) 2 + 4 ( x + 2 y ) 2 ( x y ) 4   = x 6 + 4 x 5 y 2 + 8 x 4 y 2 + 16 x 3 y 3 + 20 x 3 y 3 + 16 x y 5 + 16 y 6
This is the m-spotty weight counter for the corresponding dual code C .

4. Conclusions

In this paper, we introduced the concepts of error control codes and MacWilliams identities, and defined the m-spotty weight over the mixed alphabet Z p R k via a Gray map from Z p α × R k β to Z p α + k β . By constructing additive characters and employing the generalized Hadamard transform, we derived the MacWilliams identity relating the m-spotty weight enumerators of a code and its dual over Z p R k . Finally, we provided an explicit example to verify the theoretical results.

Author Contributions

Writing—original draft preparation, J.W. and A.J.; writing—review and editing, P.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research is supported by the Natural Science Foundation of Anhui Province Higher School (2023AH051697, 2023AH051682, 2022AH020099).

Data Availability Statement

No new data were created or analyzed in this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. MacWilliams, J. A Theorem on the Distribution of Weights in a Systematic Code. Bell Syst. Tech. J. 1963, 42, 79–94. [Google Scholar] [CrossRef] [Scilit]
  2. Özen, M.; Siap, V. The MacWilliams identity for m-spotty weight enumerators of linear codes over finite fields. Comput. Math. Appl. Int. J. 2011, 61, 1000–1004. [Google Scholar] [CrossRef] [Scilit]
  3. Sharma, A.; Sharma, A.K. On MacWilliams type identities for r-fold joint m-spotty weight enumerators. Discret. Math. 2012, 312, 3316–3327. [Google Scholar] [CrossRef] [Scilit]
  4. Sharma, A.; Sharma, A.K. MacWilliams type identities for some new m-spotty weight enumerators. IEEE Trans. Inf. Theory 2012, 58, 3912–3924. [Google Scholar] [CrossRef] [Scilit]
  5. Shi, M.; Wang, D.; Solé, P. Linear codes over F3+uF3+u2F3: MacWilliams identities, optimal ternary codes from one-Lee weight codes and two-Lee weight codes. J. Appl. Math. Comput. 2016, 51, 527–544. [Google Scholar] [CrossRef] [Scilit]
  6. Umanesan, G.; Fujiwara, E. A class of random multiple bits in a byte error correcting and single byte error detecting (St/bEC-SbED) codes. IEEE Trans. Comput. 2003, 52, 835–847. [Google Scholar] [CrossRef]
  7. Suzuki, K.; Kashiyama, T.; Fujiwara, E. A general class of m-spotty weight enumerator. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 2007, 90, 1418–1427. [Google Scholar]
  8. Siap, I. MacWilliams identity for m-spotty Lee weight enumerators. Appl. Math. Lett. 2010, 23, 13–16. [Google Scholar] [CrossRef] [Scilit]
  9. Siap, V.; Özen, M. A MacWilliams Type identity for m-spotty Rosenbloom-Tsfasman weight enumerators over Frobenius rings. In Proceedings of the CMMSE 2013: 13th International Conference on Mathematical Methods in Science and Engineering, Almeria, Spain, 23–27 June 2013; pp. 1236–1241. [Google Scholar]
  10. Özen, M.; Shi, M.; Siap, V. An identity between the m-spotty Rosenbloom-Tsfasman weight numerators over finite commutative Frobenius rings. Bull. Korean Math. Soc. 2015, 52, 809–823. [Google Scholar] [CrossRef] [Scilit]
  11. Özen, M.; Siap, V. The MacWilliams identity for m-spotty Rosenbloom-Tsfasman weight enumerator. J. Frankl. Inst. 2014, 351, 743–750. [Google Scholar] [CrossRef] [Scilit]
  12. Sharma, A.; Sharma, A.K. On some new m-spotty Lee weight enumerators. Des. Codes Cryptogr. 2014, 71, 119–152. [Google Scholar] [CrossRef] [Scilit]
  13. Shi, M.; Choie, Y.; Sharma, A.; Solé, P. Codes and Modular Fors: A Dictionary; World Scientific: Singapore, 2020. [Google Scholar]
  14. Siap, I. An identity between the m-spotty weight enumerators of a linear code and its dual. Turk. J. Math. 2012, 36, 641–650. [Google Scholar] [CrossRef] [Scilit]
Table 1. The m-spotty weight of codewords of C .
Table 1. The m-spotty weight of codewords of C .
Codeword w M ( c ) Codeword w M ( c ) Codeword w M ( c )
( 0 0 | 0 0 ) 0 ( 0 2 | 0 v ) 2 ( 2 2 | v v ) 4
( 0 1 | 0 2 v ) 2 ( 1 0 | 2 v 0 ) 2 ( 1 1 | 2 v 2 v ) 4
( 2 0 | v 0 ) 2 ( 2 1 | v 2 v ) 4 ( 1 2 | 2 v v ) 4
Table 2. Weight distribution of C .
Table 2. Weight distribution of C .
w M ( c ) 01234
A i 10404
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, J.; Jiang, A.; Solé, P. The MacWilliams Identity for the m-Spotty Weight Enumerators over ZpRk. Entropy 2026, 28, 59. https://doi.org/10.3390/e28010059

AMA Style

Wang J, Jiang A, Solé P. The MacWilliams Identity for the m-Spotty Weight Enumerators over ZpRk. Entropy. 2026; 28(1):59. https://doi.org/10.3390/e28010059

Chicago/Turabian Style

Wang, Juan, An Jiang, and Patrick Solé. 2026. "The MacWilliams Identity for the m-Spotty Weight Enumerators over ZpRk" Entropy 28, no. 1: 59. https://doi.org/10.3390/e28010059

APA Style

Wang, J., Jiang, A., & Solé, P. (2026). The MacWilliams Identity for the m-Spotty Weight Enumerators over ZpRk. Entropy, 28(1), 59. https://doi.org/10.3390/e28010059

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop