Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Interesting to see that ... it takes a few dozen iterations to actually reach middle ground:

That is the nature of randomness. If it was exactly 50:50, it wouldn't be random.

But the more trials you run, the closer it will tend. This is more evident if you run this version with various different resets:

C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f +: %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; re +do}" 10 45.455 : 54.545 27.273 : 72.727 36.364 : 63.636 54.545 : 45.455 72.727 : 27.273 63.636 : 36.364 36.364 : 63.636 45.455 : 54.545 27.273 : 72.727 36.364 : 63.636 72.727 : 27.273 45.455 : 54.545 54.545 : 45.455 63.636 : 36.364 C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f +: %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; re +do}" 100 52.475 : 47.525 52.475 : 47.525 52.475 : 47.525 46.535 : 53.465 45.545 : 54.455 51.485 : 48.515 41.584 : 58.416 46.535 : 53.465 42.574 : 57.426 40.594 : 59.406 C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f +: %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; re +do}" 1000 49.750 : 50.250 51.349 : 48.651 48.651 : 51.349 53.047 : 46.953

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

In reply to Re^3: Send x% of the users to A, the rest to B by BrowserUk
in thread Send x% of the users to A, the rest to B by DreamT

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [ambrus]: I think the minimal implementation here is just a timer and io function, plus pushing to the @REGISTRY.
    [Corion]: ambrus: Yeah, at least that's what I think I'll start with. A timer and potentially the dummy IO function that never is ready
    [ambrus]: That only lets you invoke the main loop from Prima->run;, not from AnyEvent->condvar- >recv; but that shouldn't matter

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (8)
    As of 2016-12-08 12:31 GMT
    Find Nodes?
      Voting Booth?
      On a regular basis, I'm most likely to spy upon:

      Results (141 votes). Check out past polls.