Find The Rainbow

Seven balls of different weights are randomly painted red, orange, yellow, green, blue, indigo and violet, each ball being painted a distinct color.

The green ball is found to be heavier than the blue ball, and the red ball is found to be heavier than the yellow ball.

Given just this information, if the probability that the red ball is heavier than the blue ball is a b \dfrac{a}{b} , where a , b a,b are coprime positive integers, find a + b a + b .


Inspiration .


The answer is 11.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

6 solutions

Brian Moehring
Feb 16, 2017

There are 4 ! 4! ways to permute the four colors. The probability that green is heavier than blue is 1/2, the probability that red is heavier than yellow is 1/2, and these events are independent, so 4 ! ( 1 / 2 ) ( 1 / 2 ) = 6 4!(1/2)(1/2) = 6 of the permutations satisfy the givens.

Now, if red is not heavier than blue, then the order must be green > blue > red > yellow, so there is only one such permutation out of the six.

Therefore, the probability of the complement, which is what we want, is 5/6.

As ball are found to be heavier so why we are using its probability

Dhruv Joshi - 4 years, 2 months ago

Because, we do not know from the facts given that, for example, the red ball is lighter or heavier than the blue ball. We only know that they are different.

A Former Brilliant Member - 2 years, 3 months ago

Letting g , b , r , y g,b,r,y being the respective weights of the green, blue, red and yellow balls, and given that g > b g \gt b and r > y r \gt y , there are 6 6 possible sequences of g , b , r , y g,b,r,y embedded among the rankings of the weights of the seven balls written in descending order, namely

  • g > b > r > y g \gt b \gt r \gt y

  • g > r > b > y g \gt r \gt b \gt y

  • g > r > y > b g \gt r \gt y \gt b

  • r > g > b > y r \gt g \gt b \gt y

  • r > g > y > b r \gt g \gt y \gt b

  • r > y > g > b r \gt y \gt g \gt b

Each of these sequences is equally likely, since they each occur in ( 7 4 ) = 35 \binom{7}{4} = 35 possible rankings of the weights of the seven balls. In 5 5 of these we have r > b r \gt b , so the desired probability is 5 6 \dfrac{5}{6} , and so a + b = 5 + 6 = 11 a + b = 5 + 6 = \boxed{11} .

This is, in fact, the same explanation as given elsewhere. I am making the lists explicit.

Ignoring the orange, indigo and violet ball as distractors.

Assigning the remaining balls indices in the permutations to be generated.

{ r , y , g , b } = { 1 , 2 , 3 , 4 } \{r,y,g,b\}=\{1,2,3,4\}

Generating the 4 ! = 24 4!=24 permutations of 4 things take 4 at a time. The numbers in each permutation are the weights of the respective balls.

perms = Permutations [ Range [ 4 ] ] ( 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2 2 1 3 4 2 1 4 3 2 3 1 4 2 3 4 1 2 4 1 3 2 4 3 1 3 1 2 4 3 1 4 2 3 2 1 4 3 2 4 1 3 4 1 2 3 4 2 1 4 1 2 3 4 1 3 2 4 2 1 3 4 2 3 1 4 3 1 2 4 3 2 1 ) \text{perms}=\text{Permutations}[\text{Range}[4]] \Longrightarrow \\ \left( \begin{array}{cccc} 1 & 2 & 3 & 4 \\ 1 & 2 & 4 & 3 \\ 1 & 3 & 2 & 4 \\ 1 & 3 & 4 & 2 \\ 1 & 4 & 2 & 3 \\ 1 & 4 & 3 & 2 \\ 2 & 1 & 3 & 4 \\ 2 & 1 & 4 & 3 \\ 2 & 3 & 1 & 4 \\ 2 & 3 & 4 & 1 \\ 2 & 4 & 1 & 3 \\ 2 & 4 & 3 & 1 \\ 3 & 1 & 2 & 4 \\ 3 & 1 & 4 & 2 \\ 3 & 2 & 1 & 4 \\ 3 & 2 & 4 & 1 \\ 3 & 4 & 1 & 2 \\ 3 & 4 & 2 & 1 \\ 4 & 1 & 2 & 3 \\ 4 & 1 & 3 & 2 \\ 4 & 2 & 1 & 3 \\ 4 & 2 & 3 & 1 \\ 4 & 3 & 1 & 2 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)

Keeping the permutations where the green ball is heavier than the blue ball.

perms = Select [ perms , $#$1 [ [ g ] ] > $#$1 [ [ b ] ] & ] ( 1 2 4 3 1 3 4 2 1 4 3 2 2 1 4 3 2 3 4 1 2 4 3 1 3 1 4 2 3 2 4 1 3 4 2 1 4 1 3 2 4 2 3 1 4 3 2 1 ) \text{perms}=\text{Select}[\text{perms},\text{\$\#\$1}[[g]]>\text{\$\#\$1}[[b]]\&] \Longrightarrow \\ \left( \begin{array}{cccc} 1 & 2 & 4 & 3 \\ 1 & 3 & 4 & 2 \\ 1 & 4 & 3 & 2 \\ 2 & 1 & 4 & 3 \\ 2 & 3 & 4 & 1 \\ 2 & 4 & 3 & 1 \\ 3 & 1 & 4 & 2 \\ 3 & 2 & 4 & 1 \\ 3 & 4 & 2 & 1 \\ 4 & 1 & 3 & 2 \\ 4 & 2 & 3 & 1 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)

Keeping the permutations where the red ball is heavier than the yellow ball.

perms = Select [ perms , $#$1 [ [ r ] ] > $#$1 [ [ y ] ] & ] ( 2 1 4 3 3 1 4 2 3 2 4 1 4 1 3 2 4 2 3 1 4 3 2 1 ) \text{perms}=\text{Select}[\text{perms},\text{\$\#\$1}[[r]]>\text{\$\#\$1}[[y]]\&] \Longrightarrow \\ \left( \begin{array}{cccc} 2 & 1 & 4 & 3 \\ 3 & 1 & 4 & 2 \\ 3 & 2 & 4 & 1 \\ 4 & 1 & 3 & 2 \\ 4 & 2 & 3 & 1 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)

Selecting the permutations where the red ball was heavier than the blue.

heavier = Select [ perms , $#$1 [ [ r ] ] > $#$1 [ [ b ] ] & ] ( 3 1 4 2 3 2 4 1 4 1 3 2 4 2 3 1 4 3 2 1 ) \text{heavier}=\text{Select}[\text{perms},\text{\$\#\$1}[[r]]>\text{\$\#\$1}[[b]]\&] \Longrightarrow \\ \left( \begin{array}{cccc} 3 & 1 & 4 & 2 \\ 3 & 2 & 4 & 1 \\ 4 & 1 & 3 & 2 \\ 4 & 2 & 3 & 1 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)

Computing the fraction.

Length [ heavier ] Length [ perms ] 5 6 \frac{\text{Length}[\text{heavier}]}{\text{Length}[\text{perms}]} \Longrightarrow \frac{5}{6}

Computing the answer.

Denominator [ fraction ] + Numerator [ fraction ] 11 \text{Denominator}[\text{fraction}]+\text{Numerator}[\text{fraction}] \Longrightarrow 11

Vinay Gupta
Aug 18, 2018

Just lie down the balls along a line with 1st being the largest and last the smallest. Total ways is 7!. But given that green > blue and red>yellow which makes total case to be 7!/2.2 (since now there is only one way instead of 2 to arrange green and blue among themselves and similarly for red and yellow). Now if red>blue then out of 4! cases possible to arrange B,G,Y and R among themselves only 5 cases (GRBY,GRYB,RGBY,RGYB,RYGB) are favorable. Hence total favorable ways are 5.7!/4!. Just taking the ratio gives 5/6. So the answer is 5+6=11

The orange, indigo and violet ball are just distractors and can be ignored.

A Former Brilliant Member - 2 years, 3 months ago
Kyle T
Feb 14, 2019

Heres some ugly php that did it for me

<?php
//build all permutations of 0-6
$arr = range(0,6);
do{
$newarr = array();
foreach($arr as $a){
for($i=0;$i<=6;$i++){
if(!preg_match('@'.$i.'@',$a)){
$newarr[] = $a.$i;
}
}
}
$arr = $newarr;
} while(strlen($arr[0])<7);






//eliminate any instances where $a[3]<$a[4] or where $a[0]<$a[2]
$c = 0;
foreach($arr as $key=>$val){
$s = str_split($val);
if($s[3]<$s[4] || $s[0]<$s[2]){
unset($arr[$key]);
} elseif($s[0]>$s[4]){
$c++;
}
}

//count remaining combos, save for later (1240)
$rc = count($arr);

//treat $c as numerator, $rc as denominator, reduce fraction
$f = simplify($c,$rc);

//print answer
echo array_sum($f);

function simplify($num,$den) {
$g = gcd($num,$den);
return array($num/$g,$den/$g);
}

function gcd($a,$b) {
$a = abs($a); $b = abs($b);
if( $a < $b) list($b,$a) = array($a,$b);
if( $b == 0) return $a;
$r = $a % $b;
while($r > 0) {
$a = $b;
$b = $r;
$r = $a % $b;
}
return $b;
}
?>

Ervyn Manuyag
Aug 17, 2018

5+6=11 bcuz 5/6 was the prob

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...