سوال ۱۱۳ کنکور ارشد علوم کامپیوتر ۱۴۰۴
فرض کنید t تعداد جایگشتهای حروف کلمه AAABBCCCDD باشد، که در آن کلمه AB ظاهر نشده است. مقدار در کدام بازه، قرار دارد؟
پاسخ صحیح: گزینهٔ C —
The word is a multiset with A's, B's, C's and D's, for letters in total.
Total arrangements. Counting all distinguishable permutations of the multiset:
Subtract those containing the substring . Use inclusion–exclusion on the number of glued blocks. Forming copies of the super-letter "" uses up A's and B's, leaving A's and B's. Since we have only B's, at most blocks are possible. The number of arrangements that contain (at least) chosen disjoint blocks is where the extra accounts for the identical blocks.
Arrangements with no substring (inclusion–exclusion ):
Final value.
Since , the value lies in — option 3.
Exam trick: For a forbidden adjacency in a multiset, glue the pattern into a super-letter and apply inclusion–exclusion over the number of glued copies; remember to divide by because the identical blocks are interchangeable.