Re: [sage-support] Re: Random Permutation

2013-03-04 Thread Martin Albrecht
Why not use shuffle()? On Monday 04 Mar 2013, Simon King wrote: > Hi Gary, > > On 2013-03-04, GaryMak wrote: > >> 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, 3

[sage-support] Re: Random Permutation

2013-03-04 Thread Simon King
Hi Gary, On 2013-03-04, GaryMak wrote: >> 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] > > I have a

[sage-support] Re: Random Permutation

2013-03-04 Thread GaryMak
On Saturday, March 5, 2011 5:42:21 AM UTC, Jason Grout wrote: > 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,

[sage-support] Re: Random Permutation

2011-03-04 Thread Jason Grout
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,