Save this video free

CS181 Lecture 16 -- Fall 2026, UCLA

Eli Jaffe · 1:44:48 · Watch on YouTube

Part of University of California, Los Angeles COM SCI 181. See all 15 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Eli Jaffe develops context-free grammars through constructions for balanced symbol counts and strings that are not of the form ww, then uses the context-free pumping lemma to show that 0^n1^n2^n is not context-free. The lecture highlights that context-free languages are closed under union and concatenation but not, in general, under intersection or complement; the pumping-lemma proof that the language of doubles is not context-free begins but is left unfinished.

Key takeaways

Chapters

0:00 CS181 Final Exam Logistics and Lecture Plan
5:48 Review: Building a CFG by Splitting the Addition Language
9:04 L1: Equal Zeros and Ones Followed by Arbitrary Twos
12:00 CFG Productions for L1 and Concatenation
15:28 L2: Arbitrary Zeros Followed by Equal Ones and Twos
19:12 Defining the Language of Bit Strings That Are Not Doubles
24:53 Odd-Length Strings Have a Direct CFG
27:49 Even-Length Non-Doubles Differ at a Matching Position
31:38 Rearranging the Mismatch into Two Balanced Components
41:34 Constructing the Even-Length Non-Double Grammar
50:38 Combining Odd and Even Cases for All Non-Doubles
55:55 CFG Closure Properties: Union, Concatenation, and Intersection
1:00:19 Why 0^n1^n2^n Is Not Context-Free
1:05:15 The Context-Free Pumping Lemma: Five-Part Decomposition
1:08:41 Pumping Constraints and the Grammar-Tree Intuition
1:14:23 Choosing a Challenge String for 0^n1^n2^n
1:20:28 Pumping Cases for the Three-Block Language
1:30:35 Starting the Proof That Doubles Are Not Context-Free
1:36:02 Four-Block Candidate for the Double Language
1:40:45 The Central-Boundary Case Is Deferred

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:03 All right, let's get started on our penultimate CS181 lecture. Very exciting. Very exciting. Welcome to week 10. Hope everybody had a good Thanksgiving. Who watched Tana Montana? >> Wow. >> Wow. You have seen it. >> A little bit. >> Okay, that count. That counts. Well, today is exciting. Uh, we are mostly going to finish our content today, which is pretty crazy. Um, what we did last time was we essentially introduced contextf free grammars, saw examples of contextfree

0:53 grammarss. Uh, we showed that they're more powerful than DFAs. So they can do everything DSAs can do and NFAs and regex uh plus some extra stuff and we talked about how they are important for programming languages among other things. Now they help us show that programs adhere to some kind of syntax. And today we're going to round it all out. We're going to look at more examples of contextf free grammarss and we're going to talk about what we've talked about with all our other uh methods of computation which are closure properties

1:43 or you know lack thereof in some cases as we saw with NFA sometimes closure is not so easy and we will talk a bit about what motivated us to do this in the first place which was computing semantic properties of in this case context program. This is what was so hard with touring machines. It was hard to figure out what they did on inputs. But as we're going to see, we can at least do some of that with contextf free grammar. And we are mostly this is basically going to constitute the end of the content. We're going to maybe talk about a couple other tiny little details depending on how far we get today. And next class, one of the pieces of

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

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, Eli Jaffe.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.