The general method for shuffling is biased. Check this – https://spin.atomicobject.com/2014/08/11/fisher-yates-shuffle-randomization-algorithm/ and http://www.i-programmer.info/programming/theory/2744-how-not-to-shuffle-the-kunth-fisher-yates-algorithm.html
When shuffling the maximum number of possible outcome can’t be more then n!( n is the number of items being shuffled). So if the algo generate more then n! possible outcome then the algo is biased.
The Knuth Fisher-Yates Algorithm produces unbiased shuffled outcome. It relies on the fact that the each item/element is only shuffled once unlike the general algo which shuffles an element multiple time.
Code – http://www.geeksforgeeks.org/shuffle-a-given-array/