TubeSum ← Transcribe a video

10 Most Interesting Algorithms Ever Engineered

0h 09m video Published Dec 21, 2023 Transcribed Jul 12, 2026 F Fireship
Intermediate 4 min read For: Tech enthusiasts and programmers curious about algorithm applications.
1.7M
Views
62.1K
Likes
1.3K
Comments
452
Dislikes
3.8%
📈 Moderate

AI Summary

This video explores 10 fascinating algorithms, from the double slit experiment's wave function collapse to Boyer-Moore string search, explaining how they solve real-world problems in graphics, cryptography, AI, and distributed systems.

[00:14]
Marching Cubes

Patented in 1987 by GE programmers, extracts polygonal mesh from 3D scalar fields (e.g., CT/MRI data). Uses 256 possible configurations per cube.

[00:57]
Wave Function Collapse

Inspired by quantum mechanics, used for procedural generation in games. Starts with superposition of possibilities, collapses to a tile following rules (e.g., connected roads).

[01:38]
Diffusion Models

Reverse thermodynamic diffusion: adds noise to images (forward phase), then reconstructs (reverse phase). Powers DALL-E, Stable Diffusion. Also works on audio and video.

[02:32]
Simulated Annealing

Optimization algorithm inspired by metallurgy. Starts with high 'temperature' for exploration, gradually lowers to exploit best solution. Used in warehouse inventory optimization.

[03:28]
Sleep Sort

Novelty sorting algorithm: for each element, spawns a thread that sleeps for that element's value, then prints it. Delegates sorting to CPU scheduler; impractical but clever.

[04:19]
Quantum Bogo Sort

Hypothetical: uses quantum mechanics to check if array is sorted in parallel universes. If sorted, travel to that universe. Not yet feasible.

[04:52]
RSA Encryption

Public-key cryptosystem based on difficulty of factoring large primes. Used for digital signatures and secure communication. Vulnerable to Shor's algorithm on quantum computers.

[05:22]
Shor's Algorithm

Quantum algorithm that factors integers exponentially faster than classical. Biggest factored number so far is 21; IBM's Q system one fails at 35. Threatens RSA.

[06:49]
Practical Byzantine Fault Tolerance (PBFT)

Consensus algorithm for distributed systems. Tolerates up to 1/3 faulty nodes. Uses pre-prepare, prepare, commit phases. Used in cloud databases and blockchain.

[07:47]
Boyd's Artificial Life (Boids)

Simulates flocking with three rules: separation, alignment, cohesion. Emergent complexity from simple rules. Used in computer graphics and swarm robotics.

[08:14]
Boyer-Moore String Search

Efficient string matching scanning right-to-left. Uses two precomputed tables to skip characters. Powers fast grep. Guarantees no false negatives.

Algorithms like Boyer-Moore and PBFT demonstrate how clever design can solve complex problems efficiently, while quantum algorithms like Shor's threaten current cryptography.

Clickbait Check

85% Legit

"Title promises interesting algorithms and delivers exactly that, though some entries are more novelty than practical."

Mentioned in this Video

Study Flashcards (7)

What year was the marching cubes algorithm patented?

easy Click to reveal answer

1987

What is the core idea behind wave function collapse in procedural generation?

medium Click to reveal answer

It starts with a superposition of all possible tiles and collapses to one following consistent rules.

00:57

How does simulated annealing balance exploration and exploitation?

medium Click to reveal answer

It starts with high temperature for exploration and gradually lowers it to exploit the best solution.

02:32

What is the main vulnerability of RSA encryption?

hard Click to reveal answer

It is vulnerable to Shor's algorithm, which can factor large numbers exponentially faster on quantum computers.

05:22

What is the maximum fraction of faulty nodes PBFT can tolerate?

easy Click to reveal answer

Up to one-third of nodes.

06:49

What are the three rules of Boids flocking simulation?

easy Click to reveal answer

Separation, alignment, and cohesion.

07:47

In which direction does Boyer-Moore scan the text?

easy Click to reveal answer

Right to left.

08:14

💡 Key Takeaways

📊

Marching Cubes Origin

Classic algorithm from 1987 still used in medical imaging and 3D graphics.

💡

Diffusion Models Explained

Core technology behind modern AI image generators, explained via thermodynamics.

01:38
📊

Shor's Algorithm Threat

Quantum algorithm that could break RSA encryption, with current limitations.

05:22
⚖️

Emergent Complexity in Boids

Demonstrates how simple rules produce complex flocking behavior.

07:47
🔧

Boyer-Moore Efficiency

Explains why grep is fast using right-to-left scanning and skip tables.

08:14

✂️ Creator Tools: Viral Hooks

AI-generated clip ideas for Shorts based on the transcript

No viral clips found for this video, or they are still being generated.

[00:00] extract a polygonal mesh of an ISO surface from a three-dimensional discrete scalar field yeah I didn't think so but back in ' 87 two programmers at General Electric did they created and patented the marching cubes

[00:14] doctors to visualize data from CT and MRI scans whenever you instruct a for rearranging ones and zeros that can make animals talk and vacuums walk most

[00:30] algorithms belong in the dumpster but some are fast some are beautiful and look at 10 of the most interesting algorithms ever engineered and how they're used to solve very interesting problems in the real world first on the

[00:44] is the double slit experiment where particles behave like a wave when you're seems counterintuitive but it makes total sense when you realize we're

[00:57] living in a simulation and the universe wrote this algorithm to cut down on its general idea behind wave function collapse can also be implemented programmatically imagine we have a map for a video game but what if this is a

[01:11] sidescrolling game that can go on for eternity we can't just make a bigger map we need an algorithm to procedurally generate it on the Fly what's so weird super position of all possibilities it's the wave function then upon observation

[01:26] it collapses into a particle or in other words it selects a Rand a map tile but follows a consistent set of rules like in this case making sure that the roads are always connected providing a random yet cohesive result and doesn't rely on

[01:38] any sort of modern generative AI speaking of which AI is weird as hell Ai and is the magic behind image generators like Dolly and stable diffusion but the concept of diffusion actually comes from thermodynamics where

[01:53] particles spread from areas of higher concentration to lower concentration in artificial intelligence the process is r reversed the algorithm starts by generating random noise which would be like high entropy in thermodynamics and

[02:05] gradually refines it to a structured image which would be lower entropy but Works in two phases in the forward phase it gradually adds noise to an image step

[02:17] by step until it becomes completely random in the second phase the algorithm reverses this process reconstructing it back into a coherent image when the that can be used to generate new images out of thin air allowing us to build an

[02:32] infinite Army of only fans models it's highly compute intensive but also works well on audio and the next Frontier is diffusion for video generation but now let's talk about simulated analing one frustrating thing about programming is

[02:44] that for many problems there's not just one solution but many solutions like an Amazon warehouse has many different ways to organize its inventory but some ways metals are heated up and cooled down over and over again to to remove defects

[03:00] the same idea is used in optimization algorithms to find the best answer in a CA of good answers imagine trying to find the highest point in a mountain range full of Peaks and valleys a simple Hill Climb algorithm won't work because

[03:12] algorithm to explore freely as time goes on though the temperature is lowered here is exploration versus exploitation but the reason I included this algorithm

[03:28] you start out exploring all kinds of different Technologies and Frameworks then eventually you find one specific area to exploit and specialize in but we ingenious sorting algorithm of all time is without a doubt sleep sort the

[03:46] conquer to break up an array into subarrays where it can be sorted more efficiently however some random genius on forchan found a better way but it's a simple it Loops over the array and then for each element it opens up a new

[04:04] element then finally after waking up it prints that element it's genius because it delegates the Sorting to the CPU scheduler it's also incredibly dumb and useless because it delegates sorting to the CPU scheduler speaking of which you

[04:19] might be familiar with another useless sorting algorithm BOGO sort which tries the lottery but what if we apply the same algorithm with Quant mechanics to possible outcomes exist in separate parallel universes that means as a

[04:37] developer if you find yourself with an unsorted array there's some other parallel universe where it is sorted the technology isn't quite there yet but if could then use a portal gun to travel to that Universe which would make our lives

[04:52] that universe but if it's a really large array Quantum BOGO sort might be worth it that's purely hypothetical but one of the most practical and goed algorithms of all time is RSA a public key crypto system it's essential for digital

[05:07] letters with a unique signature but it's based on one simple mathematical reality extremely difficult and timec consuming like it take your laptop 300 trillion

[05:22] start leveraging Shores algorithm which can solve the integer factorization problem exponentially faster than any classical algorithm Prime factoring is relies on Concepts like cubits superposition and entanglement to

[05:40] perform massive amounts of calculations in parallel the algorithm is legit but so far the biggest number ever factored is [Music] 21 even IBM state-of-the-art Q system

[05:52] one fails when trying to factor the number 35 however just recently the different algorithm that doesn't scale very well for large numbers unlike make quantum computers work expect all hell to break loose in the cyber

[06:09] algorithm but it deserves a closer look so first we start with a 3D scalar field which might represent data from an MRI machine each point in the 3D space is

[06:21] represented by a single number or scaler the algorithm starts with a single point treats the values as a bit in an 8bit integer this results in 256 different

[06:34] algorithm marches through each point to create a 3D mesh that can be used in 3D of data that can now be rendered in 3D in modern times though we're often

[06:49] dealing with distributed systems in the cloud and that brings us to the you're camped around a city with a few other generals with plans to attack up to hung over to attack the entire system could collapse computers have the

[07:06] same problem sometimes they might fail or be infiltrated by hackers and you never know when or where that's going to happen luckily algorithms like pbft are designed to solve this they can keep a distributed Network working properly

[07:18] even if up to onethird of its nodes go Haywire it works by having a node broadcast a pre-prepare message to other nodes indicating its Readiness to an agreement then after a certain threshold a consensus is formed once

[07:33] other nodes which can then all execute the changes making the entire state of technology and things like distributed Cloud databases what's really cool about

[07:47] algorithms though is that they can also reflect nature like Boyd's artificial Life program it was created back in ' 86 and simulates the flocking behavior of birds what's so cool about it is that it demonstrates the emerging complexity or

[07:59] beauty that we get out of just a few simple rules in this case the birds have of the flock and they steer towards the center of mass of their local flock

[08:11] directly but just emerge naturally but finally that brings us to an old algorithm that blew my mind just the other day and inspired this video boy or string it's searching becomes bigger that seems impossible but it makes sense

[08:29] when you understand the algorithm it scans text from right to left then has pattern it jumps past it based on an estimation made in a pre-processed table likewise if it finds a partial match then a mismatch occurs it has a separate

[08:44] pre-calculated table that maximizes the number of characters it can safely skip guaranteed to be perfect but are far more practical than looping over every because it's able to to skip a higher proportion of characters and if you've

[09:01] ever wondered why grep is so fast you have this algorithm to thank

⚡ Saved you 0h 09m reading this? Transcribe any YouTube video for free — no signup needed.