#17242: Uniform random generation  of Composition of a given size
-------------------------------------+-------------------------------------
       Reporter:  g.chatel           |        Owner:  gchatel
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorics      |   Resolution:
       Keywords:  composition,       |    Merged in:
  combinatorics, random              |    Reviewers:
        Authors:  Grégory Châtel     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  public/combinat    |  2470bbf9bbfcab09c8645d9ec36c64467bc75b42
  /composition-random-17242          |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by darij):

 I have not done any benchmarks, but I bet that
 `[sage.misc.prandom.choice([0,1]) for _ in range(self.n - 1)]` is faster
 than `FiniteWords_length_k_over_OrderedAlphabet(A, length = self.n -
 1).random_element()` (and, besides, works for n = 0 as well).

--
Ticket URL: <http://trac.sagemath.org/ticket/17242#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to