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

There are 10 types of fruits, of them 1 type is apples. You have to pick 4 of fruits, but max 2 apples. How many ways are there for you to pick fruits?

share|cite|improve this question
Since you are new, I want to give some advice about the site: To get the best possible answers, you should explain what your thoughts on the problem are so far. That way, people won't tell you things you already know, and they can write answers at an appropriate level; also, people are much more willing to help you if you show that you've tried the problem yourself. If this is homework, please add the [homework] tag; people will still help, so don't worry. – Zev Chonoles Jan 2 '13 at 21:59


In how many ways can you pick the fruits without apples?

In how many ways can you pick them with 1 apple?

In how many ways can you pick them with 2 apples?

What's the sum of those?

share|cite|improve this answer

Let $x_1$ be the number of apples that you choose, and let $x_2,x_3,\dots,x_{10}$ be the numbers of the other nine types of fruit that you choose. The answer to your question is the number of solutions in non-negative integers of the equation


subject to the condition that $x_1\le 2$.

Without that extra condition limiting the value of $x_1$, this is a standard stars-and-bars problem, and the answer is


(The reasoning behind this formula is explained reasonably well in the linked article.)

However, we have to subtract from this the solutions that have $x_1>2$. If we choose at least $3$ apples, there are $10$ ways to choose the fourth piece of fruit, so there are just $10$ of these unacceptable choices, and the final answer is $715-10=705$.

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.