Counting binary parity matrices
Combinatorics & Counting

Answer & solution
Official answer: A
Our answer: 512; option A
Givens and goal
Count 4-by-4 matrices with entries 0 or 1 in which every row and every column has an even number of ones. The offered counts include 512, 1025, 1023 and 255.
Approach
Choose an independent block freely and show that parity determines every remaining entry uniquely.
Step-by-step solution
1. Select the nine entries a_ij with 1≤i,j≤3 arbitrarily. Each is a binary choice, so there are 29 possibilities at this stage.
2. For each of the first three rows, choose ai4 as the sum of its first three entries modulo 2. If that sum is odd, append 1; if even, append 0. This forces even row parity.
3. For each of the first three columns, choose a_4j similarly from its first three entries. This forces even column parity.
4. Let p be the parity of the original 3-by-3 block. The parity of the three new bottom-row entries is p, and the parity of the three new last-column entries is also p: both count the same nine original entries. Setting a44=p therefore makes both the last row and last column even simultaneously.
5. Every initial block has exactly one completion, and different initial blocks yield different matrices. Thus the required count is 29=512, option A.
Why not 28? Although eight parity conditions are written, one is redundant: the total parity obtained by summing row parities equals that obtained by summing column parities. There are seven independent constraints on sixteen bits, leaving nine free bits.
































![Question 1.2, GATE 2000: For 1≤i,j≤n, define v[i,j]=i−j. Find the sum of all n² entries. Options include 0,n−1,n²−3n+2,n²(n+1)/2.](../../../assets/questions/CS-2000-Q2-1.webp)












