The discussion focuses on calculating the most probable number of tries needed to form 10 pairs of socks from a box containing 30 pairs. Participants explore the complexities of probability distributions and sample spaces, emphasizing the need for a clear understanding of combinations versus permutations. A simulation approach suggests that the most probable number of socks needed to guarantee 10 pairs is 40, as this ensures at least one pair is formed. Mathematical expressions for probability are discussed, with attempts to derive a formula for the exact number of socks required to achieve the desired pairs. Ultimately, the conversation highlights the challenges of applying probability theory to this problem, with a consensus that further study may be necessary for clarity.
#31
juanitotruan77
44
0
haruspex said:
P(r,t) is the probability that you will have r pairs after t selections. But you want the probability of needing t selections to get r pairs. You might have had r pairs already after t-1 selections.
You want the probability that the tth selection took you from r-1 pairs to r pairs. so first you had to have r-1 pairs after t-1 selections (for which you have a formula now), then the tth had to complete one more pair.
You want the probability that the tth selection took you from r-1 pairs to r pairs. so first you had to have r-1 pairs after t-1 selections (for which you have a formula now), then the tth had to complete one more pair.
So i have to multiply the result from the formula with the probability that i'll get the last sock in the tth draw?
A minor issue but you need to fix your combination calculation so that if (t-2r) > (N-r), or if (t-2r) < 0 (and (N-r) > 0), then (N-r)C(t-2r) = 0 (this is how aCb is mathematically defined). This will fix the cases t= 0 through t = 19 and t = 41 through 60 where the probability should be zero.
Last edited:
#41
juanitotruan77
44
0
rcgldr said:
A minor issue but you need to fix your combination calculation so that if (t-2r) > (N-r), or if (t-2r) < 0 (and (N-r) > 0), then (N-r)C(t-2r) = 0 (this is how aCb is mathematically defined). This will fix the cases t= 0 through t = 19 and t = 41 through 60 where the probability should be zero.
So i have to multiply the result from the formula with the probability that i'll get the last sock in the tth draw?
Yes. At this point, you have r-1 pairs and (t-1)-2(r-1) odd ones. The remaining 2N-t+1 socks consist of the same number of odd ones and N+r-t pairs. So what are the chances the next sock drawn will complete a pair?
#43
juanitotruan77
44
0
so let's take 30 for the example. If you have already 9 pairs in 29 tries, so there're 31 socks and you've 11 odd socks So you've 11 possible pairs with you. So the probability of you getting one of the 11 probable pairs is 31n11?
so let's take 30 for the example. If you have already 9 pairs in 29 tries, so there're 31 socks and you've 11 odd socks So you've 11 possible pairs with you. So the probability of you getting one of the 11 probable pairs is 31n11?
What is "31n11"? Do you mean 31C11? That would be the number of ways of choosing 11 things from 31, a huge number, and certainly not a probability.
As you say, there would be 31 socks left, and you want the prob of choosing one out of a particular 11 of them...
#45
juanitotruan77
44
0
haruspex said:
What is "31n11"? Do you mean 31C11? That would be the number of ways of choosing 11 things from 31, a huge number, and certainly not a probability.
As you say, there would be 31 socks left, and you want the prob of choosing one out of a particular 11 of them...
Having in mind that P(r, t) is the probability of having r-1 pairs in t-1 tries, then:
P(r, t) = NCr × (N-r)C(t-2r) × 2^(t-2r) / (2N)Ct
Q(r,t) = P(r, t) x ((t-1)-(2r-2)))/(2N-(t-1))
Just one more thing, why does that formula give me the probability of having r-1 in t-1 tries, and not r pairs in t tries if we're using t and r and not r-1 And t-1.
Last edited:
#48
juanitotruan77
44
0
I was checking my code and i noticed that i was doing something wrong. When i corrected it, it gave me the following:
Having in mind that P(r, t) is the probability of having r-1 pairs in t-1 tries,
No, P(r, t) was defined as the probability of having r pairs in t tries. We want P(r-1,t-1): ##Q(r,t) = \frac{{^NC_r} ^{N-r}C_{t-2r} 2^{t-2r}}{^{2N}C_t}\frac{t+1-2r}{2N-t+1}##
To find the peak value in a unimodal sequence, just look for two consecutive terms that are about equal. Algebraically, that will all but cancel out all the factorials, leaving a relatively simple polynomial, probably a quadratic. Solving that will almost certainly give you a non-integer. The value you're looking for will be either the next integer up or the next one down.
#50
juanitotruan77
44
0
haruspex said:
No, P(r, t) was defined as the probability of having r pairs in t tries. We want P(r-1,t-1): ##Q(r,t) = \frac{{^NC_r} ^{N-r}C_{t-2r} 2^{t-2r}}{^{2N}C_t}\frac{t+1-2r}{2N-t+1}##
To find the peak value in a unimodal sequence, just look for two consecutive terms that are about equal. Algebraically, that will all but cancel out all the factorials, leaving a relatively simple polynomial, probably a quadratic. Solving that will almost certainly give you a non-integer. The value you're looking for will be either the next integer up or the next one down.
I didn't understand that, can you explain it, please?
You have the expression for Q(r,t). We want the peak value as t varies. At the peak, consecutive terms will be about equal (same principle as finding maxima with calculus). So you write Q(r,t) = Q(r,t+1). Because of all the factorials involved (see the formula I posted for nCr), there will be a lot of cancellation of terms. When the smoke clears, you should have a relatively simple polynomial for t. This won't give a whole number, so try the whole numbers either side of what it does give. One of these two will be the peak term in the sequence.
#52
juanitotruan77
44
0
So i equal them and replace the values in the full formula with all the factorials? You said at the beggining that you got 27 by doing this, how? i tried and it didn't reduced to a cuadratic t term.
No, P(r, t) was defined as the probability of having r pairs in t tries. We want P(r-1,t-1): ##Q(r,t) = \frac{{^NC_r} ^{N-r}C_{t-2r} 2^{t-2r}}{^{2N}C_t}\frac{t+1-2r}{2N-t+1}##
Sorry, I forgot to edit the formula. I meant:
##Q(r,t) = \frac{{^NC_{r-1}} ^{N-r+1}C_{t+1-2r} 2^{t+1-2r}}{^{2N}C_{t-1}}\frac{t+1-2r}{2N-t+1}##
#54
juanitotruan77
44
0
haruspex said:
Sorry, I forgot to edit the formula. I meant:
##Q(r,t) = \frac{{^NC_{r-1}} ^{N-r+1}C_{t+1-2r} 2^{t+1-2r}}{^{2N}C_{t-1}}\frac{t+1-2r}{2N-t+1}##
Well, i did the Q(r,t) = Q(r,t+1)
and it gave me t=12.50842616853577.
I attached my Mathematica notebook with the procedure, but i can't find with I'm doing wrong.
Starting with the same equations, when I do all the cancellation I wind up with t2-t-2N(2r-1) = 0. This gives t = 33.76. (My earlier answer of 27 was wrong.)
I checked it by generating Q(r,t) for t = 20 to 40 in a spreadsheet, and the peak is at t=34 (with prob=0.168).
(Note that the Q(r,t) add up to 1.)
Here are the cell formulae:
First column (t-1) starts at cell A4. Named cell _r1 represents r-1. These are the formulae in cells B4, C4:
=COMBIN(_N;_r1)*COMBIN(_N-_r1;$A4-2*_r1)*2^($A4-2*_r1)/COMBIN(2*_N;$A4)
=B4*(A4-2*_r1)/(2*_N-A4)
A4 contains 19. A5 etc. increment from there.
#56
juanitotruan77
44
0
haruspex said:
Starting with the same equations, when I do all the cancellation I wind up with t2-t-2N(2r-1) = 0. This gives t = 33.76. (My earlier answer of 27 was wrong.)
I checked it by generating Q(r,t) for t = 20 to 40 in a spreadsheet, and the peak is at t=34 (with prob=0.168).
(Note that the Q(r,t) add up to 1.)
Here are the cell formulae:
First column (t-1) starts at cell A4. Named cell _r1 represents r-1. These are the formulae in cells B4, C4:
=COMBIN(_N;_r1)*COMBIN(_N-_r1;$A4-2*_r1)*2^($A4-2*_r1)/COMBIN(2*_N;$A4)
=B4*(A4-2*_r1)/(2*_N-A4)
A4 contains 19. A5 etc. increment from there.
The thing is that my physics teacher told me that the answer has to be near 28, that's why I'm so frustrated. I think it has something to do with the fact that you might be considering that the array of posibilities is a binary tree but you can't have a pair in your next move without another not pair sock so is something like
Ohhh i made a mistake in the code, i didn't think that the random number generator could generate more than 1 pair of the same kind of socks. You're both right, and THANKS A LOT FOR ALL YOUR HELP, especially to haruspex for having me so much patience.
Ohhh i made a mistake in the code, i didn't think that the random number generator could generate more than 1 pair of the same kind of socks. You're both right, and THANKS A LOT FOR ALL YOUR HELP, especially to haruspex for having me so much patience.
It was an interesting journey, and I hope it was useful for you. (You can no longer claim to know nothing about probability!)
#60
juanitotruan77
44
0
haruspex said:
It was an interesting journey, and I hope it was useful for you. (You can no longer claim to know nothing about probability!)
yeah, I've learn more probability here in 5 days than in 6 months of school, thanks!