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.

  • 1
    $\begingroup$ I'm not sure what is the question, but I am fairly certain that it's not set theory. I have tagged it as elementary set theory, but I'm not 100% convinced that it fits either. Someone else who understands what is asked here please retag or confirm my retag. Thanks. $\endgroup$ – Asaf Karagila Dec 8 '12 at 14:58
  • $\begingroup$ @AsafKaragila: Hey, it is elementary set theory only. Basic set theory operations may help. But don't know how :( $\endgroup$ – Ravi Joshi Dec 8 '12 at 15:01
  • $\begingroup$ The word "intersection" comes to mind. $\endgroup$ – Asaf Karagila Dec 8 '12 at 17:14

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}
  • $\begingroup$ 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. $\endgroup$ – Ross Millikan Dec 8 '12 at 16:54

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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