2026-07-27

Problem — 2026-07-27

Medium

MediumCombinatorics

A museum curator is arranging 8 distinct paintings in a row along a gallery wall. However, 3 of these paintings are from the same artist and cannot be placed next to each other (no two of these 3 can be adjacent). In how many ways can the curator arrange all 8 paintings?

Enter your answer as a whole number

Show solution
We need to count arrangements of 8 distinct paintings where 3 specific paintings (call them A, B, C) are not adjacent to each other. **Solution using complementary counting:** Let's use the inclusion-exclusion principle. Call the 3 special paintings A, B, C and the other 5 paintings P₁, P₂, P₃, P₄, P₅. **Step 1:** Total arrangements with no restrictions: 8!=403208! = 40320 **Step 2:** Apply inclusion-exclusion to remove bad arrangements. Let: - S1S_1 = arrangements where A and B are adjacent - S2S_2 = arrangements where B and C are adjacent - S3S_3 = arrangements where A and C are adjacent We want: 8!−∣S1∪S2∪S3∣8! - |S_1 \cup S_2 \cup S_3| By inclusion-exclusion: ∣S1∪S2∪S3∣=∣S1∣+∣S2∣+∣S3∣−∣S1∩S2∣−∣S1∩S3∣−∣S2∩S3∣+∣S1∩S2∩S3∣|S_1 \cup S_2 \cup S_3| = |S_1| + |S_2| + |S_3| - |S_1 \cap S_2| - |S_1 \cap S_3| - |S_2 \cap S_3| + |S_1 \cap S_2 \cap S_3| **Step 3:** Calculate each term. ∣S1∣|S_1|: Treat AB as a single block. We have 7 objects to arrange (the AB block plus 6 other paintings). Within the block, A and B can be in 2 orders. ∣S1∣=7!×2=10080|S_1| = 7! \times 2 = 10080 By symmetry: ∣S2∣=∣S3∣=10080|S_2| = |S_3| = 10080 ∣S1∩S2∣|S_1 \cap S_2|: Both A-B and B-C are adjacent. This means A, B, C form a consecutive block with B in the middle, giving us ABC or CBA. We have 6 objects to arrange (the 3-block plus 5 other paintings). ∣S1∩S2∣=6!×2=1440|S_1 \cap S_2| = 6! \times 2 = 1440 Similarly: ∣S1∩S3∣|S_1 \cap S_3|: A-B adjacent AND A-C adjacent means BAC or CAB (A in middle). ∣S1∩S3∣=6!×2=1440|S_1 \cap S_3| = 6! \times 2 = 1440 ∣S2∩S3∣|S_2 \cap S_3|: B-C adjacent AND A-C adjacent means BCA or ACB (C in middle). ∣S2∩S3∣=6!×2=1440|S_2 \cap S_3| = 6! \times 2 = 1440 ∣S1∩S2∩S3∣|S_1 \cap S_2 \cap S_3|: All three pairs adjacent means all three form one block in some order. ∣S1∩S2∩S3∣=6!×3!=4320|S_1 \cap S_2 \cap S_3| = 6! \times 3! = 4320 **Step 4:** Apply inclusion-exclusion: ∣S1∪S2∪S3∣=3(10080)−3(1440)+4320=30240−4320+4320=30240|S_1 \cup S_2 \cup S_3| = 3(10080) - 3(1440) + 4320 = 30240 - 4320 + 4320 = 30240 Wait, let me recalculate the last term. If all three must be mutually adjacent (forming one consecutive block), they can be arranged in 3!=63! = 6 ways, and we have 6 objects total. ∣S1∩S2∩S3∣=6!×6=4320|S_1 \cap S_2 \cap S_3| = 6! \times 6 = 4320 So: ∣S1∪S2∪S3∣=30240−4320+4320=30240|S_1 \cup S_2 \cup S_3| = 30240 - 4320 + 4320 = 30240 However, this counts arrangements where at least one pair is adjacent. Actually, let me reconsider: ∣S1∩S2∩S3∣|S_1 \cap S_2 \cap S_3| means all three conditions hold, but A-B adjacent AND B-C adjacent already implies ABC or CBA as a block. Adding A-C adjacent doesn't further restrict when A,B,C are already consecutive. So ∣S1∩S2∩S3∣=6!×6=4320|S_1 \cap S_2 \cap S_3| = 6! \times 6 = 4320 Therefore: 30240−4320+4320=3024030240 - 4320 + 4320 = 30240 Answer: 40320−30240=1008040320 - 30240 = 10080 Wait, this seems too large. Let me reconsider with a direct approach. **Alternative: Direct counting** First arrange the 5 ordinary paintings: 5!5! ways. This creates 6 gaps: _P₁_P₂_P₃_P₄_P₅_ We need to place A, B, C in these gaps such that no two occupy the same gap. This is choosing 3 gaps from 6 and arranging A,B,C: (63)×3!=20×6=120\binom{6}{3} \times 3! = 20 \times 6 = 120 Total: 5!×120=120×120=144005! \times 120 = 120 \times 120 = 14400