Reply
Mon 8 Mar, 2004 01:59 am
Hi! Here I am again...
I have a question concerning "random" probabilities; bear with me if you will... I know what answer I want but I can't seem to word the question properly. Anyway...
Random probabilities. Take the lottery for example:
Let's say that lottery "drum" (ya know, with all the ping pong balls inside?) has only 5 balls in it, and each are numbered 1-4. This gives us a spread of 15 integers, 5 being lowest, and 20 being highest, if the value of the balls were added.
How would I figure out the frequency of each number in that 5-20 range?
Thanks!
Harmonic,
You need to make this problem a bit clearer. I am not sure how the game you are describing is played. Please let us know the following.
How many balls are inside the drum? (You said 5, but please clarify since you said they are numbered 1-4).
How are they numbered? (Are there duplicates?)
How many balls to we take from the drum to play?
Thanks,
Eric
I am guessing:
The game is played by taking a ball out five times, than summing the numbers.
I guess this from bounds, and the error (5 balls, 1-4) : minimal sum is 5 (5 times number one), and max sum is 20 (5 times 4). Actually the balls should be numbered 1-5, so the max is 25.
Obviously the ball must be returned after each draw (otherwise the sum will be 1+2+3+4+5 in each case).
Number of all different possible outcomes is N=5*5*5*5*5.
Probability for sum 5 is the easiest:
only 1 permutation out of N will produce that, hence probability is 1/(N) = 1/(5*5*5*5*5).
The same for 25.
In the middle, you have a complex calculation.
First it must be determined in how many possible ways can one get the desired sum, for example:
7 = 1+1+1+1+3 = V1
7 = 1+1+1+2+2 = V2
Then you must consider possible permutations of each variant:
1+1+1+1+3
1+1+1+3+1
1+1+3+1+1
1+3+1+1+1
3+1+1+1+1
P(v1)=5
P(v2)=9
Probability is then sum(P(vx))/N.
For the case 7, we have (5+9)/(5*5*5*5*5).
I don't have the will and interest to develop this further, however I think some explicit formula is possible that is based on combinations, permutations and the binomial formula (I think).
Using MS Access, it took me about a minute to create a database to calculate the answers, assuming that basically it's the total of 5 numbers, each of which can be from values 1 to 4, duplicates allowed.
5 - 1
6 - 5
7 - 15
8 - 35
9 - 65
10 - 101
11 - 135
12 - 155
13 - 155
14 - 135
15 - 101
16 - 65
17 - 35
18 - 15
19 - 5
20 - 1
There must be a mathematical way to calculate these, but Access does the business for me most times. I'll explain how I set it up if you want - let me know.
As for a 'proper' mathematical answer - I don't know!
Huh. That came out as a binomial distribution, but I'm not sure why (that is, I can't think of how to set this up as a binomial problem). That's odd...
Bell curve.
so, how much more homework are we gonna do?
Come on Seal!
Some people actually pay to do homework. We get to do it here for free!
Nope. This is definitely not a Gaussian, (aka Bell curve).
Gaussian is a smooth, infinite curve, its formula
y = exp (-x^2)/(2*pi). While binomial coefficients, if plotted in x,y coordinate space, resemble the shape of a Gaussian in discrete steps, they do so only very approximately.
I agree with patiodog that it's a binomial distribution, which was my guess also, but I can't prove it yet. Binomials tend to pop out all over the place in combinatorics.
I used Access to recalculate this, changing the numbers (4 balls of 1-5, 4 balls of 1-4 and 5 balls of 1-5) and the distribution looks the same. It's definately a puzzler...
Of course, the formula is NOT bare binomial, it contains binomial. The bare binomial is
1 5 10 10 5 1.
The formula we're talking about here is something like this (I will just write about the 'simpler' case where we have different label on each ball. )
Lets suppose we have N balls with labels 1,2,..N on them. We repeatedly choose one by random , k-times.
We can write the formula for distribution like this:
F(m,k) ; k <= m <= k*N
Some properties of F(m,k):
F(m,k+1) = F(m-1,k) + F(m-2,k) + .. + F(m-N,k)
where we only count those factors where m satisfies k <= m <= k*N.
F(k,k) = 1, because there is only one combination.
F(k+1,k) = F(k-1,k-1) + F(k,k-1) = 1+ F(k,k-1) = k
F(k+2,k) = F(k-1,k-1) + F(k,k-1) + F(k+1,k-1) = 1 + (k-1) + F(k+1,k-1) = 1+2+3+4+...+k
F(k+3,k) = 1 + (k-1) + (1+2+3+..+k-1) + F(k+2,k-1) = F(k+2,k) + F(k+2,k-1)
F(k+n,k) = F(k+n-1,k) + F(k+n-1,k-1) - F(n-1,k)
There is definitely some 'established' math behind this since this is so basic.
Sorry , that last formula should be:
F(k+n,k) = F(k+n-1,k) + F(k+n-1,k-1) - F(k+n-N-1,k-1)
Based on this, we get: (N=5)
F(1,1) = 1
F(2,1) = 1
..
F(5,1) = 1
F(2,2) = F(1,2) + F(1,1) - F(2-6,1) = 0 + 1 - 0 = 1
F(3,2) = F(2,2) + F(2,1) - F(3-6,1) = 1 + 1 - 0 = 2
F(4,2) = F(3,2) + F(3,1) - F(4-6,1) = 2 + 1 - 0 = 3
F(5,2) = F(4,2) + F(4,1) - F(5-6,1) = 3 + 1 - 0 = 4
F(6,2) = F(5,2) + F(5,1) - F(6-6,1) = 4 + 1 - 0 = 5
F(7,2) = F(6,2) + F(6,1) - F(7-6,1) = 5 + 0 - 1 = 4
F(8,2) = F(7,2) + F(7,1) - F(8-6,1) = 4 + 0 - 1 = 3
F(9,2) = F(8,2) + F(8,1) - F(8-6,1) = 3 + 0 - 1 = 2
F(10,2) = F(9,2) + F(9,1) - F(8-6,1) = 2 + 0 - 1 = 1
You can calculate any F(x,y) recursively from this.
Relative.
I played with a simple C code, which gives the same result as Grand Duke already showed.
Code:
#include <stdio.h>
int main(void){
int a,b,c,d,e,i;
int sum[16];
for(i=0;i<16;i++) sum[i]=0;
for(a=1;a<=4;a++){
for(b=1;b<=4;b++){
for(c=1;c<=4;c++){
for(d=1;d<=4;d++){
for(e=1;e<=4;e++){
sum[a+b+c+d+e-5]++;
}
}
}
}
}
for(i=0;i<16;i++){
printf("%d ",(i+5));
printf("%d\n",sum[i]);
}
return 0;
}