TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. 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

Is there a notation that expresses a summation over all order-independent combinations of two variables? I have a single set of objects and want to show the summation of the joint probabilities of each unordered pair of those objects. I want it to be clear I'm not counting duplicate pairs, because the order of the elements doesn't matter.

For example, if I have the set:

w = [dog, cat, bear]

I want to convey:

Z = P(dog, cat) + P(dog, bear) + P(cat, bear)


Z = P(dog, cat) + P(dog, bear) + P(cat, dog) + P(cat, bear) + P(bear, dog) + P(bear, cat)


share|improve this question
How about defining a set: "Let $C_w$ be the set of all unordered pairs $(i,j)$ where $i,j\in w$" and using that? – Werner Jun 10 '12 at 6:09
It's a math question. If you found out how it looks like it's easy to find out how to set up the formula in latex. – 5chdn Jun 10 '12 at 6:19
Thanks Werner, I think I'll go with that approach. – mrjf Jun 10 '12 at 6:47
@Scott: To be honest, I don't really understand your notation. I'm not familiar with \binom{A}{2} for a set A, and then shouldn't it be P(i,j)? (To add context, I'm a mathematician :-)) – Hendrik Vogt Jun 10 '12 at 7:44
You're right, I typed that quickly. A would be the set of indices, when A choose 2 just represents the set of two element subsets of A. Thinking now, wouldn't simply i<j beneath the summation accomplish what is required? – Scott H. Jun 10 '12 at 8:22
up vote 3 down vote accepted

It looks like this has already been answered in the comments. As an alternative, if order doesn't matter, then you could impose some order on your indices to use fairly standard notation:


    \sum_{\mathclap{a\leq i<j\leq b}}P(w_i,w_j)
    \sum_{\substack{i<j\\i,j\in A}} \!P(w_i,w_j)


If you have a range of indices then the first option might be preferable, while if you have an arbitrary set of indices (or don't like the first option) then you might prefer the second.

share|improve this answer
Accepting. Answers in comments above also good. Thanks everyone! – mrjf Jun 10 '12 at 20:30

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.