The Student Room Group

Awkward Maths Challenge.

(I realise this is hardly a study issue, but it's a mathematical problem nonetheless and I couldn't find a more suitable sub-forum.)

I challenged a friend to this question - as an example of the sometimes strange questions exam boards offer. I would love some help as to what answers you guys think is correct.

"Keith has 10000 apples. The probability that he picks a blue one by random selection is 0.6. All the rest of the apples are green. What is the probability he picks exactly 500 blue and 500 green apples?"

I have an issue with his answer, 0.00000000000000000000000281477, because I don't think that you can discernibly get from the original 10000 to the selected 1000 (as it is not defined by the question) - or if it is, then the way of getting it would be to de-increment the probability each time, e.g. 0.6 > 5999/9999 > 5998/9998 > etc, which is a very painstaking method.

He used the method of using technology and coding a solution to this problem:
================================================

#include <iostream>
#include <cstdlib>
#include <cstdio>

using namespace std;

int main()
{
long double numerator1 = 6000;
long double numerator2 = 4000;
long double denominator1 = 10000;
long double denominator2 = 10000;
long double probability = 1;

for (;denominator1 > 9499; denominator1 --, denominator2 --, numerator1 --, numerator2 --)
{
probability *= (numerator1/denominator1);
probability *= (numerator2/denominator2);
cout << probability;
cout << endl;
}

probability *= (2.70288e+299);

cout << "Probability =";
cout << probability;

system("PAUSE");
return 0;
}
================================================

So, what do you think?
Reply 1
Original post by Greating
(I realise this is hardly a study issue, but it's a mathematical problem nonetheless and I couldn't find a more suitable sub-forum.)

I challenged a friend to this question - as an example of the sometimes strange questions exam boards offer. I would love some help as to what answers you guys think is correct.

"Keith has 10000 apples. The probability that he picks a blue one by random selection is 0.6. All the rest of the apples are green. What is the probability he picks exactly 500 blue and 500 green apples?"

I have an issue with his answer, 0.00000000000000000000000281477, because I don't think that you can discernibly get from the original 10000 to the selected 1000 (as it is not defined by the question) - or if it is, then the way of getting it would be to de-increment the probability each time, e.g. 0.6 > 5999/9999 > 5998/9998 > etc, which is a very painstaking method.

I would be extremely wary of using C++ for this. Because the numbers we're talking about are so small, there's a lot of scope for rounding error. I make the actual answer 2.8333708E-308
calculated as 6000.5999...5500 * 4000.3999...3500 / (10000.9999...9900). [ETA: This is wrong] I used Mathematica to calculate this exactly, and then numericised it, so there's no rounding error.

ETA: Sorry, this answer's wrong - I'll fix it later (absolutely no time right now…), but the C++ worry is still valid.
ETA2: Orchestra was cancelled, so there is time now :smile: The answer should actually be that times (1000 choose 500), because I calculated the probability that a given string of "green blue green…" would come up; but there's 1000 choose 500 valid ways for it to happen. That makes the actual answer 7.65E-9.
ETA3: I now agree with BabyMaths below - this answer's wrong again :smile:
(edited 10 years ago)
Reply 2
Original post by Smaug123
I would be extremely wary of using C++ for this. Because the numbers we're talking about are so small, there's a lot of scope for rounding error. I make the actual answer 2.8333708E-308
calculated as 6000.5999...5500 * 4000.3999...3500 / (10000.9999...9900). [ETA: This is wrong] I used Mathematica to calculate this exactly, and then numericised it, so there's no rounding error.

ETA: Sorry, this answer's wrong - I'll fix it later (absolutely no time right now…), but the C++ worry is still valid.
ETA2: Orchestra was cancelled, so there is time now :smile: The answer should actually be that times (1000 choose 500), because I calculated the probability that a given string of "green blue green…" would come up; but there's 1000 choose 500 valid ways for it to happen. That makes the actual answer 7.65E-9.


I make it 3.580489...×10123.580489... \times 10^{-12}.

Did I go wrong I wonder?
Reply 3
Original post by BabyMaths
I make it 3.580489...×10123.580489... \times 10^{-12}.

Did I go wrong I wonder?

I did this in very much of a rush, but I did use Mathematica so that rounding error's not an issue.
Reply 4
Original post by Smaug123
I did this in very much of a rush, but I did use Mathematica so that rounding error's not an issue.


Me too, sort of. http://www.wolframalpha.com/input/?i=%281000+Choose+500%29*%286000%21*4000%21*9000%21%29%2F%285500%21*3500%21*10000%21%29

I think C++ might cope if p was initialised to 1000C500 rather than multiplying by 1000C500 at the end.

Writing a program is too much effort though. :tongue:
shouldn't it be

(1000 Choose 500)*(((6000!*4000!)/(5500!*3500!))/((10000!*10000!)/(9500!*9500!)))

which is near enough to the value I obtained using my program, giving 1.319654395557795889578170796090334680137001214512631295... × 10^-23
instead of
2.81477x10^-24
(edited 10 years ago)
Reply 6
Original post by D3LLI5
You all used mathematica incorrectly, it should be

(1000 Choose 500)*(((6000!*4000!)/(5500!*3500!))/((10000!*10000!)/(9500!*9500!)))

So that's 1000C500 ways to get 500 of each colour, then (grouping the colours together for convenience, as we'll end up with the same answer because altering the order of colours doesn't change the numerators and denominators other than their order) for the first apple it's 6000/10000, for the second it's 5999/9999, , 5501/9501; then for the blue ones it's 4000/9500, 3999/9499, …, 3501/9001. That makes 3.58049*10^-12, which is BabyMaths's answer.
Original post by BabyMaths
I make it 3.580489...×10123.580489... \times 10^{-12}.
Reply 7
Yay! Thank you very much, guys. Very helpful.

Looks like the £20 is still mine :3
Original post by Smaug123
So that's 1000C500 ways to get 500 of each colour, then (grouping the colours together for convenience, as we'll end up with the same answer because altering the order of colours doesn't change the numerators and denominators other than their order) for the first apple it's 6000/10000, for the second it's 5999/9999, , 5501/9501; then for the blue ones it's 4000/9500, 3999/9499, …, 3501/9001. That makes 3.58049*10^-12, which is BabyMaths's answer.


hahaha, glossed over the fact that there was the section between 9500 and 9000, apologies

Quick Reply

Latest