How would I permutate n books on n shelves, with no limit on how many books could be placed on a shelf?
2 answers
https://math.stackexchange.com/questions/290570/how-to-solve-for-the-amount-of-arrangements-of-books-on-a-shelf
Take a numerical example,
suppose you have 3 different books on 3 different shelves
the books can line up on the shelves as:
3 0 0 or 0 3 0 or 0 0 3 ----- 3!/2! = 3 ways
2 1 0 or 2 0 1 or 1 2 0 or 1 0 2 or 0 1 2 or 0 2 1 ---- 3! = 6 ways
1 1 1 ----> 3!/3! = 1 way
10 ways just to arrange the books, but in each of these arrangement we can permutate the 3 books without changing the shelf arrangements.
So number of ways = 10*3! = 60
suppose you have 4 books with 4 shelves
the books can line up on the shelves as:
4 0 0 0 ------> 4!/3! = 4 ways
3 1 0 0 ------> 4!/2! = 12 ways
2 2 0 0 -----> 4!/(2!2!) = 6 ways
2 1 1 0 -----> 4!/2! = 12 ways
1 1 1 1 -----> 4!/4! = 1 way
35 ways just to arrange the books, but in each of these arrangement we can permutate the 4 books without changing the shelf arrangements.
So number of ways = 35*4! = 840
suppose you have 5 books with 5 shelves
the books can line up on the shelves as:
5 0 0 0 0 ---- 5!/4! = 5 ways
4 1 0 0 0 ----- 5!/3! = 20
3 2 0 0 0 -----> 5!/3! = 20
3 1 1 0 0 -----> 5!/(2!2!) = 30
2 2 1 0 0 -----> 5!/(2!2!) = 30
2 1 1 1 0 -----> 5!/3! = 20
1 1 1 1 1 ------> 1 way
126 ways just to arrange the books, but in each of these arrangement we can permutate the 5 books without changing the shelf arrangements.
So number of ways = 126*5! = 15120
I might be overthinking this problem, and I might have missed one or more cases, or might have made arithmetic errors,
but I really don't see any organized way of doing this.
suppose you have 3 different books on 3 different shelves
the books can line up on the shelves as:
3 0 0 or 0 3 0 or 0 0 3 ----- 3!/2! = 3 ways
2 1 0 or 2 0 1 or 1 2 0 or 1 0 2 or 0 1 2 or 0 2 1 ---- 3! = 6 ways
1 1 1 ----> 3!/3! = 1 way
10 ways just to arrange the books, but in each of these arrangement we can permutate the 3 books without changing the shelf arrangements.
So number of ways = 10*3! = 60
suppose you have 4 books with 4 shelves
the books can line up on the shelves as:
4 0 0 0 ------> 4!/3! = 4 ways
3 1 0 0 ------> 4!/2! = 12 ways
2 2 0 0 -----> 4!/(2!2!) = 6 ways
2 1 1 0 -----> 4!/2! = 12 ways
1 1 1 1 -----> 4!/4! = 1 way
35 ways just to arrange the books, but in each of these arrangement we can permutate the 4 books without changing the shelf arrangements.
So number of ways = 35*4! = 840
suppose you have 5 books with 5 shelves
the books can line up on the shelves as:
5 0 0 0 0 ---- 5!/4! = 5 ways
4 1 0 0 0 ----- 5!/3! = 20
3 2 0 0 0 -----> 5!/3! = 20
3 1 1 0 0 -----> 5!/(2!2!) = 30
2 2 1 0 0 -----> 5!/(2!2!) = 30
2 1 1 1 0 -----> 5!/3! = 20
1 1 1 1 1 ------> 1 way
126 ways just to arrange the books, but in each of these arrangement we can permutate the 5 books without changing the shelf arrangements.
So number of ways = 126*5! = 15120
I might be overthinking this problem, and I might have missed one or more cases, or might have made arithmetic errors,
but I really don't see any organized way of doing this.