What is the "reverse" of the cartesian product?
Suppose $A = \{a_1,a_2 \}$ and $B = \{b_1,b_2 \}$. Then $A \times B =
\{(a_1,b_1), (a_1,b_2), (a_2,b_1), (a_2,b_2) \}$. What is the "reverse" of
this operation? In particular, what would $A \div B$ be?
The motivation for this question is from relational algebra. Consider the
following two tables:
$$\text{Table A}: \{(s_1,p_1), (s_2,p_1), (s_1,p_2), (s_3,p_1), (s_5,p_3)
\}$$ $$\text{Table B}: \{p_1,p_2\}$$
Then $$A \div B = \{s_1 \}$$
In other words, we look at the x-coordinate which has both $p_1$ and $p_2$
as y-coordinates.
No comments:
Post a Comment