Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Random Derangement Of An Array

by dcturner (Initiate)
on Dec 04, 2008 at 19:54 UTC ( #728077=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    }
    
    printf "Total %d (%d runs)\n", (scalar keys %f), $c;
    
  2. or download this
    $ ./derangements.pl 4
    2,3,0,1: 11.08% (expected -0.03%)
    ...
    3,2,1,0: 11.13% (expected +0.02%)
    3,2,0,1: 11.14% (expected +0.03%)
    Total 9 (1000000 runs)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2021-03-05 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (112 votes). Check out past polls.

    Notices?