The expression is:
a1 | a2 |⋯| an ≤ a1 + a2 +⋯+ an , where '|' denotes the Bitwise OR operator
By definition, each bit of the OR of two numbers is independent from each other. That is,
OR
$$\left(\sum_{i=0}^N a_i2^i\right) \mid \left(\sum_{i=0}^N b_i2^i\right) = \sum_{i=0}^N (a_i \mid b_i) 2^i$$
So it suffices to show this for $a_i, b_i \in \{0, 1\}$. However, that is easy, since
With a similar proof, you have $a + b = (a \mid b) + (a \& b)$ where $\&$ is the bitwise AND operation.
From this, use induction.
Copyright © 2021 JogjaFile Inc.
By definition, each bit of the
ORof two numbers is independent from each other. That is,$$\left(\sum_{i=0}^N a_i2^i\right) \mid \left(\sum_{i=0}^N b_i2^i\right) = \sum_{i=0}^N (a_i \mid b_i) 2^i$$
So it suffices to show this for $a_i, b_i \in \{0, 1\}$. However, that is easy, since
With a similar proof, you have $a + b = (a \mid b) + (a \& b)$ where $\&$ is the bitwise AND operation.
From this, use induction.