Quantitative Interview questions and answers

well, I finally saw sudoku skills being useful in math :) Let's see how sudoku guy deals with the problem now :)

How is this for a proof:
Given A is an [n x n] symmetric matrix subject to "Each column and each row is a permutation of numbers from 1 to n" and n is ODD.
The main diagonal of A is a permutation of 1:n by induction.

Define V to be the top row of matrix A.
IF A(0,0)=V(0) is true, and for each integer 0 <= k <= n-1, A(k+1,k+1)=V( mod(2(k+1),n) is true whenever A(k,k)=V(mod(2k,n)) is true.
THEN for any size matrix A (as long as n is odd), the diagonal of A is a permutation of the vector V which itself is a permutation of 1:n.
 
How is this for a proof:
Given A is an [n x n] symmetric matrix subject to "Each column and each row is a permutation of numbers from 1 to n" and n is ODD.
The main diagonal of A is a permutation of 1:n by induction.

Define V to be the top row of matrix A.
IF A(0,0)=V(0) is true, and for each integer 0 <= k <= n-1, A(k+1,k+1)=V( mod(2(k+1),n) is true whenever A(k,k)=V(mod(2k,n)) is true.
THEN for any size matrix A (as long as n is odd), the diagonal of A is a permutation of the vector V which itself is a permutation of 1:n.

Well now it's certainly clear as day.

Here's the proof...easy and cute...

Every element of the set {1, ..., n} appears an odd number of times (namely, n) in the matrix. Every time it appears off the diagonal, it appears at its reflection across the diagonal as well, so the number of off-diagonal instances is even. This means it must appear at least once on the diagonal. But since this applies to every element in {1, ..., n}, it follows that each must appear exactly once on the diagonal.
 
2. (Barclays, ML) (W_t) is brownian motion. N is cdf of normal (N(0,1)). Calculate (E(N(W_t))).



5. (ML, LB, SG, Bear, DB) The today price of a certain stock is 20$. Here is an option: if the stock reaches 40$ then the payoff is 1$. Price this option.

2. .5


5. .5

2 can be proved by taking the differential. ( dN(W_t)=\frac{1}{2 \pi} e^ {\frac{-w^2}{2}} dW_t + \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} dt )
( N(W_t)=.5+Ito + \int_0 ^t \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} dt )
( \mathbb{E} [N(W_t)]= .5+ \int_0 ^t \mathbb{E}[\frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}}] dt )
( = .5+ \int_0 ^t \int_{-\infty} ^ {\infty} \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} e^{\frac{-w^2}{2}} dw dt )
(=.5 )


For 5, the price of the option is the solution to ( \mathbb{E} [e^{-r \tau}] ) where ( \tau ) is the first time the stock hits 40. This is simply the laplace transform of ( \tau ), which is ( e^{-(\sqrt{2r+a^2}-a)m} ) (if I assume B.M. with drift). However, since I assume the stock follows R.N. GBM with constant coefficients, I have to rewrite as follows:
( S_t = 20 e^{\sigma W_t +(r-\frac{1}{2}\sigma^2 )t} )
( \frac{S_t}{20} = e^{\sigma W_t +(r-\frac{1}{2}\sigma^2 )t} )
( log\large(\frac{S_t}{20}\right) = \sigma W_t +(r-\frac{1}{2}\sigma^2 )t )
( \frac{1}{\sigma}log\large(\frac{S_t}{20}\right) = W_t +(\frac{r}{\sigma}-\frac{1}{2}\sigma)t )

Therefore in the laplace transform equation ( m=\frac{log\frac{40}{20}}{\sigma} ), ( a=\frac{r}{\sigma} -\frac{1}{2} \sigma ). After completing the square this becomes

( e^{-(\frac{r}{\sigma} +\frac{1}{2} \sigma -\frac{r}{\sigma} +\frac{1}{2}\sigma) \frac{log(2)}{\sigma}} )

( =e^{-log(2)} =.5 )
 
2 can be proved by taking the differential. ( dN(W_t)=\frac{1}{2 \pi} e^ {\frac{-w^2}{2}} dW_t + \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} dt )
( N(W_t)=.5+Ito + \int_0 ^t \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} dt )
( \mathbb{E} [N(W_t)]= .5+ \int_0 ^t \mathbb{E}[\frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}}] dt )
( = .5+ \int_0 ^t \int_{-\infty} ^ {\infty} \frac{-2w}{2 \pi} e^ {\frac{-w^2}{2}} e^{\frac{-w^2}{2}} dw dt )
(=.5 )

An alternative solution:

For a Brownian motion, there is equal probability that Wt = a or Wt = -a. Taking the average,

(1/2(N(a)+N(-a))=1/2)
 
For # 7, it doesn't mean if you get x such that x is the largest integer for \(?2^x \leq n\) then you have the answer, right? Because it only took 2 times to find the heaviest ball among 8.
 
Generalized Semicircle Covering Points Problem



A nice generalization of this problem can be found here
If \(n\) points are drawn randomly on a circle, the probability of them being on the same semi-circle is \(\frac{n}{2^{n-1}}\)
Hi I have a different solution. There will be two chances for every point, either it is in the semi circle or it is not in the semi circle. So choose one point. Now the probability that the other 2 points exist in the same semi circle is (2*1*1/2*2*2)=1/4 . But we can chose a point in 3 ways. So the probability is 3/4 . generalizing it for n points it is n*2/2^n which is n/2^n-1.
 
No, the answer to this is \(x=\sqrt{2}\)
\(a=x^{x^{\ldots}}=2\)
\(ln(x^{x^{\ldots}}) = ln2\)
\(x^{x^{\ldots}}lnx = ln2\)
\(a lnx = ln2\)
\(2lnx = ln2\)
\(lnx = \frac{1}{2}ln2\)
\(lnx = ln\sqrt{2}\)
\(x = \sqrt{2}\)

a=x^x^.. =2 i.e x^a =2 => x^2=2 => x = sqrt(2).. No ln stuff.. I really dont know if sqrt(2) is the answer. If it is, it is a very silly problem
 
Nifty question. My gut was to say that the answer here is (\frac{1}{4}), since we're conditioning on the report of the roll, which gives us more information to work with. A closer look shows that this is a reasonable answer to the question, but not the only possible one....

This is actually a conditional probability:

(P(rolls 6 | reports 6) = \frac{P(rolls 6, reports 6)}{P(reports 6)})

Here's where the assumptions begin to come in. For one thing, we assume that the roll and the decision to lie are independent; under this assumption, the numerator is easy:

(P(rolls 6, reports 6) = P(rolls 6, tells the truth) = \frac{1}{6}*\frac{1}{4} = \frac{1}{24})

The denominator is trickier. This is where the biggest assumptions come in.

(P(reports 6) = P(rolls 6, tells the truth) + P(rolls non-6, lies, reports 6))

We've already computed the first term, but how do we compute the second? We have to know something about how the person lies.

Are the person's lies always plausible? (That is, would the person lie by saying a 3.4 had been rolled, or a 529?) Given that they're always plausible, are they "fair?" (That is, is the person's lying strategy to choose a plausible lie at random with an equal probability of each lie, or is there some other distribution to the lies? Is the lie even random, aside from the initial throw of the die?)

For the sake of convenience, let's assume that, when the person lies, he or she does so by reporting some other plausible result at random, with equal probability of each lie. Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*\frac{1}{5}=\frac{1}{24}+\frac{1}{8}=\frac{1}{6})

Overall, then:
(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{1}{6}} = \frac{1}{4}), as expected.

For the sake of illustration, though, let's work the problem under a different lying strategy: suppose the person always says "6" when lying about a non-6. (We don't really care what he does when lying about a 6.) Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*1 = \frac{1}{24} + \frac{5}{8} = \frac{2}{3})

Under this alternative assumption:

(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{2}{3}} = \frac{1}{16})

As you can see, how you assume the person lies can have a rather dramatic impact on the answer....
Hi few doubts..
1) the probability of truth telling is 3/4 not 1/4..
2) taking it as 1/4 and solving the problem... the answer seems to be independent of the dice.. the answer seems to be like forget the dice thing and just say how many times he tells the truth? Just wondering is it a coincidence or is it always this way ?
 
No, the answer to this is (x=\sqrt{2})

(a=x^{x^{\ldots}}=2)

(ln(x^{x^{\ldots}}) = ln2)

(x^{x^{\ldots}}lnx = ln2)

(a lnx = ln2)

(2lnx = ln2)

(lnx = \frac{1}{2}ln2)

(lnx = ln\sqrt{2})

(x = \sqrt{2})

We can simply say, ( x^{x^{\ldots}}=2 => x^2 = 2)
(hence, x = \sqrt{2})
 
Correct. Since the sides are from a unit length, we can calculate that any side of the triangle must be strictly less than 1/2. The prob that the length of each stick being less than 1/2 is 50% and this condition must hold for all three of them. Hence I have 1/8

I have objection. If we take length of all sides as 0.4, this satisfies above condition that sides are less than 0.5, but this makes total length of triangle as 1.2 > 1, which is not right. Suggestions ?
 
Solution to question 6:
Let x be the expression. Then sqrt(2+x)=x, square on both sides and solve the resulting quadratic equation. The solution x=-1 must be rejected.
 
to Yan He:
Prob(rolling 6 | 6 was rolled and reported the truth) + Prob(rolling 6 | 6 wasn't was rolled and lied) = (1/6) x (1/4) + (5/6) x (3/4)=2/3

 
Questions
Let C(K) denote a European vanilla Call option with strike price . Assume that all options are identical except for strike price, and strike prices satisfy K1< K2<K3and 2K2 = K1+K3.

Question 1
What are the no-arbitrage lower bound, and the no-arbitrage upper bound, of the vertical spread

C(K1) −C(K2)?

Question 2

Derive the functional relationship between the no-arbitrage values of the two vertical spreads,
C(K1) - C(K2) and C(K2) - C(K3).
 
Correct. Since the sides are from a unit length, we can calculate that any side of the triangle must be strictly less than 1/2. The prob that the length of each stick being less than 1/2 is 50% and this condition must hold for all three of them. Hence I have 1/8


Not totally convinced they are related or merely coincidence but I thought of the semi-circle as follow:
Any two points on a circle will be on the same semi-circle (just connect one point to the center, the second point must be on one of the two semi-circles. Pick the one that contains two points). The problem now becomes finding the probability that the third point is on that same semi-circle. There are only 2 semi-circles to begin with so the chance is 50%

Welcome any opinions since with 1,2 minutes to come up with an answer, there are pretty good chance that I may have big holes in my reasonings. I hope to learn from my mistakes and not to repeat them again in future occasions.

I think the answer is 3/4
 
Actually, the answer here is (\frac{1}{4}). It's easy to only consider half the possibilities when you work this one.

As Andy has said, this basically amounts to asking the question: Pick two points on the interval (0,1); what's the probability that none of the three resulting intervals is longer than \(\frac{1}{2}\)?

Consider first the circumstance where the first point--(x_1)--is on the interval \((0,\frac{1}{2})\). Where can we place the second point in order to make the desired result happen?

It's fairly clear that the interval \((\frac{1}{2}, x_1 + \frac{1}{2})\) is the answer to that question. This interval has length (x_1). Thus, the probability of success, given \(x_1 < \frac{1}{2}\), is \(x_1\), since our second cut is uniformly distributed on (0,1).

The probability of success overall, then, is the integral of this probability over all choices of \(x_1 < \frac{1}{2}\):
\(\int_0^{\frac{1}{2}}x_1dx_1 = \frac{1}{2}(\frac{1}{4}-0) = \frac{1}{8}\)

But remember that we started the problem under the constraint \(x_1 < \frac{1}{2}\). Clearly, the problem is symmetric, so the probability of success with \(x_1 > \frac{1}{2}\) is the same again--\(\frac{1}{8}\).

Altogether, then, the probability of success is \(\frac{1}{4}\).

Yes, I think you are right. And the answer for the 3 points on a semicircle question is 3/4.
 
Questions
Let C(K) denote a European vanilla Call option with strike price . Assume that all options are identical except for strike price, and strike prices satisfy K1< K2<K3and 2K2 = K1+K3.

Question 1
What are the no-arbitrage lower bound, and the no-arbitrage upper bound, of the vertical spread
C(K1) −C(K2)?

Question 2

Derive the functional relationship between the no-arbitrage values of the two vertical spreads,
C(K1) - C(K2) and C(K2) - C(K3).

Hi,

You can prove that B(t,T) =< [C(K1)−C(K2)] / (K1-K2) =< 0 using arbitrage argument, with B(t,T) the price of the Zero Coupon bond with the maturity T.

For the second one, the call price is a convex function of the strike, So use the fact that the cords are oriented up in this order:
[(K1,C1) ; (K2,C2)] =< [(K2,C2), (K3,C3)] =< [(K1,C1);(K3,C3)].

So the slops and you deduce the no-arbitrage condition :)
 
1. Find \(x\) if \(x^{x^{x^{\ldots}}}=2\)
Answer: \(x=\sqrt{2}\)

2. Find all real and complex root of \(x^6=64\)
Answer
: \(x_1,\ldots,x_6 =\{\pm 2,\pm 1 \pm \sqrt{3} \}\)

3. The hour and minute hands of a clock meet at 12'oclock. When will be the first time they meet again ?
Answer
: After 1 hour, 5 minutes 27.2727 seconds

4. 3 points are randomly drawn on a circle. What is the probability of them being on the same semi-circle ?
Answer
: 1/2 or 50%

5. A unit length is broken off into 3 pieces. What is the probability of them forming a triangle ?
Answer
: 1/8 or 12.5%

6. Calculate \(\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\ldots}}}} \)
Answer: 2

7. There are 14 identical-looking balls. 13 of them have the same weight while one of them is heavier than the rest. What is the minimum times you can weight to identify the heaviest ball ? How do you generalize for n balls ?
Answer
: With 3 weights, I can identify the heaviest ball. For n balls, I can identify the heaviest ball after x times where x is the largest integer such that \(2^x \leq n\)

Hi Andy, I think the answer for Q7 should be t=argmin(x) 3^x >= n.
 
I'm pretty sure the correct answer to this one should be (\frac{3}{4}).

EDIT:
...but it isn't.
I'm still not sure why, but a quick MC simulation has convinced me that I'm missing something here. I'll take a look at it again when my brain's working a little better.

something like (\frac{2 \times 3}{2^3})?
 
Top