Density of Free Modules over Finite Chain Rings

In this paper we focus on modules over a finite chain ring $\mathcal{R}$ of size $q^s$. We compute the density of free modules of $\mathcal{R}^n$, where we separately treat the asymptotics in $n,q$ and $s$. In particular, we focus on two cases: one where we fix the length of the module and one where we fix the rank of the module. In both cases, the density results can be bounded by the Andrews-Gordon identities. We also study the asymptotic behaviour of modules generated by random matrices over $\mathcal{R}$. Since linear codes over $\mathcal{R}$ are submodules of $\mathcal{R}^n$ we get direct implications for coding theory. For example, we show that random codes achieve the Gilbert-Varshamov bound with high probability.


Introduction
The study of the asymptotic behaviour of integer sequences is a classical topic of number theory (see, e.g.[39]).Such methods rely on obtaining density functions on sets of positive integers in a given interval.More generally, one can study the asymptotic behaviour of combinatorial objects such as linear codes and matrices over a finite alphabet.There are numerous works in this direction in the case of linear codes and matrices over finite fields [4,7,13,20,30], while the study of random code ensembles is as old as the topic of coding theory itself [8,22,36,41,46].
In this paper, we consider such questions in the context of linear codes over finite chain rings.A linear code over a finite ring R is simply an R-module, typically an R-submodule of the free module R n where R n is endowed with a distance function such as the Hamming, Lee or homogeneous metric.If R is not commutative, then the corresponding linear code is usually selected to be a left R-module.Codes over rings have been studied widely [5,10,11,16,28,31,34,38,47,48], but their asymptotic behaviour has not been addressed as thoroughly as their finite field counterparts.Formulas on the number of modules over finite chain rings and the matrices that generate them can be found in [12,17,19,32,43].Obtaining estimates on the density of finite modules of a given shape over a finite chain ring R can be found by asymptotic enumeration of such formulas in respect of certain parameters, such as the size of the residue field of R, the depth of the ideal chain (also called its nilpotency index) of R, or the rank of the ambient space.Our main results are focused on computing the densities of free modules in R n ; in our approach we treat the cases of asymptotic growth of the alphabet R and the asymptotic growth of n separately.We also separately consider the behaviour of modules of a fixed length ℓ, and modules of a fixed rank K.For the free submodules of R n of length ℓ, we show that as n goes to infinity the density is bounded from above and below by the Andrews-Gordon identities [2,26].As the order q of the residue field of R goes to infinity, the density of the free codes of length ℓ in R n goes to 1.In contrast to this, as the depth s of the ideal chain in R goes to infinity, the density of the free codes of length ℓ in R n approaches Euler's function (1/q) ∞ .In respect of free modules of rank K, we show that the density of such modules as n grows infinitely large is 1 if K < n/2 and is zero if Related to such problems is the question on the probability that a random matrix generates a code attaining the Gilbert-Varshamov bound.The probabilistic method has a natural application to this topic in coding theory, where density questions can be framed in terms of the behaviour of random matrices.We show that a random matrix generates a code that achieves the Gilbert-Varshamov bound with probability at least 1 − e Ω(n) .In this result, we consider a general metric on the ambient space, which is extended to tuples additively.The Hamming, Lee and homogeneous metric are some examples of such a metric.The interest in this result is two-fold: on one hand it shows the existence of asymptotically good codes, and on the other hand it is of importance in the design and analysis of certain code-based cryptosystems based on linear codes over finite chain rings.For the latter, note that in particular Lee-metric codes have recently gained interest in the code-based cryptography community (see for example [9,33,51]).However, many open questions about these codes have so far obstructed the design and proper cryptanalysis of cryptosystems based on them.One of these questions is the behaviour of codes generated by a random matrix, which we hereby answer.
This paper is organized as follows: in Section 2 we introduce the definitions and tools that are used throughout this paper.In Section 3 we give the density results of free modules of given length, respectively of given rank.In Section 4 we point out the implications of these results for coding theory and show that random codes achieve the Gilbert-Varshamov bound with high probability.Finally, in Section 5 we state some interesting open problems.

Preliminaries
In this section we recall some basics of modules over finite chain rings.We also introduce the main tools that are used in this paper, such as the Gaussian coefficient and its connection to the q-Pochhammer symbol (for more information see for example [6,15,24,37]).

2.1.
Modules over Finite Chain Rings.We consider finite chain rings and modules over such rings.See, for example, [32,37] for an introduction to these objects.A ring R is called a left (resp.right) chain ring if the left (resp.right) ideals of R form a chain i.e., for any two left (resp.right) ideals I, J ⊆ R one has either I ⊆ J or J ⊆ I.Note that in such rings every left ideal is also a right ideal.Every finite chain ring is a local ring, where the maximal ideal is principal.Throughout this paper, we let R denote a finite chain ring and denote by π its unique maximal ideal.We denote by s the nilpotency index of R, i.e., s is the smallest positive integer such that π s = 0.If q is the size of the residue field of R, i.e., if q = |R/ π | then |R| = q s .Well-known examples of finite chain rings include the integer modular ring Z/p s Z for p prime and the Galois ring GR(p s , r) of characteristic p s and order p rs .
Unless explicitly stated otherwise, M := R M will henceforth denote a finite left R-module.
Any module M of our finite chain ring R can be written as a direct sum of cyclic R-modules, i.e., This sequence forms thus a partition λ = (λ 1 , . . ., λ K ), which is called the type of a module [37].The conjugate partition of λ is called the shape µ = (µ 1 , µ 2 , . ..) of the module and is such that The length ℓ of the module M is equal to the weight of the type λ, i.e., ℓ =| λ whereas the length K of this partition λ is called the rank of the module.Note that the type λ is uniquely determined by the module M and any two modules of type λ are isomorphic.Clearly M is a free R-module if it has type (s, . . ., s) and thus shape (K, . . ., K).
For convenience, we will denote the type ) of a module, using the frequencies of its parts, i.e., λ = (s k1 (s − 1)  We say that a matrix A ∈ R m×n has type λ, if the left R-module generated by its rows has type λ.

Gaussian Coefficient.
We now introduce some standard formulas that we will use in our counting arguments.Definition 1.The Gaussian coefficient or the q-binomial coefficient is defined as .
If q is a prime power, then the Gaussian coefficient gives the number of subspaces of F n q of dimension k.Definition 2. Let r be a positive integer.The q-Pochhammer symbol is defined to be We also define (a; q) 0 := 1 and in the instance that 0 < q < 1 for a fixed a ∈ R, we define lim r→∞ (a; q) r = (a; q) ∞ := Clearly, (q; q) r = r i=1 1 − q i , and since we will use this quantity often, we will abbreviate (q; q) r to (q) r .
The Gaussian coefficient has the following expression in terms of q-Pochhammer symbols: Regarding the asymptotics of the Gaussian coefficient, we have that for a constant k ∈ {1, . . ., n} and |1/q| < 1 For fixed 0 < R < 1 we have that whereas for R ∈ {0, 1}, this limit is 1, as n Rn 1/q = 1.An important identity of the Gaussian coefficient is the following: It was shown in [21], that The factor (1/q) ∞ , also called Euler's function, can be interpreted as the ratio of invertible m × m matrices to all matrices, i.e., | for m going to infinity.We have that (1/q) ∞ is increasing in q and approaches 1 as q → ∞.In particular, n k q ∼ q (n−k)k as q → ∞. 2.3.Counting Modules.In this subsection we will provide the main formulas for counting the number of modules of a given length or rank over a finite chain ring R.
The following proposition is a special case of [32,Theorem 2.4].A proof for the case R = Z/p s Z can be read in [12].Proposition 3. The number of submodules of R n with shape µ = (µ 1 , . . ., µ s ) is given by where we define µ s+1 = 0.If we consider the type, then the number of submodules of R n with type (s k1 • • • 1 ks ) is given by The number of free submodules of rank K is then given by N n,q (K, 0, . . ., 0) = q (n−K)K(s−1) n K q .
Using the connection of the type to the shape µ of a module M , we see that M (n, ℓ, q, s) is a q-multinomial as defined in [50, Definition 1]: Definition 4. Let ℓ ≤ n be non-negative integers, let s be a positive integer and let q > 0. The q-multinomial is defined as Note that this definition is different to the usual definition of the q-multinomial coefficient (see for example [15]), which is defined as where m j=1 i j = K m .In addition, we need to count the number of modules of a given rank, for which we need the set of weak compositions of K into s parts, denoted by C(s, K), i.e.,

The Density of Free Modules
In this section we will determine the densities of free modules of a finite chain ring R. In the first subsection we fix the length of the modules and in the second we fix the rank of the modules.By density, we refer to the limit of a probability as a chosen parameter goes to infinity.More precisely, for any two sequences (A(n)) n≥1 and (S(n)) n≥1 of sets satisfying A(n) ⊆ S(n), we denote by the density of A in S, if the limit exists.Furthermore, if the density of A in S is 0, we say that A is sparse in S and if the density of A in S is 1, we say that A is dense in S.

Density of Free Modules of Fixed Length.
For the remainder, we let R have a residue field of order q.Recall that we denote by s the nilpotency index of R.
Note that, for a free module, ℓ is a multiple of s.In order to rewrite this probability, we introduce the following notation, adapted from Equation (2.17) of [44]: Using the fact that n k q = n k 1/q q (n−k)k and (3.1), we can rewrite the probability ψ(n, ℓ, q, s) as The quantity T s (n, sn/2 − ℓ; 1/q) was shown in [45, Corollary 2.1] to have the following limit where C is the (s − 1) × (s − 1) Cartan matrix defined via C −1 i,j = min{i, j} − ij s .In the following we study the asymptotics of ψ(n, ℓ, q, s), thus finding the density of free modules of a given length.We start with the asymptotics in n, where we let ℓ = Rns for 0 < R < 1 and s | ℓ.
Theorem 5. Let ℓ and n be positive integers with ℓ = Rns, where 0 < R < 1 and s | ℓ.The density as n → ∞ of the free submodules of R n of length ℓ is given by where Proof.From (2.1) and (3.2) it follows that It can be proved by induction that: where we set K i = i j=2 k j .Hence the density of the free modules of length ℓ is given by  Note that this is very similar to the Andrews-Gordon identity [2, Theorem 1], which states that for | q |< 1 AGI(q, s) := n1,...,ns−1≥0 for any i ∈ {1, . . ., s} and It may be the case that the series in (3.3) has a similar expression to the above in terms of q-Pochhammer symbols.Achieving this would require a generalization of the Andrews-Gordon identity, which is itself a generalization of the Roger-Ramanujan identities.Another generalization of the Roger-Ramanujan identities that can be considered is the Alder polynomial [1].This generalization is essentially the Andrews-Gordon identity along with the condition that s | (N Since a suitable formulation of the Alder polynomial in terms of q-Pochhammer symbols is not known, we only consider the Andrews-Gordon identity for our results. In the special case where s = 2, we are indeed able to express this density in terms of q-Pochhammer symbols: in fact, in Equation (2.53) of [3] it is shown that for even n − m: Since we set m = n − ℓ, this is indeed the case and thus, the density for s = 2 is given by 2 (− 1/q; 1/q) ∞ + ( 1/q; 1/q) ∞ .
In the case s > 2 however, we can give bounds on (3.3) using the Andrews-Gordon identity.Theorem 6.Let R have a residue field of size q and s be its nilpotency index.Let ℓ and n be positive integers with ℓ = Rns, where 0 < R < 1 and s | ℓ.The density as n → ∞ of free submodules in R n of length ℓ given by (3.3) can be bounded as follows: for q ′ := q s 2 −s .
Proof.We first show that For this, we first note that This is equivalent to which follows from the Cauchy-Schwarz inequality.Note, that there always exists some a, b ∈ N, such that 1 s > a 2 b 2 , with b | K i for all i ∈ {2, . . ., s}.For example one can always choose a = 1 and b = sK . ., s}.Since n i < k i and hence (1/q) ki < (1/q) ni , we can bound our sum using the observation above and the Andrews-Gordon identity as k2,...,ks≥0 s|K2+•••+Ks We now show that .
In order to give this upper bound on the density, we lower bound the series by taking fewer summands.More precisely, we assume that s | K i for all i ∈ {2, . . ., s}.Thus, we can introduce new variables N i = K i /s as well as n i = k i /s for all i ∈ {2, . . ., s}.
Values for the upper and lower bound, as well as the exact values can be found in Table 1.This shows that the density for growing n of free modules of a given length over a finite chain ring is neither dense nor sparse, if q and s are fixed.
Remark 7. It can easily be seen that the probability for a submodule to be not free, is upper bounded by the counter probability of a submodule to be free.Explicitly, the density of submodules having type (s k1 • • • 1 ks ) such that (k 1 , . . ., k s ) ∈ L(s, n, ℓ) with sk 1 = ℓ is upper bounded by 1 − AGI(1/q, s) −1 .

Lower Bound Exact
Upper Bound As a next step we consider the behaviour of ψ(n, ℓ, q, s) for large q.It turns out, that for q → ∞ we have that modules are with high probability free.This is quite intuitive, as for increasing q, we are closer to a finite field structure.While the opposite is true for increasing s; thus we expect that the probability of having a free module decreases when s increases.
In the following theorem we prove a stronger statement that implies the above remark.The question we want to answer reads as follows: for a fixed choice of n, ℓ, s and an 0 < ε < 1, how large should we choose q (in terms of n, ℓ, s and ε) such that the probability of having a free submodule of R n of given length ℓ is at least 1 − ε? Theorem 8. Let R have a residue field of size q and nilpotency index s.Let 0 < ε < 1.Then for q satisfying AGI(1/q, s) −1 ≥ 1−ε, we have that the probability of a random submodule of R n of length ℓ to be free is at least 1 − ε.
Since AGI(1/q, s) −1 ≥ (1/q) ∞ we get the following statement, which does not depend on s.Corollary 9. Let R have a residue field of size q and s be its nilpotency index and let ℓ < sn be positive integers with s | ℓ.The probability for a submodule of R n of length ℓ to be free is at least (1/q) ∞ .
Corollary 10.Let R have a residue field of size q and let s be its nilpotency index.
(1) The density of free submodules in R n of length ℓ for q → ∞ is 1.
(2) The density of free submodules in R n of length ℓ for s → ∞ is at least (1/q) ∞ .

3.2.
Density of Free Modules of Given Rank.As before, let R have a residue field of size q and s be its nilpotency index.In this subsection we study the asymptotics of ϕ(n, K, q, s) := q (n−K)K(s−1) n K q W (n, K, q, s) , i.e., the density of free modules of given rank K.We first rewrite ϕ(n, K, q, s), as follows ϕ(n, K, q, s) In contrast to the density from Theorem 5, we have that the asymptotics of ϕ(n, K, q, s) depends on the relation between K and n.Theorem 11.Let R have a residue field of size q and s be its nilpotency index.Let K and n be positive integers with K = R ′ n, where 1/2 < R ′ < 1.The density of free submodules of R n of given rank K for n → ∞ is 0.
Proof.We want to show that ϕ(n, K, q, s) goes to 0 for n → ∞.First, we observe that the exponent of q in (3.4) is where for the first inequality we have used that ℓ ≥ K and the second inequality follows from n > s(n − K), which in turn follows from 1/s ≥ 1/2 > 1 − K/n.Thus, we get the limit of ϕ(n, K, q, s) for K > n/2: Theorem 12. Let R have a residue field of size q and let s be its nilpotency index.Let K and n be positive integers with K = R ′ n, where 0 < R ′ ≤ 1/2.The density of free submodules of R n of given rank K is greater than or equal to AGI(1/q, s) −1 .Moreover, if R ′ < 1/2, the density is 1.
If we omit the type (s K (s − 1) 0 • • • 1 0 ) from the sum over C(s, K) we get: Observe that whenever ℓ < sK, the exponent of q is This follows from the fact, that nℓ−snK +sK 2 −ℓ 2 /s is decreasing for ℓ decreasing, and thus its largest value is reached at the largest ℓ = sK, which is given by K − 1 + (s − 1)/s corresponding to the type (s K−1 (s − 1) Now, we have that the probability of having a free module of given rank K for R ′ < 1/2 is lower bounded by , which clearly goes to 1, as 1 − 2R ′ > 0.

Connections to Coding Theory
We turn now to the asymptotic behaviour of linear codes over a finite chain ring.This question is highly related to the results of the previous section, as a linear code over a finite chain ring R is simply an R-module, albeit one that is studied in respect of a weight function defined on R n .Since the length of a code already denotes the rank of the ambient space, we want to introduce a different parameter to denote the length ℓ of the module C. The usual parameter for ring-linear codes is also called type and either denotes size of the module, i.e., | C |= q ℓ , or the frequencies of the parts of the type λ of the module C, i.e., π s−1 ks • • • (1) k1 .However, to relate to the usual rate of a code, we will call the R−dimension of the code C, since then the rate of C is given by R = k n .We summarize the density results derived in Section 3, which clearly apply immediately to linear codes.Let 1 ≤ k ≤ n be a fixed positive rational number with ks ∈ N.
(2) The density of the free codes of R-dimension k in R n is 1 as q → ∞.
(3) The density of the free codes of R-dimension k in R n is (1/q) ∞ as s → ∞. (4) Let 1/2 < R ′ < 1 and let K and n be positive integers satisfying K = R ′ n.
The density of the free codes of rank K in R n is 0 as n → ∞. (5) Let 0 < R ′ ≤ 1/2 and let K and n be positive integers satisfying The density of the free codes of rank the density is 1.The most prominent scalar ring arising in ring-linear coding is the Galois ring.The Z/4Z-linear codes are perhaps the most well-known of all codes over rings.A great interest in codes over rings was generated by the discovery that several infamous families of optimal but non-linear binary codes for the Hamming metric could be interpreted as linear codes over Z/4Z for the Lee metric [31].For codes over rings of odd characteristic, the Lee weight has been studied for its applications to partial response channels (see for example [42]).Codes defined over finite Frobenius rings are typically studied in relation to the homogeneous weight; due to its expression in terms of generating character of the underlying ring, several classical coding theoretic results extend for codes with respect to this metric (e.g.[14,29,27]).Note that a homogeneous weight is a weight function which takes the same average value on every non-zero one-sided ideal of the ring and hence every coordinate of a linear code carries the same total, respectively average, weight (see [16]).
Example 14.The density of free codes of fixed rate in Z/4Z n , for n → ∞, is given by 2 The standard way to generate the codewords of a (left) linear code is via a generator matrix.For a (left) linear code C of rank K defined over a finite ring, a generator matrix is defined to be any matrix Asymptotic properties of codes are often examined by creating a random code ensemble.One way to achieve this is via the generator matrix: a random linear code may be constructed by taking a random matrix and defining the code to be the row span of this matrix.
Hence, we study the probability that a random matrix of size m × n over R has R-dimension k.To count the number of m × n matrices over R of R-dimension k, we use the formulas derived in [19].
In the following we compute the density of matrices of R-dimension k.Let n < m ∈ N. We call A ∈ R m×n rectangular unimodular if there exist m − n rows in R n , such that when adjoining these rows to A, the resulting m × m matrix is invertible over R. Thus, a rectangular unimodular matrix is the ring analog of a full rank matrix over a field.
Proposition 16.The density of m × n matrices over R having R-dimension k, is Proof.We note that it is enough to prove the result for the case k = m, because for k < m the probability is bounded from above by the counter probability of the case k = m.Hence, we start with a random k × n matrix over R and ask for the module generated by this matrix to have R-dimension k.Note that this is the same as asking for the matrix to be rectangular unimodular.The probability that a k × n matrix over R is rectangular unimodular is (1/q) n (1/q) n−k , which does not depend on s and goes to 1 for n → ∞, also when k = Rn for 0 ≤ R < 1.
Remark 17.We can give a lower bound on the probability in the case k < m, using the fact that the number of all modules of R-dimension k is greater than or equal to the number of free modules of R-dimension k, i.e., n ks Thus, we get that (k1,...,ks)∈L(s,n,ks) q smk (1/q)m (1/q)m−K N n,q (k 1 , . . ., k s ) 4.1.Random Codes Achieve the Gilbert-Varshamov Bound.In algebraic coding theory one of the most important parameters of a code is its minimum distance.For this we have to endow our finite chain ring with a metric.
One can extend this weight additively to a weight on R n .By abuse of notation, the weight on R n will also be denoted by wt.Then for any x = (x 1 , . . ., x n ) ∈ R n we have wt(x) := We will furthermore assume that any distance function considered in this section is translation-invariant, that is, d(x, y) = d(x+a, y +a) for all a, x, y ∈ R n .One can endow R with the following weights, which all induce translation invariant distance functions on R n .

Definition 19.
i) The Hamming weight of x ∈ R n is given by the number of non-zero entries, i.e., wt H (x) :=| {i ∈ {1, . . ., n} ii) The homogeneous weight of x ∈ R is defined to be iii) The Lee weight of x ∈ Z/p s Z is given by wt Note, in the case that R = F q , for the formulation of the homogeneous weight given here, the Hamming weight represents a normalization of the homogeneous weight, while for R = Z/4Z, the Lee weight and the homogeneous weight coincide.
One of the most important bounds in coding theory is the Gilbert-Varshamov (G-V) bound, which gives a bound on the maximal possible size a code can have given its length n and its minimum distance.In its asymptotic version, the G-V bound gives a lower bound on the rate R = k/n of a code.For codes over finite fields it is well known that random codes achieve the G-V bound with high probability [8,41].The same result for rank-metric codes was also shown using the probabilistic method in [36].While the G-V bound for codes over finite chain rings has been addressed in [40], the statement on random codes is missing in the literature.
In the rest of section, we prove that a random code over a finite chain ring R endowed with a metric achieves, with high probability, the asymptotic Gilbert-Varshamov bound.
Let N be the maximal weight that an element of R n can achieve.For example in the Hamming metric we have N = n, for the homogeneous weight we have N = q q−1 n, while in the Lee metric on (Z/p s Z) n we have N = n⌊ p s 2 ⌋.The open ball of radius w centred at u ∈ R n is defined by Since d is translation-invariant, we have that |B(n, x, w)| is independent of its center and in particular is equal to |B(n, 0, w)|.We denote its size by V (n, w) := |B(n, 0, w)|.We write B(n, x, w) to denoted the closed ball centred at x, that is B(n, x, w) := {y ∈ R n | d(x, y) ≤ w}, which is again translation-invariant and we write V (n, w) to denote its cardinality, | B(n, 0, w)|.Let us denote by AL(n, d) the maximal size of a code in R n having minimum distance d.
In [35] it is shown that this limit exists for an arbitrary weight function defined additively on its coordinates and that it is equal to the entropy of the corresponding probability distribution on R. For example, in the Hamming metric it is well known [35] that g(δ) = h q s (δ), where h q s is the q s -ary entropy function.In the case of homogeneous weight, the limit was explicitly computed in [28], and for the Lee metric on (Z/p s Z) n , it was computed in [23,51].
Let us denote by The asymptotic Gilbert-Varshamov bound now states that Note that g(δ) ∈ [0, 1] is a continuous and increasing function in δ.Let us denote by D the minimum value in [0, 1] such that g(D) = 1.For example in the Hamming metric we have D = 1 − 1/q s , in the homogeneous metric we have D = 1, and in the Lee metric over Z/p s Z we have D ≈ 1/2.
Recall that in complexity theory we write f For example, f (n) = Ω(n) means that f (n) grows at least polynomially in n.
Theorem 20.Let R be a finite chain ring having maximal ideal π , residue field of size q and nilpotency index s.Then for every δ ∈ [0, D), and sufficiently large n, the following holds for If G ∈ R k×n is chosen uniformly at random, then the code generated by G has rate k/n and relative minimum distance δ with probability at least Proof.The probability that a matrix G ∈ R k×n generates a code of R-dimension k is given by (1/q) n (1/q) n−k as seen in the proof of Proposition 16.
For any non-zero x ∈ R k , we will show that the probability that wt(xG) ≤ δN/n is at most V (n, δN/n) q sn ≤ q s(g(δN/n)n−n) .
This clearly follows if we assume x is unimodular, since then the morphism f x : R k −→ R, z → x • z is a surjection and so xG is a uniformly distributed in R n for G chosen uniformly at random in R k×n .More generally, let x ∈ π i R k \ π i+1 R k for some i ∈ {1, . . ., s − 1}, i.e., x = π i y for some unimodular y ∈ R k .For we see that wt(xG) ≤ ηwt(yG).Moreover, yG is uniformly random in R n .Finally, the probability that wt(xG) ≤ δN/n is less than or equal to the probability that wt(yG) ≤ (δN/n)/η, which is upper bounded by V (n, (δN/n)/η) q sn ≤ V (n, δN/n) q sn ≤ q s(g(δN/n)n−n) .
Using a union bound over all non-zero x implies that the code has minimum distance at most δn is bounded from above by q sk q s(g(δN/n)n−n) ≤ q s(1−εn) .
Hence, we have that the code C has relative minimum distance δ with probability at least 1 − q s(1−εn) ≥ 1 − e −Ω(n) .

Conclusion
We conclude this paper with two interesting open problems we encountered.The first problem is to find another generalization of the Roger-Ramanujan identities.Since the density of free modules is bounded by the Andrews-Gordon identity (see Theorem 5), which themselves are products of q-Pochhammer symbols, this leads us to the question of finding a similar identity for the density of free submodules of R n of given length.More precisely, we state the following problem.
where K i = i j=2 k j , has an expression as product of q-Pochhammer symbols.The second problem we have encountered is that there does not seem to exist a natural way to order the types in L(s, n, ℓ) such that the canonical order on the number of modules N n,q (k 1 , . . ., k s ) is induced by this order on L(s, n, ℓ).Such a characterization would be convenient in order to determine which type is more likely.For example, for fixed finite parameters, does the number of free submodules dominate the number of modules of any other type?Example 21.
Remark 22.We remark that since this paper was submitted, Problem 1 was addressed in [18], wherein the authors showed that the quantity in Problem 1 can be expressed as a sum of s 2 quotients of theta functions, rather than as a product of q-Pochhammer symbols.

n
i=1 wt(x i ).Such a weight induces a distance function d : R × R → R, (x, y) → wt(x − y).Again, we may extend this additively to a distance function d : R n × R n −→ R. The minimum distance of a code C ∈ R n is defined to be d(C) := min{d(x, y) | x, y ∈ C, x = y}. k2

Table 1 .
Density of free modules in R n of a given length

Table 2 .
Probability of having a free submodule in R n with rank K 13.A (left) linear code C over R of length n is a (left) R-submodule of R n .The free module R n is called the ambient space of the code.