Context Free Grammar
Definition
A context-free grammar G is a quadruple (V, T, P, S), where:
- V is the set of non-terminals. (Non-terminals used in the grammar and they do not appear in strings of the language).
- T is the set of terminals.
- P is the set of productions. All productions in P have the form A → x where A ∈ V and x ∈ (V ∪ T)*.
- S is the start symbol, S ∈ V.
- Every regular grammar is context free, so a regular language is also a context free one.
- Family of regular language is a proper subset of the family of CFLs.

Example:
The grammar G = ({s}, {a, b}, s, p) with productions.
S → aSa
S → bSb
S → λ
is context free A typical derivation in this grammar is
S → aSa → aaSaa → aabSbaa → aabbaa
this, and similar derivations, make it clear that
L(G)={ww R : w ∈ {a, b}*}
Dear Aspirants,
Your preparation for GATE, ESE, PSUs, and AE/JE is now smarter than ever — thanks to the MADE EASY YouTube channel.
This is not just a channel, but a complete strategy for success, where you get toppers strategies, PYQ–GTQ discussions, current affairs updates, and important job-related information, all delivered by the country’s best teachers and industry experts.
If you also want to stay one step ahead in the race to success, subscribe to MADE EASY on YouTube and stay connected with us on social media.
MADE EASY — where preparation happens with confidence.

MADE EASY is a well-organized institute, complete in all aspects, and provides quality guidance for both written and personality tests. MADE EASY has produced top-ranked students in ESE, GATE, and various public sector exams. The publishing team regularly writes exam-related blogs based on conversations with the faculty, helping students prepare effectively for their exams.
