Count 'em all!

Find the number of 2018 × 2019 2018 \times 2019 matrices formed from only the elements { 0 , 1 } \{0, 1\} such that the number of 1 1 's in each row and each column is even.

If your answer is N N , then find N m o d 2017 N\bmod{2017} .


The answer is 4.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Ivan Koswara
Feb 16, 2017

Fill the top-left 2017 × 2018 2017 \times 2018 portion of the grid freely. We claim this gives exactly one solution. We also claim all solutions can be produced in this way, and no solution is produced twice.

The latter claim is easy: from any solution, look at the top-left 2017 × 2018 2017 \times 2018 portion. This solution is generated from that portion. No solution is produced twice, since each solution can only be possibly produced from one portion.

Now we claim each portion gives one solution. To see this, simply note that the last cell of each of the first 2017 rows is determined from the other cells: it's the only cell that will make the count of 1's to be even in the row. Now that we fix this, the last cell of each column is also determined in the same way. Finally, the last row will automatically match: there are a total of an even number of 1's (because each column gives an even number of 1's), and the first 2017 rows have an even number of 1's each, so this last row must also have an even number of 1's.

This proves the claim. So each solution is generated by a unique portion, and each portion generates a unique solution. There are 2 2017 × 2018 2^{2017 \times 2018} portions, and hence that's the number of solutions. So N = 2 2017 × 2018 N = 2^{2017 \times 2018} .

Now, by Fermat's Little Theorem, since 2017 is prime, we have 2 2017 2 ( m o d 2017 ) 2^{2017} \equiv 2 \pmod{2017} . Thus

N 2 2017 × 2018 ( 2 2017 ) 2018 2 2018 ( m o d 2017 ) 2 2 2017 2 2 ( m o d 2017 ) 4 \begin{aligned} N &\equiv 2^{2017 \times 2018} \\ &\equiv (2^{2017})^{2018} \\ &\equiv 2^{2018} \pmod{2017} \\ &\equiv 2 \cdot 2^{2017} \\ &\equiv 2 \cdot 2 \pmod{2017} \\ &\equiv \boxed{4} \end{aligned}

Mark Hennings
Feb 16, 2017

Let V n V_n be the n n -dimensional vector space over the field Z 2 \mathbb{Z}_2 of two elements consisting of column vectors. Then W n = { x V n x 1 + x 2 + + x n = 0 } W_n \; = \; \big\{\mathbb{x} \in V_n \; \big| \; x_1 + x_2 + \cdots + x_n = 0\big\} is an n 1 n-1 -dimensional subspace of V n V_n . From this we see, for any m , n 2 m,n \ge 2 , that Z m , n = { A L ( V m , W n ) e ( m ) K e r A } Z_{m,n} \; = \; \big\{ A \in \mathcal{L}(V_m,W_n) \; \big| \; \mathbb{e}(m) \in \mathrm{Ker}\,A \big\} where L ( V m , W n ) \mathcal{L}(V_m,W_n) is the vector space (over Z 2 \mathbb{Z}_2 of all linear transformations from V m V_m to W n W_n , and e ( m ) V m \mathbb{e}(m) \in V_m is the column vector ( 1 1 1 1 ) T (1\;\;1\;\;1\;\;\cdots\;\;1)^\mathrm{T} , is a vector space over Z 2 \mathbb{Z}_2 of dimension ( m 1 ) ( n 1 ) (m-1)(n-1) . Thus Z m , n Z_{m,n} contains 2 ( m 1 ) ( n 1 ) 2^{(m-1)(n-1)} elements.

We are interested in the number of elements in Z 2018 , 2019 Z_{2018,2019} , and hence N = 2 2017 × 2018 N \,=\, 2^{2017 \times 2018} . Since 2 2016 1 ( m o d 2017 ) 2^{2016} \equiv 1 \pmod{2017} , we deduce that N 2 2018 2 2 = 4 ( m o d 2017 ) N \equiv 2^{2018} \equiv 2^2 = \boxed{4} \pmod{2017} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...