Skip to content

GATE CS 2026 Set 1 Q2 — Combinatorics: Counting, Recurrence Relations, Generating Functions

Explain with AI

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

Choose one option
View worked solution

Answer: A

To find the number of 4×44 \times 4 matrices with elements from {0,1}\{0, 1\} such that every row and every column has an even number of 11s, we can analyze the degrees of freedom in choosing the elements.

Let the matrix be M=(aij)M = (a_{ij}) of size 4×44 \times 4. Consider the top-left 3×33 \times 3 submatrix:

(a11a12a13a21a22a23a31a32a33)\begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}

Each of these 3×3=93 \times 3 = 9 elements can be chosen independently as either 00 or 11. There are 29=5122^9 = 512 ways to choose these elements.

Once these 99 elements are chosen, the remaining elements of the 4×44 \times 4 matrix are uniquely determined to satisfy the even-parity constraints:

  1. First 3 elements of the 4th column: For each row i∈{1,2,3}i \in \{1, 2, 3\}, the element ai4a_{i4} must be chosen such that the row sum is even: ai4≡∑j=13aij(mod2)a_{i4} \equiv \sum_{j=1}^3 a_{ij} \pmod 2 This uniquely determines a14,a24,a_{14}, a_{24}, and a34a_{34}.
  2. First 3 elements of the 4th row: For each column j∈{1,2,3}j \in \{1, 2, 3\}, the element a4ja_{4j} must be chosen such that the column sum is even: a4j≡∑i=13aij(mod2)a_{4j} \equiv \sum_{i=1}^3 a_{ij} \pmod 2 This uniquely determines a41,a42,a_{41}, a_{42}, and a43a_{43}.
  3. The corner element a44a_{44}:
    • To satisfy the parity of the 4th row: a44≡∑j=13a4j≡∑j=13∑i=13aij(mod2)a_{44} \equiv \sum_{j=1}^3 a_{4j} \equiv \sum_{j=1}^3 \sum_{i=1}^3 a_{ij} \pmod 2
    • To satisfy the parity of the 4th column: a44≡∑i=13ai4≡∑i=13∑j=13aij(mod2)a_{44} \equiv \sum_{i=1}^3 a_{i4} \equiv \sum_{i=1}^3 \sum_{j=1}^3 a_{ij} \pmod 2
    Both conditions yield the exact same value for a44a_{44}. Thus, a44a_{44} is consistently and uniquely determined.

Since the remaining elements are uniquely determined for any choice of the 3×33 \times 3 submatrix, the total number of such matrices is:

29=5122^9 = 512

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Combinatorics: Counting, Recurrence Relations, Generating Functions questions