Math 2.0

Computer science Definition

Chomsky normal form

Builds on Context-free grammarContext-free language

Definition

Let G=(N,Σ,P,S)G = (N, \Sigma, P, S) be a context-free grammar. The grammar GG is in Chomsky normal form if every rule in PP has one of the following forms:

  1. A→BCA \to BC, where A∈NA \in N and B,C∈N∖{S}B, C \in N \setminus \set{S};
  2. A→aA \to a, where A∈NA \in N and a∈Σa \in \Sigma;
  3. S→εS \to \varepsilon, where ε\varepsilon is the empty string.

Remarks

Example: take N={S,T,A,B,C}N = \set{S, T, A, B, C} and the rules S→AB∣ACS \to AB \mid AC, T→AB∣ACT \to AB \mid AC, C→TBC \to TB, A→aA \to a, B→bB \to b. Each rule has two nonterminals other than SS on the right, or one terminal, so all clauses hold. The nonterminal TT generates {anbn:n≥1}\set{a^n b^n : n \ge 1}, so CC generates {anbn+1:n≥1}\set{a^n b^{n+1} : n \ge 1}, and SS generates {anbn:n≥1}\set{a^n b^n : n \ge 1}. Non-example: the rule S→aSbS \to aSb fails clauses 1 and 2, since its right side mixes terminals and nonterminals and has length 33. Every context-free language is generated by a grammar in Chomsky normal form, which can be computed from any context-free grammar for it. In such a grammar, a derivation of a word of length n≥1n \ge 1 has exactly 2n−12n - 1 steps.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Context-free grammar concept
  2. Context-free language concept
  3. Chomsky normal form definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Chomsky_normal_form
About this page
TagX30EV3D5GT
URIm2://X30EV3D5GT
Kinddefinition
WritingW0 stub
MSC68Q42, 68Q45
DefinesChomsky normal form
UsesContext-free grammar, Context-free language
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.