Statistics and Probability Letters 89 (2014) 51–57
Contents lists available at ScienceDirect
Statistics and Probability Letters journal homepage: www.elsevier.com/locate/stapro
Construction of Sudoku designs and Sudoku-based uniform designs Hongyi Li a,b , Qisheng Li a , Zujun Ou a,c,∗ a
College of Mathematics and Statistics, Jishou University, China
b
Normal College, Jishou University, China
c
College of Physical Science and Technology, Central China Normal University, China
article
info
Article history: Received 1 November 2013 Received in revised form 26 February 2014 Accepted 27 February 2014 Available online 6 March 2014 MSC: 62K15 62K10 62K99
abstract In this paper, an easy and effective construction method of Sudoku designs with any order is provided based on the right shift operator. Based on the constructed Sudoku designs, a class of Sudoku-based uniform designs is constructed. Moreover, the properties of the constructed Sudoku designs and Sudoku-based uniform designs are investigated, it is shown that both the constructed Sudoku designs and Sudoku-based uniform designs are uniform designs in terms of discrete discrepancy. © 2014 Elsevier B.V. All rights reserved.
Keywords: Discrete discrepancy Right shift operator Sudoku design Uniformity
1. Introduction Sudoku designs originated from a popular game which is named Sudoku puzzle. It has simple rules and is very addictive. The game board is a 9 × 9 grid of numbers from one to nine. Several entries within the grid are provided and the remaining entries must be filled in subject to no row, column, or 3 × 3 subsquare containing duplicate numbers. Sudoku puzzle is just the construction of a Sudoku design with order 9, see Table 1 for example. Now, Sudoku designs have been extensively used in many areas such as agricultural experiment, genetic statistics, biostatistics, medical statistics and so on. Recently, many papers in terms of the construction method and the properties of Sudoku designs have been published. Subramani and Ponnuswamy (2009) considered the construction and analysis of Sudoku designs with order m2 . Subramani (2012) extended the Sudoku designs to orthogonal (Graeco) Sudoku square designs in line with that of the orthogonal (Graeco) Latin square designs. A simple method of constructing Graeco Sudoku square designs of odd orders was also presented in Subramani (2012). Xu et al. (2011) considered the construction of a space-filling design based on the Sudoku design, which can achieve maximum uniformity in univariate and bivariate margins. Fontana (2011) studied the simplification of fractional factorial design generation based on Sudoku designs. Subsequently, Fontana (2013) developed a simple algorithm for uniform random sampling of Latin squares and Sudoku designs by graph analysis tools. Meng and Lu (2011) developed an algorithm to generate puzzles which guarantees a unique solution for the most important premise and ensures low enough
∗
Corresponding author at: College of Mathematics and Statistics, Jishou University, China. E-mail address:
[email protected] (Z. Ou).
http://dx.doi.org/10.1016/j.spl.2014.02.016 0167-7152/© 2014 Elsevier B.V. All rights reserved.
52
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57 Table 1 A completed Sudoku puzzle. 1 4 7
2 5 8
3 6 9
4 7 1
5 8 2
6 9 3
7 1 4
8 2 5
9 3 6
2 5 8
3 6 9
4 7 1
5 8 2
6 9 3
7 1 4
8 2 5
9 3 6
1 4 7
3 6 9
4 7 1
5 8 2
6 9 3
7 1 4
8 2 5
9 3 6
1 4 7
2 5 8
complexity. The Sudoku design also has been studied in Fontana and Rogantin (2010) by algebraic statistics methods. Bailey et al. (2008) explained several connections between Sudoku and various parts of mathematics and statistics. As an important method of computer experiments and robust experimental designs, uniform designs (Fang and Wang, 1994; Fang et al., 2005) distribute their experimental points evenly throughout the design space. The measure of uniformity plays a key role in the construction of uniform designs. Various discrepancies in quasi-Monte Carlo methods have been used as measures of uniformity in the literature, such as the star-discrepancy, the star-L2 -discrepancy (Fang and Wang, 1994), the centered L2 -discrepancy, the wrap-around L2 -discrepancy (Hickernell, 1998a,b; Chatterjee et al., 2005, 2006), the discrete discrepancy (Qin and Fang, 2004), and the mixture discrepancy (Zhou et al., 2013). The aim of this paper is twofold: first, for any positive integer p, a general construction method of Sudoku designs with order p will be presented, and based on the constructed Sudoku designs, a class of Sudoku-based uniform designs are constructed; second, the properties, especially the uniformity measured by discrete discrepancy of the constructed Sudoku designs and Sudoku-based uniform designs will be investigated. The paper is organized as follows. Section 2 provides the notations and preliminaries. In Section 3, a general construction method of Sudoku designs by right shift operator is provided, and some basic properties of the constructed Sudoku designs are investigated. A class of Sudoku-based uniform designs is constructed in Section 4, it is shown that both the constructed Sudoku designs and Sudoku-based uniform designs are uniform designs in terms of discrete discrepancy. Some illustrative examples are also provided in Section 4 to lend further support to our theoretical results. We close through the Remarks section with some notes and comments. 2. Notations and preliminaries Definition 1. Suppose p = m × l, where p, m, l are all positive integers. If the design X with order p × p satisfies that each row, each column and each m × l (or l × m) block contains the numbers 1 − p, without repeating any, then the design X is called as the Sudoku design with order p. Consider a class of n runs and s factors with q levels U-type designs, denoted as U(n; qs ). A design d in U(n; qs ) can be presented as an n × s matrix with entries 1, 2, . . . , q, with each element occurring equally often in each column. From Definition 1, it is obvious that the Sudoku design X with order p is a member of U(p; pp ). Definition 2. Let C = (c1 , c2 , . . . , cp ) be any random permutation of {1, 2, . . . , p}, and k is an integer between 0 and p, then T (C , k) = (ck+1 , ck+2 , . . . , cp , c1 , . . . , ck ) is called as k-step right shift operator. For a design d ∈ U(n; qs ) or equivalently for any U (n; qs ), the measures of uniformity, discrete discrepancy, denoted as DD(d), can be expressed in the following closed form
[DD(d; a, b)]2 = −
a + (q − 1)b
s +
q
as n
+
n n 2bs a ψij
n2
i =1 j =i +1
b
,
(1)
where a > b > 0, and ψij is the meeting number between the ith and the jth rows of d, i.e., the number of elements for which the ith and the jth rows of d take the same value. We can refer Qin and Fang (2004) for details. According to Qin and Fang (2004), we have the attained lower bound of [DD(d; a, b)]2 , which is given in the following lemma. This lemma will help us to obtain uniformity of the constructed Sudoku designs. Lemma 1. Let d ∈ U(n; qs ) be U-type. Then
[DD(d; a, b)]2 ≥ LDD(d; a, b),
(2)
where LDD(d; a, b) = −
a + (q − 1)b q
s +
as n
+
(n − 1)[b(γ + 1 − ψ) + a(ψ − γ )]bs a γ nb
b
,
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57
53
Table 2 Sudoku design X6,1 . 1 4
2 5
3 6
4 1
5 2
6 3
2 5
3 6
4 1
5 2
6 3
1 4
3 6
4 1
5 2
6 3
1 4
2 5
ψ = s(n − q)/q(n − 1), γ is the integer part of ψ . The lower bound of [DD(d; a, b)]2 on the right hand side of (2) can be achieved if and only if for any run of d, among the n − 1 values of ψij (i ̸= j), there are (n − 1)(γ + 1 − ψ) with value γ , and (n − 1)(ψ − γ ) with the value γ + 1. Lemma 2. Let d ∈ U(n; qs ) be U-type. If the meeting number between any pair of distinct rows of design d is not larger than 1, then the squared discrete discrepancy of d can attain the lower bound of the right side of (2). The next section deals with a general construction method of Sudoku designs by right shift operator, and some basic properties of the constructed Sudoku designs are investigated. 3. Construction method and properties of Sudoku designs Suppose p = m × l, where p, m, l are all positive integers. An easy and effective construction method of Sudoku design X with order p will be given below, where X = (X1′ , X2′ , . . . , Xp′ )′ has p blocks with order l × m and Xi is the ith row of X , i = 1, 2, . . . , p. Step 1: Take any random permutation C = (c1 , c2 , . . . , cp ) of {1, 2, . . . , p} as the first row X1 of X . By use of the integers between 1 and p, without repeating any, constructing a vector a = (1, l + 1, 2l + 1, . . . , (m − 1)l + 1, 2, l + 2, 2l + 2, . . . , (m − 1)l + 2, 3, l + 3, 2l + 3, . . . , (m − 1)l + 3,
... l, 2l, 3l, . . . , ml) with length p. Step 2: Let the ai -th row of X , Xai = T (Xai−1 , 1), i = 2, 3, . . . , p, where ai is the ith element of vector a and T (Xai−1 , 1) is the 1-step right shift operator defined as in Definition 2. If we regard X as m row blocks with order l × p, then the above construction method actually can be described as follows. First, we take any random permutation C = (c1 , c2 , . . . , cp ) of {1, 2, . . . , p} as the first row X1 of X , it is just the first row of the first row block, the first row of the second row block is taken as the 1-step right shift operator of C (i.e., the first row of the first row block), and the first row of the third row block is taken as the 2-step right shift operator of C , · · ·, the first row of the m-th row block is taken as the (m − 1)-step right shift operator of C ; second, the second row of the first row block is taken as the m-step right shift operator of C , and the second row of the second row block is taken as the (m + 1)-step right shift operator of C , and so on; finally, the l-th row of the first row block is taken as the m(l − 1)-step right shift operator of C , . . ., the l-th row of the m-th row block is taken as the (ml − 1)-step right shift operator of C . The process can be summarized as the following algorithm. Algorithm 1. Construction method of Sudoku designs with order p = m × l Input p, m, l and the initial random permutation C = (c1 , c2 , . . . , cp ) of {1, 2, . . . , p}, where p = m × l; for i = 1 to ldo for j = 1 to mdo X(j−1)l+i = T (C , (i − 1)m + j − 1) end for end for Output Sudoku design X = (X1′ , X2′ , . . . , Xp′ )′ with order p. Example 1. In this example, we will give two Sudoku designs with order 6, which are constructed by Algorithm 1. Take C = (1, 2, 3, 4, 5, 6), and the first Sudoku design X6,1 has 6 blocks with order 2 × 3, and the second Sudoku design X6,2 has 6 blocks with order 3 × 2. Sudoku designs X6,1 and X6,2 are respectively listed in Tables 2 and 3.
54
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57 Table 3 Sudoku design X6,2 . 1 3 5
2 4 6
3 5 1
4 6 2
5 1 3
6 2 4
2 4 6
3 5 1
4 6 2
5 1 3
6 2 4
1 3 5
Table 4 Sudoku design X10,1 . 1 6
2 7
3 8
4 9
5 10
6 1
7 2
8 3
9 4
10 5
2 7
3 8
4 9
5 10
6 1
7 2
8 3
9 4
10 5
1 6
3 8
4 9
5 10
6 1
7 2
8 3
9 4
10 5
1 6
2 7
4 9
5 10
6 1
7 2
8 3
9 4
10 5
1 6
2 7
3 8
5 10
6 1
7 2
8 3
9 4
10 5
1 6
2 7
3 8
4 9
Table 5 Sudoku design X10,2 . 1 3 5 7 9
2 4 6 8 10
3 5 7 9 1
4 6 8 10 2
5 7 9 1 3
6 8 10 2 4
7 9 1 3 5
8 10 2 4 6
9 1 3 5 7
10 2 4 6 8
2 4 6 8 10
3 5 7 9 1
4 6 8 10 2
5 7 9 1 3
6 8 10 2 4
7 9 1 3 5
8 10 2 4 6
9 1 3 5 7
10 2 4 6 8
1 3 5 7 9
Example 2. In this example, we will give two Sudoku designs with order 10, which are constructed by Algorithm 1. Take C = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10), and the first Sudoku design X10,1 has 10 blocks with order 2 × 5, and the second Sudoku design X10,2 has 10 blocks with order 5 × 2. Sudoku designs X10,1 and X10,2 are respectively listed in Tables 4 and 5. The following theorem provides the basic properties of the constructed Sudoku designs. The proof is obvious and then it is omitted. Theorem 1. Suppose X is a Sudoku design with order p, and X contains p blocks with order m × l. Then we have (i) X ′ is also a Sudoku design with order p, and X ′ contains p blocks with order l × m; (ii) If we reorder the m row blocks with order l × p of X or reorder the l column blocks with order p × m of X , then X is also a Sudoku design with order p. 4. Sudoku-based uniform designs 4.1. Uniformity of the constructed Sudoku designs The following theorem provides a property of the constructed Sudoku designs from the viewpoint of uniformity. Theorem 2. Suppose X is a Sudoku design with order p which is constructed by Algorithm 1, then X is a uniform design in U(p; pp ) in terms of discrete discrepancy. Proof. From Lemma 1, we have the fact that if the meeting number between any pair of distinct rows of design d is not larger than 1, then the discrete discrepancy of d can attain the lower bound of the right side of (2), that is, d is a uniform design. From the definition of Sudoku designs, we know that the meeting number between any pair of distinct rows of Sudoku design X is all 0. Therefore, X is a uniform design in U(p; pp ) in terms of discrete discrepancy, which completes the proof.
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57
55
Corollary 1. Suppose X is a Sudoku design with order p, then we have (i) if any k columns of X are deleted, then the resulted design also is a uniform design in U(p; pp−k ) in terms of discrete discrepancy, where 1 ≤ k ≤ p − 1; (ii) if any random permutation column vector of {1, 2, . . . , p} is added to X , then the resulted design also is a uniform design in U(p; pp+1 ) in terms of discrete discrepancy. Example 1 (Continued). Consider the Sudoku design X6,1 as given in Example 1, and take a = 1, b = 0.5, then from (1) and (2) we have [DD(X6,1 ; a, b)]2 = 0.1403 and LDD(X6,1 ; a, b) = 0.1403. Therefore, X6,1 is a uniform design in U(6; 66 ) in terms of discrete discrepancy. Example 2 (Continued). Consider the Sudoku design X10,1 as given in Example 2, and take a = 1, b = 0.5, then from (1) and (2) we have [DD(X10,1 ; a, b)]2 = 0.0983 and LDD(X10,1 ; a, b) = 0.0983. Therefore, X10,1 is a uniform design in U(10; 1010 ) in terms of discrete discrepancy. 4.2. Uniformity of the resulting designs Based on the above constructed Sudoku designs X with order p, where p = m × l, we will provide a construction method of uniform designs U in U(2p; pm ) in terms of discrete discrepancy in this subsection. The construction process of Sudokubased uniform designs can be described in detail as follows. Step 1: The constructed Sudoku design X with order p (p = m × l) can be regarded as the column juxtaposition of its l complete column blocks. A complete column block means a subdesign of X with order p × m. Based on the constructed Sudoku design X , take any complete column block of X as the first part U1 of Sudoku-based uniform design U, for simplicity, we can take the first complete column block of X . Note that the first complete column block of X has p rows and m columns. Step 2: For the above selected complete column block of X , we reorder its columns by mirror mapping. That means, if we label the column number of the above selected complete column block of X as {1, 2, . . . , m}, then we reorder its columns by the following mirror mapping 1 2
.. . m/2
←→ ←→ .. . ←→
m m−1
.. .
m/2 + 1
for even m and 1 2
.. . ⌊m/2⌋
←→ ←→ .. . ←→
m m−1
.. . ⌊m/2⌋ + 2
for odd m, where ⌊m/2⌋ is the largest integer contained in m/2. After reordering the column of the column block U1 , we get a subdesign U2 with p rows and m columns. Step 3: Combining U1 and U2 together by rows yields the Sudoku-based uniform design U =
U1 U2
.
The following theorem provides a theoretical confirmation of the above constructed Sudoku-based uniform design U in terms of discrete discrepancy. Theorem 3. Suppose X is a Sudoku design with order p and U is constructed by the above method based on X , then U is a uniform design in U(2p; pm ) in terms of discrete discrepancy. Proof. From the process of the above construction method of Sudoku-based uniform design U, we know that the meeting number between any pair of distinct rows of U is all 0. Therefore, U is a uniform design in U(2p; pm ) in terms of discrete discrepancy from Lemma 1 again, which completes the proof. Example 1 (Continued). Consider the Sudoku designs X6,1 and X6,2 as given in Example 1, then we can easily get two Sudoku-based uniform designs U12,1 and U12,2 by the above method respectively. Take a = 1, b = 0.5, then from (1) and (2) we have [DD(U12,1 ; a, b)]2 = 0.0307, LDD(U12,1 ; a, b) = 0.0307 and [DD(U12,2 ; a, b)]2 = 0.0139, LDD(U12,2 ; a, b) = 0.0139. Therefore, U12,1 is a uniform design in U(12; 63 ) and U12,2 is a uniform design in U(12; 62 ) in terms of discrete discrepancy.
56
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57
Example 2 (Continued). Consider the Sudoku designs X10,1 and X10,2 as given in Example 2, then we can easily get two Sudoku-based uniform designs U20,1 and U20,2 by the above method respectively. Taking a = 1, b = 0.5 again, then from (1) and (2) we have [DD(U20,1 ; a, b)]2 = 0.0372, LDD(U20,1 ; a, b) = 0.0372 and [DD(U20,2 ; a, b)]2 = 0.0100, LDD(U20,2 ; a, b) = 0.0100. Therefore, U20,1 is a uniform design in U(20; 105 ) and U20,2 is a uniform design in U(20; 102 ) in terms of discrete discrepancy.
1 4 2 5 3 6
U12,1
= · · · 3 6 4 1 5 2
U20,1
1 6 2 7 3 8 4 9 5 10 = · · · 5 10 6 1 7 2 8 3 9 4
2 5 3 6 4 1
3 6 4 1 5 2
1
3 5 2 4 6
· · · , 1 4 2 5
U12,2
2 7 3 8 4 9 5 10 6 1
3 8 4 9 5 10 6 1 7 2
4 9 5 10 6 1 7 2 8 3
···
···
···
5 10 6 1 7 2 8 3 9 4
4 9 5 10 6 1 7 2 8 3
3 8 4 9 5 10 6 1 7 2
2 7 3 8 4 9 5 10 6 1
··· 2 5 3 6 4 1
3 6
= · · · 2 4 6 3 5 1
· · · , 1 6 2 7 3 8 4 9 5 10
2 4 6 3 5 1
· · · 1 3 5 2
U20,2
4 6
1 3 5 7 9 2 4 6 8 10 = · · · 2 4 6 8 10 3 5 7 9 1
2 4 6 8 10 3 5 7 9 1
· · · . 1 3 5 7 9 2 4 6 8 10
5. Remarks In this paper, we provide an easy and effective construction method of Sudoku designs, simultaneously, a class of uniform designs can be easily obtained based on the constructed Sudoku designs. Our construction methods are very impressive since they depend only on some simple transformations such as right shift operator, and column reordering. In addition, the constructed Sudoku designs and Sudoku-based uniform designs have good property from the viewpoint of uniformity. Hence, our results are useful complements to the construction of Sudoku designs, especially of uniform designs. On the other hand, the uniform design under discrete discrepancy is still the generalized minimum aberration design as shown in Xu and Wu (2005). Therefore, the constructed Sudoku designs and Sudoku-based uniform designs in this paper possess the generalized minimum aberration. Acknowledgments The authors greatly appreciate helpful suggestions of an Associate Editor and the referees. This work was partially supported by the National Natural Science Foundation of China (Grant Nos. 11201177 and 11271147), China Postdoctoral Science Foundation (No. 2013M531716), Scientific Research Plan Item of Hunan Provincial Department of Education (No. 12C0287), Jishou University Doctor Science Foundation (No. jsdxxcfxbskyxm201113), Scientific Research Plan Item of Jishou University (No. 13JDY041).
H. Li et al. / Statistics and Probability Letters 89 (2014) 51–57
57
References Bailey, R.A., Cameron, P.J., Connelly, R., 2008. Sudoku, gerechte designs, resolutions, affine space, spreads, reguli, and hamming codes. Amer. Math. Monthly 115, 383–404. Chatterjee, K., Fang, K.T., Qin, H., 2005. Uniformity in factional designs with mixed levels. J. Statist. Plann. Inference 128, 593–607. Chatterjee, K., Fang, K.T., Qin, H., 2006. A lower bound for centered L2 -discrepancy on asymmetric factorials and its application. Metrika 63, 243–255. Fang, K.T., Li, R., Sudjianto, A., 2005. Design and Modeling for Computer Experiments. Chapman and Hall, London. Fang, K.T., Wang, Y., 1994. Number-Theoretic Methods in Statistics. Chapman and Hall, London. Fontana, R., 2011. Fractions of permutations. An application to Sudoku. J. Statist. Plann. Inference 141, 3697–3704. Fontana, R., 2013. Random Latin squares and Sudoku designs generation. arXiv:1305.3697 [stat.CO]. Fontana, R., Rogantin, M.P., 2010. Indicator function and Sudoku designs. In: Gibilisco, P., Riccomagno, E., Rogantin, M.P., Wynn, H.P. (Eds.), Algebraic and Geometric Methods in Statistics. Cambridge University Press, pp. 203–224. Hickernell, F.J., 1998a. A generalized discrepancy and quadrature error bound. Math. Comp. 67, 299–322. Hickernell, F.J., 1998b. Lattice rules: how well do they measure up? In: Hellekalek, P., Larcher, G. (Eds.), Random and Quasi-Random Point Sets. In: Lecture Notes in Statistics, vol. 138. Springer, New York, pp. 109–166. Meng, J.X., Lu, X.Z., 2011. The design of the algorithm of creating Sudoku puzzle. Lecture Notes in Comput. Sci. 6729, 427–433. Qin, H., Fang, K.T., 2004. Discrete discrepancy in factorials designs. Metrika 60, 59–72. Subramani, J., 2012. Construction of Graeco Sudoku square designs of odd orders. Bonfring Int. J. Data Min. 2, 37–41. Subramani, J., Ponnuswamy, K.N., 2009. Construction and analysis of Sudoku designs. Model Assist. Stat. Appl. 4, 287–301. Xu, X., Haaland, B., Qian, P.Z.G., 2011. Sudoku-based space-filling designs. Biometrika 98, 711–720. Xu, H., Wu, C.F.J., 2005. Construction of optimal multi-level supersaturated designs. Ann. Statist. 33, 2811–2836. Zhou, Y.D., Fang, K.T., Ning, J.H., 2013. Mixture discrepancy for quasi-random point sets. J. Complexity 29, 283–301.