Save this video free

Randomized Searching and Sorting

Kent Quanrud · 1:10:27 · Watch on YouTube

Part of Purdue University Fundamental Algorithms (Fall 2026). See all 20 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

Kent Quanrud introduces randomized algorithms through three examples: random assignments for 3-SAT, randomized quicksort, and quickselect. He develops probability tools, especially linearity of expectation, then uses them to show that random 3-SAT assignments satisfy an expected 7/8 of clauses, derandomize that guarantee with conditional expectation, and analyze quicksort's expected O(n log n) comparisons by counting pairs.

Key takeaways

Chapters

0:00 Why Randomized Algorithms Can Simplify Algorithms
1:38 Random Assignments as a 7/8 Approximation for 3-SAT
7:31 Random-Pivot Quicksort and Its Expected n log n Cost
11:00 Quickselect Finds One Rank Without Sorting Both Sides
14:05 Events, Conditioning, and the Union Bound
20:10 Random Variables, Independence, and Expected Value
25:00 Linearity of Expectation and Markov's Inequality
27:55 Computing the Expected Number of Satisfied 3-SAT Clauses
38:40 Indicator Variables Make the 3-SAT Analysis Scale
41:05 Derandomizing 3-SAT with Conditional Expectation
51:35 Why Quicksort's Random Recursion Is Hard to Analyze Directly
59:40 Indicator Variables for Quicksort Comparisons
1:04:00 Harmonic Sums Yield Quicksort's Expected O(n log n) Bound
1:08:25 High-Probability Guarantees and Lecture Wrap-Up

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

Transcript excerpt

0:05 Okay. All right. So today we're doing um a little bit of randomized algorithms. So um and these [snorts] are some of the the topics we'll do. Uh forget that. Um Okay. [snorts] So Right. So um last time we did amortized analysis. That was one kind of like average case analysis of algorithms because they're always in kind of in hindsight. And today we're going to do randomized algorithms that actually deliberately flip coins. And sometimes that actually is helpful. Often our algorithms are much simpler. Uh but the analysis becomes a little more sophisticated. Um one thing I want to keep our eye on is that all our algorithms will always work uh for any input. Okay? So we'll never lose the worst case guarantees even though the the word average is

0:51 floating around in there. And that's really important. So um so this is the other half of the word average. And so it will depend a little bit on your I know you've done some probability probably in discrete math. So we'll just see like how warm you are with it or if we should go over some stuff more slowly. You know, the slides are there. But uh the game plan is to first um just introduce three simple algorithms right away uh without analyzing them just to get it like a little more fun. And then we'll like go through all the usual definitions and depending on how comfortable you are, we can skip some or blah blah blah. And then we'll go back and analyze uh the algorithms. So I want to try to get back to algorithms as quickly as possible. Okay. So

1:37 [snorts] All right. So the first problem we'll look at is is 3-SAT, your favorite. We were just talking about it.

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

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.