NISHIO Hirokazu[English][日本語]

XOR and Sum Exchange

The following holds for the 0/1 column

  • $\sum_i^N x_i = K \iff \sum_i^N (1 \oplus x_i) = N - K$

Even a general integer sequence can be regarded as a bit-by-bit sequence Change the order of addition ABC147D.

  • $A_i = \sum_j x_{ij} 2^j$

This page is auto-translated from /nishio/XORと和の交換 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.


(C)NISHIO Hirokazu / Converted from Markdown (en)
Source: [GitHub] / [Scrapbox]