All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Assigning a wonky die (Posted on 2006-04-28) Difficulty: 2 of 5
I have an unfair die whose sides are known to have the following probabilities:{.02,.04,.08,.12,.24,.5}
Assign the numbers {1,2,3,4,5,6} to these sides so the expected roll is the same as for a fair die.

Can you solve this without brute force?

See The Solution Submitted by Jer    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution More brute force | Comment 3 of 4 |

If the weights are in sequence
 .02  .04  .08  .12  .24  .5

the numbers can be assigned in any of these orders:

134562
165324
246153
251643
325614
452163
526134
531624
612453
643215

or, looked at the other way around, for faces 1, 2, 3, 4, 5, 6:

 0.02 0.50 0.04 0.08 0.12 0.24
 0.02 0.24 0.12 0.50 0.08 0.04
 0.12 0.02 0.50 0.04 0.24 0.08
 0.08 0.02 0.50 0.24 0.04 0.12
 0.24 0.04 0.02 0.50 0.08 0.12
 0.12 0.08 0.50 0.02 0.04 0.24
 0.12 0.04 0.24 0.50 0.02 0.08
 0.08 0.24 0.04 0.50 0.02 0.12
 0.04 0.08 0.50 0.12 0.24 0.02
 0.24 0.12 0.08 0.04 0.50 0.02

the first list from:

DECLARE SUB permute (a$)
CLS
DATA .02,.04,.08,.12,.24,.5
FOR i = 1 TO 6
    READ vl(i)
    PRINT vl(i);
NEXT
PRINT

a$ = "123456": h$ = a$
DO
  t = 0
  FOR i = 1 TO 6
    t = t + vl(i) * VAL(MID$(a$, i, 1))
  NEXT
  IF t = 3.5 THEN
         PRINT a$
     ct = ct + 1
  END IF
  permute a$
LOOP UNTIL a$ = h$
PRINT ct

and the latter list from

DECLARE SUB permute (a$)
CLS
DATA .02,.04,.08,.12,.24,.5
FOR i = 1 TO 6
    READ vl(i)
    PRINT vl(i);
NEXT
PRINT

a$ = "123456": h$ = a$
DO
  t = 0
  FOR i = 1 TO 6
    t = t + vl(i) * VAL(MID$(a$, i, 1))
  NEXT
  IF t = 3.5 THEN
     FOR i = 1 TO 6
       ix = INSTR(a$, LTRIM$(STR$(i)))
       PRINT USING " #.##"; vl(ix);
     NEXT
     PRINT
     ct = ct + 1
  END IF
  permute a$
LOOP UNTIL a$ = h$
PRINT ct


  Posted by Charlie on 2006-04-28 15:01:51
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information