Jane Street Capital Interview
January 24, 2017 | Author: hc87 | Category: N/A
Short Description
interview...
Description
Jane Street Capital Interview Questions Nikolaos Rapanos March 8, 2010
First Round.
The first round phone interview took place on Tuesday, 16 February 2010. I was asked the following questions: The Questions 1. Mental Arithmetic. Questions like 1 million - 101, 342 , 54 percent of 110 etc. 2. (a) What is the expected value of a fair die? (b) What will be the expected value of the same die if for each dot you are given 100 GBP? (c) Now you are given the chance to roll the die twice, but if you choose to do so then you are obliged to keep your second outcome. What is your strategy in order to maximize the expected value and what is the new expected value? (d) Same as (b) but now you are allowed to re-roll twice and obliged to keep your third roll. 3. You roll two dice and you are told that one of them is six. What is the probability that both are six? 4. You hold a ball 10m above the ground. You leave the ball and you are told that each time the ball hits the ground, it will bounce up to the half of the height it was left from. So the first time the ball hits the ground will bounce up to 5m, the second time to 2.5m and so on. What is the total distance the ball will travel? How confident are you about your answer? The Answers 1. In general, we can speed up calculations using Vedic Mathematics or other simple tricks. For instance, 342 = 302 + 2 · 30 · 4 + 42 = 900 + 240 + 16 = 900 + 256 = 1156. 2. (a) The expected value of a fair die is
6 X 1 i=1
6
· i = 3.5 (simply the values weighted by the corresponding
probabilities). (b) We only need to multiply each of the values by 100, and so the expected value will be 100 times greater than the previously computed expected value. Thus the new expected value turns out to be 350 GBP. (c) Obviously if the first outcome is less than or equal to 3, we choose to roll the die again. Therefore, the new expected value will be the average of the expected values of the first and the second round. The expected value of the first round will be the expected value among the values that we choose to keep, namely 4, 5 and 6. Hence the expected value of the first round is 5 and the expected value of the second round is 3.5 as derived above. Therefore, the new expected value will be 0.5(5 + 3.5) = 4.25. Note that as this is an extension of question (b) we also have to multiply by the factor 100, and so the expected value will become 425. What this says, is that if we play this game then we should expect to gain in average 425 GBP. (d) In this case we stop on the first roll if we get 5 or 6 (higher than 4.25). on the second Also we stop 1 2 140 roll if we get 4, 5 or 6 (higher than 3.5). Hence the expected value is 100 · 5.5 + 4.25 = = 466.7 3 3 3 GBP.
1
Comments on Problem 2 Comment 1. Now we are told that we have to pay a (one-off) ticket in order to play the game in (b), and by definition the fair value of this ticket is the value that would force the expected profit to be zero. As follows, from the analysis above the fair value of this game would be 425 GBP. This can be interpreted as the maximum amount of money we are willing to spend in order to play the game (i.e. take the risk with the hope to make profit). The logic can be conversed. If for example we are the “owner” of this game, then we can set the ticket price for the game to be equal to the fair value of the game plus possibly a small margin for profit. Comment 2. In order to demonstrate the concept of the fair value consider the following example appeared in a past Jane Street interview: You pay a ticket in order to roll a die. If the result is 6, then you get 10 GBP. What is the fair value of this game? Let x be the fair value of this game. The expected profit for this game is EP = (10 − x) · Demanding EP ≥ 0 we get x ≤ 10 6 = 1.67 GBP.
1 6
− x · 56 .
Comment 3. Now suppose that we are told that we have to pay a fixed value ticket each time we decide to roll a die, then this value would be the half of the aforementioned fair value. In fact, if we follow the logic demonstrated above we can explicitly deduce this intuitive result. Indeed, if x is the fair value of the ticket then denoting by EP1 and EP2 the expected profits for the first and second roll respectively, we get the following expressions: 1 1 EP1 = (100 · 5 − x) − x 2 2 1 1 EP2 = (100 · 3.5 − x) − x 2 2 Hence EP = EP1 + EP2 , and by demanding this total expected profit to be non-negative we get x≤
425 = 212.5 2
3. Solution 1. We know that all the possible combinations (outcomes) of two dice are 6 · 6 = 36. From these combinations, we are interested in those which contain at least one 6. This is equivalent to counting the outcomes which contain no 6 and then subtracting them from the total number of possible outcomes which is 36. The outcomes which contain no 6 are 5 · 5 = 25, and hence the outcomes which contain at 1 least one 6 are 36 − 25 = 11. Therefore the probability of having exactly two 6 is P = . 11 Solution 2. Alternatively, we can work this out with conditional probabilities. By A denote the event that both will face up a 6, and by B denote the event that at least one will face up a 6. Now, call B1 the event that the first die is a 6, and B2 the event that the second die is a 6. It is more than obvious that B = B1 ∪ B2 and therefore P (B) = P (B1 ) + P (B2 ) − P (B1 ∩ B2 ). Using the definition of conditional probability we have: P (A|B) =
1 P (A ∩ B) 36 = = P (B) P (B1 ) + P (B2 ) − P (B1 ∩ B2 )
1 6
+
1 36 1 1 6 − 36
=
1 11
Solution 3. A slight deviation from the solution discussed above, makes use of Bayes Theorem and worths to be presented here. Following the above notation we have: P (A|B) =
P (A) · P (B|A) by Bayes Theorem, and plugging in numbers we get P (A|B) = P (B)
1 36 · 11 36
1
=
1 11
Solution 4. Finally, we can also tackle this problem using Binomial Distribution (see Appendix A). We roll two dice, so n = 2 and the probability of each outcome is a sixth, therefore p = 61 . Let us denote by Pn (x) the probability of x successes in n trials and in our case a success can be interpreted as a rolling a die and getting a six. Following the aforementioned notation, we conclude that the probability of having exactly two 6 can be calculated as the probability of two successes in two trials divided by the probability of having at least one success in two trials (which in turn is the sum of the probabilities of one success in two trials and two successes in two trials). Mathematically, we can write 2
P (A|B) =
P2 (2) P2 (1) + P2 (2)
2 2 1 · 1 2 6 = 2 = 11 2 1 5 2 1 · · + · 1 6 6 2 6 Comment. Especially the last solution to the problem makes evident that the problem can be naturally generalized and also a universal approach can be developed and adopted in similar situations. Obviously a prerequisite for this, is a deep understanding of Binomial Distribution. Consider for example the following problem which appeared in another Jane Street interview: You flip four coins and at least two are heads. What is the probability that exactly three are heads? This type of questions should ring the bell. The answer is Binomial Distribution for n = 4 and p = 21 . Using the notation introduced in Solution 4, we compute the requested probability P as follows:
P =
P4 (3) 4 = P4 (2) + P4 (3) + P4 (4) 11
4. In this problem we have to be careful to take into account that the ball will travel once downwards and once upwards in each bounce. Therefore the total distance traveled by the ball can be calculated as d = 10 + 2 ·
! ! 2 2 1 1 1 + ... = 2 · 10 + 10 · + 10 · + ... − 10 = 2 2 2 ! 1 n −1 2 =20· lim − 10 = 20 · 2 − 10 = 30. 1 n→∞ 2 −1
1 10 · + 10 · 2
Regarding the confidence question, I was told that there is no correct answer but the whole point is that after taking the decision to implement a trading idea, we first have to allocate some time debating on how confident we are and consequently how much risk we are willing to take. I find it helpful to think that I bet my own money on this, so even if I am sure about my answer I have to be quite reserved since I risk my own money.
3
Second Round.
The second round phone interview took place on Tuesday, 23 February 2010. I was asked the following questions: The Questions 1. You roll two dice. What is the probability that the product of the numbers you get is a perfect square? 2. Give a 10-digit number so that each digit represents the instances of that ordinal number in the whole number. 3. England will play five cricket games against Russia. The team which will win the majority of the games will be the winner of the series. You have 100 GBP and you want to spend them betting on England being the winner of the series. Unfortunately, you find out that you cannot place bets for the entire series; you can only bet for single games. In this case how could you use your 100 GBP, so that at the end if England is the winner of the series you will have won 100 GBP? Regarding the bets the rule is that if you win then you double the amount of money you had bet, and if you lose then you just lose the amount of money you had bet. The Answers 1. In this problem we have to be careful. In total there are 36 different outcomes. In order for the product of the two numbers to be a perfect square there are two cases: (a) the two numbers are the same (which can be done in 6 different ways) (b) the numbers are 1 and 4 (which can be done in 2 different ways). 2 8 = . Therefore the requested probability is 36 9 2. The answer is 6210001000. 3. This is a hard question, because it can be done only in one way. You can be wasting your time thinking about possible combinations and probabilities while what you should do is Brute Force. Namely, after the fifth game our desired status is demonstrated in Table 1 below. Table 1: Desired Status after the fifth game England’s wins Russia’s wins Status 5 0 +100 4 1 +100 3 2 +100 2 3 −100 1 4 −100 0 5 −100 The information of the above table can be used in order to construct an equivalent table demonstrating the desired status after the fourth game. Table 2: Desired Status after the fourth game England’s wins Russia’s wins Status Bet for the next game 4 0 +100 0 3 1 +100 0 2 2 0 100 1 3 −100 0 0 4 −100 0 To understand how the above table is constructed, let us focus in the first row. In the case that England has won four of the games, then there are two possible scenarios after the fifth game. England will have won all of the five games, or will have won all but one game. By examining Table 1 we observe that in both cases our desired status is +100. Therefore, if we call x the desired status at the first row of Table 2 and y the bet we will place in the fifth game; then according to the above explanation we can formulate the following equations: x + y = +100
4
(1)
x − y = +100
(2)
From (1) and (2) above, we conclude that x = 100 and consequently y = 0. Note that Table 2 differs from Table 1 in that, it contains one more column with information on what our next bet should be. This is equal to the value of y as defined above, and can be calculated from two simultaneous equations as we just demonstrated. Similarly, we can fill the following rows of Table 2. We will use this technique to go backwards until we reach our base case, namely the first game between England and Russia. Our results are presented in the following tables. Table 3: Desired Status after the third game England’s wins Russia’s wins Status Bet for the next game 3 0 +100 0 2 1 +50 50 1 2 −50 50 0 3 −100 0
Table 4: Desired Status after the second game England’s wins Russia’s wins Status Bet for the next game 2 0 +75 25 1 1 0 50 0 2 −75 25
Table 5: Desired Status after the first game England’s wins Russia’s wins Status Bet for the next game 1 0 37.5 37.5 0 1 −37.5 37.5 The desired status after the first game can be interpreted as the bet we are willing to place on the first game. Therefore we can place 37.5 GBP on the first game, and then according to the results we can follow the strategy implied by the y values of the above tables and we are ensured to win 100 GBP if England is the winner of the series, or lose 100 GBP in the opposite case. The betting strategy can be visualized using a tree diagram. ONML HIJK 37.5 h VVVVV h h h VVEngland h Russia VVVV hh VVVV hhhh h h h VV hhh ONML HIJK ONML HIJK 37.5 37.5 V V h PPPP n VVVV h n h h n PPE VVVEV Rnnn R hhhh PPP h VVVV PPP nnn hhhh V h n V h n V h h n ONML HIJK ONML HIJK ONML HIJK 50 25 25 P V n ;;; hh VVVVV PPPP E n h h n h n V h R E R R VVVV h PPP ;;E nnn VVVV hhhh PPP ;; VV nnnnn P hhhhhh ONML HIJK ONML HIJK ONML HIJK ONML HIJK 0 50 50 0 ;; V P V h P n V h P n V h V h P n ;; V h PPE VVVEV Rnnn R h PPP ; VVVV hhhh PPP E,R nnn E,R ;; VVV hhhhhhh nnn ONML HIJK ONML HIJK ONML HIJK 100 0 0 UUUU n n UUUUP rof it P rof itnnnn UUUU Loss nn UUUU UUnnnnn −100 +100
Figure 1. The betting strategy is demonstrated using a tree diagram structure. We start with 37.5 GBP bet for the first game, and then we follow the tree nodes according to the results. 5
Appendix A Binomial Distribution Suppose that n identical and independent experiments are conducted, and result in two mutually exclusive outcomes (often called success and failure). Also, suppose that the probability of success is constant and equal to p (whereas the failure probability is q = 1 − p). This scenario is called Binomial Distribution and has the following properties: n x • The probability of x successes in n trials is given by the formula Pn (x) = p (1 − p)n−x x • The probability of at most K successes in n trials is given by
K X
Pn (x)
x=0
• The probability of at least k success in n trials is given by
n X
Pn (x)
x=k
• The expected value of a random variable X obeying a Binomial Distribution is given by E[X] = np • The variance of a random variable X obeying a Binomial Distribution is given by σ 2 = np(1 − p) As an example consider the following problem which has appeared in past Jane Street interview: John and Nick flip a coin sequentially. John counts 1 for heads and 0 for tails, whereas the opposite is true for Nick. The game finishes when one of the players reaches number 4. What is the probability of reaching game 7 in order to have a winner? For this to happen, we require 3 wins in 6 games from one of the players. Hence the probability will be 5 P6 (3) = 16 Geometric Distribution A different view of a sequence of identical and independent dichotomous trials is embodied in the question “how many trials are required before the first success ?”. If p is the probability of a success, then to achieve a first success at integer k, we must have observed k − 1 failures. The probability of this event is P (X = k; p) = (1 − p)k−1 p for given parameter p and for k = 1, 2, .... The random variable X that counts the number of trials until the first success, has a geometric distribution. The following properties hold: • The expected value of a geometric distribution is E[X] = • The variance of a geometric distribution is σ 2 =
1 p
1−p p2
Consider the following two examples. 1. (Jane Street Interview ) (a) Two players A and B flip a coin sequentially. The game finishes when the sequence TTH is formed and player A wins or the sequence HTT is formed and player B wins. What is the probability that the game will finish at the nth flip? (b) What is the probability that the game will have finished before or at the nth flip. (c) What are the odds of player A winning the game? Solution. (a) The question is a bit tricky. First of all note that n ≥ 3. Also say that we have flipped the coin five times for example, and the outcomes are labeled 1,2,...,5. In order to check that one of the two desired events has or has not occur until the 5th flip we have to check the triples (1,2,3), (2,3,4), (3,4,5) which are three, and in general two less than the number of the flip. The probability that a single triple is one of the desired two, is 82 = 14 Therefore the probability that the game will finish at the nth flip is P = ( 34 )n−3 · 14 . (b) This is the probability that it will have not finished by the nth flip subtracted from 1, that is P = 1 − ( 34 )n−2 . (c) The odds are 1:1. 2. (a) Consider throwing a fair coin. What is the probability that the first head occurs on the third throw? (b) What is the expected number of throws before observing a head? 2 Solution. (a) P = 1 − 12 12 = 18 (b) Consider observing a head as a success with single probability p = 0.5. Then the random variable X that counts the number of trials until the first success has a geometric distribution, and hence the requested expected number of throws is the expected value of the random variable X, that is E[X] = p1 = 2.
6
View more...
Comments