Wednesday, July 1, 2009

Transform a dice

You are given a dice with 4 faces, which generate numbers with uniform probability {1, 2, 3, 4}. Generate a number in {1, 2, 3, 4, 5, 6, 7} with uniform probability.

1 comment:

  1. Could y, as calculated below, be uniform?

    1. Throw the dice twice and you get two numbers x1 and x2: x1 = {1,2,3,4} and x2 = {1,2,3,4}

    2. If x2=x1 or x2=x1+1:
    Calculate y=x1+x2-1

    3. Else: do not use the result, goto 1.

    ReplyDelete