Regular expression a + b denotes the set:

Regular expression a + b denotes the set:

Answer: C. {a,b}In the context of regular expressions and formal language theory: The + operator (also written as | or U) represents UNION or logical OR. a denotes the set…

  1. A.

    {a}

  2. B.

    {∈, a, b}

  3. C.

    {a,b}

  4. D.

    None of these

Attempted by 447 students.

Show answer & explanation

Correct answer: C

In the context of regular expressions and formal language theory:

  • The + operator (also written as | or U) represents UNION or logical OR.

  • a denotes the set containing only the string "a", which is {a}.

  • b denotes the set containing only the string "b", which is {b}.

Therefore, a + b means the union of these two sets: {a} \cup {b}, which results in the set {a, b}. It matches either the string "a" or the string "b".

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…