Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

Suppose that I am given n consecutive dates for buying and selling shares . So what are the number of ways of choosing a pair of buy date and sell date such that buy date always precede sale date ?

share|cite|improve this question
up vote 3 down vote accepted

Pick any two distinct dates. There are $\binom{n}{2}=\frac{n(n-1)}{2}$ ways to do this. Label the earlier one buy, the later one sell.

I have interpreted "earlier" as meaning different. It is always possible to buy one day and sell later the same day. With that interpretation, there are $n$ additional possibilities.

share|cite|improve this answer
Can you explain how is it n(n−1)/2? What is the term inside the brackets called ? – Geek Aug 1 '12 at 7:36
This is a binomial coefficient. One high school notation for the same thing is ${}_n\text{C}_2$, often pronounced in english "$n$ choose $2$." There are other notations, like $C(n,2)$, or $C_2^n$. To see that there are $\frac{n(n-1)}{2}$ ways to do this, write down one date. There are $n$ ways to do this. For each choice, there are $n-1$ ways to write a different date, for a total of $n(n-1)$. For half these choices, the first date chosen will be later than the second date chosen.So the number of pairs $(a,b)$ such that $a$ is earlier than $b$ is $\frac{n(n-1)}{2}$. – André Nicolas Aug 1 '12 at 7:43

I think it's just (n choose 2). You just need the number of ways to pick two distinct dates. The earlier one is the buy date. The later is the sell date.

share|cite|improve this answer

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.