Permutation with repetition algorithm needed
From: Emir Palandi (emirpalandi_at_pop.com.br)
Date: 09/08/04
- Next message: Ross A. Finlayson: "Re: Uncountable sets in CZF?"
- Previous message: Keith Ramsay: "Re: Co-re set with no infinite r.e. subset"
- Messages sorted by: [ date ] [ thread ]
Date: 7 Sep 2004 18:09:45 -0700
Given an arbitrary permutation of n distinct numbers, I know how to
map it to a unique number within the range (0, ..., n! - 1). I know
also how to do the inverse: given a number between (0, ..., n! - 1),
construct the corresponding permutation.
Does someone know of an algorithm to do this for permutations with
repetitions?
Suppose, for example, that I have m distinct numbers, each one
repeated r_k times, 1 <= k <= m.
Now
m
n = Sum r_k
k=1
and let
m
p = Product r_k!
k=1
Then the desired range is (0, ..., n!/p - 1).
Thanks in advance.
- Next message: Ross A. Finlayson: "Re: Uncountable sets in CZF?"
- Previous message: Keith Ramsay: "Re: Co-re set with no infinite r.e. subset"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|