Back to the 2021 paper

Module 1: Introduction & Regular Languages

20212m

The construction time for DFA from NFA with mm nodes is:

(i) O(m2)O(m^2)
(ii) O(2m)O(2^m)
(iii) O(m)O(m)
(iv) O(log⁡m)O(\log m)

Worked SolutionAI Assisted

Answer

Correct Option: (ii) O(2m)O(2^{m})

Explanation

NFA with mm states → DFA via subset construction:

Number of DFA states =2m= 2^{m} in worst case, and constructing each state requires processing transitions for each symbol (∣Σ∣|\Sigma|).

Time is proportional to number of subsets times alphabet:

T=O(∣Σ∣⋅2m)=O(2m)T = O(|\Sigma| \cdot 2^{m}) = O(2^{m})

(If counting edges, O(m⋅2m)O(m \cdot 2^{m}) but dominant exponential.)

Options:

  • O(m2)O(m^2) — polynomial, false for NFA→DFA
  • O(m)O(m) — linear, false
  • O(log⁡m)O(\log m) — false

Final Answer

O(2m)O(2^{m}) → Option (ii).

Similar questions

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.