Got a credit card? use our Credit Card & Finance Calculators
Thanks to Anonymous,bruncher,niord,gvonge,Shelford, for Donating to support the site
Socks
-
- Lemon Slice
- Posts: 575
- Joined: November 9th, 2016, 11:33 am
- Has thanked: 248 times
- Been thanked: 167 times
Socks
I own only black and white socks and all are in the wash except for four. The probability of withdrawing two at random and finding a white pair is 1/2. What is the probability of withdrawing two black socks instead?
Cinelli
Cinelli
-
- Lemon Quarter
- Posts: 1832
- Joined: November 13th, 2016, 3:41 pm
- Has thanked: 1444 times
- Been thanked: 663 times
Re: Socks
cinelli wrote:I own only black and white socks and all are in the wash except for four. The probability of withdrawing two at random and finding a white pair is 1/2. What is the probability of withdrawing two black socks instead?
Cinelli
Zero. There are 3 white socks and 1 black.
n/4 * (n-1)/3 = 0.5
where n = number of white socks.
-
- Lemon Slice
- Posts: 353
- Joined: November 23rd, 2016, 9:45 am
- Has thanked: 29 times
- Been thanked: 120 times
Re: Socks
Or, if you don't like equations:
If there are 4 socks A B C D, the 6 possible combinations are AB, AC, AD, BC, BD, CD
If sock A only is black, then BC, BD, CD are white pairs, half of the total possible combinations.
If A is the only black sock, there cannot be a black pair.
If there are 4 socks A B C D, the 6 possible combinations are AB, AC, AD, BC, BD, CD
If sock A only is black, then BC, BD, CD are white pairs, half of the total possible combinations.
If A is the only black sock, there cannot be a black pair.
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
Methinks the level of your 'trap' may not be quite that of regulars here.
Still, now if we ever meet in person, I shall know you by the zebra-striped socks.
Still, now if we ever meet in person, I shall know you by the zebra-striped socks.
-
- Lemon Quarter
- Posts: 2595
- Joined: November 4th, 2016, 3:36 pm
- Has thanked: 1120 times
- Been thanked: 1182 times
Re: Socks
bluedonkey wrote:Zero. There are 3 white socks and 1 black.
There could be two long white socks and two short white socks. The answer is still zero, however.
If you are not careful when you wash them, you could end up with some grey socks.
I have a nephew who always buys the same type of navy blue socks so that he doesn't have to sort them into pairs.
Julian F. G. W.
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
jfgw wrote:I have a nephew who always buys the same type of navy blue socks so that he doesn't have to sort them into pairs.
Julian F. G. W.
Does he sort the holy from the wholly unholy?
What about holes in different places: for instance the toe vs under the ball of the foot?
-
- Lemon Quarter
- Posts: 3169
- Joined: November 4th, 2016, 11:12 am
- Has thanked: 3733 times
- Been thanked: 1539 times
Re: Socks
UncleEbenezer wrote:jfgw wrote:I have a nephew who always buys the same type of navy blue socks so that he doesn't have to sort them into pairs.
Julian F. G. W.
Does he sort the holy from the wholly unholy?
What about holes in different places: for instance the toe vs under the ball of the foot?
In those circumstances wearing both socks on the same foot provides both adequate coverage and maximum sock utility.
RC
-
- Lemon Quarter
- Posts: 4519
- Joined: November 8th, 2016, 11:14 pm
- Has thanked: 1642 times
- Been thanked: 1647 times
Re: Socks
UncleEbenezer wrote:jfgw wrote:I have a nephew who always buys the same type of navy blue socks so that he doesn't have to sort them into pairs.
Julian F. G. W.
Does he sort the holy from the wholly unholy?
Does he sort the wooly from the un-wooly? [... as the Romans did in Life of Brian...]
GS
-
- Lemon Slice
- Posts: 575
- Joined: November 9th, 2016, 11:33 am
- Has thanked: 248 times
- Been thanked: 167 times
Re: Socks
UncleEbenezer wrote:Methinks the level of your 'trap' may not be quite that of regulars here.
I have always tried to vary the level of puzzles so as not to exclude people.
For lovers of Father Ted: did you know that priests don't wear black socks? The colour is very very very very very very very very very very very dark blue.
Cinelli
-
- Lemon Quarter
- Posts: 1832
- Joined: November 13th, 2016, 3:41 pm
- Has thanked: 1444 times
- Been thanked: 663 times
Re: Socks
cinelli wrote:UncleEbenezer wrote:Methinks the level of your 'trap' may not be quite that of regulars here.
I have always tried to vary the level of puzzles so as not to exclude people.
For lovers of Father Ted: did you know that priests don't wear black socks? The colour is very very very very very very very very very very very dark blue.
Cinelli
Oh go on! Go on!
Go on go on go on etc ....
Happy to do my bit to lower the usual high tone of puzzle corner.
-
- Lemon Quarter
- Posts: 2595
- Joined: November 4th, 2016, 3:36 pm
- Has thanked: 1120 times
- Been thanked: 1182 times
Re: Socks
UncleEbenezer wrote:Does he sort the holy from the wholly unholy?
What about holes in different places: for instance the toe vs under the ball of the foot?
I'm not sure. Maybe, if he gets a hole in one, he cuts corresponding holes in all of the others so that they still all match.
Julian F. G. W.
-
- Lemon Quarter
- Posts: 4255
- Joined: November 4th, 2016, 1:17 am
- Been thanked: 2631 times
Re: Socks
jfgw wrote:UncleEbenezer wrote:What about holes in different places: for instance the toe vs under the ball of the foot?
I'm not sure. Maybe, if he gets a hole in one, he cuts corresponding holes in all of the others so that they still all match.
Surely the more traditional way of responding to a hole in one involves a round of drinks in the clubhouse? ;-)
More seriously, a somewhat more challenging problem: for which numbers of socks, some black and some white, is it possible for the probability that two socks drawn at random are both white to be exactly 1/2? And for such collections of socks, how large can the probability that two socks drawn at random are both black be made?
Gengulphus
-
- Lemon Half
- Posts: 7389
- Joined: November 24th, 2016, 3:29 am
- Has thanked: 1713 times
- Been thanked: 3970 times
Re: Socks
Talking about holes in socks, it is interesting to note that all socks have a hole.
The hole you pass your foot through when putting it on.
![Smile :)](./images/smilies/icon_e_smile.gif)
The hole you pass your foot through when putting it on.
![Smile :)](./images/smilies/icon_e_smile.gif)
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
Gengulphus wrote:More seriously, a somewhat more challenging problem: for which numbers of socks, some black and some white, is it possible for the probability that two socks drawn at random are both white to be exactly 1/2? And for such collections of socks, how large can the probability that two socks drawn at random are both black be made?
Gengulphus
The first part of that is a generalised statement of bluedonkey's equation: solutions to s(s-1) = 2w(w-1). Enumerating them is left as an exercise for the reader.
The secnd part of your question is easier. We have a lower bound of sqrt(1/2) on w/s. Since b=s-w, we have an upper bound of (1-sqrt(1/2)) on b/s and hence (1-sqrt(1/2)) squared on (b/s) squared - which is in turn an upper bound on b(b-1)/(s(s-1)). So the probability of two blacks must remain below 1.5 - sqrt(2), which is a little under 8.6%.
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
UncleEbenezer wrote:Gengulphus wrote:More seriously, a somewhat more challenging problem: for which numbers of socks, some black and some white, is it possible for the probability that two socks drawn at random are both white to be exactly 1/2? And for such collections of socks, how large can the probability that two socks drawn at random are both black be made?
Gengulphus
The first part of that is a generalised statement of bluedonkey's equation: solutions to s(s-1) = 2w(w-1). Enumerating them is left as an exercise for the reader.
The secnd part of your question is easier. We have a lower bound of sqrt(1/2) on w/s. Since b=s-w, we have an upper bound of (1-sqrt(1/2)) on b/s and hence (1-sqrt(1/2)) squared on (b/s) squared - which is in turn an upper bound on b(b-1)/(s(s-1)). So the probability of two blacks must remain below 1.5 - sqrt(2), which is a little under 8.6%.
OK, I set the 'puter to enumerate low solutions. Highest it gave was s=803761, w=568345. With those numbers the number of blacks is 235416, and the probability of two blacks is 235416*235415/(803761*803760). Which is just under the theoretical upper bound: indeed, identical to six decimal places (0.085786).
-
- Lemon Quarter
- Posts: 4255
- Joined: November 4th, 2016, 1:17 am
- Been thanked: 2631 times
Re: Socks
UncleEbenezer wrote:Gengulphus wrote:More seriously, a somewhat more challenging problem: for which numbers of socks, some black and some white, is it possible for the probability that two socks drawn at random are both white to be exactly 1/2? And for such collections of socks, how large can the probability that two socks drawn at random are both black be made?
The first part of that is a generalised statement of bluedonkey's equation: solutions to s(s-1) = 2w(w-1). Enumerating them is left as an exercise for the reader.
Yes, an exercise for the reader that is pretty trivially equivalent to the question I posed - no marks for repeating that exercise-setting! ;-)
UncleEbenezer wrote:The secnd part of your question is easier. We have a lower bound of sqrt(1/2) on w/s. Since b=s-w, we have an upper bound of (1-sqrt(1/2)) on b/s and hence (1-sqrt(1/2)) squared on (b/s) squared - which is in turn an upper bound on b(b-1)/(s(s-1)). So the probability of two blacks must remain below 1.5 - sqrt(2), which is a little under 8.6%.
Yes, and your computerised search shows that it can get very close to 1.5 - sqrt(2). But can it get arbitrarily close?
Gengulphus
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
Gengulphus wrote:UncleEbenezer wrote:Gengulphus wrote:More seriously, a somewhat more challenging problem: for which numbers of socks, some black and some white, is it possible for the probability that two socks drawn at random are both white to be exactly 1/2? And for such collections of socks, how large can the probability that two socks drawn at random are both black be made?
The first part of that is a generalised statement of bluedonkey's equation: solutions to s(s-1) = 2w(w-1). Enumerating them is left as an exercise for the reader.
Yes, an exercise for the reader that is pretty trivially equivalent to the question I posed - no marks for repeating that exercise-setting! ;-)
Enumerations don't interest me. Generalities do - hence the focus on the second part of your question. I expect I'm missing some blindingly-obvious insight into the equation there.
UncleEbenezer wrote:The secnd part of your question is easier. We have a lower bound of sqrt(1/2) on w/s. Since b=s-w, we have an upper bound of (1-sqrt(1/2)) on b/s and hence (1-sqrt(1/2)) squared on (b/s) squared - which is in turn an upper bound on b(b-1)/(s(s-1)). So the probability of two blacks must remain below 1.5 - sqrt(2), which is a little under 8.6%.
Yes, and your computerised search shows that it can get very close to 1.5 - sqrt(2). But can it get arbitrarily close?
Gengulphus
'puter gets it to eleven decimal places with s=183648021600, w=129858761425 (and a smarter search than last night).
But since the upper bound is asymptotic, the question is to prove whether or not there's an infinitude of solutions. Though not to socks in drawers: we've surely already exceeded the planet's capacity for socks. You may be Mr Shine, but my poor brain needs the Pork Futures Warehouse.
-
- The full Lemon
- Posts: 10978
- Joined: November 4th, 2016, 8:17 pm
- Has thanked: 1505 times
- Been thanked: 3050 times
Re: Socks
Damn, fell asleep composing this last night!
OK, brain's still overheated, but has had the relief of a good long walkies, a dip in a local river, and a goodly dose of mediocre Portuguese plonk. The key I was missing is the sequence itself: each s/w/b triplet tends aymptotically to values (1 / (2(1.5-sqrt(2))) times its predecessor. Here's a hack that finds solutions quickly and efficiently by recursion. If anyone wants to rewrite it in arbitrary-precision arithmetic, you could take this a long way.
It shows solutions, and the shrinking difference between bprob (probability of two blacks) and the theoretical limit, up to the limit of our integer type:
OK, brain's still overheated, but has had the relief of a good long walkies, a dip in a local river, and a goodly dose of mediocre Portuguese plonk. The key I was missing is the sequence itself: each s/w/b triplet tends aymptotically to values (1 / (2(1.5-sqrt(2))) times its predecessor. Here's a hack that finds solutions quickly and efficiently by recursion. If anyone wants to rewrite it in arbitrary-precision arithmetic, you could take this a long way.
Code: Select all
#include <stdio.h>
#include <math.h>
static double sqrt2;
static double seek_ratio;
static double last_ratio;
static double bproblim;
void findnext(long long unsigned int last) {
long long unsigned int w, s, b;
double bprob;
for (w = 1 + last*seek_ratio; w > last; w--) {
for (s = w*sqrt2; s<w*last_ratio; s++) {
if (2*w*(w-1) == s*(s-1)) {
b = s - w;
bprob = 1.0*b/s*(b-1)/(s-1);
printf("%lld/%lld %le\n", s, w, bproblim - bprob);
last_ratio = 2.0 * w / s;
findnext(w);
return; /* never happens, but structures our would-be exit from the search loop */
}
}
}
}
int main() {
sqrt2 = sqrt(2.0);
last_ratio = 2.0;
bproblim = 1.5 - sqrt(2.0);
seek_ratio = 1 / (2*bproblim);
findnext(1);
return 0;
}
It shows solutions, and the shrinking difference between bprob (probability of two blacks) and the theoretical limit, up to the limit of our integer type:
4/3 8.578644e-02
21/15 1.435787e-02
120/85 2.453104e-03
697/493 4.205840e-04
4060/2871 7.215191e-05
23661/16731 1.237905e-05
137904/97513 2.123901e-06
803761/568345 3.644036e-07
4684660/3312555 6.252177e-08
27304197/19306983 1.072704e-08
159140520/112529341 1.840469e-09
927538921/655869061 3.157745e-10
5406093004/3822685023 5.417825e-11
31509019101/22280241075 9.295439e-12
183648021600/129858761425 1.594752e-12
1070379110497/756872327473 2.735312e-13
6238626641380/4411375203411 4.685141e-14
36361380737781/25711378892991 7.965850e-15
211929657785304/149856898154533 1.290634e-15
1235216565974041/873430010034205 1.387779e-16
-
- Lemon Quarter
- Posts: 4255
- Joined: November 4th, 2016, 1:17 am
- Been thanked: 2631 times
Re: Socks
UncleEbenezer wrote:Gengulphus wrote:UncleEbenezer wrote:The first part of that is a generalised statement of bluedonkey's equation: solutions to s(s-1) = 2w(w-1). Enumerating them is left as an exercise for the reader.
Yes, an exercise for the reader that is pretty trivially equivalent to the question I posed - no marks for repeating that exercise-setting! ;-)
Enumerations don't interest me. Generalities do - hence the focus on the second part of your question. I expect I'm missing some blindingly-obvious insight into the equation there.
OK, a stricter meaning of "enumerating" than I thought you meant... I think I was misled by your use of computer searches, since all a computer search can ever produce is an enumeration of a finite number of solutions. So when there appear to be infinitely many solutions (which your computer search does suggest!) a computer search can do is put you on the trail towards generalities - which I think is where you're trying to go...
Anyway, as a hint, bluedonkey's equation is of a type that is well known to be solvable for any particular value of s (or for any particular value of w, or indeed after substituting s = w+b, for any particular value of b)...
Gengulphus
Return to “Games, Puzzles and Riddles”
Who is online
Users browsing this forum: No registered users and 15 guests