News for hackers. Stuff that matters.
Re: by cubefox on Sunday November 05, 2023 @11:54AM (#38152883)
The formula is slightly wrong though. This is the right one:

a or b = a + b - (a * b)

The last term is equivalent to a conjunction. Which also makes sense when you think of probability:

P(a or b) = P(a) + P(b) - P(a and b)

Re: by moritzwarhier on Sunday November 05, 2023 @12:19PM (#38153184)
Awesome, thanks!

I've seen this formula I think, and for mod 2 addition, there is no difference I guess.

Re: by xigoi on Sunday November 05, 2023 @01:38PM (#38154128)
True, but in modulo 2, + and - are the same. I chose the + to keep the formula simple.