quant interview

6
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, 34 2 , 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, 34 2 = 30 2 +2 · 30 · 4+4 2 = 900 + 240 + 16 = 900 + 256 = 1156. 2. (a) The expected value of a fair die is 6 X i=1 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). Also we stop on the second roll if we get 4, 5 or 6 (higher than 3.5). Hence the expected value is 100 · 1 3 5.5+ 2 3 4.25 = 140 3 = 466.7 GBP. 1

Upload: wong-xianling

Post on 23-Nov-2015

109 views

Category:

Documents


2 download

DESCRIPTION

JSC interview

TRANSCRIPT

  • 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 askedthe 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 tokeep your second outcome. What is your strategy in order to maximize the expected value and what isthe 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 hitsthe ground, it will bounce up to the half of the height it was left from. So the first time the ball hits theground will bounce up to 5m, the second time to 2.5m and so on. What is the total distance the ball willtravel? 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

    6i=1

    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 greaterthan 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. Theexpected 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 secondround is 3.5 as derived above. Therefore, the new expected value will be 0.5(5 + 3.5) = 4.25. Note that asthis is an extension of question (b) we also have to multiply by the factor 100, and so the expected valuewill become 425. What this says, is that if we play this game then we should expect to gain in average425 GBP.(d) In this case we stop on the first roll if we get 5 or 6 (higher than 4.25). Also we stop on the second

    roll if we get 4, 5 or 6 (higher than 3.5). Hence the expected value is 100 (

    1

    35.5 +

    2

    34.25

    )=

    140

    3= 466.7

    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 interpretedas the maximum amount of money we are willing to spend in order to play the game (i.e. take the riskwith the hope to make profit). The logic can be conversed. If for example we are the owner of thisgame, then we can set the ticket price for the game to be equal to the fair value of the game plus possiblya small margin for profit.

    Comment 2. In order to demonstrate the concept of the fair value consider the following exampleappeared 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 ofthis game?

    Let x be the fair value of this game. The expected profit for this game is EP = (10 x) 16 x 56 .Demanding EP 0 we get x 106 = 1.67 GBP.Comment 3. Now suppose that we are told that we have to pay a fixed value ticket each time we decideto roll a die, then this value would be the half of the aforementioned fair value. In fact, if we follow thelogic demonstrated above we can explicitly deduce this intuitive result. Indeed, if x is the fair value ofthe ticket then denoting by EP1 and EP2 the expected profits for the first and second roll respectively,we get the following expressions:

    EP1 = (100 5 x)12 x1

    2

    EP2 = (100 3.5 x)12 x1

    2

    Hence EP = EP1 + EP2, and by demanding this total expected profit to be non-negative we get

    x 4252

    = 212.5

    3. Solution 1. We know that all the possible combinations (outcomes) of two dice are 6 6 = 36. Fromthese combinations, we are interested in those which contain at least one 6. This is equivalent to countingthe outcomes which contain no 6 and then subtracting them from the total number of possible outcomeswhich is 36. The outcomes which contain no 6 are 5 5 = 25, and hence the outcomes which contain atleast one 6 are 36 25 = 11. Therefore the probability of having exactly two 6 is P = 1

    11.

    Solution 2. Alternatively, we can work this out with conditional probabilities. By A denote the eventthat both will face up a 6, and by B denote the event that at least one will face up a 6. Now, call B1 theevent that the first die is a 6, and B2 the event that the second die is a 6. It is more than obvious thatB = B1 B2 and therefore P (B) = P (B1) + P (B2) P (B1 B2). Using the definition of conditionalprobability we have:

    P (A|B) = P (A B)P (B)

    =136

    P (B1) + P (B2) P (B1 B2) =136

    16 +

    16 136

    =1

    11

    Solution 3. A slight deviation from the solution discussed above, makes use of Bayes Theorem and worthsto be presented here. Following the above notation we have:

    P (A|B) = P (A) P (B|A)P (B)

    by Bayes Theorem, and plugging in numbers we get P (A|B) =136 11136

    =1

    11

    Solution 4. Finally, we can also tackle this problem using Binomial Distribution (see Appendix A). Weroll two dice, so n = 2 and the probability of each outcome is a sixth, therefore p = 16 . Let us denote byPn(x) the probability of x successes in n trials and in our case a success can be interpreted as a rolling adie and getting a six. Following the aforementioned notation, we conclude that the probability of havingexactly two 6 can be calculated as the probability of two successes in two trials divided by the probabilityof having at least one success in two trials (which in turn is the sum of the probabilities of one success intwo trials and two successes in two trials). Mathematically, we can write

    2

  • P (A|B) = P2(2)P2(1) + P2(2)

    =

    (2

    2

    )(

    1

    6

    )2(

    2

    1

    ) 1

    6 5

    6+

    (2

    2

    )(

    1

    6

    )2 = 111Comment. Especially the last solution to the problem makes evident that the problem can be naturallygeneralized and also a universal approach can be developed and adopted in similar situations. Obviously aprerequisite for this, is a deep understanding of Binomial Distribution. Consider for example the followingproblem 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 = 12 .Using the notation introduced in Solution 4, we compute the requested probability P as follows:

    P =P4(3)

    P4(2) + P4(3) + P4(4)=

    4

    11

    4. In this problem we have to be careful to take into account that the ball will travel once downwards andonce upwards in each bounce. Therefore the total distance traveled by the ball can be calculated as

    d = 10 + 2 (

    10 12

    + 10 (

    1

    2

    )2+ ...

    )= 2

    (10 + 10 1

    2+ 10

    (1

    2

    )2+ ...

    ) 10 =

    =20 limn

    ((12

    )n 112 1

    ) 10 = 20 2 10 = 30.

    Regarding the confidence question, I was told that there is no correct answer but the whole point is thatafter taking the decision to implement a trading idea, we first have to allocate some time debating on howconfident we are and consequently how much risk we are willing to take. I find it helpful to think that Ibet my own money on this, so even if I am sure about my answer I have to be quite reserved since I riskmy own money.

    3

  • Second Round. The second round phone interview took place on Tuesday, 23 February 2010. I wasasked 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 wholenumber.

    3. England will play five cricket games against Russia. The team which will win the majority of the gameswill be the winner of the series. You have 100 GBP and you want to spend them betting on Englandbeing 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 ifEngland is the winner of the series you will have won 100 GBP? Regarding the bets the rule is that if youwin then you double the amount of money you had bet, and if you lose then you just lose the amount ofmoney 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 productof the two numbers to be a perfect square there are two cases: (a) the two numbers are the same (whichcan be done in 6 different ways) (b) the numbers are 1 and 4 (which can be done in 2 different ways).

    Therefore the requested probability is8

    36=

    2

    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 thinkingabout possible combinations and probabilities while what you should do is Brute Force. Namely, after thefifth game our desired status is demonstrated in Table 1 below.

    Table 1: Desired Status after the fifth game

    Englands wins Russias wins Status5 0 +1004 1 +1003 2 +1002 3 1001 4 1000 5 100

    The information of the above table can be used in order to construct an equivalent table demonstratingthe desired status after the fourth game.

    Table 2: Desired Status after the fourth game

    Englands wins Russias wins Status Bet for the next game4 0 +100 03 1 +100 02 2 0 1001 3 100 00 4 100 0

    To understand how the above table is constructed, let us focus in the first row. In the case that Englandhas won four of the games, then there are two possible scenarios after the fifth game. England will havewon all of the five games, or will have won all but one game. By examining Table 1 we observe that inboth cases our desired status is +100. Therefore, if we call x the desired status at the first row of Table 2and y the bet we will place in the fifth game; then according to the above explanation we can formulatethe following equations:

    x+ y = +100 (1)

    4

  • x y = +100 (2)From (1) and (2) above, we conclude that x = 100 and consequently y = 0. Note that Table 2 differs fromTable 1 in that, it contains one more column with information on what our next bet should be. This isequal to the value of y as defined above, and can be calculated from two simultaneous equations as wejust 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 betweenEngland and Russia. Our results are presented in the following tables.

    Table 3: Desired Status after the third game

    Englands wins Russias wins Status Bet for the next game3 0 +100 02 1 +50 501 2 50 500 3 100 0

    Table 4: Desired Status after the second game

    Englands wins Russias wins Status Bet for the next game2 0 +75 251 1 0 500 2 75 25

    Table 5: Desired Status after the first game

    Englands wins Russias wins Status Bet for the next game1 0 37.5 37.50 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 firstgame. Therefore we can place 37.5 GBP on the first game, and then according to the results we can followthe strategy implied by the y values of the above tables and we are ensured to win 100 GBP if Englandis the winner of the series, or lose 100 GBP in the opposite case. The betting strategy can be visualizedusing a tree diagram.

    37.5ONMLHIJKRussia

    hhhhhhhh

    hhhhhhhh

    hEngland

    VVVVVVVV

    VVVVVVVV

    V

    37.5ONMLHIJKR

    nnnnnn

    nnnnnn E

    VVVVVVVV

    VVVVVVVV

    V37.5ONMLHIJK

    R

    hhhhhhhh

    hhhhhhhh

    hE

    PPPPPP

    PPPPPP

    25ONMLHIJKR

    E

    PPPPPP

    PPPPPP

    50ONMLHIJKR

    hhhhhhhh

    hhhhhhhh

    hE

    VVVVVVVV

    VVVVVVVV

    V25ONMLHIJK

    R

    nnnnnn

    nnnnnn E

    ;;;;

    ;;;

    0ONMLHIJKE,R ;;

    ;;;;

    ;50ONMLHIJK

    R

    nnnnnn

    nnnnnn E

    VVVVVVVV

    VVVVVVVV

    V50ONMLHIJK

    R

    hhhhhhhh

    hhhhhhhh

    hE

    PPPPPP

    PPPPPP

    0ONMLHIJKE,R

    0ONMLHIJKLoss

    100ONMLHIJKProfit

    UUUUUUUU

    UUUUUUUU

    UU0ONMLHIJK

    Profit

    nnnnnn

    nnnnnn

    n

    100 +100

    Figure 1. The betting strategy is demonstrated using a tree diagram structure. We start with 37.5 GBPbet for the first game, and then we follow the tree nodes according to the results.

    5

  • Appendix ABinomial Distribution

    Suppose that n identical and independent experiments are conducted, and result in two mutually exclusiveoutcomes (often called success and failure). Also, suppose that the probability of success is constant and equalto p (whereas the failure probability is q = 1 p). This scenario is called Binomial Distribution and has thefollowing properties:

    The probability of x successes in n trials is given by the formula Pn(x) =(n

    x

    )px(1 p)nx

    The probability of at most K successes in n trials is given byKx=0

    Pn(x)

    The probability of at least k success in n trials is given byn

    x=k

    Pn(x)

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

    P6(3) =5

    16

    Geometric Distribution

    A different view of a sequence of identical and independent dichotomous trials is embodied in the question howmany trials are required before the first success ?. If p is the probability of a success, then to achieve a firstsuccess at integer k, we must have observed k 1 failures. The probability of this event is

    P (X = k; p) = (1 p)k1pfor 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] = 1p The variance of a geometric distribution is 2 = 1pp2Consider the following two examples.

    1. (Jane Street Interview) (a) Two players A and B flip a coin sequentially. The game finishes when thesequence TTH is formed and player A wins or the sequence HTT is formed and player B wins. What isthe probability that the game will finish at the nth flip? (b) What is the probability that the game willhave 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 thecoin five times for example, and the outcomes are labeled 1,2,...,5. In order to check that one of the twodesired 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 tripleis one of the desired two, is 28 =

    14 Therefore the probability that the game will finish at the nth flip is

    P = ( 34 )n3 14 . (b) This is the probability that it will have not finished by the nth flip subtracted from

    1, that is P = 1 ( 34 )n2. (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?

    Solution. (a) P =(1 12

    )2 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 ageometric distribution, and hence the requested expected number of throws is the expected value of therandom variable X, that is E[X] = 1p = 2.

    6