Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Behold! The power of recursion.

by pg (Canon)
on Oct 18, 2004 at 04:32 UTC ( #400058=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        my $avg =$total / (2 ** $i - 1);
        print "For range 1 .. $last, total guesses = $total, avg = $avg\n"
    +;
    } 
    
  2. or download this
    For range 1 .. 1, total guesses = 1, avg = 1
    For range 1 .. 3, total guesses = 5, avg = 1.66666666666667
    ...
    For range 1 .. 262143, total guesses = 4456449, avg = 17.0000686648127
    For range 1 .. 524287, total guesses = 9437185, avg = 18.0000362396931
    For range 1 .. 1048575, total guesses = 19922945, avg = 19.00001907350
    +45
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-01 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls