-1

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.

Rustyn
  • 8,407
Zignd
  • 127
  • 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 Answers1

3

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)\}$.

Git Gud
  • 31,356