Probability of picking exactly one correct from a pool of 6 incorrect and 4 correct

So as the question says. You have 6 incorrect objects and 4 correct ones. What are the odds that, when picking 3 of them at random, you end up with exactly one of them being correct.

This seems to be quite trivial but I'm having issues since my solution differs from the provided one. Also, I've written a program that simulates it and it seems to be leaning towards my solution.

Anyways, the way I did it is just by multiplying $\dfrac{4}{10}\dfrac{6}{9}\dfrac{5}{8}$ with the result being $\dfrac{1}{6}$. The reasoning is that you first have a 4 in 10 chance of picking the correct one and then you need to pick the incorrect one 2 times with 6 in 9 and 5 in 8 chances. I thought that maybe the fact that the order doesn't matter is making my calculation off but since you can write the product as a big fraction and commute everything, that can't be the problem.

The provided solution is $\dfrac{\binom{4}{1}\binom{6}{2}}{\binom{10}{3}}$. I can see how that would work as well so I can't really say what the problem might be with their solution.

Anyways, I wrote a program that picks 3 numbers out of [0,0,0,0,0,0,1,1,1,1] at random. It does it 100000 times and the number of times it got exactly one 1 is around 18800. That's obviously much closer to my $\dfrac{1}{6}$ than their $\dfrac{1}{2}$. Is their solution wrong? If so, why?

Edit: Now that I think about it, my solution should be the incorrect one since it answers the question of what the odds are that I FIRST pick a correct one and then 2 incorrect ones, but why would the simulation lean towards my solution then?

• You calculate the probability that you first pick a correct one and then two wrong ones. There are $3$ possible orders here: CWW, WCW and WWC. Note that $3\times\frac{1}{6}=\frac{1}{2}$ – drhab Nov 19 '13 at 19:02
• I've noticed that (see my edit) but it still doesn't explain the simulation. – Luka Horvat Nov 19 '13 at 19:02
• Your first proposed solution is not right, though it can be made right by multiplying by $3$, the number of orders in which you can get $1$ correct, $2$ incorrect. As to the simulation, presumably the simulation follows the wrong analysis, the program counts the cases where you get good, then bad, then bad. – André Nicolas Nov 19 '13 at 19:03
• Yes, three identical numbers, which you then should add. – André Nicolas Nov 19 '13 at 19:05
• Your code for shuffle is wrong. "arr.Add(array[rand.Next(i, array.Count - 1)]);" picks up a random element in an array containing 6 zeros and 4 ones. You might end up creating a new list that is shuffled but not having exactly 4 1's and 6 0's. – Sudarsan Nov 19 '13 at 19:28

I just tried running the simulation and it works (out of $100000$, I got the number of trials in which only 1 correct object picked up as $49982$, fairly converging to $\frac{1}{2}$).

Code: (Octave)

sum = 0;
res = 0;
a=[0,0,0,0,0,0,1,1,1,1];
for i = 1:100000;
[junk,index] = sort(rand(1,10));
pick = index(1);
sum = sum+a(pick);
b=[];
tempcount = 1;
for j = 1:length(a);
if(j == pick)
continue
else
b(tempcount) = a(j);
end
tempcount = tempcount + 1;
end
[junk,index] = sort(rand(1,9));
pick = index(1);
sum = sum+b(pick);
c = [];
tempcount = 1;
for j = 1:length(b);
if(j == pick)
continue
else
c(tempcount) = b(j);
end
tempcount = tempcount + 1;
end
[junk,index] = sort(rand(1,8));
pick = index(1);
sum = sum+c(pick);
if(sum == 1);
res = res + 1;
end
sum = 0;
end