On 3/4/11 11:38 PM, Santanu Sarkar wrote:
How one can generate random permutation over the set
A={1,2,...,50}?



I think this does it:

sage: Permutations(50).random_element()
[11, 4, 30, 48, 49, 36, 22, 16, 27, 6, 44, 33, 13, 50, 9, 35, 15, 12, 26, 45, 1, 18, 2, 40, 19, 10, 28, 7, 37, 46, 25, 29, 34, 41, 38, 24, 8, 20, 32, 21, 14, 23, 31, 47, 43, 17, 3, 39, 5, 42]


Jason


--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to