Hacker News new | ask | show | jobs
by Adlai 4235 days ago
Why is set intersection intuitively multiplication?

My expectation is that a set multiplication would give me a new set consisting of all pairs consisting of a single element from each set.

2 comments

Compare to probability. Probability of element being in one set AND another distinct set is multiplication of two probabilities (which are, in reality, actually defined by sets).

"Pairs" (and, respectively, cartesian product) is a bit more complex, and not so much related to boolean algebra deduction concept.

x ∈ (A ∩ B) = (x ∈ A) * (x ∈ B) if "x ∈ A" equals 1 when x is in the set A, 0 when x is not in the set A. Using "indicator functions" like this also gives you a nice formulation for probability and integration, etc. that falls apart if you use 1 to represent x ∉ A.

edit: I should add that I'm not claiming "you can't build measure theoretic probability from this formulation of booleans" is a strike against the project. Just addressing the math question.

I don't see how you lose boolean algebra, you just need to flip * and + in your equations. x ∈ (A ∩ B) = (x ∈ A) + (x ∈ B) (and) x ∈ (A ∪ B) = (x ∈ A) * (x ∈ B) (or)
You lose the ability to write step functions as

g(y) = ∑ᵢ cᵢ × (y ∈ Aᵢ)

which is useful when you define integrals and expectations:

E g(Y) = ∫ g(y) f(y) dy = ∑ᵢ g(cᵢ) P(y ∈ Aᵢ)

where Y is a random variable with density function f. Any integrable function can be approximated as the limit of step functions, so this is a well-behaved way to get a general theory of integration.

Of course, one could replace (y ∈ Aᵢ) with 1 - (y ∈ Aᵢ) if one wanted to use "0" to represent the event (y ∈ Aᵢ) and "1" to represent its complement and not affect the truth of the math, but then there will be lots of termf floating around just to convert the notation into the terms that you need for the math.