Question:

Consider \(4 \times 4\) matrices with their elements from \(\{0, 1\}\). The number of such matrices with even number of 1s in every row and every column is ______.

Show Hint

Fill the top-left 3x3 block freely (2^9 ways); the last row and last column are then forced by the even-parity requirement, and the corner entry works out consistently every time.
Updated On: Jul 22, 2026
  • 512
  • 1025
  • 1023
  • 255
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Set up the counting problem.
A \(4 \times 4\) 0-1 matrix has 16 entries. We need every row's entries to sum to an even number (0, 2, or 4 ones) and every column's entries to sum to an even number as well.

Step 2: Freely choose the top-left \(3 \times 3\) submatrix.
Consider the entries in rows 1 to 3 and columns 1 to 3 (a \(3 \times 3\) block of 9 cells). Each of these 9 entries can independently be chosen as 0 or 1, giving \(2^9 = 512\) possible choices, with no parity restriction on this block by itself.

Step 3: Show the remaining entries in each of the first 3 rows and first 3 columns are forced.
For each of rows 1, 2, 3, the entry in column 4 (the 4th column of that row) must be chosen so that the row's total count of 1s is even; since the first three entries of that row are already fixed from Step 2, this 4th entry is uniquely determined (either 0 or 1, whichever makes the row sum even). Similarly, for each of columns 1, 2, 3, the entry in row 4 is uniquely determined by the requirement that the column's total count of 1s is even.

Step 4: Show the single remaining corner entry (row 4, column 4) is also forced, and consistently so.
The entry at row 4, column 4 must simultaneously make row 4 even and make column 4 even. A standard parity (double counting) argument shows these two requirements agree: the parity forced by row 4's other three entries equals the parity forced by column 4's other three entries, because both ultimately trace back to the same overall parity of the \(3\times3\) block. So there is no contradiction, and exactly one valid value of the corner entry exists for every choice made in Step 2.

Step 5: Count the total.
Since the \(3 \times 3\) block can be filled freely in \(2^9\) ways, and every other entry (the last column of the first 3 rows, the last row of the first 3 columns, and the corner) is then uniquely and consistently determined, the total number of valid \(4 \times 4\) matrices is:
\[ 2^{(4-1)(4-1)} = 2^{9} = 512 \]

Step 6: Match against the options.
512 matches option (A) exactly. Option (D) 255 is \(2^8-1\), missing a factor and subtracting 1 incorrectly. Options (B) 1025 and (C) 1023 are close to \(2^{10}\) but correspond to no valid derivation of this count and are ruled out.
\[ \boxed{512} \]
Was this answer helpful?
0
0

Top GATE CS Engineering Mathematics Questions

View More Questions