Very clear and visual explanation of Fisher-Yates, including why it's better. I've used the algorithm in my code without really understanding it. Now I do, which feels good. You are great at explaining things!
This was fantastic! Very clear way to teach each of the three shuffling algorithms. I wanted to create a shuffling algorithm in Perl in order to learn the language more deeply, and I was able to create the algorithm (Fisher-Yates Modernized) in a very pleasant fashion thanks to your video! Thank you so much and I wish you have a lovely day!
I implemented this algorithm myself for shuffling deck of cards without even knowing that it's already a well known algorithm. Saw your video and noticed it
The linear time solution isn't truly same as the first two because the last element in the array is always moved away. However, it should have a small chance to stay in its original position in the final result. I think we should add an additional swap to fix this.
Im a little bit confused because shuffle the deck should be completly random, and correct me if im wrong but in the modern version its not really random cause the last index could never be shuffled into the position which kinda make it 100% for the last card to be diifferent which means is not completly random... am i missing something or is it just the way it designed?
Interesting. I did this in similar way to third method. I itereted through an array (0, n) then I took random element from range (0, n) and swapped that with the choosen one. Swap(i, rand(0, n) ; I think this is actually a little better beacuse it is shuffling the last element. In your case 7.