# Thread: Sliding block puzzle problem

1. ## Sliding block puzzle problem

Hi, Im building a large scale sliding block puzzle ( you know the ones that are usually on a 4 x 4 grid and you have to get them in the correct order), I want to make one thats got a 14 x 20 grid. ( 279 blocks in total - keep in mind that there must always be one empty space on the grid for the blocks to slide into.

What I want to know, is how many possible variations of block alignment there are. Im not much of a mathematician, but if somebody could show me through the working of it and possibly give me an (X) x (Y) = ? equation for it (incase the dimensions change) that would be really great.

Thanks!

2. ## Re: Sliding block puzzle problem

Take the first possible 'placement'. There can be any of the 279 blocks, or the empty space there, giving 280 possibilities in the first 'placement'. Take any one block or space and put it there.

In the second placement, there will be one less, giving 279. Take another block or space (if the space was not already taken above).

In the third, there will be one less again, giving 278. Take another block or space (if the space was not already taken above).

And so on, until the last one where there is only one possibility, the last block, or space if it hasn't already been picked.

This gives you a total of 280*279*278*...*1, or 280! (read as 280 factorial) which is a huge number!!!

Why multiplied now, you may possibly ask.
The first 'placement' one has 280 different possibilities to pick. Assume you chose a block labeled '1'.
The second 'placement' will have 279 possibilities to pick from. This means that up to now, you have 1 and 279 others, which make 1 and 2 or, 1 and 3 or, 1 and 4, or 1 and 5, etc until you get to 1 and 280. You would first think... but why not ADD them? You multiply because in the case of 1 and 2, the next step gives you again many many more possibilites, from 1, 2 and 3 to 1, 2, and 280. Simply adding 279 initially forces you to add 278 for each time you added 279. And this goes on and on and if you want to add, you'll get lost after a few blocks only, or you'll go crazy