Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Bag uniform distribution algorithms

by kcott (Abbot)
on Apr 26, 2013 at 09:02 UTC ( #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
Node Status?
node history
Node Type: note [id://1030794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2014-08-31 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls