Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Random Sampling

by demerphq (Chancellor)
on Jun 26, 2002 at 11:15 UTC ( #177354=note: print w/ replies, xml ) Need Help??


in reply to Re: Random Sampling
in thread Random Sampling

Well, to be honest I think your criticism should be aimed at the way I presented the algorithm (mostly as "proof of concept") than the algorithm itself.

For instance it would work just fine for a picking N elelements from a file of known arbitrarily large size, regardless of fixed record or not, and of media restrictions (for instance it would work fine for data stroed on a tape).

Whereas the algorithm you mention (and thanks :-) needs to have the full set in memory at one time, or efficient random access to the records as stored on some form of fixed media (which afaict would require fixed record lengths).

I realize this criticism applys to my implementation as well, since I used an array. Clearly I shouldnt have as it distracts from the point I was making. :-)

Thanks for the comments though, added value for the thread for sure.

Update
Dont be sorry, I should have explained in more detail. You know the old saying about how

Ass u me

is a bad thing...

;-)

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.


Comment on Re: Re: Random Sampling

Log In?
Username:
Password:

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

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

    When choosing user names for websites, I prefer to use:








    Results (213 votes), past polls