Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Bag uniform distribution algorithms

by kennethk (Monsignor)
on Apr 25, 2013 at 20:41 UTC ( #1030730=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    use List::Util 'sum';
    ...
    
    pp gen( { A => 4, B => 2, C => 3, D => 1 } );
    pp gen( { A => 5, B => 4, C => 3, D => 2, E => 1 } );
    
  2. or download this
    ["A", "C", "B", "A", "D", "C", "A", "B", "C", "A"]
    ["A" .. "D", "A", "B", "E", "A", "C", "B", "A", "D", "C", "B", "A"]
    
  3. or download this
    use strict;
    use warnings;
    use List::Util 'sum';
    ...
    print measure("A", "C", "B", "A", "D", "C", "A", "B", "C", "A"), "\n";
    print measure("A", "C", "B", "A", "C", "D", "A", "B", "C", "A"), "\n";
    print measure("A", "A", "A", "A", "B", "B", "C", "C", "C", "D"), "\n";
    
  4. or download this
    0.37
    0.37
    3.45
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030730]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-08-31 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls