Feb 26, 2011

# Crazy D.E. Shaw phone interview question -- Help!

I had a first round phone interview for a quant trader position with D.E. Shaw today, and got stumped on what seems like a pretty simple probability question (see below). Do any of you know how to figure it out? I think it deals with combinations.

There are n socks in a closet, and 3 of them are purple. What is the value of n such that when 2 socks are taken randomly from the drawer, the probability that they are both red is 0.5?

#### Relevant Interview Data

New York, NY - 2019

New York, NY - 2019

New York - 2019

New York, NY - 2019

New York, NY - 2019

##### Wall Street Oasis Notifications

##### Please tell us a little bit more about yourself to send you the most relevant notifications

##### Get Notified?

Popular Content See all

- Private Wealth Management/Private Banking Guide for AssociatesOnce and for all - Here is the best guidebook I can give you for PWM/PB at the Associate level. Enjoy and show me some love... 1.1 What is Private Wealth Management? 1.2 Who is a High Net Worth Investor? 1.3 Industry Today 1.4 Career Paths within Private Wealth Management 1.5 How to...
- How was Investment Banking modeling done back in the day?Have always wondered this. Investment banks have been around long before excel - even back to the 80s and 90s - so how would investment banks and private equity firms create IPO pricing, valuations, LBOs, etc?
- I work in event driven / arbitrage. Here are some career advice for youIt’s been a while since I’ve visited WSO. Yet in my early 20s, this was the place that I would often come to for information and guidance. In the spirit of giving back, I’ll share my story and a few nuggets of wisdom that I believe may help others who are also trying to strive in their...
- Parents [including celebs and various hot shots] indicted in college admissions test scamOuch... prestige attempts done the wrong way AND caught no less! Prosecutors filed charges against 33 parents, accused of paying between $200,000 and $6.5 million to get their children into elite universities. Those indicted include actresses Lori Loughlin and Felicity Huffman [actress and...
- SA and Full Time Recruiting 2020 threadWanted to better organize the 2020 recruiting here instead of my previous post. @AndyLouis" Current 2020 SA Info: [quote="champagnepaki"] Not really. Sure the WSJ article from this past Fall brought awareness and the process will probably be a little slower this year, but...
- Net debt: The definite listSince this topic comes up on WSO every now and then, I thought that it might help to collect everything in one list. The underlying definition is all "interest bearing liabilities". I will split it up into “positive items” and “negative items” which are subtracted. For some I...
- Anyone actually like their corporate development job? (Post -IB)I know most people exit to PE/HF (coming from my firm) and maybe 1-2 in each analyst class exit to corporate development. I myself also plan on exiting to PE but I've always been curious about corporate dev I know the positive to corporate development is actually getting your life back...
- Join the WSO Chats for Your City Join the email list for your city to receive updates on future WSO events in your city. When signing up you will also receive a welcome email with a link to join your city's chat group. We created these Telegram groups with the goal of making it easier for WSO members to organize events /...
- Financial & Valuation Modeling Boot-CampFinancial modeling is a skill that any investment banking analyst will have to master. Although the majority of investment banks and other financial firms now have formal training programs, many students and prospective finance professionals are choosing to enroll in self-study financial...
- Free Access to the Video & Template Library - 200+ videos, templates, cases, models++So as part of an effort to source more high-quality cases, templates, modeling tests, stock pitches, etc I wanted to open up an offer to the community to see what the response would be. Here is the deal. The WSO Video and Template Library already has a TON of high quality cases/...

Leaderboard See all

1 | CompBanker | 97.4 |

2 | NuckFuts | 97.2 |

3 | frgna | 97.1 |

4 | Linda Abraham | 96.8 |

5 | bolo up | 96.8 |

6 | kanon | 96.7 |

7 | picklemonkey | 96.7 |

8 | Ricky Rosay | 96.5 |

9 | Secyh62 | 96.5 |

10 | InfoDominatrix | 96.3 |

Upcoming EventsSee all

- Mar21
- Mar21
- Mar21
- Mar21
- Mar21

## Comments (25)

Not certain but I think it's n = 11 total (assuming the 8 non-purple ones are all red) - though this answer does not come out with a clean 0.5 probability, the probability for my answer is actually .5090

There's an 8/11 probability of picking a red one on your first grab, and a 7/10 probability of picking a red one on your second draw. = 8/11 * 7/10 = .5090

To find the solution, I used combinations as you suggested with the numerator being: Combination (n - 3, 2)

Choose 2 out of the total number of red socks = total socks - purple socks = n - 3

and the denominator being: Combination (n, 2)

Choose 2 out of the total number of socks = n

Combin (n - 3, 2) / Combin (n, 2) = approx .5

For my choice of n I just did an iteration of integers upwards from 5 till I got in the ballpark.

Once again, I'm not sure if it's right since it's not exactly .5 but let me know your thoughts.

Answer is 4

3/ N * 2/ (N-1) = 0.5

Solve for that and you get 4

3/4 - first sock

2/3 - second sock

= 0.5

Wait, did he want to know the probability of getting a purple sock or a red sock?

Actually you're right. I totally misread the question.

I guess the answer would be about 11

(N-3)/N * (N-4)/(N-1) = 0.5

So, like all math questions we need to break it down.

Are the variables independent are dependent(you should have asked this), I'm going to guess dependent. You also should have asked are there any other colors.

We are trying to solve for N which is the total number of socks in the closet

So, how many red socks are in the drawer? Well we know that 3 out of N are are purple so N -3 can't be purple.

Thus on the first pick the probility is P(N-3) = (N-3)/N.

Ok, so after the first pick what is remaining? Well, the amount of scoks left would be N -1, because one sock got taken off. The numerator would also have to have one more sock missing N-4 because N-3 -1 = N-4.

Thus on the second pick the probibility is P(N-4| N-3) = (N-4 )/(N-1)

Use the General Rule of Multiplication to solve this problem we have

P( N-3 and N-4) = P(N-3) * P(N-4| N-3) = (N-3)/N * (N-4)/(N-1) = (n^2 -7n +12)/n^2 = (-7n +12)/n^2 = -.5

= -7n+12 = -.5n^2 = .5n^2 - 7n +12 = 0

So, N = aprox 11

lol i made an algebra mistake some where in that long txt

814 questions across 165 hedge funds. 10+ Sample Pitches (Short and Long) with Template Files. The WSO Hedge Fund Interview Prep Course has everything you'll ever need to land the most coveted jobs on the buyside. Learn more.

wait that can't be right

Lol... that was impressive however, all the diagnostics/breaking down whatnot.

It's what you put into it

814 questions across 165 hedge funds. 10+ Sample Pitches (Short and Long) with Template Files. The WSO Hedge Fund Interview Prep Course has everything you'll ever need to land the most coveted jobs on the buyside. Learn more.

you simplified the denominator to N^2 when it should be N^2-N

You can also think about it another way:

The number of possible dual red combinations assuming only red and purple socks and R as number of red socks-

(R)(R-1)/2

The number of total combinations of socks with T as total number of socks should be-

(T)(T-1)/2

Since you know that T=R+3 and the probability of dual red is .5, all you need to do is put it together.

((R)(R-1)/2) / ((T)(T-1)/2) = .5

->

(R)(R-1) / (R+3)(R-2) = .5

->

R^2-7n-6=0

->

R~8

T~11

Instead of having of having to do the quadratic u could just guess and check. Since .7 squared is.49 u know that the two fractions have to b around there. Obviously the odds of the first sock being red is higher thN the second so were looking for a fraction just larger than 7/10...so u guess 8/11and then it checks out

....

Yea 11's probability should be 56/110 or 1/110 over our goal of .50

Assuming no replacement, the equation you're solving is:

(n-3)/n * (n-4)/(n-1) = 0.5

Rearranging, you get:

(n-3)(n-4) = 0.5n(n-1)

Foiling and multiplying by 2:

2(n^2 - 7n + 12) = n^2 - n

2n^2 - 14n + 24 = n^2 - n

Simplifying and collecting terms on one side:

n^2 -13n + 24 = 0

Apply quadratic_formula(1, -13, 24) and you get ~10.8 and ~2.2 as solutions.

^^ that is correct answer i forgot how to do quadratic forumla lololol

if the question is right, then you can't know because you dont know how many red socks there are, just purple

sure, if you want to be pedantic about it. or be a reasonable person and just assume that red = non-purple.

When reading the question, that never even occurred to me, I was thinking the same exact thing as lifeofpupose was.

I'm sure the question was asked in a clearer way than the way the OP paraphrased it.

The answers to date have missed the point completely.

If there are k red socks among n socks, the probability of picking two red socks at random is (k/n), the chance of getting a red sock on the first pick, times (k-1)/(n-1), the chance of getting a red sock on the second pick given that you got a red sock on the first pick. So we need to solve k(k-1)/[n(n-1)]=0.5 or n^2 - n - 2k^2 + 2k = 0.

The quadratic formula tells us we need 2n - 1= sqrt(8k^2-8k+1), so 8k^2-8k+1 must be an odd perfect square.

The first solution is k = n = 1, which is inadmissible since the probability of picking two red socks is undefined, 0/0.

The next solution is k = 3, n = 4 which is inadmissible since there can't be three purple socks if there is only one non-red sock.

The next solution is k = 15, n = 21, which works. 15 red socks, 3 purple socks and three non-red, non-purple socks. There are also solutions at k = 85, n = 120, and k = 493, n = 697.

I suspect you get a pretty good score by setting things up properly and realizing that n = 1 and n = 3 don't work. If you can come up with n = 21 in your head during an interview, that's great, but most people would likely explain how to get the answer with a short computer program or how they would do it by mental trial and error in ten minutes or so. You don't have to try every number since you know k/n has to be near sqrt(.5)+1/(7n).

Your answer is wrong and overly complicated... There are 3 purple socks not at least 3 purple socks.

Yes, three purple socks and an unknown number of socks that are neither red nor purple.

You may be right about overly complicated, there may be a simpler way to find the answers. But The answer are correct in that they meet both stated conditions: there are three purple socks and if you pick two at random the probability they are both red is 50%.

I see what you are saying and can admit you're answer is better. I was putting myself in the situation and assuming the interviewee confirmed that the rest of the socks were red. In a trading position it's important to gather all the information you can and try to quantify what you don't/can't know.

I partly agree. I use brain teasers a lot in my interviews, and the main think I look for is attitude. People who are used to thinking things through and getting things right attack problems with confidence. They don't always get the answer right, but they take reasonable approaches and explain them. Yes, they ask questions, but the type of question is important.

Most people fail the test, but not for getting the wrong answer or even for not seeing how to approach the problem. They ask random questions to stall. They are overly suspicious about tricks (e.g. "you said it was dark, but am I able to feel the difference between the different sock colors?").

They don't appreciate that the problem was carefully crafted and tells you all you need to know, and is hard enough to be interesting, but not impossible. Starting from that assumption, you can answer most questions for yourself. Just asking questions without thinking about the problem makes you seem unaware of the situation.

Rather than asking, "Are all the socks either red or purple?" it's better to say, "Well, the straightforward solution is to assume there are only purple and red socks, so I need to solve 2K(K-1)=(K+3)(K+2), which reduces to K^2-7K-6=0 which has no integer roots since 49+24 is not a perfect square. So are are at least three colors, right?" Right there you've shown you've understood the problem and have some idea how to solve it. Asking the question without thinking about whether it could be true is lazy or stalling.

Another popular way to fail is to say random stuff and look at the interviewer's face hoping to see if you're close; or to get him or her to give you hints.

Remember your goal is not to solve the problem, but to get the job. To do that you should demonstrate confidence about solving problems like this. If you're not confident, it's probably because you're not good at it. You should look for ways to show intelligence--like explaining why there must be some non-red/non-purple socks--you don't need to get the right answer to do that.

## See All Comments - 100% Free

WSO depends on everyone being able to pitch in when they know something. Unlock with your email and get bonus: 6 financial modeling lessons free ($199 value)

Want to sign in with your social account?

## Want to Vote on this Content?! No WSO Credits?

Join Us

Already a member? Login

## Related Content

## Popular Content

See all