[Math] How to bitwise operations be modeled with math

boolean-algebra

In programming, if I did 100 | 001 (| being the "or" operator), I would get 101. Can this be done in math? I.e. with sets:
$$A=\{1,0,0\}$$
$$B=\{0,0,1\}$$
$$A ?B = \{1,0,1\}$$
Is there an operator that would satisfy the equation in place of the question mark? Thanks.

Best Answer

The AND and OR operators can be modelled algebraically thus: $$ \begin{align} a \wedge b &= ab\\ a \vee b &= a+b-ab \end{align}$$

Now, for $A,B \in \Bbb Z_2^n$, that is, $A=(a_1,\ldots,a_n)$ and $B=(b_1,\ldots,b_n)$ where $a_i,b_i \in \{0,1\}$, define $$ \begin{align} A \wedge B &= (a_1\wedge b_1,\ldots,a_n\wedge b_n)\\ A \vee B &= (a_1\vee b_1,\ldots,a_n\vee b_n) \end{align}$$

Related Question