Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have variables $a, b, c, d \in N^+$, how do I express the condition that all their values must be different? Also, what field of mathematics covers ways of expressing constraints? I couldn't even find an adequate way to tag this question.

share|cite|improve this question
ok what do I do when many answers seem to be equally valid ? – pwned Feb 26 '13 at 13:56
Upvote them all. – AJMansfield Feb 26 '13 at 13:57
@AJMansfield done and done, but they all represent what I want to do in ways I could express algorithmically. This place is like a treasure trove – pwned Feb 26 '13 at 13:58
then just try using them for whatever you need then for, and accept the one that ends up being used. – AJMansfield Feb 26 '13 at 14:01
Who would believe this simple question would give rise to so much alternatives... – vonbrand Feb 26 '13 at 15:04
up vote 9 down vote accepted

If you don't mind relabelling the variables so that they are in ascending order, you could write $a < b < c < d$. Otherwise, the phrase "pairwise distinct" is often used.

share|cite|improve this answer
this answer has taught me the most through reading about finer differences between "pairwise distinct" and "unique". – pwned Feb 26 '13 at 14:25

I think it's fine to just say that "$a$, $b$, $c$, $d$ are all different". This is precise, clear, and easy to understand. Someone might be able to concoct a clever way to say the same thing symbolically, but I suspect it will be far less clear. Doing mathematics doesn't require you to sprinkle strange symbols throughout your writing.

The confusing discussion in the comments seems to suggest that my approach is a good one :-)

share|cite|improve this answer

$| \{ a , b , c , d \} | = 4$.

(But I would never use that. I'd only say "$a , b ,c ,d \in N^+$ are distinct.")

share|cite|improve this answer
I really like the idea, though – pwned Feb 26 '13 at 13:43
@pwned, I don't. You want to express the idea as clearly as possible to fellow humans. If you extend this to, say, 10 variables, nobody will understand a thing (remember the standard mathematician's number line ;-) – vonbrand Feb 26 '13 at 14:59
Too indirect (though better than many of the other suggestions). It says that the set has cardinality equal to four. The reader has to infer from this that a, b, c, d are all different. Why make the reader do this work? Why not just tell the reader directly what you want him to know? – bubba Feb 27 '13 at 6:08
@bubba: I wouldn't say indirect, though as the parenthetical comment in my answer hints at, I don't find it particularly natural. It has the advantage that it would work regardless of the underlying set. It has the disadvantage that unless you index the elements of the finite collection by consecutive natural numbers, after about $7$ or $8$ the reader would have to spend a bit of time discerning exactly what is said: e.g., " $\{ a,q,c,w,e,r,g,t,i,y\} | = 9$". – arjafi Feb 27 '13 at 6:39
@Arthur -- OK, well I like your parenthetical answer a lot better (as you do, I think). BTW, I think it should be "=10" in you last example. Maybe you were just illustrating the fact that counting is error-prone once you get past 7 or 8. – bubba Feb 27 '13 at 9:10

There are fine examples already, I just wanted to mention, that is is possible to do it by single inequality:

$$\prod_{i\neq j}(x_i-x_j) \neq 0,$$

to be more specific

$$\big((a-b)(a-c)(a-d)(b-c)(b-d)(c-d)\big)^2 > 0.$$


share|cite|improve this answer
Better yet: you could multiply this out! Obfuscation ahoy! :-) – arjafi Feb 26 '13 at 14:02
+1 cool but why square the result? is square root symbol too ugly? – pwned Feb 26 '13 at 14:29
@pwned It's just to write $>$ instead of $\neq$, besides that it doesn't matter. Also, for natural numbers, bitwise XORs would do the job too. – dtldarek Feb 26 '13 at 14:38
This is pretty much the same as saying $x_i \neq x_j\forall(i \neq j)$ , or simply $x_i = x_j \Rightarrow i = j$ . Either way, it doesn't work too well with a,b,c and d. – Kobi Feb 26 '13 at 15:05

You could phrase it $$\{a,b,c,d\} = S \subseteq N^+ \ni \exists \;f:S\leftrightarrow \{1,2,3,4\}$$ I am naming the set $\{a,b,c,d\}$ as $S \subseteq N^+$, and saying that there must be a one-to-one mapping between set $S$ and a second set $\{1,2,3,4\}$ that we already know has four distinct members.

share|cite|improve this answer
Changed my answer to be completely different. – AJMansfield Feb 26 '13 at 14:05
@AJMansfield Is this a function definition? could you elaborate a bit for someone who didn't attend to a discrete mathematics course? – pwned Feb 26 '13 at 14:06
Strange and misleading. – Damian Sobota Feb 26 '13 at 14:08
so it is a cool way of counting elements in a set hehe – pwned Feb 26 '13 at 14:19
Maybe it's cool, maybe it's not -- that's a matter of taste. But, what's more important here -- being cool, or being clear? Do you want to impress the reader with your ingenuity, or do you want to make it easy for him/her to understand what you wrote? – bubba Feb 27 '13 at 6:27


share|cite|improve this answer
This doesn't say they must be different. – Stefan Hansen Feb 26 '13 at 13:31
In the usual systems of set theory {1,1} is a set, but it's equal to {1}. – Ben Millwood Feb 26 '13 at 13:34
@mezhang: Absolutely not. A set can be written in the "curly-brace" notation by listing all elements however often you want. $\{ 1 \}$ is a set, so is $\{ 1,1\}$ and $\{ 1,1,1 \}$ and $\{ 1,1,1,1 \}$, etc. They just happen to represent the same set. – arjafi Feb 26 '13 at 13:34
No, it isn't. The multisets {1,1} and {1} are not equal, but the sets are equal. – Ben Millwood Feb 26 '13 at 13:35
This is a notational question, not a mathematical one. The most common convention is the one I, Arthur and Stefan have all mentioned. – Ben Millwood Feb 26 '13 at 13:39

Your Answer


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.