Is binary divisibility by 3 determined by even and odd bit count?

  • Context: Undergrad 
  • Thread starter Thread starter mpekatsoula
  • Start date Start date
  • Tags Tags
    Binary Divisibility
Click For Summary

Discussion Overview

The discussion revolves around the concept of binary divisibility by 3, specifically whether it can be determined by the count of even and odd bits in a binary representation. Participants explore the relationship between binary numbers and modular arithmetic, seeking proofs and clarifications regarding the proposed rule.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification

Main Points Raised

  • One participant presents a statement suggesting that if the difference between the number of even bits and odd bits is a multiple of 3, then the number is divisible by 3.
  • Another participant references modular arithmetic to explain how binary numbers can be analyzed for divisibility by 3, providing a mathematical expression involving powers of 2 and their equivalences modulo 3.
  • A third participant discusses the general principles of modular arithmetic, illustrating how numbers can be replaced by their remainders in calculations, and connects this to the earlier discussion about binary numbers.
  • A later reply expresses gratitude for the explanations and indicates a newfound understanding of modular arithmetic.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the proof of the initial claim regarding even and odd bit counts determining divisibility by 3. Multiple viewpoints and approaches to understanding the concept remain present.

Contextual Notes

Some participants express uncertainty regarding the clarity of modular arithmetic and its application to the problem at hand. There are indications of missing concise summaries or references that could aid understanding.

Who May Find This Useful

This discussion may be useful for individuals interested in binary number theory, modular arithmetic, and the mathematical principles underlying divisibility rules.

mpekatsoula
Messages
4
Reaction score
0
Well i found this sentence: "If the number of even bits minus the number of odd bits is a multiple of 3 (e.g. -3,0,3,6, etc) then the number is divisible by three." Can anyone tell me the proof of this?
Thanks
 
Physics news on Phys.org
These rules can be found from modular arithmetic.
http://en.wikipedia.org/wiki/Modular_arithmetic

For binary number in particular we can write the following equation for a binary number where all equations are taking mod 3
[tex] (a_n\dotsb a_3a_2a_1a_0)_b=2^n a_n+\dotsb+ 2^3 \cdot a_3+2^2\cdot a_2+2\cdot a_1+a_0=(-1)^n a_n+\dotsb+ (-1) \cdot a_3+(+1)\cdot a_2+(-1)\cdot a_1+a_0[/tex]
Here you say that one has the alternatively add the bits and the final result will have the same divisibility by 3 as the complete binary number.

Have a look at Wikipedia and then ask, if something is unclear. I admit Wikipedia doesn't explain this well. Maybe you can also find a better reference.
 
Hmm, couldn't find a very concise summary of modular arithmetic. Basically what you need to know is that one can write equations where one only cares if the remainder to some division is the same. For example
[tex] 9=19=29=\dotsb\qquad\text{mod 10}[/tex]
since all numbers have the same remainder w.r.t. division by 10. Note that also
[tex] 9=-1=-11=\dotsb\qquad\text{mod 10}[/tex]
since in general you can add or subtract any multiple of 10 (in this case).

Now some rule are, that for you can replace any integer by another which gives the same remainder. For example
[tex] 156=12\cdot 13=2\cdot 3=6\qquad\text{mod 10}[/tex]
as you can check for yourself.

You can do this in equations also at any instant of the calculation
[tex] 1116=12\cdot (89+4)=2\cdot (9+4)=2\cdot 13=2\cdot 3=6\qquad\text{mod 10}[/tex]
where in some steps I replaced number by their remainder w.r.t. division by 10 (which is basically the last digit of the number)

That what I did for your problem
[tex] 2^n=(-1)^n\qquad\text{mod 3}[/tex]
where I replaced 2 with the "equivalent" remainder-wise -1.
 
Well thanks for the help! First time in my life i hear about modular arithmetic! It took me some time to understand but thanks to your answer i think i got it!
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K