Yes I agree to it, it won't be random... but suppose I don't want a case
when all elements are at their own position........ because that case means
that they are not shuffled. Perhaps we can run the algorithm again, since
the probability of same event occurring two times in a row will be very
less.

On Tue, Jan 29, 2013 at 12:13 AM, Carl Barton <odysseus.ulys...@gmail.com>wrote:

> Because then it's not a random shuffle? If you randomly shuffle something
> the order you currently have should be just as likely as any other
>
>
> On 28 January 2013 12:29, shady <sinv...@gmail.com> wrote:
>
>> Why do we use Fisher Yates 
>> algorithm<http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm>
>>  when
>> in the worst case there is no shuffle at all ?
>> we can modify it by generating random number not inclusive of the element
>> that we are about to swap....
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to