CSCD 420 Oct 28 2026
Watch on YouTube →
Overview
The lecture develops the context-free pumping lemma by comparing it with the regular-language lemma: grammar recursion creates two pumpable parts, V and Y, within a decomposition UVXYZ, with |VXY| bounded by M and |VY| at least 1. It applies the lemma to show that {a^n b^n c^n} is not context-free, then starts a proof for {ww} using a^M b^M a^M b^M; that case analysis is assigned for completion in the next class.
Key takeaways
- The context-free pumping lemma pumps two recursive segments, V and Y, in lockstep, unlike the single loop segment in the regular pumping lemma.
- A valid context-free pumping proof must account for every decomposition with |VXY| ≤ M, and the recursive region may occur anywhere in the string.
- The language {a^n b^n c^n} is not context-free: pumping a bounded substring either changes one block alone or disrupts equality across adjacent blocks.
- A stack can compare two sequential blocks by pushing during one block and popping during the next, but it cannot retain enough information to enforce three-way equality across a^n b^n c^n.
- The witness a^M b^M a^M b^M creates separated count constraints for the {ww} language, so a pumped window of length at most M cannot preserve both copies.
Chapters
- The homework is due tonight, but students who are rushed can contact Chris Cain for a one-day extension.
- The exam has moved to next Wednesday, with review sessions planned for Monday or Tuesday depending on student emails.
- The CYK project assignment links to a visual step-by-step tool that checks grammars and test strings against the diagonal parsing table.
- The regular pumping lemma uses repeated DFA states to establish a loop in strings longer than the automaton's state bound.
- For context-free languages, the analogous repeated structure is a non-terminal that reappears during a derivation.
- A grammar rule such as S → ASB illustrates recursion: each repetition adds a prefix and suffix while preserving S in the middle.
- A recursive derivation can be represented as A ⇒* VAY, followed by a terminating derivation A ⇒* X.
- Repeating the recursive step produces strings with matching numbers of V and Y segments, such as V²XY².
- In S → ASB, recursion adds one A at the front and one B at the end, producing the same number of each.
- The context-free pumping decomposition is UVXYZ: U and Z surround the recursive region, V and Y are added by recursion, and X is the terminating portion.
- For a pumping bound M, the lemma requires |VXY| ≤ M and |VY| ≥ 1, then guarantees UV^iXY^iZ is in the language for every i ≥ 0.
- Unlike the regular pumping lemma, the recursive region can occur anywhere in the string, making proofs require cases for possible locations.
- U and Z describe the one-time context outside the repeated derivation, while V and Y are the recursive additions and X is the termination yield.
- The symbols in these segments may initially be terminals or non-terminals, as long as the chosen derivation eventually yields terminals.
- In the classroom grammar example, recursion adds a B and a Y-like segment repeatedly, while the final production contributes X once.
- The proof strategy treats M as the number of grammar productions, then chooses a string of length at least M.
- The opposing choice determines where the bounded recursive substring VXY appears, so the proof must handle every permitted decomposition.
- The proof then selects a pumping exponent, often i = 2, and shows the resulting string violates a defining condition of the language.
- For {a^n b^n c^n}, a stack can match the A-count with the B-count, but the count information is consumed before the C-block is read.
- Pushing two stack markers per A would enforce a relation such as the number of A's equaling the number of B's plus the number of C's, not equality of all three counts.
- This motivates a pumping-lemma proof that the three-block language is not context-free.
- Choose a^M b^M c^M; because |VXY| ≤ M, the pumped window can lie among only A's, overlap A's and B's, lie among B's, overlap B's and C's, or lie among C's.
- For a window contained in one block, pumping with i = 2 changes that block's count while leaving the other two counts at M.
- For an A-B or B-C overlap, pumping adds at least one symbol across those adjacent blocks, disrupting the requirement that all three block counts match.
- Each of the five cases yields a pumped string outside {a^n b^n c^n}, contradicting the context-free pumping lemma.
- The language {wwᴿ} is context-free because a stack can match the second half in reverse order to the first half.
- Recognizing {ww} requires matching the first half in the same order, effectively needing a queue rather than the stack used by a pushdown automaton.
- The simple candidate a^M a^M is inadequate because pumping an even-length all-A substring can preserve the equal-halves condition.
- The proposed witness is a^M b^M a^M b^M, viewed as w = a^M b^M repeated twice.
- The four blocks impose separated matching-count constraints, while the pumped region has length at most M and cannot span both matching relationships.
- The class ends before the full case analysis; students are asked to identify the cases and counterexamples before the solution is reviewed next class.
Transcript excerpt
0:03 Okay, let's go ahead and get started. Reminder that we have a homework due tonight. Given that we're extending the exam out until next week, I'm okay extending things a little bit on that homework. So, if you find yourself extremely rushed tonight, just reach out to me and I can give you an extra day. See, I think that's just about everything. We have our exam next Wednesday. We have our review sessions planned for either Tuesday or Monday and Tuesday, depending on the number of emails that I received. I think that's everything. I guess we have a project ongoing as well. So, be thinking about working with that
0:52 CYK project. There's a link in the assignment that I recommend everybody take a look at. That shows the step-by-step for an arbitrary CYK. So, you can use that to help debug your program as well. You can throw in the grammar and a string from any of the test cases that you're using. It will run through, give you the solution, as well as show which of the boxes in the diagonal table it's accessing at that time or is reading from at that time. And you can make sure that everything looks good in your program that way. So, I think it's it's a nice and visual way of debugging and testing your own program. Questions before we dive into the context-free pumping lemma? Okay.
1:48 Well, let's go do it. So, it's been a little bit since we talked about the regular pumping lemma, but let's see if we can recap that in some capacity. Anyone want to take a stab at giving a quick overview of the regular language pumping lemma? What is it? What is it for? How does it work? It's a great sign for this talk.
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Chris Cain.