Skip to content

First program accepts as an input a permutation and prints the permutation rank in the lexicpgraphic order of all same length permutations. Second program accepts two integers n and k as inputs and prints the permutation of [n] which is at position k in the lexicographic order of all its permutations of [n].

License

Notifications You must be signed in to change notification settings

PetePrattis/Permutations-and-Lexicographic-order

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Python Exercise

This is a simple python project from my early days as a Computer Science student

This programm was created for the second semester class Discrete mathematics

Description of project

A program that accepts as an input a permutation in a list format from natural numbers separated by the space character (eg 7 10 9 11 2 1 3 5 6 8 4) and prints the permutation rank in the lexicographic order of all same length permutations.

A program that accepts two integers n and k as inputs and prints the permutation of [n] which is at position k in the lexicographic order of all its permutations of [n].

About this project

  • The comments to make the code understandable, are within the .py archive
  • This program runs for Python version 3.6+
  • This repository was created to show the variety of the work I did and experience I gained as a student

About

First program accepts as an input a permutation and prints the permutation rank in the lexicpgraphic order of all same length permutations. Second program accepts two integers n and k as inputs and prints the permutation of [n] which is at position k in the lexicographic order of all its permutations of [n].

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages