Simple factorial and matrix question

  • Context: Undergrad 
  • Thread starter Thread starter arpace
  • Start date Start date
  • Tags Tags
    Factorial Matrix
Click For Summary
SUMMARY

The discussion centers on validating arrangements of numbers in n slots, specifically ensuring that each number from 1 to n is used exactly once without repetition. The user proposes using factorial notation, specifically n! (n factorial), to confirm the validity of these arrangements. They suggest that multiplying the values in each slot and comparing against n! is a method to check correctness, while also inquiring if (n!)^n could validate the entire grid. The consensus confirms that there are indeed n! permutations for arranging these numbers.

PREREQUISITES
  • Understanding of factorial notation (n!)
  • Basic knowledge of permutations and combinations
  • Familiarity with array data structures
  • Concept of validation in algorithm design
NEXT STEPS
  • Research "factorial properties in combinatorics"
  • Learn about "permutation algorithms in programming"
  • Explore "Sudoku validation techniques"
  • Study "backtracking algorithms for constraint satisfaction problems"
USEFUL FOR

Mathematicians, computer scientists, algorithm developers, and anyone interested in combinatorial logic and validation techniques in programming.

arpace
Messages
9
Reaction score
0
if I have n slots [1,2,3,4,5,...n] where I must use numbers from 1 through n, and I have to ensure that none of them were reused...

the way I figure to make sure that none of the numbers are reused is to multiply the values in each slot and compare them against n!

e.g. [1,2,3,4,5] would be correct, but [1,4,6,3,2] or [5,5,2,1,3]

kind of like sudoku's rule for a row but not quite
e.g. if I had n=6
[[1,2,3,4,5,6],
[6,1,2,3,4,5],
[5,6,1,2,3,4],
[4,5,6,1,2,3],
[3,4,5,6,1,2]]
that would be correct

Am I right in assuming that that n! would be useful for looping through the rows to see if they are correct? and then (n!)^(n) would be a way to validate the entire grid?

is this a rule I just don't know? is there a rule that is easier?
 
Last edited:
Physics news on Phys.org
arpace said:
if I have n slots [1,2,3,4,5,...n] where I must use numbers from 1 through n, and I have to ensure that none of them were reused...

the way I figure to make sure that none of the numbers are reused is to multiply the values in each slot and compare them against n!

e.g. [1,2,3,4,5] would be correct, but [1,4,6,3,2] or [5,5,2,1,3]

kind of like sudoku's rule for a row but not quite
e.g. if I had n=6
[[1,2,3,4,5,6],
[6,1,2,3,4,5],
[5,6,1,2,3,4],
[4,5,6,1,2,3],
[3,4,5,6,1,2]]
that would be correct

Am I right in assuming that that n! would be useful for looping through the rows to see if they are correct? and then (n!)^(n) would be a way to validate the entire grid?

is this a rule I just don't know? is there a rule that is easier?



Google "permutations", and yes: there are n! different ways to order in an array the numbers 1,2,...,n in such a way that each

appears exactly once.

DonAntonio
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
8
Views
3K
  • · Replies 27 ·
Replies
27
Views
4K
Replies
4
Views
2K