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.

Suppose relation $R(A,B,C)$ has the following tuples:

$X\;\;\;\; Y\;\;\;Z$

$1\;\;\;\;\; 2\;\;\;\;\; 3$

$4\;\;\;\;\; 2\;\;\;\;\; 3$

$4\;\;\;\;\; 5\;\;\;\;\; 6$

$2\;\;\;\;\; 5\;\;\;\;\; 3$

$1\;\;\;\;\; 2\;\;\;\;\; 6$

and relation $S(A,B,C)$ has the following tuples:

$X\;\;\;\; Y\;\;\; Z$

$2\;\;\;\;\; 5\;\;\;\;\; 3$

$2\;\;\;\;\; 5\;\;\;\;\; 4$

$4\;\;\;\;\; 5\;\;\;\;\; 6$

$1\;\;\;\;\; 2\;\;\;\;\; 3$

How do I compute $(R - S) \cup (S - R)$? What would be the result?
Thanks.

share|improve this question
    
My guess is that someone down-voted as you have not provided your thought or what you have tried on the problem. This information helps the MSE Community to better provide guidance to help your learning. Regards. –  Amzoti Jan 26 '13 at 18:20
    
@Amzoti I've tried to solve by my own but I got stuck in the part I have to performe the union. –  Zignd Jan 26 '13 at 18:26

1 Answer 1

up vote 3 down vote accepted

We have $R=\{(1,2,3), (4,2,3), (4,5,6), (2,5,3), (1,2,6)\}$ and $S=\{(2,5,3), (2,5,4), (4,5,6), (1,2,3)\}$.

Can you now compute $R-S$ and $S-R$ as elementary operations on sets?

It's useful to notice that $R-S=R-(R\cap S)$ and $S-R=S-(R\cap S)$.

We have $R\cap S=\{(1,2,3), (4,5,6), (2,5,3)\}$.

It follows $R-S=\{(4,2,3), (1,2,6)\}$ and $S-R=\{(2,5,4)\}$, therefore $R\cup S=\{(4,2,3), (1,2,6), (2,5,4)\}$.

share|improve this answer
    
in order to performe the subtraction you have to use the difference set theory –  Zignd Jan 26 '13 at 18:19
    
@Zignd Yep. That is correct –  Rustyn Jan 26 '13 at 18:21
    
I got this R-S: 4 2 3, 1 2 6 and S-R: 2 5 4, if I'm right, so the union is the the 3 sets of numbers? –  Zignd Jan 26 '13 at 18:44
    
@Zignd That's correct.I'll write in the answer anyway. –  Git Gud Jan 26 '13 at 18:49

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.