0
$\begingroup$

With reference to the question, posted by me at Stackoverflow here, i want to know the mathematical details about the concept.

Below is my question.

In multiple set, which contains Integers, I want to get all those elements, which has no duplicate. i.e. which came only once in union of all the Set. Ex: consider set first contains {2,4,6,8,9}, second set contains {2,8,9} and third set contains {2,4,8,9}. In all these sets, element 6 occurs only once.

Somebody please explain the set theory behind it.

  • 0
    The word "intersection" comes to mind.2012-12-08

2 Answers 2

1

Here's what I see in the question:

  1. Union of the 3 sets: U = {2,4,6,8,9}
  2. A counter -function which counts how many times each number is used: $f : U\rightarrow N,$ $f = \{2\rightarrow 3, 4 \rightarrow 2, 6 \rightarrow 1, 8 \rightarrow 3, 9\rightarrow 3\}$
  3. An equation which chooses the elements where count is one: f(X)=1.
  4. The resulting set: X = {6}
  • 0
    I think you have it right, but in step 2 the function could just return 1 or "more than 1". I don't know if that makes it easier.2012-12-08
0

The set theory formulation of your problem would be to let $A_i$ be your input sets. Let $\phi(x)=\exists i \exists j (i \neq j \wedge x \in A_i \wedge x \in A_j)$ Then your output is the set $\{y | y \in \bigcup A_i \wedge \lnot \phi(y)\}$. I'm not sure this explains anything.