My Math Forum  

Go Back   My Math Forum > College Math Forum > Number Theory

Number Theory Number Theory Math Forum


Reply
 
LinkBack Thread Tools Display Modes
July 15th, 2010, 05:54 PM   #1
Newbie
 
Joined: Jul 2010

Posts: 3
Thanks: 0

boolean and modulo

Please do you know if (a&b)modp(where & stands for bitwise boolean AND operator)is the same as (amodp)&(bmodp)?Or can you direct me to somewhere i can find more information on this?Thanks.
dynamo is offline  
 
July 15th, 2010, 06:08 PM   #2
Senior Member
 
Joined: Aug 2008
From: Blacksburg VA USA

Posts: 354
Thanks: 7

Math Focus: primes of course
Re: boolean and modulo

ok, via wolframalpha, input box: (45 BitAnd 69) mod 4 returns 1
45mod4=1, 69mod4=1 1BitAnd1 gives 1, so on the first test check it worked. You may try others now ...
billymac00 is offline  
July 16th, 2010, 06:18 AM   #3
Senior Member
 
Joined: Apr 2010

Posts: 215
Thanks: 0

Re: boolean and modulo

Your statement is valid if (for some natural integer n).
Any other p will not work.
brangelito is offline  
July 16th, 2010, 02:18 PM   #4
Senior Member
 
Joined: Feb 2009
From: Adelaide, Australia

Posts: 1,519
Thanks: 3

Re: boolean and modulo

If a and b are less than p, then the statements are equivalent, as a&b can't exceed min{a,b}.

Otherwise (if p is not a power of 2) the situation is complicated. I have plotted results for (a,b) using modulo 3 and modulo 17. A white dot means equivalence, a black dot non-equivalence.

aswoods is offline  
July 16th, 2010, 03:30 PM   #5
Senior Member
 
Joined: Apr 2010

Posts: 215
Thanks: 0

Re: boolean and modulo

Quote:
Originally Posted by aswoods
If a and b are less than p, then the statements are equivalent, as a&b can't exceed min{a,b}.

Otherwise (if p is not a power of 2) the situation is complicated. I have plotted results for (a,b) using modulo 3 and modulo 17. A white dot means equivalence, a black dot non-equivalence.

Very nice patterns.

They are obviously symmetrical because the AND-operation is communitative:

(a&b)%p == (b&a)%p
(a%p)&(b%p) == (b%p)&(a%p)
brangelito is offline  
July 17th, 2010, 01:37 AM   #6
Newbie
 
Joined: Jul 2010

Posts: 3
Thanks: 0

Re: boolean and modulo

Thank you guys so much for replying.I feel so at home here on this forum.So many on point posts.I sorta suspected this about powers of two,but for the when a and b are less than p case that was a revelation.Thank you so much
dynamo is offline  
Reply

  My Math Forum > College Math Forum > Number Theory

Tags
boolean, modulo



Search tags for this page
Click on a term to search for related topics.
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boolean Algebra. HELP! Shamieh Applied Math 1 September 12th, 2013 05:09 PM
Boolean Questions rhymin Applied Math 0 April 17th, 2013 08:48 AM
Boolean Algebras Hooman Abstract Algebra 1 December 18th, 2012 12:38 PM
Boolean algebra Anamaria Applied Math 1 February 18th, 2011 11:16 AM
Need help with boolean logics babypsycho Applied Math 13 March 28th, 2010 02:43 AM





Copyright © 2019 My Math Forum. All rights reserved.