Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which among the following cannot be accepted ... Start Learning for Free
Which among the following cannot be accepted by a regular grammar?
  • a)
    L is a set of numbers divisible by 2
  • b)
    L is a set of binary complement
  • c)
    L is a set of string with odd number of 0
  • d)
    L is a set of 0n1n
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Which among the following cannot be accepted by a regular grammar?a)L ...
There exists no finite automata to accept the given language i.e. 0n1n. For other options, it is possible to make a dfa or nfa representing the language set.

A Non-Regular Grammar 
may or may not produce a Regular Language

Hence, the correct answer is Option D

View all questions of this test
Most Upvoted Answer
Which among the following cannot be accepted by a regular grammar?a)L ...
Explanation:

Regular Grammar:
A regular grammar is a formal grammar that generates regular languages. A regular language is a language that can be expressed using a regular expression or a finite automaton.

Given options:
a) L is a set of numbers divisible by 2
- This can be expressed using a regular grammar as it is a regular language.

b) L is a set of binary complement
- This can be expressed using a regular grammar as it is a regular language.

c) L is a set of string with odd number of 0
- This can be expressed using a regular grammar as it is a regular language.

d) L is a set of 0^n1^n
- This language cannot be expressed using a regular grammar.

Explanation for option d:
The language L is a set of strings of the form 0^n1^n, where n is any positive integer. This language is not a regular language, thus it cannot be expressed using a regular grammar. This can be proved using the pumping lemma for regular languages.

Pumping lemma:
The pumping lemma for regular languages states that if a language L is regular, then there exists a constant n such that any string w in L with length greater than or equal to n can be divided into three parts, w = xyz, such that:
- |xy| ≤ n
- |y| ≥ 1
- for all i ≥ 0, xy^iz ∈ L

Using the pumping lemma, we can prove that the language L = {0^n1^n | n ≥ 1} is not a regular language.

Proof:
Assume that L is a regular language. Then, there exists a constant n such that the pumping lemma holds for all strings in L with length greater than or equal to n.

Let w = 0^n1^n be a string in L with length greater than or equal to n. By the pumping lemma, we can divide w into three parts, w = xyz, such that:
- |xy| ≤ n
- |y| ≥ 1
- for all i ≥ 0, xy^iz ∈ L

Since |xy| ≤ n, we know that y contains only 0's. Let y = 0^k, where 1 ≤ k ≤ n. Then, x = 0^(n-k) and z = 1^n.

Now, consider the string xy^2z. This string is of the form 0^(n+k)1^n, which is not in L. Thus, the pumping lemma does not hold for the string w = 0^n1^n, which contradicts our assumption that L is a regular language.

Therefore, the language L = {0^n1^n | n ≥ 1} is not a regular language and cannot be expressed using a regular grammar.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer?
Question Description
Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which among the following cannot be accepted by a regular grammar?a)L is a set of numbers divisible by 2b)L is a set of binary complementc)L is a set of string with odd number of 0d)L is a set of 0n1nCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev