- 22
- 9 783 605
Reducible
United States
Registrace 8. 10. 2019
This channel is all about animating computer science concepts in a fun, interactive, and intuitive manner.
The Discrete Fourier Transform: Most Important Algorithm Ever?
Go to nordvpn.com/reducible to get the two year plan with an exclusive deal PLUS 1 bonus month free! It’s risk free with NordVPN’s 30 day money back guarantee!
The Discrete Fourier Transform (DFT) is one of the most essential algorithms that power modern society. In this video, we go through a discovery-oriented approach to deriving the core ideas of the DFT.
We start by defining ideal conditions and properties of our transform. We define a similarity measure and come up with an idea that the transform we are looking for is fundamentally a matrix multiplication. Within the context of simple cosine waves, we develop an initial version of our transform using cosine wave analysis frequencies that seems to fit the parameters of what we are looking for. But we discover some key issues with that transform involving the phase of the signal.
To solve the phase problem, we take a look a sine wave analysis frequencies and observe how using a combination of sine and cosine wave analysis frequencies perfectly solves the phase problem. The final step involves representing these sine and cosine wave analysis frequencies as complex exponentials. We finish the video by analyzing some interesting properties of the DFT and their implications.
Chapters:
0:00 Intro
1:50 Sampling Continuous Signals
3:41 Shannon-Nyquist Sampling Theorem
4:36 Frequency Domain Representations
5:38 Defining Ideal Behavior
6:00 Measuring SImilarity
6:57 Analysis Frequencies
8:58 Cosine Wave Analysis Frequency Transform
9:58 A Linear Algebraic Perspective
13:51 Sponsored Segment
15:20 Testing our "Fake Fourier Transform"
18:33 Phase Problems
19:18 Solving the Phase Problem
21:26 Defining the True DFT
28:21 DFT Recap/Outro
Animations created jointly by Nipun Ramakrishnan and Jesús Rascón.
References:
Great written guide on the DFT: brianmcfee.net/dstbook-site/content/ch05-fourier/intro.html
Proof of orthonormality of the DFT: math.stackexchange.com/questions/2413218/proof-of-orthonormality-of-basis-of-dft
More on the Shannon Nyquist sampling theorem: brianmcfee.net/dstbook-site/content/ch02-sampling/Nyquist.html
Great intuition on the continuous Fourier Transform: czcams.com/video/spUNpyF58BY/video.html&ab_channel=3Blue1Brown
This video wouldn't be possible without the open source library manim created by 3blue1brown and maintained by Manim Community.
The Manim Community Developers. (2022). Manim - Mathematical Animation Framework (Version v0.11.0) [Computer software]. www.manim.community/
Here is link to the repository that contains the code used to generate the animations in this video: github.com/nipunramk/Reducible
Music in this video comes from Jesús Rascón and Aaskash Gandhi
Socials:
Patreon: www.patreon.com/reducible
Twitter: Reducible20
Big thanks to the community of Patreons that support this channel. Special thanks to the following Patreons:
Nicolas Berube
kerrytazi
Brian Cloutier
Andreas
Matt Q
Winston Durand
Adam Dřínek
Burt Humburg
Ram Kanhirotentavida
Jorge
Dan
Eugene Tulushev
Mutual Information
Sebastian Gamboa
Zac Landis
Richard Wells
Asha Ramakrishnan
The Discrete Fourier Transform (DFT) is one of the most essential algorithms that power modern society. In this video, we go through a discovery-oriented approach to deriving the core ideas of the DFT.
We start by defining ideal conditions and properties of our transform. We define a similarity measure and come up with an idea that the transform we are looking for is fundamentally a matrix multiplication. Within the context of simple cosine waves, we develop an initial version of our transform using cosine wave analysis frequencies that seems to fit the parameters of what we are looking for. But we discover some key issues with that transform involving the phase of the signal.
To solve the phase problem, we take a look a sine wave analysis frequencies and observe how using a combination of sine and cosine wave analysis frequencies perfectly solves the phase problem. The final step involves representing these sine and cosine wave analysis frequencies as complex exponentials. We finish the video by analyzing some interesting properties of the DFT and their implications.
Chapters:
0:00 Intro
1:50 Sampling Continuous Signals
3:41 Shannon-Nyquist Sampling Theorem
4:36 Frequency Domain Representations
5:38 Defining Ideal Behavior
6:00 Measuring SImilarity
6:57 Analysis Frequencies
8:58 Cosine Wave Analysis Frequency Transform
9:58 A Linear Algebraic Perspective
13:51 Sponsored Segment
15:20 Testing our "Fake Fourier Transform"
18:33 Phase Problems
19:18 Solving the Phase Problem
21:26 Defining the True DFT
28:21 DFT Recap/Outro
Animations created jointly by Nipun Ramakrishnan and Jesús Rascón.
References:
Great written guide on the DFT: brianmcfee.net/dstbook-site/content/ch05-fourier/intro.html
Proof of orthonormality of the DFT: math.stackexchange.com/questions/2413218/proof-of-orthonormality-of-basis-of-dft
More on the Shannon Nyquist sampling theorem: brianmcfee.net/dstbook-site/content/ch02-sampling/Nyquist.html
Great intuition on the continuous Fourier Transform: czcams.com/video/spUNpyF58BY/video.html&ab_channel=3Blue1Brown
This video wouldn't be possible without the open source library manim created by 3blue1brown and maintained by Manim Community.
The Manim Community Developers. (2022). Manim - Mathematical Animation Framework (Version v0.11.0) [Computer software]. www.manim.community/
Here is link to the repository that contains the code used to generate the animations in this video: github.com/nipunramk/Reducible
Music in this video comes from Jesús Rascón and Aaskash Gandhi
Socials:
Patreon: www.patreon.com/reducible
Twitter: Reducible20
Big thanks to the community of Patreons that support this channel. Special thanks to the following Patreons:
Nicolas Berube
kerrytazi
Brian Cloutier
Andreas
Matt Q
Winston Durand
Adam Dřínek
Burt Humburg
Ram Kanhirotentavida
Jorge
Dan
Eugene Tulushev
Mutual Information
Sebastian Gamboa
Zac Landis
Richard Wells
Asha Ramakrishnan
zhlédnutí: 105 046
Video
The Traveling Salesman Problem: When Good Enough Beats Perfect
zhlédnutí 256KPřed rokem
Use the code "reducible" to get CuriosityStream for less than $15 a year! curiositystream.com/reducible The Traveling Salesman Problem (TSP) is one of the most notorious problems in all of computer science. In this video, we dive into why the problem presents such a challenge for computer scientists and some of the clever methods used to solve the problem. We start with showing why all brute fo...
PageRank: A Trillion Dollar Algorithm
zhlédnutí 158KPřed rokem
Visit brilliant.org/Reducible/ to get started learning STEM for free, and the first 200 people will get 20% off their annual premium subscription. Chapters: 0:00 Intro 1:00 Defining Markov Chains 2:00 Introducing the Problem 4:08 Modeling Markov Chains 6:26 Stationary Distributions 7:20 Uniqueness of Stationary Distributions (Irreducibility) 9:11 Convergence of Stationary Distributions (Periodi...
How PNG Works: Compromising Speed for Quality
zhlédnutí 624KPřed 2 lety
Visit brilliant.org/Reducible/ to get started learning STEM for free, and the first 200 people will get 20% off their annual premium subscription. Chapters: 0:00 Introduction 1:35 Exploiting redundancy 2:09 Huffman Codes 4:22 Run Length Encoding 5:23 Lempel-Ziv Schemes (LZSS) 13:50 Transforming the problem 14:36 Filtering 17:46 How PNG Picks Filters 18:58 Heuristics for Filtering 21:06 PNG Enco...
The Unreasonable Effectiveness of JPEG: A Signal Processing Approach
zhlédnutí 1,1MPřed 2 lety
Visit brilliant.org/Reducible/ to get started learning STEM for free, and the first 200 people will get 20% off their annual premium subscription. Chapters: 00:00 Introducing JPEG and RGB Representation 2:15 Lossy Compression 3:41 What information can we get rid of? 4:36 Introducing YCbCr 6:10 Chroma subsampling/downsampling 8:10 Images represented as signals 9:52 Introducing the Discrete Cosin...
How Computers Draw Weird Shapes (Marching Squares)
zhlédnutí 406KPřed 2 lety
In this video, we start with an interesting animation of blobby objects which we introduce as metaballs. There's a lot of surprisingly intricate ideas behind making these objects render on a screen. We'll see how folks in computer graphics attempted to solve this problem through a really elegant algorithm called marching squares. Marching squares is a really powerful algorithm that allows you t...
Huffman Codes: An Information Theory Perspective
zhlédnutí 219KPřed 2 lety
Huffman Codes are one of the most important discoveries in the field of data compression. When you first see them, they almost feel obvious in hindsight, mainly due to how simple and elegant the algorithm ends up being. But there's an underlying story of how they were discovered by Huffman and how he built the idea from early ideas in information theory that is often missed. This video is all a...
A Strange But Elegant Approach to a Surprisingly Hard Problem (GJK Algorithm)
zhlédnutí 329KPřed 3 lety
In 1988, three engineers came together and developed one of the most clever solutions to the problem of detecting when two complex objects collide. Their solution, the Gilbert Johnson Keerthi (GJK) algorithm, named after the authors, made an incredible impact in the fields of robotics, control, and computer graphics. This video is about understanding this ingenious algorithm from first principl...
Building Collision Simulations: An Introduction to Computer Graphics
zhlédnutí 454KPřed 3 lety
Collision detection systems show up in all sorts of video games and simulations. But how do you actually build these systems? Turns out that the key ideas behind these systems show up all over a field of computer science called computer graphics. We start off with the basics of animation and then branch off into ideas in discrete and continuous collision detection. We break them down in the con...
FFT Example: Unraveling the Recursion
zhlédnutí 79KPřed 3 lety
This video is meant as further support to the main video on the FFT czcams.com/video/h7apO7q16V0/video.html We break down how the FFT evaluates a particular polynomial at the roots of unity by unraveling the recursive process completely. 0:00 Introduction 1:13 FFT Example Breakdown Support: www.patreon.com/reducible This video wouldn't be possible without the open source manim library created b...
The Fast Fourier Transform (FFT): Most Ingenious Algorithm Ever?
zhlédnutí 1,8MPřed 3 lety
In this video, we take a look at one of the most beautiful algorithms ever created: the Fast Fourier Transform (FFT). This is a tricky algorithm to understand so we take a look at it in a context that we are all familiar with: polynomial multiplication. You will see how the core ideas of the FFT can be "discovered" through asking the right questions. The key insights that are presented in this ...
Breadth First Search (BFS): Visualized and Explained
zhlédnutí 183KPřed 3 lety
In this video we break down the BFS algorithm in a visual manner with examples and key intuition. We then show the implementation of the algorithm with code and then finish off the video by demonstrating how you can use the BFS algorithm to solve the Flood Fill problem. 0:00 Introduction 0:45 BFS Intuition/Examples 2:39 BFS Implementation 5:19 Flood Fill Problem Support: www.patreon.com/reducib...
5 Simple Steps for Solving Dynamic Programming Problems
zhlédnutí 994KPřed 3 lety
In this video, we go over five steps that you can use as a framework to solve dynamic programming problems. You will see how these steps are applied to two specific dynamic programming problems: the longest increasing subsequence problem and optimal box stacking. The five steps in order are as follows: 1. Visualize examples 2. Find an appropriate subproblem 3. Find relationships among subproble...
Depth First Search (DFS) Explained: Algorithm, Examples, and Code
zhlédnutí 362KPřed 3 lety
In this video, I explain the fundamental ideas behind the Depth First Search (DFS) graph algorithm. We first introduce the concept of a graph traversal. We then go through several examples of DFS to provide intuition. Afterwards, we then go through both a recursive and iterative implementation with provided code. We discuss the differences between the implementation and also make a distinction ...
Introduction to Graph Theory: A Computer Science Perspective
zhlédnutí 535KPřed 3 lety
In this video, I introduce the field of graph theory. We first answer the important question of why someone should even care about studying graph theory through an application perspective. Afterwards, we introduce definitions and essential terminology in graph theory, followed by a discussion of the types of graphs you may encounter. We then define several ways to represent graphs as a data str...
Towers of Hanoi: A Complete Recursive Visualization
zhlédnutí 434KPřed 3 lety
Towers of Hanoi: A Complete Recursive Visualization
5 Simple Steps for Solving Any Recursive Problem
zhlédnutí 1,2MPřed 4 lety
5 Simple Steps for Solving Any Recursive Problem
The Simple and Elegant Idea behind Efficient Dynamic Arrays
zhlédnutí 58KPřed 4 lety
The Simple and Elegant Idea behind Efficient Dynamic Arrays
What if you had to invent a dynamic array?
zhlédnutí 138KPřed 4 lety
What if you had to invent a dynamic array?
A Preview for Data Structures and Algorithms
zhlédnutí 23KPřed 4 lety
A Preview for Data Structures and Algorithms
In this example the order of result is necessary after that I try to calculate by myself with n=4 this algorithm seems not work very well
Nice video; a small caveat with the normalization. 26:44 : i think the 1/n normalization is not at the w level (1/n would disappear in the power zero and we would divide for example w^{-7} by n^7, which does not match your formula for the inverse of the matrix. Instead, return y/n at the end.
should've included what line of code the action is taking place, for better understanding i got lost
Wow man. Love you
Very nicely presented, clear and concise. You are the great teacher.
this video is so well done, thank you so much!
06:30 why is the result (-2,9) and not (4,9) and so on? Is it because the x-coord is simply unchanged in your method, and is it important to choose set with same x's?
By Far the Best Explanation Ever for Recursion with Those Tips😀😀
Teach better than my professor
You clarified a lot of the math involved in JPEG compression so that now I think I understand it, or at least the most important parts. Great explanation!
Why not using recursion?
I don't see why the coefficient to value representation algorithm is O(n log n)
I got lost at “We’re given 2 polynomials”
Instant confusion. Right out of the gate lol.
char* ptr0 = {'h', 'i'}; char* ptr1 = {' ', 'm'}; char* ptr2 = {'a', 'n'}; char** aptr = {*ptr0, *ptr1, *ptr2}; char** ptptptaotp = ***aptr;
part 2?
thank youuuuuu
how this simulation works? you can even see at 14:35 near left bottom corner that yellow and orange balls dont simply bounce but "orbits" or something for a while
❤
The Shannon-Nyquist explanation is pretty misleading here, I think. You only need 2 points to sample a 7hz (or any other hz) wave. It's about the speed of sampling, not the number of points. The only reason you need 15 points here is specifically because of the length of the waveform shown.
The best explanation!!This guy is a gem
That was a great explanation 👏 I'd like to add a different perspective. Suppose we have 5 disks and label our rods as 'A', 'B', and 'C'. It's important to recognize that the largest disk, disk number 5, will ultimately need to be placed at the bottom of the target rod. To achieve this, how can we remove the other 4 disks from rod 'A'? We can approach this by temporarily moving the top 4 disks (disks 1 to 4) from rod 'A' to rod 'B'. This relocation allows us to move disk 5 directly from rod 'A' to rod 'C'. Once disk 5 is placed, we then need to move the 4 disks from rod 'B' to rod 'C', starting with the smaller disks. This requires a recursive process, where each step involves moving fewer disks than the previous one until only one disk remains to be moved. Here is some Java code that illustrates this process more clearly: public class Main { public static void moveDisk(int n, char originalRod, char auxRod, char targetRod) { if (n == 1) { System.out.println("Move disk 1 from " + originalRod + " to " + targetRod); return; } moveDisk(n - 1, originalRod, targetRod, auxRod); System.out.println("Move disk " + n + " from " + originalRod + " to " + targetRod); moveDisk(n - 1, auxRod, originalRod, targetRod); } public static void main(String[] args) { int diskNumbers = 4; moveDisk(diskNumbers, 'A', 'B', 'C'); } }
legend
Brilliant!
im so lost lmao Im just hoping that this wont come out in interviews because it's so popular lmao
legend
i got confused at @5:50 because what if the element of at LIS[4] is 1 therefore the formula would not be valid, right?
Why other = 6 - (start + end) ?
because 6 = 1 + 2 + 3. since start is 1 and end = 3, with that we can assume the middle is of 1 and 3 is 2
1:50 I thought of this by accident; Interestingly, if you assign zero as the start of your acceptable range there is an extra sequence that could be valid: [2, 6, 6, 9] --> 4 I assume if you continue to add or decrease your starting position the Goldilocks zone changes. I remember from somewhere that the resulting numbers of a functions subset, remains constant in any set. Assuming of course that each node remains constant, without the set changing mid step.
Very helpful, thank you.
your last example is totally unclear. When you clearly said m goes from 0 up to m, why didn't you don't consider m = 0 when doing partition for (4,3) and (5, 3)? Also you considered m=0 for partition for (3, 3), SMH. At least be consistent in your examples.
Can you please provide a solution to the Box Stack problem in case if you are allowed to rotate the boxes? The original Box Stack problem states that you can rotate the boxes however you want and any side of the box may serve as a base of that box. I think it complicates the problem a bit. Thank you!
Great video but I still find it hard to wrap my mind around, by no fault of yours lol. Got a test tomorrow too.
Very clear explanation!
B - Boss F - Fighting S - Stages
An interesting twist on count_partitions would be to return the actual partitions instead of the count.
Step 1: collect underpants Step 2: …… Step 3: profit
Are you going to add move videos or is this channel dead?
around 6:30, you said (row, col): (2,2). but it seems like (3,3). what am I missing here?
Best explanation to Hanoi tower and its basis in discrete mathematics and algorithms, This is multi target video!!
Looking at that paper for the polynomial approximation of field strength, I think I have found a potential improvement. Specifically, I found a visually indistinguishable polynomial which can be computed in fewer arithmetic operations. If we let s = r²/R², the paper recommends using p = 1 - (22/9)s + (17/9)s² - (4/9)s³, which they say can be computed in 5 multiplications and 3 additions. However, if we let u = (1 - s)² then we can use q = (3 + u)u/4 as our polynomial. This takes only 2 multiplications (1 each for u and q) and 3 additions if we count division-by-4 as an addition. If we count it instead as a multiplication then we’re at 3-and-2, but either way it’s fewer total operations and fewer multiplications than the method from the paper. And in fact, we can completely eliminate the division-by-4 if we’re happy with a different overall scale for the field strength. That would bring the operation counts down to 2-and-2. Note that my polynomial q satisfies all the same constraints on its values and slopes that the paper requires of p. Here is a Desmos graph showing the two curves on top of each other: www.desmos.com/calculator/dde9rpjtj2 (Okay, technically my curve crosses y=1/2 at a slightly different x-value, but that was not one of their original constraints. They added it when they had an extra degree of freedom. My approach can still match it though, if we use q_2 = (47/16 + u)u(16/63), where again the final multiplication by 16/63 can be eliminated if we don’t care about the overall scaling of the field.) And of course, if we we just want a vaguely-similar shape, and don’t care too much about the specifics, then we can simply use u itself. That only takes 1 multiplication and 1 addition.
I have a test tomorrow thank you ❤
Can you do count_partitions(n-1,m) + count_partitions(n,m-1)?
What an awesome video, I was struggling to understand recursion until I saw this video. keept them comming
I feel bad for our teachers who had to teach us this 😂
Now I just gotta do it in assembly...
What a clean video anyone can understand from images itself Thanks a lot for this
I have never been good in math, even simple math. I have an app called IMPULSE. One of the games is Tower of Hanoi. It started out relatively simple but I was taking so long to finish each level and was ending up at 2% of the number of moves and time used. So i searched out a video to help me understand how this game works. I never thought it was a mathematical problem. One of my issues is my ADHD & ASD brain. Trying to keep organized in my thinking is not easy. But now I hope to finish my next level in much fewer moves. I will never reach a faster time, but improving in fewer moves is now my biggest goal. Thank you for this video
love it... awesome explanation of recursion.
You're the only cs channel using manim at that level. Respect bro, keep going