Ask Your Question

alsdasdakjshd's profile - activity

2014-02-05 11:24:16 +0100 received badge  Student (source)
2014-02-05 03:54:45 +0100 received badge  Supporter (source)
2014-02-05 03:54:26 +0100 marked best answer Strings with given frequency

What you want is probably Permutations

sage: P = Permutations([0]*2+[1])
sage: P.list()
[[0, 0, 1], [0, 1, 0], [1, 0, 0]]
2014-02-05 03:54:26 +0100 received badge  Scholar (source)
2014-02-04 17:52:06 +0100 asked a question 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"]