Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Online, I have read contradicting opinions on whether intersect should take precedence over union (by analogy to logical and and or), or whether all set operators should have equal precedence.

Which way makes more sense and why?

And where does difference fit in? (I'd say it should be equal precedence to intersect because A - B = A intersect B'.)

share|improve this question
    
What do you mean with "precedence" here? –  Rasmus Oct 11 '10 at 13:33
    
Yeah the connection with arithmetic operators is the second best guide. Usually you can just figure it out by looking at which bracketing make sense though. –  anon Oct 11 '10 at 13:34
3  
I don't understand the downvote to this question. –  Aryabhata Oct 11 '10 at 16:24
1  
@Rasmus: Operator precedence determines whether A union B intersect C is (A union B) intersect C or A union (B intersect C). –  David R Tribble Oct 11 '10 at 17:01

2 Answers 2

up vote 8 down vote accepted

There is no sensible way of preferring one of intersection and union more than the other, since complement switches them. I don't think you should assume an order at all and you should always use parentheses.

share|improve this answer

Since there are contradicting opinions, I recommend assuming that whoever is reading your work assumes a different precedence order than you do, and using lots of parentheses.

share|improve this answer
    
Good rule of thumb, so ++. But I was looking for arguments for why the precedence should be one way or the other if you got to choose. –  AlcubierreDrive Oct 11 '10 at 23:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.