Probability of Getting 10 Pairs from a Box of 30 Socks

  • Thread starter Thread starter juanitotruan77
  • Start date Start date
  • Tags Tags
    Probability
AI Thread Summary
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.
  • #51
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.
 
Physics news on Phys.org
  • #52
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.
 
Last edited:
  • #53
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}##
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
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.
 

Attachments

Last edited:
  • #55
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).
Code:
t-1	Pr-1t-1	Qrt
19	0.0000	0.0000
20	0.0000	0.0000
21	0.0000	0.0000
22	0.0001	0.0000
23	0.0004	0.0001
24	0.0014	0.0002
25	0.0041	0.0008
26	0.0107	0.0025
27	0.0245	0.0067
28	0.0498	0.0156
29	0.0903	0.0320
30	0.1456	0.0583
31	0.2084	0.0934
32	0.2628	0.1314
33	0.2891	0.1606
34	0.2730	0.1680
35	0.2162	0.1470
36	0.1384	0.1038
37	0.0674	0.0556
38	0.0223	0.0202
39	0.0038	0.0038
(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
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).
Code:
t-1	Pr-1t-1	Qrt
19	0.0000	0.0000
20	0.0000	0.0000
21	0.0000	0.0000
22	0.0001	0.0000
23	0.0004	0.0001
24	0.0014	0.0002
25	0.0041	0.0008
26	0.0107	0.0025
27	0.0245	0.0067
28	0.0498	0.0156
29	0.0903	0.0320
30	0.1456	0.0583
31	0.2084	0.0934
32	0.2628	0.1314
33	0.2891	0.1606
34	0.2730	0.1680
35	0.2162	0.1470
36	0.1384	0.1038
37	0.0674	0.0556
38	0.0223	0.0202
39	0.0038	0.0038
(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
 

Attachments

  • tree.jpg
    tree.jpg
    20.2 KB · Views: 404
Last edited:
  • #57
I did simulate this and I got

Code:
20 0.000:
21 0.000:
22 0.000:
23 0.000:
24 0.000:
25 0.000:
26 0.001:
27 0.003:*
28 0.009:****
29 0.020:**********
30 0.040:********************
31 0.069:**********************************
32 0.105:****************************************************
33 0.140:*********************************************************************
34 0.160:********************************************************************************
35 0.158:******************************************************************************
36 0.131:*****************************************************************
37 0.089:********************************************
38 0.048:***********************
39 0.019:*********
40 0.005:**
41 0.001:
 
  • #58
jfgobin said:
I did simulate this and I got

Code:
20 0.000:
21 0.000:
22 0.000:
23 0.000:
24 0.000:
25 0.000:
26 0.001:
27 0.003:*
28 0.009:****
29 0.020:**********
30 0.040:********************
31 0.069:**********************************
32 0.105:****************************************************
33 0.140:*********************************************************************
34 0.160:********************************************************************************
35 0.158:******************************************************************************
36 0.131:*****************************************************************
37 0.089:********************************************
38 0.048:***********************
39 0.019:*********
40 0.005:**
41 0.001:
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.
 
Last edited:
  • #59
juanitotruan77 said:
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
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!
 
  • #61
It was a learning experience for me as well. What class was this that you got this problem from?
 
  • #62
rcgldr said:
It was a learning experience for me as well. What class was this that you got this problem from?
Thanks to you too! Physics, my physic's teacher is a very good teacher.
 
Back
Top