How To Solve  Amazon’s Pair Of Socks Interview Puzzle
Articles,  Blog

How To Solve Amazon’s Pair Of Socks Interview Puzzle


Hey, this is Presh Talwalkar. This problem was part of a written interview test for Amazon in India. A drawer contains twelve identical black socks and twelve identical white socks. If you pick two socks at random: what is the probability of getting a matching pair? Can you figure it out? Give this problem a try and when you’re ready keep watching the video for the solution. Many people think when you pick two socks they will either match or they will not match. Since the number of black and white socks are equal, the probability of matching should be 50%. But this tempting answer is wrong! The probability of making a pair is actually slightly less than 50%. Let’s calculate and figure out why? There are 12 white socks and 12 black socks. By symmetry the probability of picking a black pair of socks equals the probability of picking a white pair of socks. So let’s calculate the probability of picking a black pair of socks. There is a 12 over 24 chance the first sock is black. This is because there are 12 black socks out of 24 socks total. 12 over 24 simplifies to be 1/2. Now what’s the chance of picking a black sock on the second draw? For the second sock the chance will be 11 out of 23, because there are 11 black socks remaining out of a total of 23 socks remaining. The asymmetry is because we are sampling without replacement. So what does this all mean? It means, the probability of picking a black pair is 1/2 times 11 over 23. This will also be the probability of picking a white pair by symmetry. So, we can put this all together to get the odds of picking a pair of matching socks. The probability of picking a matching pair will equal the probability of picking a black pair plus the probability of picking a white pair. Each of these is equal to 1/2 times 11 over 23. And therefore the probability of picking a pair of matching socks will be 11 over 23, which is approximately 47.8%. This is slightly less than 1/2. Did you figure it out? Thanks for watching this video. Please subscribe to my channel. I make videos on math. You can catch me on my blog mindyourdecisions. If you like this video you can support me on patreon… …and you can check out my books which are listed in the video description. You can also follow me on social media either at mindyourdecisions or at preshtalwalkar depending on the site.

100 Comments

  • MindYourDecisions

    Wow in just about one week you guys have captioned this video in English, AND it's been translated into Arabic and German! Captioning is a lot of hard work–I know I've done a few–and I'm really appreciative. I read that Youtube gives some rewards for doing captions, has anyone earned any worthwhile rewards yet? You guys are great, I have so many things to be thankful for this year!

  • ZombieTex

    To be fair, when I imagined the scenario in my head, I wasn't picking one sock at a time. I was plunging two hands into a sock drawer at the same time and pulling two socks simultaneously. I think that methodology makes a difference.

  • blkswansec

    This is the real question, If the socks are already paired, (two matching socks already together), why is this an issue?

  • Caleb Fuller

    11 in 23. Too easy.

    Unless of course, you are running late, in which case the odds decrease exponentially, in accordance with Murphy's law…

  • RodCornholio

    Another hint: One sock taken out of the pile, how many (total) socks are left? Regardless of which color you chose, how many of THAT color must still be in the pile? Now you know all you need to solve the problem. You know how many of ANY color of socks are remaining. You know how many of – whatever color you chose – are still in the pile. Now don't screw the pooch and divide wrongly and get over a 100% probability!

  • Neil deGrasse Tyson

    Wait why did i get i wrong.
    I thought this:
    1 sock: 50%
    2 sock: 47.83%

    But since you can also pick the 53% you need to do 50•47.83
    While writing this i realised it is 47.83 because its 50/50 and i just need to think more logical.

  • Eric Hart

    100% chance I'll get a matching pair cause i fold my socks in pairs before i put them in the drawer it's not as complex as you've made it to be, it's two socks at random well randomly i choose this pair and they happen to match

  • Himanshu Chauhan

    Oh ghosh that was tooooo easy
    We people in india solve way harder problems to get a good btech colledge

  • Timothy Buchanan

    The question did not say that you select one sock, and then another. It just says you pick two socks. If you select them at the exact same time, wouldn't that change the probability?

  • Luiz Sarchis

    Your solution is kind of cumbersome. Think first about the probability of drawing two socks that don't match.

    You take one sock out…it will have SOME collor, let's try not to worry so much about which is it. The opposite collor hadn't any pair removed, so there are 12 of those out of the 23 still in the closet. 12/23 chances of not forming a pair.

    Hence chances of picking a pair 11/23! CQD

    Your way is not wrong, but I suspect a job interviewer will be looking for a simpler solution

  • HankL

    Given that this is an interview question, would it not be correct to say the probability is 11/23 straight away since the first sock is always correct (color was not specified) which leaves you with an 11/23 chance of picking the same color again?

  • Radek K

    There is much better approach. The probability of first sock pick doesnt really matter as the amount is the same. When you pick black one, the probability that next one is black is 11/23 and the same if you pick white one first. Always in second step you have 11/23 and this is what matters.

  • Soumosir Dutta

    It can be done by PnC
    Total ways of picking 2 socks = 24C2= 12*23
    Total ways of picking a unmatching pair= 12C1*12C1 = 12*12
    Now total ways of picking a matching pair= 12*23-12*12= 12*11.
    Hence p(picking a matching pair) = (12*11)/(12*23) = 11/23.

    This is for those who want to get into the depth of the problem.

  • Jared Prince

    12/24*11/23+12/24*11/23=0.478261
    The probability of an unmatched pair is:
    12/24*12/23+12/24*12/23=0.521739
    and, of course, 0.478261+0.521739=1

  • P3RK4N

    -If we look just at black socks, chance of getting the first one is 12/23 (1/2) and the chance of getting the second one is 11/23

    So the chance of pulling them booth is equall to 11/23 x 1/2 = 11/46

    Thats only for black… white has the same chance so we just double the chance we will get the pair… 11/46 x2 = 22/46 = 11/23

    Combinatorics…

  • Albatros

    for any amount of black and white socks, we have positive combinations for black in this case 11*12/2 = 66 and same for white so 132 positive combinations, all combinations are 23*24/2=276 so probability is 132/276= 0.47826…

  • Mike12522

    I think a better question would be: " Why on Earth would you want to work long hours in an un-air-conditioned Amazon sweatshop in India for $2.00 an hour ? "

  • MisterVercetti

    You don't even really need math to solve this one. No matter which color sock you pick first, you'll always have an 11/23 chance of picking the same color again.

    I guess Amazon's expectations of its talent pool in India are pathetically low.

  • rolawrence036

    The answer is quite easy….if your reach in and pick 2 single socks at the EXACT same time using both your hand the chances are still 50% seeing you wont leave 1 less color in the drawer if you picked out a single sock

  • Grinning Guise

    Based on the construction of the question (pick two socks at random) the chances are EXACTLY 50% because you pick both socks at the same time.

  • john thompson

    This is a simple problem with an easy solution, which can be solved by combination of addition and product rule in probabilty. (12/24)*(11/23)+(12/24)*(11/23)

  • Ennio Ricciardi

    But … following a different reasoning, the result is different.
    If I pick two socks at random, I can obtain three different outcomes: two black socks, or two white socks, or one black and one white sock.
    So, the probabilities of having two socks of the same colour are 2 out of 3, that is 2/3, i.e. 66.66% !

  • Ennio Ricciardi

    But … following a different reasoning, the result is different.
    If I pick two socks at random, I can obtain three different outcomes: two black socks, or two white socks, or one black and one white sock.
    So, the probabilities of having two socks of the same colour are 2 out of 3, that is 2/3, i.e. 66.66% !

  • Nordic Exile

    Given that this was an interview question, there is only one "right answer": one hundred percent! You just have to put your socks together in pairs as you put them in the drawer. Then when you reach in to get them, you grab a pair and have a perfect match every time. Yeah the answer for a random pile of socks is 11/23, but who would hire someone who cannot organize themselves to be efficient on the job? Not Amazon!

  • Hitler Cat

    Your answer is only correct if you pick 2 socks separately (pick one then pick another), but if you take two socks together in one action it has to be 50%

  • Straw B. Milk - MUTEproxxy

    But this is under the assumption that the black sock was picked at time (0) followed by another sock at some time after (1second let's say)..but what if both socks were chosen at exactly the same time?? That means there was never a moment in time where there was 1 fewer black sock or 1 more white sock than the black, thus throwing this probability out the window doesnt it? Giving room for the 50 % probability to very much be plausible and most logical at that point. Tell me where I'm wrong , I'm like hella confused as to why no one else seems to think about this that way. I mean the video never claims nor the question states in what order or fashion were the socks picked to begin with. Of course every one else seems to accept this answer portrayed in the video and I think it's right if you make that initial assumption that they were chosen at to different times..but the question doesnt imply or even gives enough information to make that assumption. Am I wrong??

  • Tom Parker

    Since the problem doesn't specify what color the pair of socks needs to be, a simpler way to explain the answer would be this – after picking the first sock, there are 11 of that color left in the drawer, so the odds of getting another of the same color on the 2nd draw is 11/23. No need to figure the probability of getting a pair of each color and then simplifying.

  • Monima Chowdhury

    According to me : 1 – no matching pair.

    No matching pair = (1 sock chosen from black ( = 12C1) + 1 sock chosen from white ( = 12 C 1) / total ( = 24 C 2)

    12 C 1 = choosing 1 sock from 12 socks of same color.

    24C2 = choosing 2 socks from whole lot of 24.

    Ans : 1 – (12C1)*(12C1)/ 24C2

  • Rajat Saxena

    My Logic was that in the first attempt one is going to pick up a sock, of any colour, hence the probability of picking up a sock would be 1. Then in the second attempt, it would be 11/23 for a matching colour sock. Hence 1*(11/23) = 0.47.

  • Allan Rosenlund

    The correct answer IS 50%, !!! The question was "If you pick 2 socks at random", that means that you have to pick 2 socks and then make the calculation. and that is 50%. You are calculating the question "what is phe probabillity to pick a black sock if you pave picked one".

  • Szabolcs Horváth

    Let's make it only one sock of each color. How much is the probability now? Then make it two of each color. How much now? And so on… Actually one needs to have infinite amount of socks to have a 50% chance of choosing a matching pair. Washing that many socks should suck anyway. (Can you read aloud that sentence? Mwhahahah!!!)

  • Maunster!

    You can jumpstart with 11/23 because you've picked out one sock and you don't need to put it into the equation. Simply put, the question becomes what is the probability of picking the matching sock out of 23.

  • kurzackd

    the question isn't asked accurately enough. "Matching pair" might mean socks of same color AND opposite feet, because that's how they "match" if you wanna wear them.
    In this case, the question should be reformulated simply as "what is the probability of getting two socks of the same color?"

  • reema varma

    It's easy the total outcomes will be obviously 24×23 and favourable outcomes will be 24×11( cause after picking 1 out of 24 socks which can be either black or white we're left with only 11 socks of the same colour.). So probability is 11/23

  • Craig InBoro

    I disagree with the method but agree with the outcome, I just done it logically. If I'm not bothered about the colour I pick out the first random sock, let's assume it's black. What's my chances of getting another black sock. Well there's 11 black left and 12 white. So the chances of another black is 11 out of 23.
    [11/(11+12)= 11/23] =47.8%

Leave a Reply

Your email address will not be published. Required fields are marked *