On Mon, Jun 28, 2010 at 11:26 AM, michel paul <mpaul...@gmail.com> wrote:
> There's no problem whatsoever in using lists of numbers, both the
> combinations and permutations functions return the expected lists of values,
> but there is this inconsistency when trying to use letters.
> - Michel

You should use the upper-case versions.  The lower-case versions that
you're using will be deprecated in Sage 5.0:

sage: Permutations(var('a,b,c')).list()
[[a, b, c], [a, c, b], [b, a, c], [b, c, a], [c, a, b], [c, b, a]]
sage: Permutations(list('abc')).list()
[['a', 'b', 'c'], ['a', 'c', 'b'], ['b', 'a', 'c'], ['b', 'c', 'a'],
['c', 'a', 'b'], ['c', 'b', 'a']]
sage: Combinations(list('abcde'), 3).list()
[['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'b', 'e'], ['a', 'c', 'd'],
['a', 'c', 'e'], ['a', 'd', 'e'], ['b', 'c', 'd'], ['b', 'c', 'e'],
['b', 'd', 'e'], ['c', 'd', 'e']]
sage: Combinations(var('a b c d e'), 3).list()
[[a, b, c], [a, b, d], [a, b, e], [a, c, d], [a, c, e], [a, d, e], [b,
c, d], [b, c, e], [b, d, e], [c, d, e]]

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to sage-...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-edu+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en.

Reply via email to