Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Get random unique lines from file

by roboticus (Canon)
on Aug 30, 2012 at 14:46 UTC ( #990776=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Get random unique lines from file
in thread Get random unique lines from file

Marshall:

I wasn't really worried whether it was the best way or not, nor whether it used modules or not. I was just amused by the technique for getting a single random line from a file with equal probability, and wanted to generalize it so I could use it for multiple lines.

Unfortunately, I haven't come up with any ideas that don't introduce a bias. (I haven't thought about it really hard for the last few days, but I've given it occasional thought during my daily commutes.)

I might be able to come up with something if I would sit down and analyze the probabilities, but it's not quite interesting enough to work *that* hard on it! ;^)

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^5: Get random unique lines from file
Re^6: Get random unique lines from file
by Marshall (Prior) on Sep 12, 2012 at 07:35 UTC
    Unless you are trying to game the tables in "Lost Wages" or do scientific calculations, this doesn't matter at all.
    Don't worry about it if it doesn't matter.

      Marshall:

      I'm not really worried about it--it's just an interesting problem. Most (?all?) of my activity here at PM is just me looking for an interesting diversion. This is just another diversion for me.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-26 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls