Permutations without Repetition


Example: what order could 16 pool balls be in? (Order does matter.)

Preview of this algorithm

Icon Variable
Ask for n with default 0
Icon Output
Print text n = number of items per column
Icon Variable
Ask for t with default 0
Icon Output
Print text t = number of columns
Icon Variable
Set x to 0
Icon Variable
Set r to 1
Icon Structure
While x < t
Icon Variable
Set y to n - x
Icon Variable
Set r to r * y
Icon Variable
Set x to x + 1
Icon Structure
End
Icon Output
Print variable r