Today while browsing https://en.wikipedia.org/wiki/List_of_algorithms for an interesting algorithm to write about i came across the Fisher- Yates shuffle. Now besides just having a cool name it also has a very interesting function. This algorithm is defined to randomly shuffle a set of data by effectively putting the data in a hat and randomly selecting the data and placing it in order for the entire length of the input data. This creates an unbiased permutation meaning that each permutation is equally likely. This to me is amazing how this one algorithm can create unbiased permutations because most things will have a bias leading to a trend in the answers. The first 4 mins of this video give a physical representation of how the algorithm works

 

This algorithm unlike some others has the bonus that it can be stopped part way allowing it to be one of the better random number generating algorithms. This algorithm is quite amazing as i can be implemented in several different places for example in another one of our assignments we need to randomly sort a set of data and bubble sort it back into the correct order. We could implement the use of the Fisher-Yates shuffle method in order to shuffle that data for us. this algorithm has more uses then one would originally think. This could be applied in places such as inline card games to randomly shuffle the deck of cards, with some alteration Sudoku puzzles for the people who are smart enough to solve them and many more places. I will say that i believe that any algorithm has uses outside of the originally intended use but we can make it work in unison with other algorithms to get the final result we desire.

In the book “The pattern on the Stone” by W. Daniel Hillis He defines an algorithm on page 78 as a fail-safe procedure guaranteed to preform a specific task. This is proven true many times but i believe this to be especially true for the Fisher-Yates Shuffle. This algorithm will without bias shuffle the data given randomly complying completely with his definition of what an algorithm is.In the book through the chapter Algorithms and Heuristics he discusses how the best algorithm may not be the most obvious or easiest one to use. This rings true to me by a lot because as with the Fisher-Yates Shuffle program it is an older algorithm so within the near future it may become obsolete as people began to venture into the world of algorithms to make it faster and more effective for more data. This is because i believe the ultimate goal of all algorithms is to be the best and fastest the can be while still providing quality work. Algorithms are tricky as the do have a set purpose when created but can be adapted to solve a multitude of problems. For example the Fisher-Yates shuffle was originally intended to shuffle numbers but, when looked at in a broader sense it can shuffle data. From this realization almost anything can be possible as with slight tweaks it can shuffle a deck of cards or shuffle the order of players in a turn based game and many more things. All this can easily be achieved by others looking at an older algorithm and seeing how they can change it to fit there needs. The idea behind an algorithm is never set in stone as i believe that any algorithm can be altered to do a different task then intended with the same accuracy. This thinking is what sparked my interest in algorithms and allowed me to come across the Fisher-Yates shuffle algorithm to talk with you about today. Thank you for taking the time to read this blog and have a good day.

Advertisements