# Thread: Calculating special lottery odds

1. ## Calculating special lottery odds

#s out of a bag!

Hello, I would appreciate anyone's help in this problem:

There are 11 balls in a bag numbered 0-10.

You get 6 picks out of the bag. Pull 1 ball, write down number, and put it back (ie interpreted as with repetition?).

If person 1 chooses 6 balls out of the bag, IE 123456, what is the probability that person 2 who chooses matches 6 balls, 5 balls, 4 balls, 3 balls, 2 balls, 1 ball and none, considering that order does not matter (ie, combination? 123456 = 6 correct, 654321 still equals 6 correct, whereas 123457 = 5 correct).

Greatly appreciate assistance with this problem which has me scrambling!!!

Many thanks!!

2. ## Re: Calculating special lottery odds

- If your labels are , then you have 12 labels.

- If person 1 is allowed to draw with replacement, and obtain a repeated result say 111234, then how did you define the number of matches with person 2? Or person 1 is drawing without replacement?

- If you are drawing with replacement, then you are probably working with some multinomial probabilities. But before going on lets clear up the above questions first.

3. ## Re: Calculating special lottery odds

The labels are {0,1,2,3,4,5,6,7,8,9,10} - 11 labels total.

Yes, person 1 is allowed to draw with replacement. Person 1 can draw 111111, and person 2 can draw 111222 (resulting in a match of 3 numbers). Another example is person 1 can draw 123455, and person 2 can draw 344455 (resulting in a match of 2 numbers).

4. ## Re: Calculating special lottery odds

Let
be the counts of each ball picked by person 1, where is the number of picks and is the number of balls in the bag. In particular, and in your question.

Similarly we can let be another multinomial vector representing the picks from person 2, which has the identical distribution as and they are independent.

The number of matches, by definition, is

and you want to find out the distribution of this discrete random variable.

I have not find a nice method to tackle this problem yet; just use R to simulate 1 million times to obtain a numerical solution first.

Code:
m<-1000000
k<-11
n<-6
pr<-rep(1/k,k)
x<-rmultinom(m,n,pr)
y<-rmultinom(m,n,pr)
count<-rep(0,7)
for (i in 1:m) {
j<-sum(pmin(x[,i],y[,i]))
count[j+1]<-count[j+1]+1
}
count/m

[1] 0.041412 0.209483 0.371843 0.280376 0.087191 0.009471 0.000224
where the last line gives you the estimate of probability mass function from left to right.

5. ## Re: Calculating special lottery odds

Note that when , the probability of having counts larger than 1 is very small. In such case, can be approximated by a hypergeometric distribution (as if considering drawing without replacement), with pmf

Of course it is not very suitable for your question as are pretty close. And you see the resulting pmf deviate from the previous simulation quite a lot.

Code:
dhyper(0:6,6,5,6)
[1] 0.000000000 0.012987013 0.162337662 0.432900433 0.324675325 0.064935065 0.002164502

 Tweet