WorldQuant Interview Question

Do you know Bezout's theorem?

Interview Answers

Anonymous

Nov 9, 2017

Answer to the 2nd question: Let P_k (C) represent the probability that condition C is met with k dice. We have P_3 (max=n)=P_2 (max=n) P_1 (

Anonymous

Jul 25, 2018

This is a hash table problem. TotalSet T N-1 subset can be defined as S(n) n index element dropped sequence, 1<= n <= N. Then multiply of S(n) can be described as T(1:n-1) * T( n+1 : N) so we make a hash table for HashTable1(n) save from 1 to n multiply , HashTable2(n), save from N to i multiply for i in range(1,N+1): HashTable1.put(i, HashTable1.getOrDefault(i, 1) * i); for i in range(1,N+1, -1): HashTable2.put(i, HashTable1.getOrDefault(i, 1) * i); for i in range(1,N+1): print(HashTable1.getOrDefault(i, 1 ) * HashTable2.getOrDefault(i , 1 ))

Anonymous

Nov 9, 2018

For 2nd question, P(max of 3 dice = p) = P(X_1 = p)P(X_2 <= p)P(X_3 <= p) + P(X_1 < p)P(X_2 = p)P(X_3 <= p) + P(X_1 < p)P(X_2 < p)P(X_3 = p) = (p^2 + p(p-1) + (p-1)^2)/(6^3)

Anonymous

Nov 9, 2018

For 3rd question: If only given 1 uniform r.v ~ U(0,1), just apply inverse CDF of Normal and get a normally distributed variable. If we dont have inverse, but can generate 2 Uniform r.v., use Box-Mueller

Anonymous

Sep 12, 2020

For ques 2, I found it easier to understand these scenarios: when all dice are p, 2 are p(3 permutations) and 1 is p(3 permutations). Combining these 3 : 1/6^3 + 3(p-1)/6^3 + 3(p-1)^2/6^3. Solving this will give same answer as solving the 09-Nov-2018 answer. For ques 3, f(x)dx = f(y)dy, where x is random number from uniform distribution and y is random variable from normal distribution. dy/dx = f(x)/f(y) = 1/e^(-x^2) y = integral of e^(x^2) dx Solve the integral