Strings with given frequency
Is there a sage function that gives me all vectors/strings/lists/tuples of integers with given "absolute frequency"? i.e.
dwim([2, 1]) == ["001", "010", "100"]
asked 2014-02-04 17:52:06 +0100
Anonymous
Is there a sage function that gives me all vectors/strings/lists/tuples of integers with given "absolute frequency"? i.e.
dwim([2, 1]) == ["001", "010", "100"]
What you want is probably Permutations
sage: P = Permutations([0]*2+[1])
sage: P.list()
[[0, 0, 1], [0, 1, 0], [1, 0, 0]]
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2014-02-04 17:52:06 +0100
Seen: 685 times
Last updated: Feb 04 '14
multi-symmetric functions and multi-partitions
A Combinatorics Problem - Product Rule Indices
Dictating the roots to RootSystem
iterating over a combinatorial class
Can I create these sequences with Sage?
A proper combinatorics tutorial?
All decompositions of a prime as a sum of four squares
Recursive backtracking function: how to clear variables on new function call?