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?

 

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.

 

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

 

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

 

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.

 
dabanobo:
lifeofpurpose:
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.

 
Most Helpful

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

 

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

 

Nobis velit pariatur non mollitia repellat ipsa recusandae. Omnis doloribus et qui iusto excepturi. Omnis quasi eum dolor eligendi.

Aut laboriosam provident quasi consequuntur doloremque non corporis eligendi. Architecto odio nihil quis voluptatem veniam sed sunt voluptate.

Et magni accusantium nulla. Dolore voluptatem temporibus adipisci iste ipsa ipsum. Et quo dolores neque repellendus autem dignissimos natus. Quis sed unde eveniet unde adipisci accusantium. Odio quaerat sequi molestiae.

 

Tenetur nobis ut ipsam quam porro praesentium. Libero deserunt facere eum autem quo quod. Et aut magnam repellendus et rerum.

Magni distinctio in in recusandae necessitatibus laboriosam. Molestias dignissimos explicabo dolores quas qui. Eum sed est quos quo. Omnis neque id quae. Dolorem sapiente cum ipsam sed enim iure. Tempore modi vitae qui temporibus.

Career Advancement Opportunities

April 2024 Hedge Fund

  • Point72 98.9%
  • D.E. Shaw 97.9%
  • Citadel Investment Group 96.8%
  • Magnetar Capital 95.8%
  • AQR Capital Management 94.7%

Overall Employee Satisfaction

April 2024 Hedge Fund

  • Magnetar Capital 98.9%
  • D.E. Shaw 97.8%
  • Blackstone Group 96.8%
  • Two Sigma Investments 95.7%
  • Citadel Investment Group 94.6%

Professional Growth Opportunities

April 2024 Hedge Fund

  • AQR Capital Management 99.0%
  • Point72 97.9%
  • D.E. Shaw 96.9%
  • Magnetar Capital 95.8%
  • Citadel Investment Group 94.8%

Total Avg Compensation

April 2024 Hedge Fund

  • Portfolio Manager (9) $1,648
  • Vice President (23) $474
  • Director/MD (12) $423
  • NA (6) $322
  • 3rd+ Year Associate (24) $287
  • Manager (4) $282
  • Engineer/Quant (71) $274
  • 2nd Year Associate (30) $251
  • 1st Year Associate (73) $190
  • Analysts (225) $179
  • Intern/Summer Associate (22) $131
  • Junior Trader (5) $102
  • Intern/Summer Analyst (250) $85
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Betsy Massar's picture
Betsy Massar
99.0
3
BankonBanking's picture
BankonBanking
99.0
4
Secyh62's picture
Secyh62
99.0
5
CompBanker's picture
CompBanker
98.9
6
kanon's picture
kanon
98.9
7
dosk17's picture
dosk17
98.9
8
GameTheory's picture
GameTheory
98.9
9
Linda Abraham's picture
Linda Abraham
98.8
10
Jamoldo's picture
Jamoldo
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”