Professional Documents
Culture Documents
10.language From Grammar Example 2
10.language From Grammar Example 2
10.language From Grammar Example 2
HOME MATERIALS
MOCKS
CODE CURRENT AFFAIRS PREVIOUS YEAR
EXAMS & JOBS
Materials
Introduction
Identify the language from the given grammar
String in automata
Example 2: Construct the language generated from the given grammar
Power of Alphabet ( ∑ ) G = ({S}, {a, b}, {S}, {P})
P: S → aSb | ab
Languages
Grammars Solutions:
This grammar consists of two production rules S → aSb and S → ab are combine to gather into a single production.
Definition of Grammars
S (Non-terminal) here the starting symbol, so we can start derivation from starting production S.
Identify Language from Grammar
For S → ab (We can get only ‘ab’)
Example1: S→aSb|λ
Example2: S→aSb|ab
Example 3: A→aSb|λ
Example 4: S→aS|λ
Example 5: S→aS|bS|λ
Every time we use the production S → ab to get the string like ab, aabb, aaabbb, aaaabbbb...
Few Important Grammars must remember So, which type of string we can get from this grammar L(G) = {ab, aabb, aaabbb, aaaabbbb…..}
Example 6 i.e. same number of a’s and b’s where every time a’s followed by b’s with at least one ab.
Example 7
Types of Grammar Note: Here range of n ≥ 1 so, λ is not allowed in your language because this language contains at least ‘ab’ string.
Power of Grammars
Comparison:
Grammar Identification
Regular Grammar or type 3 grammar
Automata Same number a’s and b’s where a followed by b and this language contains λ also that’s the reason n ≥ 0.
Regular Language and Expressions
DFA/NFA to Regular Expression Same number a’s and b’s where a followed by b but this language does not contain λ also that’s the reason n ≥ 1. This language
All form of (a+b)* contains at least one length of string ‘ab’.
Simplification Regular Expressions
Follow the next examples:
Arden’s Theorem 1. Example1: S→aSb|λ
2. Example 3: A→aSb|λ
Regular Expressions to Finite Automata 3. Example 4: S→aS|λ
Finite State Machine (Transducer) 4. Example 5: S→aS|bS|λ
Identification of Language
Pumping Lemma Please Login to Bookmark Share
Myhill-Nerode Theorem
Grammar Part- II
Reverse of Grammar
Context Free Grammar (CFG)
Push Down Automata (PDA)
One Liner
Formula
Question Answer
Subject Mock
Programming
Previous Year
Reference Book
Home NTA NET Gate Bank Clerk Contact Us To get updated news and
Ask :
information subscribe:
support@ mycareerwise.com About Us Help Center
Privacy Policy
Contribute:
Email GO
contribute@ mycareerwise.com Terms of Use
2023 © MyCareerwise - All rights reserved