TOC PYQ 2019 Solution

by

Last updated on Dec 29, 2023
TOC PYQ 2021 Solution

Question 1 (a): Prove that for all sets S, (S+)=S.

To prove that for all sets S, (S+)=S, we need to show that (S+)* is a subset of S* and S* is a subset of (S+)*.

Let’s start by proving that (S+)* is a subset of S*.

(S+)* is the set of all strings that can be formed by concatenating one or more strings from S. S* is the set of all strings that can be formed by concatenating zero or more strings from S. Since (S+)* includes all the strings in S*, (S+)* is a subset of S*.

Now let’s prove that S* is a subset of (S+)*.

S* is the set of all strings that can be formed by concatenating zero or more strings from S. Since the empty string is included in S*, it is also included in (S+). Therefore, S is a subset of (S+)*.

Since (S+)* is a subset of S* and S* is a subset of (S+), we can conclude that (S+)=S* for all sets S.

Question 1 (b): Give regular expression for the language of all strings that do not end with double letter.

The regular expression for the language of all strings that do not end with a double letter is ((a|b)*|(a|b)*ab|(a|b)*ba) .

This regular expression can be broken down into three parts:

  • (a|b)*: This part matches all strings that end with a single letter.
  • (a|b)*ab: This part matches all strings that end with an a followed by a b.
  • (a|b)*ba: This part matches all strings that end with a b followed by an a.

By combining these three parts using the | operator, we can match all strings that do not end with a double letter.

Congratulations on completing two free questions! To continue your quest for knowledge and unlock the full solution of TOC PYQ 2021 Solution, consider purchasing our full solution by clicking here.

We also have an exclusive discount on the 2017 + 2019 solution Bundle for you, if you want to purchase both solution once then you can click here to purchase the bundle to get ₹100 off.

How useful was this post?

5 star mean very useful & 1 star means not useful at all.

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Tags: