Save this video free

CS 181 Lecture 8 -- Fall 2026, UCLA

Eli Jaffe · 1:46:03 · Watch on YouTube

CS 181 Lecture 8 -- Fall 2026, UCLA Watch on YouTube →

Overview

Eli Jaffe proves that every nondeterministic finite automaton (NFA), including one with epsilon transitions, has an equivalent deterministic finite automaton (DFA), using subset construction and epsilon closure. He then connects automata to practical string matching: the KMP algorithm builds a pattern-specific DFA with m+1 states to search an n-bit string in O(n+m) time, before introducing the inductive syntax of regular expressions.

Key takeaways

Chapters

0:00 Lecture Goals, Homework Deadline, and Exam One
5:00 Why NFA Branches Can Be Compressed into Subsets
7:24 Subset Construction: DFA States as NFA-State Sets
14:35 DFA Transitions and Accepting Subsets
23:36 Tracing Subset Transitions in a Four-State NFA
31:36 Epsilon Transitions and the Reachability-Level Problem
34:30 Epsilon Closure: Reachable States Without Reading Input
42:32 Extending Subset Construction with Epsilon Closure
49:01 Worked Epsilon-NFA Conversion: Five States, 32 Subsets
55:32 Every NFA Has an Equivalent DFA
59:43 Epsilon-Closure Conventions and Exam-Study Questions
1:06:39 Running DFAs and NFAs: Time Complexity
1:14:31 Pattern Matching and the Sliding-Window Baseline
1:21:21 KMP Uses a Pattern-Specific DFA for Linear Search
1:27:16 Building a DFA for the Pattern 1111
1:30:03 Handling Overlapping Prefixes for the Pattern 101
1:33:37 Regular Expressions for Variable-Length DNA Patterns
1:37:08 Where Regular Expressions Are Used
1:39:56 Regular Expressions: Inductive Base Cases
1:41:30 Regular-Expression Composition: Concatenation, OR, and Star

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

Transcript excerpt

0:09 Let's start getting started. Uh let's see. >> All right. Hello everybody. Sorry for the delay. It's raining. Everything's slower. Um, I'm pretty excited for today's lecture. I guess while I'm uh sort of opening up my documents, a reminder of what we did last class. So, last class we did some NFA exploration. So we're in the larger context wrapping

0:57 up our discussion of NFAS and DFAS today. They'll come back, but I mean as a tool. And so we introduced this idea of NFAS to hopefully solve some problems that we encountered with DFAS. We used them to construct some uh NFAs for important composition functions. So we looked at concatenation. We looked at the clean star operation which was kind of an extension of concatenation in a way. And then we explored a limitation of NFAS which was the knots. And we talked

1:44 about how computing not was actually not so easy for non-deterministic machines. Somehow this threw a wrench in the game for NFA. And what we stated without proof and started to develop an intuition for is this fact that as it turns out every NFA actually has an equivalent DFI equivalence. So today our goal is to fully establish this equivalence between NFAs and DFAS.

2:40 We are going to use that to kind of put a almost cap on our discussion of finite automata and then we're going to bridge into a discussion of our next model of computation which is going to be regular expressions and we're going to see that we did it in this order for a reason. there is this kind of deep connection between finite automata and regular expressions and we're going to use that to see maybe our first real practical application of NFAS until now they've just kind of existed

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