1

I hope someone can help me with some combinations (and perhaps permutations).

This is still the hardest area of math for me, but I'm still trying.

This is a two part question.

(1)

I have a bag of apples (A) and a bag of bananas (B), I would like to find out in how many different ways I can pick 5 different fruits.

Order is important, so AABBB is different from ABBBA.

(2)

Let's now say I have to pick 3 apples and 2 bananas, how many unique ways can I do this?

I know this will be a subset of the result sets in question 1, but I don't know how to find the answer.

I've been searching for an answer to this, but I keep getting answers to when the amount of picks are fewer than the selections, which is opposite to this, where I need to pick 5 from only 2 choices.

Thanks in advance.

4 Answers4

1

1: For each slot 1 to 5 we have 2 options, and they are all independent of another. The total number of configurations is therefore $2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 = 2^5 = 32$.

2: Here you want to use combinations. Basically, imagine you're drawing 3 positions (without replacement, order doesn't matter) for the apples from a bag with labels $\{1, 2, 3, 4, 5\}$. The number of different configurations there equals the number of different ways to draw 3 apples and 2 bananas, and equals ${5 \choose 3} = 10$.

Mark
  • 1,433
  • Thanks Mark. I can see the logic in the first one, and I guess the second one was too simple.

    I am trying to solve a bigger problem, so what if I modify the situation, and I add a bag of carrots (C). I now have to pick 1 apple, 2 bananas and 3 carrots. In how many unique ways can I do this?

    Thanks again for your help.

    – Ole Drews Jensen Jun 16 '15 at 13:26
  • To stick with the numbers and fruits from your original question (so 3 apples and 2 bananas), let's say you add one carrot. If you have a fixed configuration of length 5 where you choose 3 apples and 2 bananas, say AABBA, how many ways do you have to insert a carrot in that sequence (e.g. to form ACABBA)? Note that dropping the carrot yields the original sequence of just apples and bananas, hence all apple-banana sequences are independent with this carrot inserting operation, so you can just multiply the number of apple-banana sequences with the number of ways to insert a carrot. – Mark Jun 16 '15 at 13:31
  • 1
    Thanks Mark. I think I'm beginning to understand the logic now. I could say that if I have 3 apples, 2 bananas and 1 carrot, I could do it step by step by saying 3 apples in 3 spots has 1 solution. I then add 2 spots for the bananas, and calculate how many ways I can place 2 bananas in 5 spots which I believe is 10. So I now have 1 x 10. I then add one more spot for the carrot, and calculate how many ways a carrot can fit in 6 spots, which is 6, which I multiply again. So the result is 1 x 10 x 6 = 60. Or did I fall off the track here? :-) – Ole Drews Jensen Jun 16 '15 at 13:38
  • Yes, that's correct! – Mark Jun 16 '15 at 13:58
1

An effort to give you some understanding about the second case.

Let the apples have the numbers $1,2$ and let the bananas have the numbers $3,4,5$. These $5$ numbers can be arranged in $5!$ ways. However, if we compare the possibilities $12345$ and $21456$ then both stand for $AABBB$. You could say that combination $AABBB$ will be counted this way more than once. How many times is it counted then? Note that $12$ and $21$ both result in $AA$ (there are $2!=2$ possibilities) and that $345$, $354$, $435$, $453$, $534$ and $543$ all result in $BBB$ (there are $3!=6$ possibilities). That means that $AABBB$ is counted $2!3!=12$ times. This is also the case for any other combination. So to find the number of "essentially different" arrangements you should divide $5!$ by $2!3!$.

More generally if there are $n_i$ "i-fruits" for $i=1,\dots,k$ then the correct answer will be: $$\frac{(n_1+\cdots+n_k)!}{n_1!\times\cdots\times n_k!}$$

drhab
  • 151,093
0

1) Clearly there's symmetry, so the number of ways to chose 1 banana and 4 apples and 4 bananas and 1 apples is the same. Now use binomial coefficients. The answeer should be $2^5$.

2) Use binomial coefficients.

Alex
  • 19,262
  • Thanks Alex. I can see the first one makes sense, as that's just like 5 bits.

    Not too familiar with binomial coefficients. Guess I can do some research on that.

    – Ole Drews Jensen Jun 16 '15 at 13:24
  • The solution is essentially a sum over 6 binomial coefficients. A binomial coefficient counts the number of ways of allocating $k$ items in $n$ slots. – Alex Jun 16 '15 at 13:30
0

Suppose for a second that your have A(1), A(2), A(3), B(1), and B(2), where all the apples and banana's are distinguishable.

It's easy to see that to order all of these in any way, you have 5!(5 for the first place, 4 for the second, etc). We then divide by 3! and 2! because they really aren't distinguishable, so we're overcounting a number of cases. But this gets 10 ways to order 3 apples and 2 bananas.

I remember I was taught this method, so how come other people get 32? Is there something wrong with my logic?

Kbot
  • 533
  • Hi Kbot. I think you're confusing two different scenarios. The 32 is when you can fill any spot with A or B, so AAAAA and BBBBB are both valid. You therefore have 2 options for each 5 spot which is 5^2=32. However, if you have 3 apples and 2 bananas, you can take my (weird) logic and say that you can place 3 apples in 3 spots in 1 way. Then add 2 spots for the bananas, and you can now put 2 bananas in 5 spots in 4+3+2+1 = 10 UNIQUE ways. So you take 1 x 10 = 10, which would be the answer. – Ole Drews Jensen Jun 16 '15 at 13:58
  • You solved (2) instead of (1). The answer for (2) is indeed 10. – Mark Jun 16 '15 at 14:00
  • @OleDrewsJensen Note that putting 2 bananas in 5 spots does give 10 unique ways, but I'm not sure whether you're right in calculating $4 + 3 + 2 + 1$. You should use $5 \choose 2$. – Mark Jun 16 '15 at 14:01
  • If I have 5 spots and put first apple in spot 1, I have 4 choices for apple 2. Next I put first apple in spot 2, now I have 3 choices for apple 2, as I can't place it in the first spot (that would be a repeat). So, I end up having 4+3+2+1 choices = 10. :-) – Ole Drews Jensen Jun 16 '15 at 14:11