سوال ۱۱۶ کنکور ارشد علوم کامپیوتر ۱۴۰۱
تعداد کل رشتههای به طول n با نمادهای ۴ و ۳ و ۲ و ۱ و ۰ بهطوریکه مجموع تعداد ۰ها و ۱های ظاهر شده زوج باشد چقدر است؟
پاسخ صحیح: گزینهٔ A —
We count strings of length over the -letter alphabet in which the number of positions holding a or a is even.
Split the alphabet into two groups.
- Marked symbols: — there are of them.
- Unmarked symbols: — there are of them.
The condition only cares about how many positions are marked; the actual identities of marked/unmarked symbols are free. If exactly of the positions are marked, the number of such strings is
We need even, so the answer is
Extract the even-index sum with the trick. For any ,
Adding these cancels every odd term and doubles every even term:
Plug in (marked) and (unmarked):
This is option 1.
Sanity checks.
- : only have an even (zero) count of marked symbols strings. Formula: . ✓
- : . Direct: marked gives , marked gives , total . ✓
Exam trick: To count arrangements where a subset of symbols must occur an even number of times, collapse the alphabet into "marked" ( choices) and "unmarked" ( choices), then read off the even part of as . Here it instantly gives .