MHB Solving Bitwise Arithmetic: What Trick Makes it Easy?

  • Thread starter Thread starter tmt1
  • Start date Start date
  • Tags Tags
    Arithmetic
AI Thread Summary
The discussion focuses on solving bitwise arithmetic expressions, specifically 1234567 ^ 7 ^ ~~1234567 and 5 & (12345678 ^ ~~12345678). The key trick mentioned involves understanding basic properties of bitwise operations: negating a bit twice (~~x) returns the original value, and the exclusive-or operation (^) has properties such as x ^ x = 0 and being both commutative and associative. These properties simplify the expressions and make solving them easier.
tmt1
Messages
230
Reaction score
0
1234567 ^ 7 ^ ~~1234567

5 & (12345678 ^ ~~ 12345678)

My prof said there is an easy way to solve these as there is a trick to it. Does anyone know what trick is being referred to?
 
Technology news on Phys.org
tmt said:
1234567 ^ 7 ^ ~~1234567

5 & (12345678 ^ ~~ 12345678)

My prof said there is an easy way to solve these as there is a trick to it. Does anyone know what trick is being referred to?

The "tricks" here are just the basic properties of bitwise arithmetic, namely that ~~x is equivalent to x (negating a bit, and then negating it again, gives you back the original bit) and x ^ x is equivalent to 0 (look at the truth table for exclusive-or). Finally, ^ is commutative. Does that make it easier?
 
Bacterius said:
Finally, ^ is commutative.

Nitpicking. We also need that ^ is associative, which it is. ;)
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Back
Top