What is the mathematical "set" function can be used to represent the uniqueness of a set?

65 Views Asked by At

What is the mathematical set function that can satisfy the following

if X = (1, 2, 3, 4, 5), Y = (1, 3, 4, 2, 5), Z = (1, 1, 3, 2, 5);

Then

F(X) = F(Y) ≠ F(Z)

what function "F" can be used to check that a specific known set is equal to another set regardless of the order of its values.

I hope I could explain it enough

As an example, I thought of the "Sum" function for the range from 1 to 4 but:

Sum(1,2,3,4) will be equal to Sum(2,2,3,3)

Thanks

3

There are 3 best solutions below

7
On BEST ANSWER

What you are looking at here are not sets but (presumably finite) sequences, or tuples. Sets don't have repeated elements, and the elements in a set are not in any particular order. To write a tuple we use parentheses instead of curly braces, so your examples would be $(1,2,3,4,5)$, $(1,1,3,2,5)$, etc.

You can assign an integer to any tuple of positive integers that uniquely determines the tuple. Namely, let $p_1,p_2,\ldots$ be the primes in order and let $(a_1,\ldots,a_n)$ be the tuple, and define $$F(a_1,\ldots,a_n)=p_1^{a_1}p_2^{a_2}\cdots p_n^{a_n}$$ Then two tuples will be equal if and only if the associated integers are equal, by unique factorization of integers.

Edit: I noticed that in your post you said you want to ignore the order of the elements. In that case you could do instead $$F(a_1,\ldots,a_n)=p_{a_1}p_{a_2}\cdots p_{a_n}$$

3
On

If you want to compare two sets at once, the binary function that indicates whether two arguments are equal is known as the Kronecker delta and is defined simply as $\delta_{ij}=\begin{cases}1,&i=j\\0,&\text{else}\end{cases}$. It is usually defined for integers but you could extend its definition to sets, e.g., $\delta(X,Y)=\begin{cases}1,&X=Y\\0,&\text{else}\end{cases}$. This is effectively just an algebraic way of saying whether the sets are equal. Equality of sets is defined regardless of the order of their elements so that isn't a problem.

Alternatively, if you want to compare sets by individually assigning each of them a value as you suggested in the question, you could do something along the lines of encoding the sets sorted elements into a number. But I don't think there is any benefit to this.

Efficient ways of encoding the elements will depend on whether the elements are integers or reals, whether the set is finite, etc. For your finite sets of integers, you could assign the integers a prime, $p_i$, and encode each integer's digits on the prime indexed digits of the function's value. Primes are useful since no two elements digits will coincide. So you would have $f(X)=f(\left\{1,2,3,4,5\right\})=50004030210$ since we assign $1\mapsto 2$, $2\mapsto3$, $3\mapsto 5$, etc and we ignore the value of the unit decimal by setting it to $0$. We could then extract the elements, e.g., $5$ by looking at the decimals of $50004030210$ that are multiples of $11$. We would then have $f(Y)=f(\left\{1,3,4,2,5\right\})=f(\left\{1,2,3,4,5\right\})=50004030210$ after sorting. The values are equal but this doesn't tell us much since we had to sort the argument sets anyway, and I think we would inevitably have to if we wanted to compare them. $Z$ isn't a true set; it's a multiset. In a true set, elements can appear at most once. Regardless, its two $1$'s can be encoded just like any other number. So, you would have $f(Z)=50003020110$, which is not equal.

If you had real number elements, or infinite elements, you could adapt your procedure to encoding sets in real number values, where the prime indexed decimal expansion of the number encodes each element.

0
On

I'm not sure I understand your question properly, but it seems you are searching for the function $F:X^n\to \mathcal{P}(X)$ (where $\mathcal{P}(X)$ is the set of subsets of $X$) given by $$(x_1,\dots,x_n) \mapsto \{x_1,\dots,x_n\}. $$

Indeed it will detect only the set of elements in your tuple, regardless of order or repetitions, and will satisfy the example in your question.