For n >= 2, let a in {0, 1}^n be a non-zero vector. Suppose that x is chosen uniformly at random from {0, 1}^n. Then, the probability that sum_{i=1}^{n} a_i * x_i is an odd number is ______________

GATE 2020 · Engineering Mathematics · Uniform Distribution · medium

Answer: P(sum a_i x_i is odd) = 0.5.

  1. Find a coordinate where a_j = 1: Let j be any index with a_j=1. Such j exists because a is non-zero.
  2. Count vectors with odd sum using parity pairing: For each of the 2^(n-1) choices of {x_i : i != j}, exactly one of x_j=0 and x_j=1 makes S odd. So exactly 2^(n-1) of the 2^n total vectors give odd S.
  3. Compute the probability: P(sum a_i x_i is odd) = 1/2 = 0.5.