# Thread: No of selections and probability

1. ## No of selections and probability

Six balls are selected from a set of 44 balls, numbered from 1 to 44. The balls are colored. The balles numbered, 1, 5, 9 ... are red, 2,6,10 are orange, the balls no, 3 ,7, 11 are yellow and the balls numbered 4,8,12... are pink

What is the probability that the selected six balls contain:
f)Four colours:

Heres my attempt: there are two cases:
[1,1,1,3] and [1,1,2,2]

This equates to
(4C3 x (11C1)^3 x (11C3) + 4C2 x (11C1)^2 x (11C2)^2)/44C11

However the book has a different solution:
(4C3 x (11C1)^3 x (11C3) + 4C2 x 2C1 X (11C1)^2 x (11C2)^2)/44C11

Can someone explain to me?

2. Originally Posted by Lukybear
Six balls are selected from a set of 44 balls, numbered from 1 to 44. The balls are colored. The balles numbered, 1, 5, 9 ... are red, 2,6,10 are orange, the balls no, 3 ,7, 11 are yellow and the balls numbered 4,8,12... are pink

What is the probability that the selected six balls contain:
f)Four colours:

Heres my attempt: there are two cases:
[1,1,1,3] and [1,1,2,2]

This equates to
(4C3 x (11C1)^3 x (11C3) + 4C2 x (11C1)^2 x (11C2)^2)/44C11

However the book has a different solution:
(4C3 x (11C1)^3 x (11C3) + 4C2 x 2C1 X (11C1)^2 x (11C2)^2)/44C11

Can someone explain to me?
shouldn't the denominator be 44C6?

the 2C1 is there because {1 red, 1 orange, 2 yellow, 2 pink} is different from {2 red, 2 orange, 1 yellow, 1 pink}.

3. Yea it should be 44C6. But isnt the 2C1 counted for by 4C2?

4. Originally Posted by Lukybear
Yea it should be 44C6. But isnt the 2C1 counted for by 4C2?
This is under case {1,1,2,2}

4C2 means you're selecting two objects from four. Think about what exactly it is you are selecting. Say you select red and orange. Do you assign these to {1,1} or to {2,2}? It could be either. Therefore you multiply by 2 which equals 2C1.

5. Yes that makes more sense.Thanks

6. Hmm. After it made sense, it had seemed that the answer was wrong after all. There is no 4C2 . Can you help me make sense of it now.

7. Originally Posted by Lukybear
Hmm. After it made sense, it had seemed that the answer was wrong after all. There is no 4C2 . Can you help me make sense of it now.
I am rather puzzled. I would like to write a brute force computer program (since 44C6 is pretty small) and compare results, then get to the bottom of it. I may or may not have time to do that right now.

8. Originally Posted by undefined
I am rather puzzled. I would like to write a brute force computer program (since 44C6 is pretty small) and compare results, then get to the bottom of it. I may or may not have time to do that right now.
Oh all right, as often happens I have made a silly error. Sorry about that.

Once you select the two colours to correspond to (for example) {1,1} then the colours for {2,2} are fixed, and by multiplying by 2 you double count.

Here's the Java program I wrote

Code:
import java.util.ArrayList;

public class ColouredBallsProb {
static int c;

public static void main(String[] args) {
long t=time();
c=0;
recurse(0, new ArrayList<Integer>());
System.out.println(c);
System.out.println("elapsed: "+(time()-t)/1000.0+" s");
}

static void recurse(int ind, ArrayList<Integer> balls) {
if(balls.size()==6) {
if (oneOfEach(balls)) c++;
return;
}
if(ind>43) return;
// select or don't select current ball
recurse(ind+1,balls);
ArrayList<Integer> nextBalls=new ArrayList<Integer>(balls);
recurse(ind+1,nextBalls);
}

static boolean oneOfEach(ArrayList<Integer> balls) {
// assume 6 balls
int i;
boolean[] colours=new boolean[4];
for (i=0;i<6;i++) {
colours[balls.get(i)%4]=true;
}
for (i=0;i<4;i++)
if(!colours[i])
return false;
return true;
}

static long time() {
return System.currentTimeMillis();
}
}
Output

Code:
3074610
elapsed: 1.101 s
As you can see it matches the first answer you gave (just the numerator). Sorry for the mix up.

9. Wow. That is brilliant. Absolutely fantastic.

I get your fixing explanation. But what about multiplying by 2? Wheres that?

10. Originally Posted by Lukybear
Wow. That is brilliant. Absolutely fantastic.

I get your fixing explanation. But what about multiplying by 2? Wheres that?
I don't follow.. The whole issue is whether the 2C1 in bold in post #1 should appear in the answer right? It shouldn't.

When you wrote 4C2 in post #6 I assumed it was a typo and was supposed to be 2C1.