Блог пользователя prudent

Автор prudent, история, 8 лет назад, По-английски

Question is solved, please ignore this post

Why if xor sum of segment is equal to sum of segment, this condition is also satisfied for all subsegments of original segment?
I know that it's true when all bits in numbers are unique, but is it the only case when it's true, and if it is, then why?

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Think about the binary representation of the bits. How is it possible that the xor sum is equal to the sum? If you figure that out, then it is obvious that this also holds for all subsegments.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by prudent (previous revision, new revision, compare).