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

Home > Probability
Paint it black II (Posted on 2007-04-17) Difficulty: 3 of 5
The eight corner cubes of the black cube formed in Paint it black (the cubes with half their faces already painted black) are assembled randomly into a smaller cube, with the outside of the new cube once again being painted black.

The eight cubes are then, again, disassembled and rebuilt randomly.

What is the probability that the outside of this cube is again completely black?

Bonus: What would the probability be if the smaller cube of eight cubes were a random selection of any eight cubes from the original black cube instead of only the eight corner cubes?

See The Solution Submitted by Dej Mar    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution bonus solution Comment 2 of 2 |

There are 77 configurations of what original type pieces wind up in the final 2x2x2 cube, such as 6 vertex pieces, 1 center piece, 1 edge piece and no face pieces. If v, c, e and f represent the number of vertex, center, edge and face pieces respectively, the probability of any given such configuration is 8!*12!*6!*C(8,v)*C(8-v,c)*C(8-v-c,e)/((8-v)!*(12-e)!*(6-f)!*(27!/19!))

We must get the conditional probabilities for each type of cube to eventually show all black faces, and then for each such configuration, raise each conditional probability to the power of the number of such cubes in the configuration, to get the overall probability that that configuration will produce an all-black outer surface, and then multiply by the probability that the configuration will in fact be that, as defined in the preceding paragraph.

We've already shown that the probability of an originally corner piece eventually showing all black is 27/64. What about the others?

Originally edge:
There are three positional edges at which the double-black edge can be aligned so that one extra face gets painted black, making three faces black. Another three positional edges hide the already-painted faces completely in the intermediate stage, so that five faces come out black. In the remaining 6 cases, one black face is outside and two white, which become black, making 4 black altogether. The table:

faces prob.  prob of showing all black   product
  3    1/4          1/8                    1/32
  4    1/2          1/4                    1/8
  5    1/4          1/2                    1/8
 

The sum of the products is 9/32.
 
Originally face:
The probability is 1/2 that the black face will be buried and the cube then gets a total of 4 black faces, and 1/2 that its black face merely gets a second coat of black, along with two other faces getting their first coat. The table:
 


faces prob.  prob of showing all black   product
  3    1/2          1/8                    1/16
  4    1/2          1/4                    1/8

The sum of these products is 3/16.

If a cube was originally in the center, it will definitely have 3 painted faces going into the final phase, leaving a probability of 1/8 of showing all black at the end.

The following program incorporates these probabilities:

  10   VProb=27//64:EProb=9//32:FProb=3//16:CProb=1//8
  100   for NoVert=0 to 8
  200    if NoVert=8 then CLim=0:else CLim=1
  300   for NoCent=0 to CLim
  400    ELim=8-NoVert-NoCent
  500   for NoEdge=0 to ELim
  600    NoFace=8-NoVert-NoCent-NoEdge
  700 
  800   if NoFace<=6 then
  810    :print NoVert;NoCent;NoEdge;NoFace;
  900    :PConfig=!(8)//!(8-NoVert)*!(12)//!(12-NoEdge)*!(6)//!(6-NoFace)
 1000    :PConfig=PConfig//(!(27)//!(19))
 1100    :PConfig=PConfig*combi(8,NoVert)*combi(8-NoVert,NoCent)*combi(8-NoVert-NoCent,NoEdge)
 1200    :Tp=Tp+PConfig
 1300    :print PConfig;
 1400    :Ct=Ct+1
 1500    :TProb=TProb+VProb^NoVert*EProb^NoEdge*FProb^NoFace*CProb^NoCent*PConfig:print VProb^NoVert*EProb^NoEdge*FProb^NoFace*CProb^NoCent
 1600 
 1700   next NoEdge
 1800   next NoCent
 1900   next NoVert
 2000   print Tp,Ct:print TProb:print TProb/1,1/TProb

It finds a probability for the second case, of 247324600785879/4628855992006737920, or
0.0000534310424029106 which is 1 in  18715.7119724380656633462

The particular probabilities making this up are:
                                 conditional
# of pieces          prob of     prob of success
vtx ctr edge face    this config given this config
0   0    2     6     2/67275    59049/17179869184
0   0    3     5     8/13455    177147/34359738368
0   0    4     4     1/299      531441/68719476736
0   0    5     3     32/4485    1594323/137438953472
0   0    6     2     28/4485    4782969/274877906944
0   0    7     1     16/7475    14348907/549755813888
0   0    8     0     1/4485     43046721/1099511627776
0   1    1     6     4/740025   6561/4294967296
0   1    2     5     4/22425    19683/8589934592
0   1    3     4     4/2691     59049/17179869184
0   1    4     3     4/897      177147/34359738368
0   1    5     2     8/1495     531441/68719476736
0   1    6     1     56/22425   1594323/137438953472
0   1    7     0     8/22425    4782969/274877906944
1   0    1     6     32/740025  177147/34359738368
1   0    2     5     32/22425   531441/68719476736
1   0    3     4     32/2691    1594323/137438953472
1   0    4     3     32/897     4782969/274877906944
1   0    5     2     64/1495    14348907/549755813888
1   0    6     1     448/22425  43046721/1099511627776
1   0    7     0     64/22425   129140163/2199023255552
1   1    0     6     8/2220075  19683/8589934592
1   1    1     5     64/246675  59049/17179869184
1   1    2     4     16/4485    177147/34359738368
1   1    3     3     128/8073   531441/68719476736
1   1    4     2     8/299      1594323/137438953472
1   1    5     1     128/7475   4782969/274877906944
1   1    6     0     224/67275  14348907/549755813888
2   0    0     6     28/2220075 531441/68719476736
2   0    1     5     224/246675 1594323/137438953472
2   0    2     4     56/4485    4782969/274877906944
2   0    3     3     448/8073   14348907/549755813888
2   0    4     2     28/299     43046721/1099511627776
2   0    5     1     448/7475   129140163/2199023255552
2   0    6     0     784/67275  387420489/4398046511104
2   1    0     5     56/740025  177147/34359738368
2   1    1     4     112/49335  531441/68719476736
2   1    2     3     224/13455  1594323/137438953472
2   1    3     2     112/2691   4782969/274877906944
2   1    4     1     56/1495    14348907/549755813888
2   1    5     0     224/22425  43046721/1099511627776
3   0    0     5     112/740025 4782969/274877906944
3   0    1     4     224/49335  14348907/549755813888
3   0    2     3     448/13455  43046721/1099511627776
3   0    3     2     224/2691   129140163/2199023255552
3   0    4     1     112/1495   387420489/4398046511104
3   0    5     0     448/22425  1162261467/8796093022208
3   1    0     4     56/148005  1594323/137438953472
3   1    1     3     896/148005 4782969/274877906944
3   1    2     2     112/4485   14348907/549755813888
3   1    3     1     448/13455  43046721/1099511627776
3   1    4     0     56/4485    129140163/2199023255552
4   0    0     4     14/29601   43046721/1099511627776
4   0    1     3     224/29601  129140163/2199023255552
4   0    2     2     28/897     387420489/4398046511104
4   0    3     1     112/2691   1162261467/8796093022208
4   0    4     0     14/897     3486784401/17592186044416
4   1    0     3     56/88803   14348907/549755813888
4   1    1     2     56/9867    43046721/1099511627776
4   1    2     1     56/4485    129140163/2199023255552
4   1    3     0     56/8073    387420489/4398046511104
5   0    0     3     224/444015 387420489/4398046511104
5   0    1     2     224/49335  1162261467/8796093022208
5   0    2     1     224/22425  3486784401/17592186044416
5   0    3     0     224/40365  10460353203/35184372088832
5   1    0     2     56/148005  129140163/2199023255552
5   1    1     1     448/246675 387420489/4398046511104
5   1    2     0     112/67275  1162261467/8796093022208
6   0    0     2     28/148005  3486784401/17592186044416
6   0    1     1     224/246675 10460353203/35184372088832
6   0    2     0     56/67275   31381059609/70368744177664
6   1    0     1     56/740025  1162261467/8796093022208
6   1    1     0     112/740025 3486784401/17592186044416
7   0    0     1     16/740025  31381059609/70368744177664
7   0    1     0     32/740025  94143178827/140737488355328
7   1    0     0     8/2220075  10460353203/35184372088832
8   0    0     0     1/2220075  282429536481/281474976710656

For example, that last line shows the  282429536481/281474976710656 probability, given all 8 cubes are original corner cubes, but also the only 1/2220075 probability that all 8 would be corner cubes (8!(27-8)!/27!), so the product of these two fractions is the contribution to the overall probability.

A simulation program on this one is as follows

RANDOMIZE TIMER
DO
  REDIM cube(8, 6)
  REDIM had(27)
  FOR c = 1 TO 8
   DO
    r = INT(RND(1) * 27 + 1)
   LOOP UNTIL had(r) = 0
   had(r) = 1
   SELECT CASE r
    CASE 1 TO 8
     blk = 3
    CASE 9 TO 20
     blk = 2
    CASE 21 TO 26
     blk = 1
    CASE ELSE
     blk = 0
   END SELECT
   FOR f = 1 TO blk
    cube(c, f) = 1
   NEXT
  NEXT

  FOR c = 1 TO 8
    GOSUB chooseFace
    cube(c, f1) = 1
    cube(c, f2) = 1
    cube(c, f3) = 1
  NEXT
  good = 1
  FOR c = 1 TO 8
    GOSUB chooseFace
    IF cube(c, f1) = 0 THEN good = 0: EXIT FOR
    IF cube(c, f2) = 0 THEN good = 0: EXIT FOR
    IF cube(c, f3) = 0 THEN good = 0: EXIT FOR
  NEXT
  totGood = totGood + good: ct = ct + 1
  PRINT totGood; ct; totGood / ct;
  IF totGood > 0 THEN PRINT ct / totGood:  ELSE PRINT
LOOP


END

chooseFace:
  f1 = INT(RND(1) * 6 + 1)
  DO
    f2 = INT(RND(1) * 6 + 1)
  LOOP WHILE f2 = f1 OR f2 + f1 = 7
  DO
    f3 = INT(RND(1) * 6 + 1)
  LOOP WHILE f3 = f1 OR f3 + f1 = 7 OR f3 = f2 OR f3 + f2 = 7
RETURN

which gives the result as .0000971585E-05 or 1/25178.86 after 1082631 trials were run, for 43 successes.


  Posted by Charlie on 2007-04-18 09:35:40
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 (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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