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

 Paint it black II (Posted on 2007-04-17)
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.)
 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 successvtx ctr edge face    this config given this config`
`0   0    2     6     2/67275    59049/171798691840   0    3     5     8/13455    177147/343597383680   0    4     4     1/299      531441/687194767360   0    5     3     32/4485    1594323/1374389534720   0    6     2     28/4485    4782969/2748779069440   0    7     1     16/7475    14348907/5497558138880   0    8     0     1/4485     43046721/10995116277760   1    1     6     4/740025   6561/42949672960   1    2     5     4/22425    19683/85899345920   1    3     4     4/2691     59049/171798691840   1    4     3     4/897      177147/343597383680   1    5     2     8/1495     531441/687194767360   1    6     1     56/22425   1594323/1374389534720   1    7     0     8/22425    4782969/2748779069441   0    1     6     32/740025  177147/343597383681   0    2     5     32/22425   531441/687194767361   0    3     4     32/2691    1594323/1374389534721   0    4     3     32/897     4782969/2748779069441   0    5     2     64/1495    14348907/5497558138881   0    6     1     448/22425  43046721/10995116277761   0    7     0     64/22425   129140163/21990232555521   1    0     6     8/2220075  19683/85899345921   1    1     5     64/246675  59049/171798691841   1    2     4     16/4485    177147/343597383681   1    3     3     128/8073   531441/687194767361   1    4     2     8/299      1594323/1374389534721   1    5     1     128/7475   4782969/2748779069441   1    6     0     224/67275  14348907/5497558138882   0    0     6     28/2220075 531441/687194767362   0    1     5     224/246675 1594323/1374389534722   0    2     4     56/4485    4782969/2748779069442   0    3     3     448/8073   14348907/5497558138882   0    4     2     28/299     43046721/10995116277762   0    5     1     448/7475   129140163/21990232555522   0    6     0     784/67275  387420489/43980465111042   1    0     5     56/740025  177147/343597383682   1    1     4     112/49335  531441/687194767362   1    2     3     224/13455  1594323/1374389534722   1    3     2     112/2691   4782969/2748779069442   1    4     1     56/1495    14348907/5497558138882   1    5     0     224/22425  43046721/10995116277763   0    0     5     112/740025 4782969/2748779069443   0    1     4     224/49335  14348907/5497558138883   0    2     3     448/13455  43046721/10995116277763   0    3     2     224/2691   129140163/21990232555523   0    4     1     112/1495   387420489/43980465111043   0    5     0     448/22425  1162261467/87960930222083   1    0     4     56/148005  1594323/1374389534723   1    1     3     896/148005 4782969/2748779069443   1    2     2     112/4485   14348907/5497558138883   1    3     1     448/13455  43046721/10995116277763   1    4     0     56/4485    129140163/21990232555524   0    0     4     14/29601   43046721/10995116277764   0    1     3     224/29601  129140163/21990232555524   0    2     2     28/897     387420489/43980465111044   0    3     1     112/2691   1162261467/87960930222084   0    4     0     14/897     3486784401/175921860444164   1    0     3     56/88803   14348907/5497558138884   1    1     2     56/9867    43046721/10995116277764   1    2     1     56/4485    129140163/21990232555524   1    3     0     56/8073    387420489/43980465111045   0    0     3     224/444015 387420489/43980465111045   0    1     2     224/49335  1162261467/87960930222085   0    2     1     224/22425  3486784401/175921860444165   0    3     0     224/40365  10460353203/351843720888325   1    0     2     56/148005  129140163/21990232555525   1    1     1     448/246675 387420489/43980465111045   1    2     0     112/67275  1162261467/87960930222086   0    0     2     28/148005  3486784401/175921860444166   0    1     1     224/246675 10460353203/351843720888326   0    2     0     56/67275   31381059609/703687441776646   1    0     1     56/740025  1162261467/87960930222086   1    1     0     112/740025 3486784401/175921860444167   0    0     1     16/740025  31381059609/703687441776647   0    1     0     32/740025  94143178827/1407374883553287   1    0     0     8/2220075  10460353203/351843720888328   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)
FOR c = 1 TO 8
DO
r = INT(RND(1) * 27 + 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

 Search: Search body:
Forums (1)