Q. What can we say about positive integers a, b if a\text{~\&~}b = a ?

(\&) denotes the bitwise AND operator.

Q. What can we say about positive integers a, b if a\text{~\&~}b = a ?

(\&) denotes the bitwise AND operator.

They are either equal, or the bits set in A are also set in B.

1 Like

I think you meant the reverse. The bits set in A are set in B.

1 Like

Yeah, thanks for correction. Edited

- a|b = b
- ( a \oplus b ) + a = b
- ( b- a ) | a = b
- ( b- a ) \oplus a = b
- (b - a) \& a = 0
- a \epsilon b

4 Likes

Either ‘a’, ‘b’ must be equal Or ‘b’ must be ‘1’ i.e., all the bits are set to ‘1’. In this two cases as per my knowledge a & b == a