Probability & Random Variables

Answer & solution
Official answer: 0.5
Worked explanation
View the sum modulo 2. Since a is nonzero, at least one coordinate j has coefficient 1. Fix every random bit except xj; those fixed bits determine some parity c. The remaining sum parity is c⊕xj. A uniform xj makes that result equally likely to be 0 or 1, regardless of c. Averaging over all choices of the other bits preserves probability 1/2. The pairing proof below is the equivalent combinatorial version. The nonzero hypothesis matters: if a were the zero vector, the sum would always be 0 and the probability would be 0.
Derivation and answer
Because a is nonzero, choose an index j with aj=1. Pair each vector x with the vector obtained by flipping only xj. This is a fixed-point-free bijection on all 2n equally likely inputs, and it reverses the parity of the dot product. Exactly half of the inputs yield an odd sum, so the probability is 1/2. The argument in fact works for any n≥1 with nonzero a.