Looks very similar to my solution. My idea was that the bad shuffle might end 
up moving too many items back to the left, so I counted how many were in their 
original position or left. This should be around 500 for a proper shuffle. It 
worked, although it turned out that my instinct was backwards. I tested and 
came up with a cutoff value of 486 which predicted the correct answer with 
about 95% accuracy. This means that more items were actually to the right of 
their initial position in the bad shuffle.

The solution you posted looks like it does it the other way around - counts 
those that are to the right of their original position (5 or more positions) 
and then uses a cutoff of 508.

I feel like any quick and dirty measure of shuffle quality like this should be 
workable and avoids the need for difficult probability calculations.

Sam.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/885dc492-f0a2-4fbe-a564-dddfd2b47472%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to