Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Bag uniform distribution algorithms

by kcott (Archbishop)
on Apr 26, 2013 at 09:02 UTC ( [id://1030794]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -Mwarnings -E '
        my %bag = ( A => 4, B => 2, C => 3, D => 1 );
    ...
        say "@distribution";
    '
    A C B A D C A B C A
    
  2. or download this
    $ perl -Mstrict -Mwarnings -E '
        my %bag = ( A => 4, B => 2, C => 3, D => 1 );
    ...
        say "@distribution";
    '
    A C B A C D A B C A
    
  3. or download this
    my %bag = ( A => 4, B => 2, C => 3, D => 1, Z => 1 );
    
  4. or download this
    my %bag = ( A => 4, B => 2, C => 3, D => 1, Y => 5, Z => 1 );
    
  5. or download this
    my %bag = ( A => 4, B => 2, C => 3, D => 1, X => 6, Y => 5, Z => 1 );
    
  6. or download this
    my %bag = ( A => 4, B => 2, C => 3, D => 1, W => 4, X => 6, Y => 5, Z 
    +=> 1 );
    
  7. or download this
    A C B A Z D C A B C A
    Y A C Y B A C D Z Y A B Y C A Y
    X Y A C X Y B A C X D Z Y X A B Y X C A Y X
    X Y A W C X Y B A W C X D Z Y X W A B Y X C W A Y X
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found