10
$\begingroup$

I don't know how to evaluate this expression: $A-B\cap C$

Is it true that:

$A-(B\cap C)=(A-B)\cap C$

or, in other words, that the associative property applies to these operations?

  • 2
    I would say it's ambiguous.2012-12-27
  • 0
    So would I. The equality you've written is not true, so some brackets are going to be necessary to understand $A-B\cap C$, unless it's clear from context.2012-12-27
  • 0
    Perhaps interestingly, $A\cap B\setminus C$ is not ambiguous...2012-12-28
  • 0
    Ok, it's not true I just drawn the Venn Diagram. But the question remains. I which order should I take these operations?2012-12-28

3 Answers 3

11

Given $\;\;A-B\cap C\;\;$ parentheses are needed to disambiguate, since in general, we have that $$A-(B\cap C)\ne(A-B)\cap C.$$

Exercise: find Sets $A, B, C$ which provide a counterexample to $A-(B\cap C)=(A-B)\cap C$.

Using parentheses is the only option that leaves nothing uncertain, as you can't rely on everyone to be as familiar with "order of set operations" as they are with, operations on numbers; indeed, there is little in the way of priority/precedence in set operations.

See these notes on compound operations on sets:

Sometimes we want to combine more than two sets and more than one operation to create a more compound expression. But in order to do this we have to establish some set of rules so that we know in what order to do each operation. Just like with numbers, we use parentheses if we want an operation to be done first.

  1. Just like with numbers, we always do anything in parentheses first. If there is more than one set of parentheses, we work from the inside out.

  2. Then we do complements.

  3. Union , intersection, and difference operations (set minus) are all equal in the order [of precedence]. So if we have more than one of these at a time, we have to use parentheses to indicate which of these operations should be done first.

For example, the expression $A\cup B - C$ doesn’t make any sense because we don’t know which operation we should do first: should we take the union first, and then the difference, or should we take the difference first and then the union? In order to make this clear, we need to either write $(A \cup B) - C$ or $A \cup (B - C)$.

  • 0
    Maybe you wanted to quote with `>`? Adding four spaces makes things unreadable!2012-12-28
  • 0
    @Asaf: changed it! You're right!2012-12-28
  • 0
    So should I take the expression as meaningless?2012-12-28
  • 0
    Yes: or if it's part of homework, make clear that the expression is **ambiguous**, and show what each possible interpretation leads to: why $(A - B)\cap C$ isn't the same as $A - (B \cap C)$, and conclude *there is no way to answer the question as stated.*2012-12-28
  • 1
    @Victor: Note the difference between "meaningless" and "ambiguous". Contact whoever assigned you this expression and ask for clarification.2012-12-28
  • 1
    @amWhy It is not homework. I'm self studying with a book called "Math Apllied to Databases" and this is one exercise at the end of chapter 2: Set theory. I asked a mathematician and he told me to do the intersection first, but he didn't say to me why.2012-12-28
  • 0
    That's fine (it wasn't a judgment). Simply move on to the next problem, as this one is clearly ambiguous. It is still good to make a note to yourself, or in your worked-out-exercises, as to why it is ambiguous.2012-12-28
  • 1
    @VictorJoseAranaRodriguez In math there are multiple conventions. As $(P(A), \varnothing, A, \cup, \cap)$ forms a semiring like $(\mathbb{N}, 0, 1, +, \times)$, some prefer to do intersection first (as it is similar to product which we do before the sums). However, others say that those are just different operations and we should treat them equally. Unless your book state which convention it uses (examples might contain hints) it is safe only with parentheses being first.2012-12-28
  • 0
    Does this help at all, Victor? Check your text first, to see if there is some clearly marked designation with respect to operation precedence. Most argue as above, in my post, when it comes to set difference vs. union, vs. intersection, they are equal in precedence*, so if you MUST choose which to do first, proceed from *left to right*, performing the first set operation (say, in your case: $A - B$), and then the next: $(A-B) \cap C$. But in any case, when YOU write answers, and such, make sure to use parentheses so there is no ambiguity for the reader.2012-12-28
3

The expressions are not equal.

Take $A=\{0,1\}$, $B=\varnothing$, $C=\{0\}$.

$$A-(B\cap C)=A-\varnothing=A\\(A-B)\cap C=A\cap C=\{0\}$$

  • 0
    Thank you Asaf but I still don't know which operation I should do first.2012-12-28
  • 0
    @Victor: It is an ambiguous term.2012-12-28
0

I was also doubtful about this, so I browsed about, and found this PDF with De Morgan's laws: $$A\setminus(B\cup C)=(A\setminus B)\cap(A\setminus C)$$ $$A\setminus(B\cap C)=(A\setminus B)\cup(A\setminus C)$$ So, I guess by simply applying them, the problem of order can be cleared…