Q: In how many different ways can the set {1,2,3,4,5} be arranged so that all odd numbers are next to each other?
Doesn’t a set mean the order of the numbers doesn’t matter? Greg solved this problem by counting the different arrangements of the odd numbers, but I thought order doesn’t matter in a set and my answer was 6. Am I understanding this wrong?
Yes, you are correct that the order of the numbers within a set does not matter (i.e. {1,2} = {2,1}), but in this question, they mean you should rearrange the numbers belonging to that set 1,2,3,4,5.
Here are the 3 possible arrangements:
all 3 odds on the left: odd odd odd even even (i.e. 1,3,5,2,4)
all 3 odds in the middle 3 spots: even odd odd odd even (i.e. 2,1,3,5,4)
all 3 odds on the right: even even odd odd odd (i.e. 2,4,1,3,5)
There is 3! ways to shuffle the odds in each case. There is 2! ways to shuffle the evens, so there are 3!2! ways to get each of the 3 above cases. Therefore, there are 3!2! (case 1) + 3!2! (case 2) +3!2! (case 3) = 12 + 12 + 12 = 36 ways total.