# Homework Help: Probability Midterm Question: Fruit row counting

1. Oct 25, 2012

### DrAlexMV

1. The problem statement, all variables and given/known data

You have 10 pieces of fruits of which 1 is an orange, 1 is an apple, 1 is a pear, and 1 is a peach. How many ways are there to organize them in a row if the apples and oranges must be together and the pears and peaches cannot be together.

2. Relevant equations

Mostly factorials

3. The attempt at a solution

Total permutations = 10!
Ways oranges and apples are together = 2!9!
Ways peaches and pears cannot be together = 10! - 2!9!

Unfortunately, I did not know how to combine them so in a futile attempt to get credit I stated:

(10! - 2!9! + 2!9!)/(2!2!) = 10!/4

I am darn sure this is wrong. Could somebody enlighten me for the next time?

2. Oct 25, 2012

### Ibix

Can you calculate the number of configurations where the apple and orange are together and the peach and the pear are together?

3. Oct 25, 2012

### DrAlexMV

^ 8!2!2!

Right?

4. Oct 25, 2012

### Ibix

Agreed. So if you know how many configurations satisfy one constraint, and how many configurations satisfy that constraint but violate the second, what's the number you are looking for?

Edit: by the way, the question is not explicit on the point, but you appear to be assuming that the other six fruits are distinguishable - not all bananas, or something.

5. Oct 25, 2012

### DrAlexMV

I am actually not sure how to combine these without counting things more twice. Could you aid me through that?

6. Oct 25, 2012

### Ibix

I suspect that the point you are missing is that the 8!2!2! are a subset of the 9!2!. Think of it this way - write every possible configuration on 10! pieces of paper, one per piece. Then split that pile in two according to whether or not the apple and orange are together. Then split the pile where they are together by whether or not the peach and pear are together. You know how many there were before that second split, and you know how many are in the wrong pile after. How many are in the right pile?