ACtE07 · Chapter 7Theory of Computation & Graphics🏛️ Past Licensure QuestionID: ac0119d7
How many strings of length strictly less than 4 (i.e., lengths 0, 1, 2, 3) are contained in the language described by the regular expression ?
How many strings of length strictly less than 4 (i.e., lengths 0, 1, 2, 3) are contained in the language described by the regular expression ?
Multiple Choice Options
- A
7
- B
10
- C
11
- D✓ Correct Option
12
Detailed Technical Solution & Explanation
Let alphabet . Every string in this language contains at least one 'y'.
•
Length 0: 0 strings (needs at least one ).
•
Length 1: string 'y' (1 string).
•
Length 2: , , , (4 strings).
•
Length 3: strings of length 3 containing at position 1, 2, or 3:
- at pos 1: (4 strings).
- at pos 2: 1 symbol from (4 strings, minus overlap with pos 1 ).
- at pos 3: 2 symbols from (4 strings, minus overlap with earlier).
Summing distinct valid strings of length gives exactly 12 strings.
Option Analysis:
•
Option A (7): Under-count.
•
Option B (10): Under-count.
•
Option C (11): Under-count by 1.
•
Option D (12): Correct. Exactly 12 valid strings of lengths 1, 2, and 3.
Reference: Mock Test 02NEC Licensure Syllabus