• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Quantitative Interview questions and answers

Hi satyag,

The issue is which urn you choose for the first stage. Isn't it obvious that the probability of drawing a white ball from urn A in the first stage is less than one-half? First address the question just asked.
It appears obvious but it is not.
Probability of drawing a white ball from U is less than half and it is not same as the probability of picking a white ball from A. Picking a ball from A follows picking 2 balls from U. These are two separate but dependent events. So you have to first establish the potential distribution of balls in A.

Just as the probability for urn A to have at least one white ball is .684 (or ..685), the probability of urn A to have at least on black ball is .808, much greater than .684. Does this fact matter?
I am not arguing about the probability of ATLEAST 1 black ball being more than probability of atleast 1 white ball. But these two scenarios are NOT mutually exclusive combinations. The cases with one black and one white are being counted in computing the probability of both scenarios. Also, this is not relevant to the question as the question asked for a white ball.

WHAT ABOUT THIS? ----> The fact that two balls were taken from urn U and placed in urn A does not affect the probability of drawing a white ball from urn A. The probability of drawing a white ball from urn A is precisely the same as the probability of drawing a white ball from urn U. Think about it: When you randomly select two balls from urn U and place them in urn A, urn A only acts as a temporary holding place. Now that you randomly choose a ball from urn A you really shouldn't care that this ball comes from urn A, it really comes from urn U. Don't you agree?
Once again picking one ball directly from U is very different from picking 2 balls from U and then picking one out of the 2. If you think they are same, think again or read some basic probability.

Let me simplify the problem for you a little bit. Imagine "U" being evenly distributed. Do you still think picking a white ball from A is 1/2? That is a definite NO! Why? Because A can have more than 1 white ball. The probability of having exactly one white ball in A is 1/2 in which case A and B are similar. But A can also endup having 2 white balls but B cannot.

=============
Let us reword this situation as a separate problem and as follows.
A has 25% probability that both are black, 50% probability that 1 is black and 1 is white, 25% probability that both are white
B has 1 white and 1 black

Now
1. Tell me which one you are going to pick if you are looking for a white ball
2. Tell me which one you are going to pick if you are looking for a black ball

The answer is A in both cases. This is exactly why I kept emphasizing this part. If you are still not convinced, just try to solve this reworded problem first before attempting the original problem.
============

That is why the issue of FIRST STAGE - which I keep on emphasizing upon - is important. The probability of drawing a white ball from urn A in the first stage is 1000/2280=.439, less than one-half.

Thank you for your responses. Feel free to contribute. I do appreciate your interest.
You are very welcome.
 
Re: Strategy

Hi satyag,

I admire your stamina. Nonetheless, I can demonstrate that either you have a radically different understanding of the problem or your thinking is incorrect.

Here's a probability distribution for the contents of urn A before the first stage is exercised:

Cases:

ww ----> Both balls white: (1000 / 2280) * (999 / 2279) = 19.23%
bb ----> Both balls black: (1280 / 2280) * (1279 / 2279) = 31.51%
bw.wb ----> Mixed black and white: 1.00 - .1923 - .3151 = 49.26%

Let a denote the probability of getting a white ball from urn A when a ball is drawn from urn A for the fist time. Let E denote the event that the ball drawn is white.

a = P{E given ww} * P{ww} + P{E given bb} * P{bb} + P{E given bw.wb} * P{bw.wb}

= (1 * .1923) + (0 * .3151) + (.5 * .4926) = .4386 = 43.86%

So, a is exactly what you'd get if you randomly chose a ball from urn U, in the first place. Convinced?

I will show my answer after you agree yours - that is, your approach - is incorrect.
 
Quantyst, I realized my conclusion was premature. I should have calculated the probabilities like you did here instead of prematurely concluding that A has a case that B does not have so A is better. Thanks for correcting me.

Now coming to the winning strategy, does the the player know which of the two urns is A ?
 
Re: Strategy

Hi satyag,

You are a true gentleman (or gentlewoman). You have shown to possess the stuff for greater success! Thank you for accepting my correction.

You asked:

" Now coming to the winning strategy, does the the player know which of the two urns is A ?"

Answer: Yes, of course. How else is the player to carry out a strategy that involves choices between urns?

I am not going to provide the full answer to the strategy problem here. I'll do that later.

I'd like, however, to go back to a statement I made earlier and ask you again if you agree with my reasoning:

"The probability of drawing a white ball from urn A is precisely the same as the probability of drawing a white ball from urn U. Think about it: When you randomly select two balls from urn U and place them in urn A, urn A only acts as a temporary holding place. Now that you randomly choose a ball from urn A you really shouldn't care that this ball comes from urn A, it really comes from urn U."

Now, I, as well as you, can demonstrate this result quite generally by letting w and b denote, respectively, the number of white balls and the number of black balls in urn U, with w>0, b>0. Then we randomly transfer two balls from urn U into urn A. Now, a ball drawn randomly from urn A has a probability of w/(w+b) of being white. In fact, we can generalize this insight (an overstatement, really) and can even prove it by taking k balls from urn U and placing them inside urn A. Then a ball drawn randomly from urn A has a probability of w/(w+b) of being white, regardless of the size of k, with k>0.

But the important thing here is to see this without any math. Informed (trained) intuition is an important part of mathematical growth. Cheers.
 
Restricted Taxicab Paths

Consider an nxn regular square chessboard (consisting of n^2 unit squares). You are to move from the lower-left endpoint to the upper-right endpoint of the board. Every step taken is defined to be a move along the side of a unit square and it must be either a rightward or upward move. An additional constraint is that at every stage of this process the number of rightward steps taken must be less than or equal to the number of upward steps taken. In how many ways can this be accomplished?

Here's another way to state the problem: Consider the set P of all paths where each path has the following properties:

1. The path joins the lower-left endpoint of the nxn chessboard to the upper-right point of the chessboard.

2. The path is entirely composed of the sides of the unit squares of the chessboard.

3. The path is the graph of an non-decreasing 'function'. (Imagine the chessboard is entirely positioned in the first quadrant of the xy-coordinate plane such that its lower-left endpoint coincides with the origin and its sides coincide with the axes).

4. Given any point of the path that is also a vertex of a unit square of the chessboard, the number of horizontal unit square sides of the path to the left of the point is less than or equal to the number of vertical unit square sides of the path below the point.

Find the size of the set P.

Variants of this problem occur in relation to certain stochastic processes along a straight line; i.e., certain random walks on a line.
 
A DUO ON A SQUARE

Prob 1.

Two points are randomly selected on the sides of a unit square. Find the probability that the distance between them is less than unity.



Prob 2.

Let d be a number between 1 and rad 2. Two points are randomly selected on the sides of a unit square. Find the probability that the distance between them is less than d.
 
It's got past me :(
sin 360 = sin 0 =0

However arcsin is not a one to one mapping, so arcsin (sin (360)) is countably infinite set.

But that does not satisfy me much, so what's the trick ?
 
arcsin(x) does not define a function unless restricted to a range of length < pi (usually -pi/2 < x < pi/2). Since sin(360) = 0 and since 0 is in the range of definition, arcsin(0) = 0. QED.
 
For problem 1, if you mean "sides," and not interior, you should be able to figure it out yourself (seems straightforward).
 
if 360 is not given in degrees, but in radians, the question is a little trickier, and the answer different.

If (x = 360 - \left[ \frac{360}{2\pi} \right] 2\pi), then

( arcsin[sin(360)] = \left{ \begin{array}{ccl} x, & if & x \leq \frac{\pi}{2} \\ \pi - x, & if & \frac{\pi}{2} < x \leq \frac{3\pi}{2} \\ x - 2\pi, & if & \frac{3\pi}{2} < x < 2 \pi \end{array} \right.)

See the post below by quantyst for the rest of the solution.http://www.quantnet.com/forum/member.php?u=1954
 
A probability quiz

Andy moderates an online forum and has an exponentially increasing number of friends.
Andy's wife just gave birth and he intends to send out invites to the child dedication, in addressed envelopes, to his numerous friends. What is the probability that each card would be in the wrong envelope.
 
Re: Not So Obvious!

dstefan is thinking the right way.

The task is to find Q = arcsin[sin(360)].

The title of the post is a hint. So, of course 360, as the argument of the sin, is to be understood as a real number, i.e., it is in radians.

By arcsin I mean the "sine inverse" function, which many textbooks still use. The domain of arcsin is [-1 ,1] and its range is [-pi/2, pi/2]..

Starting at point (1,0), let a self-overlapping arc of length 360 wrap counter-clockwise around the unit circle as many full circles as it can. How many? Well, [360/2pi] = 57, where [.] denotes the greatest integer function. (See dstefan).

After [360/2pi]*2pi is used up, how much of the original 360 is left over?

Ans. r = 360 - [360/2pi]*2pi =360 - 57*2pi = 360 - 114 pi..

Now if r is in quadrant QI, i.e. in the interval [-pi/2 , pi/2], then the answer to the question is r itself, as shown by dstefan. If r is in quadrant QII, then the answer is (pi - r), as shown by dstefan. So, if r is in any quadrant other than QI, you need to do a little bit of adjusting. It turns out that that r is in QII.

So, the answer to the question is Q = pi - r = 115 pi - 360. You can 'confirm' this by your calculator.
 
The probability that at least one card would be in the right envelop
(\frac{e-1}{e}) as N (number of Andy's friends) approaches infinity :D seriously!.
That is by problem 1.27 in Heard on the Street.
 
This would defeat the requirement to drink at the same time no?

It may be teh fastest, but thats not what is asked in the question...

The answer is 10.

Label the bottles 0,1,2,...999

Line the 10 people up in a row. They are going to act like digits of a binary number. Pour a bit of bottle X in the glass of each of the people for whom the binary representation of X sets their digit to 1. Repeat for all X.


In other words, pour wine from bottle 0 into nobody's glass. Pour wine from bottle 1 into the first person's glass only (counting from the right). Pour wine from bottle 746 into the glasses of the tenth, eighth, seventh, sixth, fourth and second people's glasses (because the binary rep. of 746 is 1011101010). Write down the binary number given by the people who die after drinking. This is the number of the poisoned bottle.

In other words, the guy at the left end has wine from bottles 512 to 999 in his glass. The guy immediately to his right has wine from bottles 256 to 511 and 768 to 999 in his glass, etc.
 
A few interview questions I had

1. It's currently 5:15 - at what time (to a few decimal places of a minute) will the the minute hand meet the hour hand?

2. You have a regular six-sided die, and you play the following game: Roll the die and you get $1 per number that comes up (ie roll a 1 get $1, roll a 6 get $6). If you are happy with your outcome after one roll, you can stop. If you would like to roll again you may do so up to two more times (so a max of 3 rolls). You will get whatever dollar amount you rolled last, so if you rolled 1-1-6, you would get $6. You can quit at any time, and have a max of 3 rolls. What is your strategy, and using that, what is the expected value for the game?

3. 50 coins in hand problem seen earlier, add up to $1, drop one, what is probability it was a penny

4. You have 5 quarters on the table in front of you: four fair (regular two-sided coins) and one double-sided (both sides are heads). You pick one of them up at random, flip it five times, and get heads each time. Given this information, what is the probability that you picked up the double-sided quarter?
 
Hi laguy,

You wrote:

1. It's currently 5:15 - at what time (to a few decimal places of a minute) will the the minute hand meet the hour hand?

Let HH denote the position of the hour-hand between 5 and 6 o'clock. So, HH=5+x, where 0<x<1.

Let MH denote the position of the minute-hand. Then MH=12x. So, the condition of minute-hand meeting hour-hand is the same as MH=HH; i.e., 5+x=12x.

There is another way of doing this without using an equation, but instead a series.

You wrote:

2. You have a regular six-sided die, and you play the following game: Roll the die and you get $1 per number that comes up (ie roll a 1 get $1, roll a 6 get $6). If you are happy with your outcome after one roll, you can stop. If you would like to roll again you may do so up to two more times (so a max of 3 rolls). You will get whatever dollar amount you rolled last, so if you rolled 1-1-6, you would get $6. You can quit at any time, and have a max of 3 rolls. What is your strategy, and using that, what is the expected value for the game?

Nice problem. There are couple of ways I am aware of for doing this problem. Here's one:

First do the problem when the player has a max of only two rolls. Let's say if a number b or less comes up, then the player rolls again (for the second and last time). Otherwise the player sticks with b. Obviously b must be less than or equal to the expected winning on the second roll, which is 7/2. So, for b <=3, the player must roll again, otherwise must keep his winning.

Now going to the case of a max of three rolls. Let's say the first roll comes up a. If a is less than the expected amount that can be won by rolling again, then the player must roll again. Otherwise, the player must stick with a. But what is the expected amount that can be won if rolled again. By the previous paragraph, either the second roll (with a probability of 1/2) is less than or equal to three, in which case a third roll with an expected amount of 7/2 is in order, or the second roll (with a probability of 1/2) is greater than or equal to 4, in which case the expected amount is (4+5+6)/3.

So, the expected amount won by rolling again after the firs roll is

(1/2)(7/2)+(1/2)(4+5+6)/3=17/4=4.25

So, if a is less than or equal to 4.25; i.e., 1,2,3, or 4, then the player must roll again for a second time. If the first roll comes up a 5 or 6, then the player should stick with it.

After this it is easy to compute the expected amount of winning.

Another way to do this problem is to write a random variable strategy S in terms of three iid random variables X, Y Z, representing the three possible rolls, followed by computing expectation, and concluding with a little (calculus) partial differentiating for maximization, etc.

You wrote:

3. 50 coins in hand problem seen earlier, add up to $1, drop one, what is probability it was a penny

This is a partition problem, a good one, though. Will leave it at that.

You wrote:

4. You have 5 quarters on the table in front of you: four fair (regular two-sided coins) and one double-sided (both sides are heads). You pick one of them up at random, flip it five times, and get heads each time. Given this information, what is the probability that you picked up the double-sided quarter?

There are two different random variables or processes involved, one is the selection of the coin, the second the tossing of that coin. So, if we let c denote the random coin selection, and T(c,i) denote the i-th tossing of the coin c, BC biased double-sided coin, FC fair coin, then the question can be stated as follows:

x=P{c=BC | T(c,i)=H for i=1, 2, ..., 5} = ?

x=P{c=BC, T(c,i)=H for i=1, 2, ..., 5}/P{T(c,i)=H for i=1, 2, ..., 5}

=P{T(c,i)=H for i=1, 2, ..., 5 | c=BC}*P{c=BC}/P{T(c,i)=H for i=1, 2, ..., 5}


where the denominator is

P{T(c,i)=H for i=1, 2, ..., 5}=P{T(c,i)=H for i=1, 2, ..., 5 | c=BC}*P{c=BC} +

P{T(c,i)=H for i=1, 2, ..., 5 | c=FC}*P{c=FC}.

The rest involves plugging in the numbers.

There is another less mathematical way of doing this problem.

Let's differentiate one 'kind' of head from another. There are two ways that a head can come up, either from a fair coin or from a biased coin.

Let's say with a probability of p a fair coin was chosen, and with a probability of q=1-p, a biased coin was chosen. (A tree diagram will help a lot here!)

If a fair coin was chosen, then, let's say with a probability of r we get n many heads in a row (here n=5 and r=1/(2^n) ). So, flipping a randomly chosen coin will result in heads due to fair coin with a probability of p*r.

If a biased coin was chosen, then with a probability of s we get n heads in a row (here s=1). So, flipping a randomly chosen coin will result in heads due to biased coin with a probability of q*s.

Between the two 'kinds' of heads, we'd want to know with what probability they come from the biased coins:

FC=p*r

BC=q*s

So, the answer is x=q*s/(q*s + p*r). Nice. Isn't it? Cheers!











 
3. 50 coins in hand problem seen earlier, add up to $1, drop one, what is probability it was a penny

The answer I got for this problem (assuming I interpret it correctly) is .8. 40 pennies, 8 nickels, 2 dimes. 40/50=.8, unless there is another way of making one dollar with 50 coins.

Edit: This is also under the assumption that you are equally likely to drop any one of the coins as pennies are smaller than nickels but larger than dimes.
 
Back
Top