Save this video free

CS 181 Lecture 9 -- Fall 2026, UCLA

Eli Jaffe · 1:38:34 · Watch on YouTube

Part of University of California, Los Angeles COM SCI 181. See all 14 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 Kleene’s theorem by showing how to construct an NFA for a regular expression using base cases and the operations for concatenation, alternation, and Kleene star. He explains how compiling an NFA into a DFA can make repeated matching against long inputs, such as DNA sequences, more efficient, then contrasts regular languages with counting problems such as majority and equal numbers of zeros and ones.

Key takeaways

Chapters

0:00 Lecture 9 Plan, Regular Expressions, and Course Updates
5:05 Regular Expression Recap and Recording Interruption
15:41 Defining Regular Functions from Regex Matches
21:00 Three Regex Examples: Modular Counts, Suffix Bits, and Substrings
28:50 Kleene’s Theorem Requires Conversions in Both Directions
32:30 Regex-to-NFA Construction as an Intermediate Step
35:10 Why Direct NFA Simulation Costs O(nm)
36:30 Grep’s Pattern-Matching Strategy and DFA Compilation
40:10 When Exponential Preprocessing Pays Off
43:30 Induction Builds NFAs for Every Regular Expression
46:40 NFA Constructions for Concatenation, OR, and Kleene Star
54:00 Worked Construction for Zero Followed by a Repeated Pattern
1:00:30 Complements, DFA Conversion, and Intermediate Representations
1:09:00 Countability Question and Summary of Automata Equivalence
1:12:30 The Majority Function Is Not Regular
1:18:00 Equal Counts Versus Equal Transition Substrings
1:25:30 Pumping Lemma and Myhill-Nerode as Regularity Tests
1:29:10 Why Proving Nonregularity Needs a General Property
1:33:00 Pumping Lemma: Split Long Accepted Strings into ABC
1:36:20 Pumping Accepted Strings and the Next Lecture

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

Transcript excerpt

0:03 All right. We are recording. Hello everybody. Happy the farthest you will be away from another exam for the rest of the quarter. Congratulations. Hopefully it wasn't too painful. Um I guess a couple Well, let's talk about what we did last class and then I'll do the logistical updates. Reminder, I know it's been a while. It's been like a week since we've actually talked about stuff. We're sort of in the tail end of wrapping up our discussion of finite automata. Uh and so what we did last class uh pretty much was we finished off our discussion of DFAs versus NFAs. We did a like

0:51 pros and cons list. Talked about the relationships a little bit. After our big result that, you know, they're actually equivalent in computational power, which was pretty cool. Uh and we talked about the relationships between all these closure properties. And what we started to introduce as a sort of accumulation of this DFA stuff was regular expressions. And we just barely got to a formal definition of regular expressions. We talked a little bit about the connection between regular expressions and Oop.

1:39 No, no, no. Don't do that. Oh, no. Uh Let me see if I can delay that. Hold on, 1 second. Uh Can I schedule it? Schedule restart. Today Oh, no, it won't let me. Um I I guess we'll deal with that when it happens. Uh well, such is life. Such is life. Uh we talked a little bit about the relationship between regular expressions and NFAs and DFAs. Kind of

2:28 looking at these applications, saying we would love a one-pass algorithm for something like string matching instead of this sliding window approach. Uh and I tantalized you with this idea that we could actually do it by exploring the

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.