Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to eyeball08,Wondergirly,bofh,johnstevens77,Bhoddhisatva, for Donating to support the site

Socks

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Socks

#331094

Postby cinelli » August 5th, 2020, 1:03 pm

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

bluedonkey
Lemon Quarter
Posts: 1804
Joined: November 13th, 2016, 3:41 pm
Has thanked: 1413 times
Been thanked: 652 times

Re: Socks

#331101

Postby bluedonkey » August 5th, 2020, 1:27 pm

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.

malkymoo
Lemon Slice
Posts: 351
Joined: November 23rd, 2016, 9:45 am
Has thanked: 29 times
Been thanked: 117 times

Re: Socks

#331304

Postby malkymoo » August 6th, 2020, 8:37 am

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.

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Socks

#331316

Postby cinelli » August 6th, 2020, 9:54 am

Well solved both. You didn't fall into the trap of saying that if the probability of a white pair is 1/2, the same must be true of a black pair.

Cinelli

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#331353

Postby UncleEbenezer » August 6th, 2020, 11:41 am

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.

jfgw
Lemon Quarter
Posts: 2560
Joined: November 4th, 2016, 3:36 pm
Has thanked: 1104 times
Been thanked: 1163 times

Re: Socks

#331366

Postby jfgw » August 6th, 2020, 12:05 pm

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.

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#331396

Postby UncleEbenezer » August 6th, 2020, 2:18 pm

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?

ReformedCharacter
Lemon Quarter
Posts: 3133
Joined: November 4th, 2016, 11:12 am
Has thanked: 3629 times
Been thanked: 1518 times

Re: Socks

#331399

Postby ReformedCharacter » August 6th, 2020, 2:45 pm

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

GoSeigen
Lemon Quarter
Posts: 4403
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1602 times
Been thanked: 1591 times

Re: Socks

#331404

Postby GoSeigen » August 6th, 2020, 3:03 pm

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

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Socks

#331410

Postby cinelli » August 6th, 2020, 4:52 pm

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

bluedonkey
Lemon Quarter
Posts: 1804
Joined: November 13th, 2016, 3:41 pm
Has thanked: 1413 times
Been thanked: 652 times

Re: Socks

#331417

Postby bluedonkey » August 6th, 2020, 5:54 pm

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.

jfgw
Lemon Quarter
Posts: 2560
Joined: November 4th, 2016, 3:36 pm
Has thanked: 1104 times
Been thanked: 1163 times

Re: Socks

#331454

Postby jfgw » August 6th, 2020, 9:42 pm

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.

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2628 times

Re: Socks

#331817

Postby Gengulphus » August 8th, 2020, 9:38 pm

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

Mike4
Lemon Half
Posts: 7164
Joined: November 24th, 2016, 3:29 am
Has thanked: 1651 times
Been thanked: 3811 times

Re: Socks

#331826

Postby Mike4 » August 8th, 2020, 11:00 pm

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.

:)

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#331827

Postby UncleEbenezer » August 8th, 2020, 11:02 pm

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%.

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#331841

Postby UncleEbenezer » August 9th, 2020, 1:16 am

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).

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2628 times

Re: Socks

#331885

Postby Gengulphus » August 9th, 2020, 11:25 am

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

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#331947

Postby UncleEbenezer » August 9th, 2020, 2:07 pm

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.

UncleEbenezer
The full Lemon
Posts: 10776
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1468 times
Been thanked: 2989 times

Re: Socks

#332100

Postby UncleEbenezer » August 10th, 2020, 10:20 am

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.

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

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2628 times

Re: Socks

#332218

Postby Gengulphus » August 10th, 2020, 6:16 pm

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 25 guests