Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $A = \{A_1, A_2, A_3, \cdots, A_n\}$ and $B = \{B_1, B_2, B_3,\cdots, B_n\}$. where $A_i\in \mathbb{Z}$ and $B_i\in \mathbb{Z}$.


$$S_{1} = A_1 + A_2 + A_3 + \cdots + A_n = \sum_{i=1}^{n}{A_{i}} \\ S_{2} = B_1 + B_2 + B_3 + \cdots + B_n = \sum_{i=1}^{n}{B_{i}}$$


$$X_1 = A_1 \oplus A_2 \oplus A_3 \oplus \cdots \oplus A_n = \bigoplus_{i=1}^{n}{A_{i}} \\ X_2 = B_1 \oplus B_2 \oplus B_3 \oplus \cdots \oplus B_n = \bigoplus_{i=1}^{n}{B_{i}}$$

Where $\oplus$ is the XOR operator.

If $S_{1} = S_{2}$ and $X_{1}=X_{2}$, does this imply that $A$ and $B$ contain the same set of integers?

share|cite|improve this question
Are you using $I$ to stand for the integers? and A1, etc., to stand for $A_1$, etc.? – Gerry Myerson Jul 15 '12 at 12:40
@GerryMyerson yes – Eight Jul 15 '12 at 12:46
up vote 5 down vote accepted

No. Counterexample: $$\begin{align*} A &= \{ 1, 6, 8, 48 \} \\ B &= \{ 3, 4, 24, 32 \} \end{align*}$$ More generally, any sets of integers of the form $$ A = \{ 2^{a_k}, 2^{b_k} + 2^{c_k} \}_{k = 1,2,\ldots} \qquad\qquad B = \{ 2^{a_k} + 2^{b_k}, 2^{c_k} \}_{k = 1,2,\ldots} $$ where the sequences $a_k, b_k, c_k$ never repeat and also don't have any elements in common, will be a counterexample. This can be generalised to any sequence of non-overlapping binary vectors, in which there are more vectors with Hamming weight 2 or greater than Hamming weight 1, interpreted as integers in binary notation.

share|cite|improve this answer

No. For example, $\{ 0, 3 \}$ and $\{1 , 2\}$ both have sum and xor $3$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.