• (cs) in reply to savar
    savar:
    Pasotaman:
    As a side comment, the real WTF is that a previous poster doesn't know how to make a uniform choice between 12 options with a 2-sided coin. You may hand your geek card at the door.

    Please explain how this is done. Since 12 isn't a power of two, I think it would be quite hard.

    Let's roll our eyes yes?

    let thier be two options and a divice that produces one of two outputs 1/2 of the time. If we map one option to each of the two outputs, we can make a choice.

    Now for the hard part.

    Let thier be N options, and a device that can produce one of K possibilities with a 1/K probability. Notice that N is not necessarily a factor of K, and vice versa. Let us introduce a second option space. This option Space must have cardinaility that is both a multiple of K and a multiple of N. The simple choice is to multiply N by K. Map each of the original N options to K options in the second option space. Divide the second option map into K sets and associate with each set a distinct output from the device. Let the device work, select the set whose associated output has occured. If its cardinaility is one reverse map the symbol back to your original symbols. Otherwise repeat the division of the selected set by K.

    Anyway, I actually thought the the OCR calculator to be a good idea. Though it's implementation can doubtlessly be improved. The Virtual Circuit calculator is a wonder wrapped inside an enema too. I wonder if they'll make a port for java?

  • zzz (unregistered)

    Just use modulo division.

        int v = 0;
        int Random12(ICoin coin)
        {
            return (Random16(coin)+(v++))%12;
        }
        int Random16(ICoin coin)
        {
            int k = 0;
            for (int i = 0; i < 4; i++)
            {
                k += (int)Math.Pow(2, i) * (coin.Get() ? 0 : 1);
            }
            return k;
        }
    
  • zzz (unregistered)

    And there is actually a proof of corectness.

    [0, 83613] [1, 83201] [2, 82878] [3, 83669] [4, 83578] [5, 83281] [6, 83505] [7, 83345] [8, 83366] [9, 83528] [10, 83035] [11, 83001]

  • (cs)

    I wonder why no finalist article featured the promised static analysis results. Are we supposed to run Coverity ourselves? 8=]

  • CAPTCHA:howdy (unregistered) in reply to zzz

    And here is a nice disproof: [image]

    use strict;
    use warnings;
    
    my $v = 0;
    sub rand12()
    {
            my $r = int rand 16;
            return(($r + ($v++)) % 12);
    }
    
    my %results = ();
    
    my $prev = rand12();
    for(1..10000000)
    {
            my $new = rand12();
            $results{"$prev $new"}++;
            $prev = $new;
    }
    
    for my $r(0..11)
    {
            for my $c(0..11)
            {
                    print qq{$results{"$r $c"},};
            }
            print "\n";
    }
    
  • Pasotaman (unregistered) in reply to Yariv
    Yariv:
    Pasotaman:
    As a side comment, the real WTF is that a previous poster doesn't know how to make a uniform choice between 12 options with a 2-sided coin. You may hand your geek card at the door.

    It is impossible, unless you use the coin as currency and by a 6*k-dice (k will be 1 or 2, probably), or allow algorithms that are not guarenteed to stop after any given amount of time. The reason is that there is no such n that 12 divide 2^n, and so no algorithm that will use at most n coin-flips can split the 2^n possible results to 12 sets of equal size.

    True, but totally irrelevant for two reasons:

    a) The random algorithms don't have guaranteed convergence, but the probability that they converge tends exponentially to 1. This can also be said of Montecarlo algorithms, widely used in the real world.

    b) If fixed n is a priority, a good approximation to randomness can be easily constructed. Let's take n=32 to keep the numbers tractable. If we follow an arbitrary a rule to assign coin tosses to zeros and ones, we can construct an unsigned int (x) from 0 to 2^32-1. Since 2^32-1=357913941*12+3, the variable y=MOD(x,12) has the following probability mass function:

    f(y)=(357913941+1)/(2^32)=0.08333333348855376244 if y in [0,1,2,3] 357913941/(2^32)=0.08333333325572311878 if y in [4,5,...,11]

    Equiprobable enough for most common uses, I think. If not, take a larger n.

  • vDave (unregistered) in reply to savar
    savar:
    Pasotaman:
    As a side comment, the real WTF is that a previous poster doesn't know how to make a uniform choice between 12 options with a 2-sided coin. You may hand your geek card at the door.

    Please explain how this is done. Since 12 isn't a power of two, I think it would be quite hard.

    START: Choose 4 random bits (you DO know how to get a bit from a coin, right?).

    Concat them into a hex_digit. If hex_digit > 0xB then goto START

    now, wasn't that hard?

    -dave-

  • (cs)

    The real WTF is that certain folk are rushing to prove Savar wrong without reading the replies.

    By adding unnecessary and elaborate explanations, proofs and algorithms, these people show how eager they are to restate the obvious over and over again.

    It's the same as seeing someone who accidentally pushes a door before reading the "pull" sign, then recite him/her the full definition of the world pull from multiple dictionaries, and taking him on a tour through the door-manufactoring plant. Three times.

  • (cs)

    This seemed like a hard choice at first. Then I noticed the balloon from the Universal Calculator saying that it had added my operands, and immidiately I knew what to vote. I literary laughed out loud. Btw, I still don't know what the N button does...

  • The real WTF (unregistered)

    There were only 12 finalists instead of 300.

  • kaiza (unregistered)

    12 sided coin?

    [image]

    ok I know it doesn't have a total of twelve sides, but in the spirit of WTF I propose assigning an entry to each side and ignoring the result if it lands face up or down. Alternately you could just roll the coin along a channel of some sort.

    captcha = bling - the original round coin was 80% silver which in todays dollar terms would make it worth nearly 10 times its face value. bling indeed

  • (cs) in reply to foxyshadis
    foxyshadis:
    I was probably most disappointed by the lack of self-modifying code in the finalists. That would have been the instant winner for me, having once tried to debug an emulator that used it.

    Do you like self-patching ASM code? If yes, then too bad (for me) you weren't one of the judges ...

  • Ericles (unregistered)

    Was anyone able to make the ORCAL actually work? I couldn't draw anything other than 1s and 7s though sometimes my attempts at an 8 turned into a 0.

  • JokerPokerUberSmoker (unregistered)

    It's got to be the Universal Calculator for me ... the total wackiness (is that a word) of it had me splitting my sides. Full to the brim with WTFs and fruit calculations too ... inspired.

  • (cs) in reply to zzz
    zzz:
    Just use modulo division.
        int v = 0;
        int Random12(ICoin coin)
        {
            return (Random16(coin)+(v++))%12;
        }
        int Random16(ICoin coin)
        {
            int k = 0;
            for (int i = 0; i < 4; i++)
            {
                k += (int)Math.Pow(2, i) * (coin.Get() ? 0 : 1);
            }
            return k;
        }</div></BLOCKQUOTE>
    

    Any single result will be strongly biased towards four of the options ((rand 16) mod 12 will produce twice as many 0, 1, 2, or 3 results than any other) , and the "v++" term means that there is strong correlation between successive results.

  • Foobar (unregistered)

    Dodecahedron roll it.

  • Jon (unregistered) in reply to Ericles
    Ericles:
    Was anyone able to make the OCRCAL actually work? I couldn't draw anything other than 1s and 7s though sometimes my attempts at an 8 turned into a 0.
    You have to draw each arc and line segment separately. To draw a digit 2, for example, draw the arc at the top, release the mouse button, draw the diagonal line, release the mouse button and draw the final horizontal line.
  • (cs) in reply to Brad Peterson
    Brad Peterson:
    This was hard. Every single entry was the product of complete genius.

    OMG!OCRCAL had to get my vote. Simply because it combined two absolutely fascinating WTFs. The English style definition file alone would have won it for me, but having it combined with that user interface still leaves me amazed.

    What two fascinating WTF did it embody?

    The English style definition file? Why is that a WTF? What is using English to define a set of rules, instead of a cryptic language a WTF?

    Why is it a WTF to allow the user to draw the numbers?

    You are right, not many people know how to speak English, and fewer people know how to write.

    So far the only WTF I've seen in this particular code is the fact that each rule in the definition file has to be a separate stroke.

    Don't get me wrong, this is a WAY cool program. Just like the universal calculator was way cool. But WTF? Hardly. I think only 2 or 3 of the 12 finalists followed the spirit, if not the leter of the contest.

  • Jon (unregistered) in reply to Jon
    Jon:
    Ericles:
    Was anyone able to make the OCRCAL actually work? I couldn't draw anything other than 1s and 7s though sometimes my attempts at an 8 turned into a 0.
    You have to draw each arc and line segment separately. To draw a digit 2, for example, draw the arc at the top, release the mouse button, draw the diagonal line, release the mouse button and draw the final horizontal line.
    Whoops, don't know what I was talking about there. The 2 is actually drawn with a single semicircle and a horizontal line under it. The truth is shown on the number pad.
  • (cs) in reply to savar
    savar:
    vt_mruhlin:
    Despite the WTF Web Calc using my Google design, I have to go with The Buggy 4-Function Calculator for looking like something that might actually exist.

    Yeah its the clear winner in terms of being a hilarious sendup of things we see every day here.

    People just don't know how to vote.

    // Remove this comment before posting.

    CommunityServer 2.0: Now with Virtual Hanging Chads!

  • (cs) in reply to savar
    savar:
    Pasotaman:
    As a side comment, the real WTF is that a previous poster doesn't know how to make a uniform choice between 12 options with a 2-sided coin. You may hand your geek card at the door.

    Please explain how this is done. Since 12 isn't a power of two, I think it would be quite hard.

    Flip the coin 11 times. Add up the number of heads, vote for finalist #(number of heads + 1).

    (This certainly explains why #6 has the highest number of votes...)

Leave a comment on “OMG Finalist Week Conclusion & Voting”

Log In or post as a guest

Replying to comment #:

« Return to Article