### Re: Finding a random position within a long string (Activeperl Build 822)

by snopal (Pilgrim)
 on Oct 12, 2007 at 21:26 UTC ( #644541=note: print w/replies, xml ) Need Help??

It seems to me that you can not have "random" and "equally distributed" without knowing the sampling size after the process. Random is one thing, handling a equal distribution randomly is a whole 'nother ball of wax.

• Comment on Re: Finding a random position within a long string (Activeperl Build 822)

Replies are listed 'Best First'.
Re^2: Finding a random position within a long string (Activeperl Build 822)
by mwah (Hermit) on Oct 12, 2007 at 22:39 UTC
snopalyou can not have "random" and "equally distributed" without knowing the sampling size after the process

As I see this, if you take samples of length M = k * W (from
the whole string of length W), then the mean ratio of the property
in question ('?' to non '?') in each M-sample should approach the
expected ratio R (e.g. 0.1), if the number of samples taken
is large enough. (The variance of the property in equally sized
M-samples shouldn't depend on their "position" within the whole ensemble.)

But maybe I didn't understand your objection correctly?

Regards

mwa

By your statement, there is no distribution restriction "if the number of samples taken is large enough." By placing all 10% of your '?' at the beginning and doing a tremendous number of samples, your "data full of ?" or "data of no ?" should even out to 10%. You just have to take a large number of samples.

Since neither the sample size, nor the number of samples is defined, it could just as easily be "one sample of ten percent plus one", the result of which would be that virtually every random solution would fail.

This looks like homework. The level of sophistication of your request changed dramatically from the original problem statement to the response you gave me.

Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://644541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2022-01-18 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
In 2022, my preferred method to securely store passwords is:

Results (52 votes). Check out past polls.

Notices?