ITPEC FE Morning October 2018 Question 2
Topic: Basic Theory
Among the bit strings of length 4, how many of them either start with 1 or end with 00?
Explanation
10 — count the two sets separately, then subtract the strings counted twice.
- •Start with 1: the first bit is fixed and 3 bits are free, 23 = 8 strings
- •End with 00: two bits are fixed and 2 are free, 22 = 4 strings
- •Both, pattern
1?00: one free bit, 21 = 2 strings (1000and1100) - •Either: 8 + 4 − 2 = 10
Answer (c)
Why not others:
- •(a) 4 — counts only the strings that end with 00
- •(b) 8 — counts only the strings that start with 1
- •(d) 12 — adds 8 + 4 without subtracting
1000and1100, which belong to both sets
Key rule: For "A or B", use inclusion–exclusion: |A ∪ B| = |A| + |B| − |A ∩ B|.
Basic Theory · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.