title: Finding the number of permutation inversions
body: <p>I was looking at <a href="http://mathworld.wolfram.com/15Puzzle.html" rel="nofollow">this</a> because I'm trying to make a fifteen puzzle solver. I don't really understand what it's talking about. How would I go about checking if a given set of numbers (from 0-15, stored in an array, 0 being the blank) is valid given that "if the permutation symbol of the list is +1 the position is possible". I'm working in javascript, if its relevant.</p>