GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many Boolean functions f(a,b,c,d) satisfy BOTH f(a,b,c,d) = f(b,a,c,d) and f(a,b,c,d) = f(c,d,a,b) for all inputs?

  1. A. 64
  2. B. 4096
  3. C. 512
  4. D. 1024

Correct answer: A. 64

The two symmetries generate swapping a↔b, swapping c↔d (conjugate one by the other) and exchanging the pairs. Under this group of order 8 the 16 inputs fall into 6 classes, determined by the multiset {weight of (a,b), weight of (c,d)}: {0,0},{0,1},{0,2},{1,1},{1,2},{2,2}. So 2^6 = 64. Using only the first symmetry gives 4096; forgetting that c↔d is implied gives 512.

More Digital Logic questions

Exams that ask this topic