سوال ۱۱۳ کنکور ارشد علوم کامپیوتر ۱۴۰۳
چند رشته ۱۰ رقمی از ارقام ۱، ۲ و ۳ وجود دارد که یا در پنج رقم سمت چپ، هیچ رقمی برابر ۱ نباشد یا در پنج رقم سمت راست، هیچ رقمی برابر ۲ نباشد؟
پاسخ صحیح: گزینهٔ C —
We count strings of length over the alphabet . Define two events:
- : the five leftmost digits contain no (each left digit ).
- : the five rightmost digits contain no (each right digit ).
We want and use inclusion-exclusion:
Count . The 5 left positions each have choices () and the 5 right positions are unrestricted ( choices each):
Count . Symmetrically, the 5 right positions each have choices () and the 5 left positions are free:
Count . Now the left 5 are restricted to and the right 5 to . These constraints touch disjoint positions, so
Combine.
Since and ,
Numerically . This is option 3.
Pitfall: Do not just add (which gives , the near-miss option 4 idea) — the overlap is double-counted. Subtracting turns into .