2026-07-24

Problem — 2026-07-24

Medium

MediumCombinatorics

A museum curator is arranging 8 distinct paintings in a single row along a gallery wall. However, there are 3 pairs of paintings that are known to clash aesthetically (6 paintings total involved in these clashing relationships, with each painting appearing in at most one clash pair). The curator wants to ensure that no two clashing paintings are placed directly next to each other. How many valid arrangements exist?

Express as a whole number

Show solution
Let's use inclusion-exclusion to solve this problem. First, the total number of arrangements without restrictions is 8!=403208! = 40320. Let AiA_i be the set of arrangements where the ii-th clashing pair is adjacent. We want to find ∣A1∪A2∪A3‾∣=8!−∣A1∪A2∪A3∣|\overline{A_1 \cup A_2 \cup A_3}| = 8! - |A_1 \cup A_2 \cup A_3|. By inclusion-exclusion: |A_1 \cup A_2 \cup A_3| = |A_1| + |A_2| + |A_3| - |A_1 \cap A_2| - |A_1 \cap A_3| - |A_2 \cap A_3| + |A_1 \cap A_2 \cap A_3| **Computing ∣Ai∣|A_i|:** If we treat a clashing pair as a single unit, we have 7 objects to arrange, and the pair can be arranged internally in 2 ways. So ∣Ai∣=7!⋅2=10080|A_i| = 7! \cdot 2 = 10080 for each ii. Thus ∣A1∣+∣A2∣+∣A3∣=3⋅10080=30240|A_1| + |A_2| + |A_3| = 3 \cdot 10080 = 30240. **Computing ∣Ai∩Aj∣|A_i \cap A_j|:** Since the 6 paintings involved in clashes are all distinct (each appears in at most one pair), when two pairs are both adjacent, we treat both pairs as blocks. This gives us 6 objects to arrange (2 blocks + 2 individual paintings), with each block having 2 internal arrangements. So ∣Ai∩Aj∣=6!⋅2⋅2=720⋅4=2880|A_i \cap A_j| = 6! \cdot 2 \cdot 2 = 720 \cdot 4 = 2880 for each pair. Thus ∣A1∩A2∣+∣A1∩A3∣+∣A2∩A3∣=3⋅2880=8640|A_1 \cap A_2| + |A_1 \cap A_3| + |A_2 \cap A_3| = 3 \cdot 2880 = 8640. **Computing ∣A1∩A2∩A3∣|A_1 \cap A_2 \cap A_3|:** When all three pairs are adjacent, we have 5 objects (3 blocks + 2 individual paintings), with each block having 2 internal arrangements. So ∣A1∩A2∩A3∣=5!⋅23=120⋅8=960|A_1 \cap A_2 \cap A_3| = 5! \cdot 2^3 = 120 \cdot 8 = 960. **Final calculation:** |A_1 \cup A_2 \cup A_3| = 30240 - 8640 + 960 = 22560 Therefore, the number of valid arrangements is: 8! - 22560 = 40320 - 22560 = 31680