CT10
What is P(# of H out of 4 tosses >= # of H out of 5 tosses)?
CT10 - Answer:
1/2 (symmetry consideration)
CT11
Flip n unbiased coins. What is P(# of H = n/2)?
CT11 - Answer:
nC_(n/2)/2^n
CT12
Toss 4 coins and win the number of H. There is an option to re-toss. What is the value of the game?
CT12 - Answer:
([1 4 6 4 1] * [2 2 2 3 4]') / 16 = $2.375 (dynamic programming/backward induction)
CT13
What is the expected product of (# of H) * (# of T) when tossing 10 fair coins? (Hint: the answer is not 25)
CT13 - Answer:
22.5 (E[(# of H) * (10 - # of H)])
CT14
Keep flipping a fair coin. What is the probability that the sequence HHT appears before THH does?
CT14 - Answer:
1/4 (Once you have T, THH would always precede HHT; likewise, once you have HH, HHT would always precede THH)
CT15
Toss 4 coins and win the number of H. There is an option to re-toss one coin. What is the value of the game?
CT15 - Answer:
2 + 0.5 * 15/16 = $2.469 (dynamic programming/backward induction)
See here for more interview questions/brainteasers
Tuesday, January 8, 2013
Wednesday, November 28, 2012
Introduction to a Weird Game
So here is a game that recently came to mind. The two-player case is almost trivial, but let's begin with it anyway.
There are players A and B. The game is turn based, at the beginning of each turn they bet on the result of the turn: A wins or B wins (so a person is allowed to bet on herself), where win is defined as scoring more points than the other person. The scoring rules are:
1. An "A wins" bet gives one point to A; the same goes for B.
2. Betting on the right winner gives a point (i.e. if B bets that A wins and A does win, then B scores a point)
At the end of the turn, calculate the points. A "draw" is called if either logical contradiction is resulted, or the two players tie in score. When there is a draw, a new turn is played. As soon as there is a loser, the game ends. There are four scenarios:
1. A bets A wins; B bets B wins
2. A bets B wins; B bets A wins
3. Both bets are A wins
4. Both bets are B wins
Let's investigate the outcomes.
For scenario 1, each player gains one point, so it's a draw.
For scenario 2 also, each player gains one point, so it's a draw.
For scenario 3, A scores 3 points versus B scores 1 point, A wins.
For scenario 4, A scores 1 point versus B scores 3 points, B wins.
So assuming everyone wants to be the winner, the best strategy is to bet on oneself. Now we introduce a new rule to make the game more fun: one can bet against a certain player, i.e. bet that she loses:
1. An "A loses" bet deducts one point from A; the same goes for B.
2. Betting on the right loser gives a point (i.e. if B bets that A loses and A does lose, then B scores a point)
It seems that for a 2-player game, the new rules do not change the nature of the game much. Thus the best strategy is to bet on oneself (or, equivalently, to bet that the other person loses). What if there are three players? Would it still be the case that the best course of action is to always bet on oneself?
There are players A and B. The game is turn based, at the beginning of each turn they bet on the result of the turn: A wins or B wins (so a person is allowed to bet on herself), where win is defined as scoring more points than the other person. The scoring rules are:
1. An "A wins" bet gives one point to A; the same goes for B.
2. Betting on the right winner gives a point (i.e. if B bets that A wins and A does win, then B scores a point)
At the end of the turn, calculate the points. A "draw" is called if either logical contradiction is resulted, or the two players tie in score. When there is a draw, a new turn is played. As soon as there is a loser, the game ends. There are four scenarios:
1. A bets A wins; B bets B wins
2. A bets B wins; B bets A wins
3. Both bets are A wins
4. Both bets are B wins
Let's investigate the outcomes.
For scenario 1, each player gains one point, so it's a draw.
For scenario 2 also, each player gains one point, so it's a draw.
For scenario 3, A scores 3 points versus B scores 1 point, A wins.
For scenario 4, A scores 1 point versus B scores 3 points, B wins.
So assuming everyone wants to be the winner, the best strategy is to bet on oneself. Now we introduce a new rule to make the game more fun: one can bet against a certain player, i.e. bet that she loses:
1. An "A loses" bet deducts one point from A; the same goes for B.
2. Betting on the right loser gives a point (i.e. if B bets that A loses and A does lose, then B scores a point)
It seems that for a 2-player game, the new rules do not change the nature of the game much. Thus the best strategy is to bet on oneself (or, equivalently, to bet that the other person loses). What if there are three players? Would it still be the case that the best course of action is to always bet on oneself?
Tuesday, November 27, 2012
Those damn coins... (Part III)
This is the final episode of coin flipping problems (previous discussions can be found here and here). Last time we ended the discussion with the expected number of toss such that the sequence HH (or other combinations like HT or THH) appears for the first time. Now we consider playing games involving H and T combinations. The first type of game concerns the probability of combination A appearing before B does while flipping an unbiased coin.
CT08
Keep flipping a fair coin. What is the probability that the sequence HTT appears before HHT does?
CT08 - Answer:
This can be solved by setting up the problem as a Markov chain and calculating the absorption probabilities. Alternatively, letting A = HTT appears before HHT, we can consider the conditional probabilities conditioning on the first 3 flips:
P(A)
= P(A|HHH) + P(A|HHT) + P(A|HTH) + P(A|HTT) + P(A|THH) + P(A|THT) + P(A|TTH) + P(A|TTT)
Now it's time to simplify terms:
P(A|HHH) = 0
P(A|HHT) = 0
P(A|HTH) = P(A|H)
P(A|HTT) = 1
P(A|H) = P(A|T) = P(A)
So
P(A) = 1/8 * 0 + 1/8 * 0 + 1/8 * P(A) + 1/8 * 1 + 1/2 * P(A)
=> P(A)= 1/3
The second type of game is a little different from the previous case:
CT09
Two players take turn tossing a fair coin. When the sequence HT shows up for the first time, the person who flipped the T wins. What are the probabilities of winning for each player?
CT09 - Answer:
Once again conditional probability saves the day. Let A = First player wins,
P(A) = 0.5 * P(A|H) + 0.5 * P(A|T)
But P(A|T) = P(B) = 1 - P(A) (because "the second player becomes the first" if the first toss give a T)
Also, P(A|H) = 0.5 * P(A|HT) + 0.5 * P(A|HH) = 0.5 * 0 + 0.5 * (1 - P(A|H))
=> P(A|H) = 1/3
So
P(A) = 0.5 * 1/3 + 0.5 * (1 - P(A))
P(A) = 4/9
See here for more interview questions/brainteasers
CT08
Keep flipping a fair coin. What is the probability that the sequence HTT appears before HHT does?
CT08 - Answer:
This can be solved by setting up the problem as a Markov chain and calculating the absorption probabilities. Alternatively, letting A = HTT appears before HHT, we can consider the conditional probabilities conditioning on the first 3 flips:
P(A)
= P(A|HHH) + P(A|HHT) + P(A|HTH) + P(A|HTT) + P(A|THH) + P(A|THT) + P(A|TTH) + P(A|TTT)
Now it's time to simplify terms:
P(A|HHH) = 0
P(A|HHT) = 0
P(A|HTH) = P(A|H)
P(A|HTT) = 1
P(A|H) = P(A|T) = P(A)
So
P(A) = 1/8 * 0 + 1/8 * 0 + 1/8 * P(A) + 1/8 * 1 + 1/2 * P(A)
=> P(A)= 1/3
The second type of game is a little different from the previous case:
CT09
Two players take turn tossing a fair coin. When the sequence HT shows up for the first time, the person who flipped the T wins. What are the probabilities of winning for each player?
CT09 - Answer:
Once again conditional probability saves the day. Let A = First player wins,
P(A) = 0.5 * P(A|H) + 0.5 * P(A|T)
But P(A|T) = P(B) = 1 - P(A) (because "the second player becomes the first" if the first toss give a T)
Also, P(A|H) = 0.5 * P(A|HT) + 0.5 * P(A|HH) = 0.5 * 0 + 0.5 * (1 - P(A|H))
=> P(A|H) = 1/3
So
P(A) = 0.5 * 1/3 + 0.5 * (1 - P(A))
P(A) = 4/9
See here for more interview questions/brainteasers
Tuesday, November 6, 2012
Those damn coins... (Part II)
Last time we saw a number of coin-tossing related interview questions. In this post we look at two types of more advanced coin-related problems:
1) (possibly) unfair coins with odds drawn from a continuous distribution, and
2) games involving trying to obtain a specific sequence of Heads and Tails
1) Coins with odds drawn from a continuous distribution
If we cannot be sure about the odds of the coin, there would be another extra degree of randomness.
CT05
Suppose you have an unfair coin with P(Tail) = p, p is an unknown constant. What is the probability distribution of N, where N is the event: 'The first Head shows up at the N-th toss', and what is the expectation value of N?
CT05 - Answer:
The probability distribution is simply the Geometric Distribution p^(N-1) (1-p).
The expectation value of N is E[N] = 1/(1-p), which can be found by
E[N] = Sum_(i=1)^(inf) i*p^(i-1) (1-p)
Noting that
i*p^(i-1) = (d/dp)p^i
Using this and exchanging the order of summation and differentiation, we get
E[N] = 1/(1-p)
Meanwhile, if the odds of Head itself is drawn from a known distribution, then we can compute the desired expected values with integrals:
CT06
Suppose you have an unfair coin, with probability of a head p ~ uniform(0,1). What is the probability of getting 2 (or n) heads with 2 (or n) tosses?
CT06 - Answer:
If the coin is fair, then P(2 Heads) = 1/4. But now we would have to integrate
\int_0^1 p^n U(0,1) dp = 1/(n+1)
So for 2 tosses P(2 Heads) = 1/3.
Note that while for a fair coin with n tosses, the probabilites of obtaining {1,2,3,...,n} Heads are binomial coefficients, in this case the probabilites of obtaining {1,2,3,...,n} Heads are identical.
2) Games involving trying to obtain a specific sequence of Heads and Tails
This is yet another popular genre of interview questions, possibly because the questions can be varied easily (for example, by modifying the desired sequence of H and T). There are two sub-types: i) what is the probability that sequence A would show up before sequence B does? and ii) what is the probability that sequence A would be obtained during the first/second player's turn? (assuming that the two take turns) The two sub-types are to be solved in different ways. Let's start with the expected number of toss for obtaining a particular sequence.
CT07
Keep flipping a fair coin. What is the expected number of toss such that the sequence HH appears for the first time? What about HT and HHH?
CT07 - Answer:
One can take the most general coute and solve this as a Markov chain problem. For short sequences, especially for repeating sequences (i.e. HH, TT, HHH, etc.), writing down a recursive formula should be faster. Let N(A) be the expected number of toss to obtain the sequence A. Then
N(T) = N(H) = 2
N(HH) = N(H) + 0.5 * 1 + 0.5 * (1 + N(HH)) => N(HH) = 6
The recursive formula can be understood as the two possible outcomes upon obtaining the first H: either another H immediately, in which case the sequence HH is complete, or a T, in which case one has to start over from scratch, hence the N(HH) on the right hand side. It is not hard to prove by induction that, for B = k consecutive H,
N(B) = 2^(k+1) - 2
is a close-form solution. For general sequences, the recursive formula approach still works, though you would have to know the expected number of tosses for the sub-swquences. For instance:
N(HT) = N(H) + 0.5 * 1 + 0.5 * (1 + N(T))
N(HTH) = N(HT) + 0.5 * 1 + 0.5 * (1 + 0.5 * N(HTH))
N(HHT) = N(HH) + 0.5 * 1 + 0.5 * (1 + N(T))
What if we want to know the probability that sequence A would show up before sequence B does? We'll discuss that next time.
See here for more interview questions/brainteasers
1) (possibly) unfair coins with odds drawn from a continuous distribution, and
2) games involving trying to obtain a specific sequence of Heads and Tails
1) Coins with odds drawn from a continuous distribution
If we cannot be sure about the odds of the coin, there would be another extra degree of randomness.
CT05
Suppose you have an unfair coin with P(Tail) = p, p is an unknown constant. What is the probability distribution of N, where N is the event: 'The first Head shows up at the N-th toss', and what is the expectation value of N?
CT05 - Answer:
The probability distribution is simply the Geometric Distribution p^(N-1) (1-p).
The expectation value of N is E[N] = 1/(1-p), which can be found by
E[N] = Sum_(i=1)^(inf) i*p^(i-1) (1-p)
Noting that
i*p^(i-1) = (d/dp)p^i
Using this and exchanging the order of summation and differentiation, we get
E[N] = 1/(1-p)
Meanwhile, if the odds of Head itself is drawn from a known distribution, then we can compute the desired expected values with integrals:
CT06
Suppose you have an unfair coin, with probability of a head p ~ uniform(0,1). What is the probability of getting 2 (or n) heads with 2 (or n) tosses?
CT06 - Answer:
If the coin is fair, then P(2 Heads) = 1/4. But now we would have to integrate
\int_0^1 p^n U(0,1) dp = 1/(n+1)
So for 2 tosses P(2 Heads) = 1/3.
Note that while for a fair coin with n tosses, the probabilites of obtaining {1,2,3,...,n} Heads are binomial coefficients, in this case the probabilites of obtaining {1,2,3,...,n} Heads are identical.
2) Games involving trying to obtain a specific sequence of Heads and Tails
This is yet another popular genre of interview questions, possibly because the questions can be varied easily (for example, by modifying the desired sequence of H and T). There are two sub-types: i) what is the probability that sequence A would show up before sequence B does? and ii) what is the probability that sequence A would be obtained during the first/second player's turn? (assuming that the two take turns) The two sub-types are to be solved in different ways. Let's start with the expected number of toss for obtaining a particular sequence.
CT07
Keep flipping a fair coin. What is the expected number of toss such that the sequence HH appears for the first time? What about HT and HHH?
CT07 - Answer:
One can take the most general coute and solve this as a Markov chain problem. For short sequences, especially for repeating sequences (i.e. HH, TT, HHH, etc.), writing down a recursive formula should be faster. Let N(A) be the expected number of toss to obtain the sequence A. Then
N(T) = N(H) = 2
N(HH) = N(H) + 0.5 * 1 + 0.5 * (1 + N(HH)) => N(HH) = 6
The recursive formula can be understood as the two possible outcomes upon obtaining the first H: either another H immediately, in which case the sequence HH is complete, or a T, in which case one has to start over from scratch, hence the N(HH) on the right hand side. It is not hard to prove by induction that, for B = k consecutive H,
N(B) = 2^(k+1) - 2
is a close-form solution. For general sequences, the recursive formula approach still works, though you would have to know the expected number of tosses for the sub-swquences. For instance:
N(HT) = N(H) + 0.5 * 1 + 0.5 * (1 + N(T))
N(HTH) = N(HT) + 0.5 * 1 + 0.5 * (1 + 0.5 * N(HTH))
N(HHT) = N(HH) + 0.5 * 1 + 0.5 * (1 + N(T))
What if we want to know the probability that sequence A would show up before sequence B does? We'll discuss that next time.
See here for more interview questions/brainteasers
Sunday, November 4, 2012
Quick Notes - Trading Ideas
- Momentum can be a result of nonlinearity/positive feedback due to algo trading: buy and sell orders induce more orders of their own kinds. Also, especially during market open, order regularities is a sign of algo in action. Can those be detected and exploited?
- Support and resistance levels, together with trading volume, provide useful insights. However, support and resistance levels (and similarly some other price patterns) are difficult to be quantified. Can neural network help?
- Support and resistance levels and volume data are more useful for securities that does not attract a lot of hedging investors (examples: commodities futures, mid cap stocks; counter-examples: ETF, some index futures).
Monday, October 15, 2012
Those damn coins...
Coin tossing (or coin flipping) is one of the popular settings for probability questions. It might be of interest to contrast coin tossing and dice rolling:
- Coin tossing follows a binomial distribution (which converges to Gaussian); die rolling follows a uniform distribution.
- Tossing m coins gives an expectation value of m/2; rolling an m-sided die gives an expectation value of (m+1)/2.
Because of the binomial distribution, coin tossing problems usually are more involved than dice rolling in terms of arithmetics. The most straight-forward kind of coin problems would simply ask you about the mean and variance of the number of Head or Tail:
CT01
What is the expected gain if you are paid $1 for each head in tossing 4 fair coins? What is the standard deviation?
CT01 - Answer:
Remember that in n binary trials with single success probability p, the mean is np and the variance is np(1-p). So the expected gain is $2 and the standard deviation is $1.
Sometimes the question is framed as a game:
CT02
What is the probability that the number of Heads is greater than or equals to 2 when tossing 4 coins?
CT02 - Answer:
The Pascal numbers for 4 trials are {1,4,6,4,1}. Hence the required probability is (6+4+1)/16 = 11/16.
Once the number of tossing becomes large, the Law of Large Number is handy.
CT03
What is the probability that there are more than 60 Heads out of tossing 100 coins?
CT03 - Answer:
The last thing you want to do is to calculate the binomial coefficients explicitly. Instead, observe that the probability distribution converges to a Gaussian as number of trials goes to infinity, with mean equals fifty and variance equals 25 (hence the standard deviation is 5). 60 is two standard deviations away from the mean, and the 68-95-997 rule gives (1 - 95%)/2 = 2.5%.
Another way to ask coin-tossing brainteeasers is to play with Bayesian statistics.
CT04
There are three coins, one with a H side and a T side (coin A); one with both sides being T (coin B); one with both sides being H (coin C).If you draw one among them at random and toss it to observe a Head, what is the conditional probability that coin C is picked?
CT04 - Answer:
This is a typical Bayesian inference question. Let X = [coin C is picked] and Y = [the toss gives an H], then
P(X|Y) = P(Y|X)*P(X)/P(Y) = 1 * (1/3) / (1/3*0 + 1/3*1/2 + 1/3*1) = 2/3
Hope you find this helpful. More to come!
See here for more interview questions/brainteasers
- Coin tossing follows a binomial distribution (which converges to Gaussian); die rolling follows a uniform distribution.
- Tossing m coins gives an expectation value of m/2; rolling an m-sided die gives an expectation value of (m+1)/2.
Because of the binomial distribution, coin tossing problems usually are more involved than dice rolling in terms of arithmetics. The most straight-forward kind of coin problems would simply ask you about the mean and variance of the number of Head or Tail:
CT01
What is the expected gain if you are paid $1 for each head in tossing 4 fair coins? What is the standard deviation?
CT01 - Answer:
Remember that in n binary trials with single success probability p, the mean is np and the variance is np(1-p). So the expected gain is $2 and the standard deviation is $1.
Sometimes the question is framed as a game:
CT02
What is the probability that the number of Heads is greater than or equals to 2 when tossing 4 coins?
CT02 - Answer:
The Pascal numbers for 4 trials are {1,4,6,4,1}. Hence the required probability is (6+4+1)/16 = 11/16.
Once the number of tossing becomes large, the Law of Large Number is handy.
CT03
What is the probability that there are more than 60 Heads out of tossing 100 coins?
CT03 - Answer:
The last thing you want to do is to calculate the binomial coefficients explicitly. Instead, observe that the probability distribution converges to a Gaussian as number of trials goes to infinity, with mean equals fifty and variance equals 25 (hence the standard deviation is 5). 60 is two standard deviations away from the mean, and the 68-95-997 rule gives (1 - 95%)/2 = 2.5%.
Another way to ask coin-tossing brainteeasers is to play with Bayesian statistics.
CT04
There are three coins, one with a H side and a T side (coin A); one with both sides being T (coin B); one with both sides being H (coin C).If you draw one among them at random and toss it to observe a Head, what is the conditional probability that coin C is picked?
CT04 - Answer:
This is a typical Bayesian inference question. Let X = [coin C is picked] and Y = [the toss gives an H], then
P(X|Y) = P(Y|X)*P(X)/P(Y) = 1 * (1/3) / (1/3*0 + 1/3*1/2 + 1/3*1) = 2/3
Hope you find this helpful. More to come!
See here for more interview questions/brainteasers
Sunday, October 14, 2012
All those interview questions and brainteasers...
It has been a while since this blog was created. It is intended to be a handy way to look up questions and brainteasers for interview preparation, although from time to time other relevant and interesting stuffs are also discussed.
I have recently once again been looking at a lot of the popular quant interview questions, and an idea comes to mind: perhaps it is worthwhile to re-do some posts in a more systemic manner? Instead of listing the questions and answers out, maybe a discussion of the brainteasers according to their solution technique would bring about more benefits?
It is with this spirit that I embark on this little project. In the following number of posts I would try to group different interview questions into categories and discuss them in more detail, especially how one should approach and attack them. You would find that all previous interview questions/brainteasers posts are now linked here; those posts would remain where they are, so you can think of this post as an overview or introduction.
Where to find more interview questions and brainteasers?
There are two popular printed books that are used extensively in interviews:
A Practical Guide To Quantitative Finance Interviews by Zhou, and
Heard on The Street: Quantitative Questions from Wall Street Job Interviews by Crack
Also, Frequently Asked Questions in Quantitative Finance by Wilmott has a relatively short section on brainteasers, although it is a compilation of materials available on his awesome website (see below). Quant Job Interview Questions And Answers by Joshi et al seems to be a good source too, though I have not read it myself.
Apart from printed books, there is an abundance of resource on the internet. The brainteaser section on the forum of Wilmott.com often has some original questions. Sites such as Braingle and Brainden are dedicated to brainteasers, although those might not be the ones that usually show up during interviews. For those looking for real challenges, wu :: forums should be able to keep you busy.
Finally, if you search the site Glassdoor for a particular company, there will be a bunch of questions that are submitted by those who have interviewed with the firm, with attempts to answer the questions (the quality of which can vary). If you can read Chinese, mitbbs.com has more questions that have actually been asked by interviewers (usually banks).
What should I expect?
Some brainteasers don't really require lengthy calculation. It takes a very specific 'Eureka' moment to be answered. It's fair to say that you won't know the answer if you haven't seen it before. And in case you wonder, yes, such questions do show up at interviews.
Otherwise, the majority of the questions does require calculation. When you are practising, don't just memorize the answer (that's obvious). Think about 1) why the answer is what it is; 2) whether there are alternative, shorter and sweeter ways to solve it; and 3) if the question could have been altered or extended. One thing that I find especially useful is to verify the answers using simulations. That not only assures you of correctness, but also gives you some intuition, as well as a handy way to play with different parameters and assumptinos.
So, here we go:
The series
Those damn coins...
Those damn coins... (Part II)
Those damn coins... (Part III)
More Coin Problems
Those damn dice...
Those damn dice... (Part II)
Those damn cards...
I have recently once again been looking at a lot of the popular quant interview questions, and an idea comes to mind: perhaps it is worthwhile to re-do some posts in a more systemic manner? Instead of listing the questions and answers out, maybe a discussion of the brainteasers according to their solution technique would bring about more benefits?
It is with this spirit that I embark on this little project. In the following number of posts I would try to group different interview questions into categories and discuss them in more detail, especially how one should approach and attack them. You would find that all previous interview questions/brainteasers posts are now linked here; those posts would remain where they are, so you can think of this post as an overview or introduction.
Where to find more interview questions and brainteasers?
There are two popular printed books that are used extensively in interviews:
A Practical Guide To Quantitative Finance Interviews by Zhou, and
Heard on The Street: Quantitative Questions from Wall Street Job Interviews by Crack
Also, Frequently Asked Questions in Quantitative Finance by Wilmott has a relatively short section on brainteasers, although it is a compilation of materials available on his awesome website (see below). Quant Job Interview Questions And Answers by Joshi et al seems to be a good source too, though I have not read it myself.
Apart from printed books, there is an abundance of resource on the internet. The brainteaser section on the forum of Wilmott.com often has some original questions. Sites such as Braingle and Brainden are dedicated to brainteasers, although those might not be the ones that usually show up during interviews. For those looking for real challenges, wu :: forums should be able to keep you busy.
Finally, if you search the site Glassdoor for a particular company, there will be a bunch of questions that are submitted by those who have interviewed with the firm, with attempts to answer the questions (the quality of which can vary). If you can read Chinese, mitbbs.com has more questions that have actually been asked by interviewers (usually banks).
What should I expect?
Some brainteasers don't really require lengthy calculation. It takes a very specific 'Eureka' moment to be answered. It's fair to say that you won't know the answer if you haven't seen it before. And in case you wonder, yes, such questions do show up at interviews.
Otherwise, the majority of the questions does require calculation. When you are practising, don't just memorize the answer (that's obvious). Think about 1) why the answer is what it is; 2) whether there are alternative, shorter and sweeter ways to solve it; and 3) if the question could have been altered or extended. One thing that I find especially useful is to verify the answers using simulations. That not only assures you of correctness, but also gives you some intuition, as well as a handy way to play with different parameters and assumptinos.
So, here we go:
The series
Those damn coins...
Those damn coins... (Part II)
Those damn coins... (Part III)
More Coin Problems
Those damn dice...
Those damn dice... (Part II)
Those damn cards...
Friday, September 28, 2012
Brainteaser: What's my 10-digit number?
I'm thinking of a 10-digit number, where each digit represents the
number of that ordinal number in the whole number. So, the first digit
represents the number of 0's in the whole 10 digits. The second digit
represents the number of 1's in the whole 10 digits. And so on. The
first digit is not a '0.' What is my number?
Answer:
- Since the first digit is not zero, there is at least one zero among the digits.
- The sum of all digits must be 10 because it is a 10-digit number.
By some trials we find that the number 6210001000 fits the bill.
Follow-up question: is it the only correct answer?
See here for more interview questions/brainteasers
Answer:
- Since the first digit is not zero, there is at least one zero among the digits.
- The sum of all digits must be 10 because it is a 10-digit number.
By some trials we find that the number 6210001000 fits the bill.
Follow-up question: is it the only correct answer?
See here for more interview questions/brainteasers
Wednesday, September 5, 2012
Timeline of Events Since 2007
The following is a non-exhaustive timeline of the events of the credit crisis:
2007 Dec - Fed's Term Auction Facility commenced.
2008 Mar - ECB extended the longest tender of Long Term Refinancing Operations (LTRO) to 6 months.
2008 Mar - Bear Stearns acquired by JP Morgan.
2008 Mar - Investment banks were allowed to borrow from the Fed's discount window.
2008 Jun - Countrywide Financial acquired by Bank of America.
2008 Jul - IndyMac placed into conservatorship.
2008 Sep - AIG bailed out by NY Fed.
2008 Sep - Goldman Sachs and Morgan Stanley became bank holding companies.
2008 Sep - Goldman Sachs bailed out by US government and Berkshire.
2008 Sep - Morgan Stanley bailed out by Mitsubishi UFJ
2008 Sep - Washington Mutual put on FDIC receivership.
2008 Sep - Lehman Brothers declared bankruptcy.
2008 Sep - Merrill Lynch acquired by Bank of America.
2008 Sep - Fannie Mae and Freddie Mac placed into conservatorship.
2008 Oct - Troubled Asset Relief Program (TARP) was signed into law.
2008 Oct - Wachovia merged with Wells Fargo.
2008 Nov - Quantitative Easing (QE) began. Fed started purchasing MBS securities.
2008 Nov - Citi bailed out by US government.
2009 Jan - Bank of England's Asset Purchase Facility (APF) began.
2009 Jun - General Motors filed for bankruptcy.
2010 Nov - QE2 began.
2011 Aug - US government downgraded by S&P.
2011 Sep - Fed announced Operation Twist.
2012 Sep - Fed announced QE3
2012 Sep - ECB announced Outright Monetary Transactions (OMT)
2007 Dec - Fed's Term Auction Facility commenced.
2008 Mar - ECB extended the longest tender of Long Term Refinancing Operations (LTRO) to 6 months.
2008 Mar - Bear Stearns acquired by JP Morgan.
2008 Mar - Investment banks were allowed to borrow from the Fed's discount window.
2008 Jun - Countrywide Financial acquired by Bank of America.
2008 Jul - IndyMac placed into conservatorship.
2008 Sep - AIG bailed out by NY Fed.
2008 Sep - Goldman Sachs and Morgan Stanley became bank holding companies.
2008 Sep - Goldman Sachs bailed out by US government and Berkshire.
2008 Sep - Morgan Stanley bailed out by Mitsubishi UFJ
2008 Sep - Washington Mutual put on FDIC receivership.
2008 Sep - Lehman Brothers declared bankruptcy.
2008 Sep - Merrill Lynch acquired by Bank of America.
2008 Sep - Fannie Mae and Freddie Mac placed into conservatorship.
2008 Oct - Troubled Asset Relief Program (TARP) was signed into law.
2008 Oct - Wachovia merged with Wells Fargo.
2008 Nov - Quantitative Easing (QE) began. Fed started purchasing MBS securities.
2008 Nov - Citi bailed out by US government.
2009 Jan - Bank of England's Asset Purchase Facility (APF) began.
2009 Jun - General Motors filed for bankruptcy.
2010 Nov - QE2 began.
2011 Aug - US government downgraded by S&P.
2011 Sep - Fed announced Operation Twist.
2012 Sep - Fed announced QE3
2012 Sep - ECB announced Outright Monetary Transactions (OMT)
Tuesday, August 21, 2012
Book Review: Fooled by Randomness by Nassim Taleb
Spoiler Alert
I first came to know about Taleb years ago when I read his Dynamic Hedging. It was a great book with clarity and real-world wisdom that is rarely found in other option trading texts.
This book (and I believe the others of his), however, is completely different. I was hoping that despite the difference, Fooled by Randomness would still be tangentially related to option and trading, but the hope did not materialize. It is fair to say that the whole 300-or-so-paged book can be summarized as
I suppose these points are worth the discussion, although I would love to see them being explored at greater depth. And as mentioned eariler, you don't see much discussion in the context of derivative trading, which is a pity. Instead, too many sections are spent in recounting anecdotes and stories, ancient or modern, that may or may not be necessary.
All in all, the book is an easy read and I did get something out of it. Considering that Black Swan was published later than Fooled by Randomness and enjoys an inferior rating, I should pass on that and spend my time re-reading Dynamic Hedging instead.
http://www.amazon.com/Fooled-Randomness-Hidden-Chance-Markets/dp/1400067936/ref=sr_1_4?ie=UTF8&qid=1345545225&sr=8-4&keywords=taleb
I first came to know about Taleb years ago when I read his Dynamic Hedging. It was a great book with clarity and real-world wisdom that is rarely found in other option trading texts.
This book (and I believe the others of his), however, is completely different. I was hoping that despite the difference, Fooled by Randomness would still be tangentially related to option and trading, but the hope did not materialize. It is fair to say that the whole 300-or-so-paged book can be summarized as
- The signal-to-noise ratio of our media is low, if not zero;
- Trading and investing are perfect examples of fields containing a huge random component;
- A common problem among quants/financial economists is that they see market dynamics as something on which a descriptive/positive theory can be posited (think physics);
- Human mind is terribly bad at thinking in probabilisitc terms. In particular, emotions usually lead one into wrong conclusions/bad decisions.
I suppose these points are worth the discussion, although I would love to see them being explored at greater depth. And as mentioned eariler, you don't see much discussion in the context of derivative trading, which is a pity. Instead, too many sections are spent in recounting anecdotes and stories, ancient or modern, that may or may not be necessary.
All in all, the book is an easy read and I did get something out of it. Considering that Black Swan was published later than Fooled by Randomness and enjoys an inferior rating, I should pass on that and spend my time re-reading Dynamic Hedging instead.
http://www.amazon.com/Fooled-Randomness-Hidden-Chance-Markets/dp/1400067936/ref=sr_1_4?ie=UTF8&qid=1345545225&sr=8-4&keywords=taleb
Subscribe to:
Posts (Atom)