├── Main.tex ├── Main_backup.tex ├── Quant_Exercises.pdf ├── README.md ├── content ├── 1-probability.tex ├── 2-calculus.tex ├── 3-finance.tex ├── 4-algorithms.tex ├── 5-brain_teasers.tex └── 6-behaviour.tex └── preamble ├── Book template.tex └── exe_sol_env.tex /Main.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{book} % chapter available 2 | 3 | \usepackage{amsmath} % For math formulas 4 | \usepackage{graphicx} % For images 5 | 6 | \include{preamble/exe_sol_env} 7 | 8 | % Book's title and subtitle 9 | \title{ 10 | \Huge \textbf{Practice Makes Quants} % \footnote{This is a footnote.} 11 | \\ 12 | \large Must solved problems to a qualified quant %\footnote{This is yet another footnote.} 13 | } 14 | % Author 15 | \author{ 16 | \textsc{Andy Hu} 17 | %\thanks{\url{www.example.com}} 18 | } 19 | 20 | 21 | 22 | \begin{document} 23 | \frontmatter 24 | \maketitle 25 | \tableofcontents 26 | 27 | \mainmatter 28 | \include{content/1-probability} 29 | \include{content/2-calculus} 30 | \include{content/3-finance} 31 | \include{content/4-algorithms} 32 | \include{content/5-brain_teasers} 33 | \include{content/6-behaviour} 34 | 35 | 36 | \backmatter 37 | \end{document} -------------------------------------------------------------------------------- /Main_backup.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{book} 2 | 3 | \usepackage{amsmath} % For math formulas 4 | \usepackage{graphicx} % For images 5 | 6 | %%%%%%%%%%%%%%%%%%%%%%%% Exercise and solution environment %%%%%%%%%%%%%%%%%%% 7 | \usepackage{comment} 8 | \usepackage{amsthm} 9 | \newtheorem{exe}{}[chapter] 10 | \newenvironment{sol}{\begin{proof}[Solution:]}{\end{proof}} 11 | \includecomment{teacher} % To comment out solution in problem only version. 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%% Template %%%%%%%%%%%%%%%%%%%%%%%%% 14 | \usepackage[T1]{fontenc} 15 | \usepackage[utf8]{inputenc} 16 | \usepackage{lmodern} 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % Source: http://en.wikibooks.org/wiki/LaTeX/Hyperlinks % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | \usepackage{hyperref} 21 | \usepackage[english]{babel} 22 | 23 | 24 | 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % First page of book which contains 'stuff' like: % 27 | % - Book title, subtitle % 28 | % - Book author name % 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | % Book's title and subtitle 32 | \title{\Huge \textbf{Sample Book Title} \footnote{This is a footnote.} \\ \huge Sample book subtitle \footnote{This is yet another footnote.}} 33 | % Author 34 | \author{\textsc{First-name Last-name}\thanks{\url{www.example.com}}} 35 | 36 | 37 | 38 | 39 | \begin{document} 40 | 41 | \frontmatter 42 | \maketitle 43 | \tableofcontents 44 | 45 | \mainmatter 46 | \include{probability} 47 | 48 | \include{stochastic_process} 49 | 50 | \include{calculus} 51 | 52 | \include{linear_algebra} 53 | 54 | \include{brain_teaser} 55 | 56 | \include{finance} 57 | 58 | \include{algorithm} 59 | 60 | \end{document} -------------------------------------------------------------------------------- /Quant_Exercises.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyhu4023/Quant-Interview-Question-Bank/30e948e01bd8bb7800acf5562068ceeec56f829f/Quant_Exercises.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quant-Interview-Question-Bank 2 | Collections of all quant related questions seen. Most with my own solutions. Comments and new ideas are welcome! 3 | -------------------------------------------------------------------------------- /content/1-probability.tex: -------------------------------------------------------------------------------- 1 | \chapter{Probability and Stochastic Process} 2 | \section{Counting and Combinatorics} 3 | \begin{exe}[Poker hands] 4 | What is the probability of getting four-of-a-kind/Full House/two pair? 5 | \end{exe} 6 | Source: Practical Guide 7 | \begin{teacher} 8 | \begin{sol} 9 | \end{sol} 10 | \end{teacher} 11 | 12 | \begin{exe}[Hopping rabbit] 13 | A rabbit sits at the bottom of a staircase with 10 stairs. It can only hop up only one or two stairs at a time. How many ways for it to ascend to the top of stairs. 14 | \end{exe} 15 | Source: Practical Guide 16 | \begin{teacher} 17 | \begin{sol} 18 | \end{sol} 19 | \end{teacher} 20 | 21 | \begin{exe}[Grid Jumping] 22 | You are on the grid $(0, 0)$. You may move right or up by 1 grid each step. How many ways are there for you to move to $(10, 10)$? 23 | \end{exe} 24 | \begin{teacher} 25 | \begin{sol} 26 | \end{sol} 27 | \end{teacher} 28 | 29 | \begin{exe}[Balls to boxes] 30 | You have 5 balls label 1 to 5 and 5 boxes label 1 to 5. The balls are randomly put into the boxes. What is the probability of all balls are put to a box with a different number? 31 | \end{exe} 32 | Source: Practical Guide 33 | \begin{teacher} 34 | \begin{sol} 35 | \end{sol} 36 | \end{teacher} 37 | 38 | \begin{exe}[Same birthday] 39 | What is the minimum number n that, among a group of n people, the probability of two people have the same birthday is greater than 1/2? (Assume a year always has 365 days) 40 | \end{exe} 41 | \begin{teacher} 42 | Source: Practical Guide 43 | \begin{sol} 44 | \end{sol} 45 | \end{teacher} 46 | 47 | 48 | 49 | 50 | 51 | 52 | \section{Probability and Normal Distribution} 53 | \begin{exe} 54 | What is the Law of Large Numbers and The Central Limit Theorem? What are the differences between them? 55 | \end{exe} 56 | \begin{teacher} 57 | \begin{sol} 58 | The Law of Large Numbers:\\ 59 | For a infinite sequence of i.i.d Lebesgue integrable random variables $\{X_1, X_2, \cdots\}$ with $E(X_i) = \mu$. Then the sample mean $\bar{X_n} := \frac{X_1+\cdots+X_n}{n}$ converge in probability to $\mu$. i.e. for any small $\epsilon>0$, 60 | $$\lim_{n\rightarrow \infty} P(|\Bar{X_n}-\mu| >\epsilon) = 0$$ 61 | The Central Limit Theorem:\\ 62 | For a infinite sequence of i.i.d random variables $\{X_1, X_2, \cdots\}$ with $E(X_i) = \mu$ and $Var(X_i) = \sigma^2$. Denote the sample mean by $\bar{X_n} := \frac{X_1+\cdots+X_n}{n}$. Then the random variable $\frac{\bar{X_n} - \mu}{\sigma/\sqrt{n}}$ converge in distribution to $N(0, 1)$, i.e. the cumulative distribution function $F_n$ converge to the normal cumulative distribution $\Phi$.\\ 63 | The law of large number tells us that the sample mean is an unbiased estimator of expected value while the central limit theorem tells us about the asymptotic distribution of the same mean, concluding that it is also consistent. 64 | \end{sol} 65 | \end{teacher} 66 | 67 | \begin{exe} 68 | Suppose you have a fair coin, and you flip it a million times. Estimate the probability that you get fewer than 499,000 heads. 69 | \end{exe} 70 | \begin{teacher} 71 | Tag: Central Limit Theorem, Normal Distribution 72 | \begin{sol} 73 | From the CLT, the outcome distribution is closed to $N(0.5M, 0.25M)$. The standard deviation is $0.5k=500$. So $P(N<499,000) = \Phi(\frac{499,000 - 500, 000}{500}) = \Phi(-2) = 0.02275$. (The number is checked from the table, should be acceptable to use $\Phi(-2$ as the final answer.) 74 | \end{sol} 75 | \end{teacher} 76 | 77 | \begin{exe} 78 | Give an example of random variables that are normal, uncorrelated, and dependent. 79 | \end{exe} 80 | \begin{teacher} 81 | Tag: Normal Distribution 82 | \begin{sol} 83 | Denote $X\sim N(0,1)$ and $Z$ has equal chance to be 1 or -1. Then $Y=ZX$. We can show that $Y$ is normal, $Cov(X, Y)=0$ and $Y$ is dependent on $X$ (simple from $f(0, 0) = p(0)\neq p(0)^2$, where $f$ is the joint density for $(X, Y)$ and $p$ if density function for normal distribution.) 84 | \end{sol} 85 | \end{teacher} 86 | 87 | \begin{exe} 88 | A stick is broken randomly into 3 pieces. Two broken points are uniformly distributed on $[0,1]$. What is the probability of three pieces being able to form a triangle? 89 | \end{exe} 90 | \begin{teacher} 91 | \begin{sol} 92 | The whole probability space is $[0,1]\times[0,1]$, which has area 1. Denote the event that three pieces are able to form a triangle by $E$. Then the probability of $E$ is just the area of $E$. 93 | 94 | Let's determine the tuples $(x, y)$ that belong to $E$. If $x\frac{1}{2}$. The space by these three constraints is a right triangle above the diagonal. (Image in your head or draw it down on paper.) The area is $\frac{1}{8}$. Similar analysis apply to the situation $x>y$ and the space is just the reflection from the line $y=x$, (as you just exchange x with y!) so it also has area $\frac{1}{8}$. So the total probability is $\frac{1}{4}$. 95 | \end{sol} 96 | \end{teacher} 97 | 98 | \begin{exe} 99 | A stick is broken randomly into two pieces, i.e. the broken point is uniform random variable on $[0, 1]$. The larger piece is then broken randomly into two pieces, i.e. the second broken points are uniform random variable on $[0, X]$, where $X$ is the length of the longer piece. What is the probability of the pieces being able to form a triangle? 100 | \end{exe} 101 | \begin{teacher} 102 | \begin{sol} 103 | It is obviously a variation of the previous problem, but the problem here is what is changed and what is not. A little thought may lead to the conclusion that the space of $E$ is the same but the total probability space has change. Given $x=\frac{1}{3}$, y are just random number from $\frac{1}{3}$ to 1. Now the total probability space is $[0, 1]\times[0,1]$ removing $[0,x]$ for $x\in[0, \frac{1}{2})$ and removing $[x, 1]$ for $x\in [\frac{1}{2}, 1]$. The area of the total probability space is $\frac{3}{4}$, so $P(E) = \frac{1/4}{3/4} = 1/3$. 104 | \end{sol} 105 | \end{teacher} 106 | 107 | \begin{exe} 108 | You play a game where you toss two fair coins in the air. You always win 1 dollar. However, if you have tossed 2 heads at least once, and 2 tails at least once, you surrender all winnings, and cannot play again. You may stop playing at anytime. What's your strategy? 109 | \end{exe} 110 | \begin{teacher} 111 | \begin{sol} 112 | If you have never tossed 2 heads or 2 tails, then next toss will guarantee you 1 dollar. After your first toss of 2 heads or 2 tails, then the next toss will have $\frac{3}{4}$ chance of 1 dollar and $\frac{1}{4}$ chance of $-n$ dollar, where $n$ is the dollars already wined. Just continue if expected value is greater than 0, i.e. $n<3$, otherwise just stop. 113 | \end{sol} 114 | \end{teacher} 115 | 116 | \begin{exe}[Coin toss game] 117 | A flips a fair coin 11 times, and B flips the coin 10 times. How likely is it that A flipped more heads than B? 118 | \end{exe} 119 | \begin{teacher} 120 | \begin{sol} 121 | \end{sol} 122 | \end{teacher} 123 | 124 | \begin{exe}[Card game] 125 | A casino offers a simple card game. There are 52 cards in a deck with 4 cards for each 126 | value 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A. Each time the cards are thoroughly shuffled 127 | (so each card has equal probability of being selected). You pick up a card from the deck 128 | and the dealer picks another one without replacement. If you have a larger number, you 129 | win; if the numbers are equal or yours is smaller, the house wins. What is your probability of winning? 130 | \end{exe} 131 | \begin{teacher} 132 | \begin{sol} 133 | \end{sol} 134 | \end{teacher} 135 | 136 | 137 | \begin{exe}[Drunk passenger] 138 | A line of 100 airline passengers are waiting to board a plane. They each hold a ticket of one of the 100 seats on the flight. For convenience, the n-th passenger holds the ticket for seat n. Being drunk, the first person in line picks a random seat (equal probability for all seats). All other passengers are sober. They will go to their seats unless it is occupied. In such case, they will pick a free seat randomly (also equal probability for all free seats). Suppose you hold ticket for seat 100, what is the probability that you end up in your seat (i.e. seat 100)? 139 | \end{exe} 140 | \begin{teacher} 141 | Source: Practical Guide 142 | \begin{sol} 143 | \end{sol} 144 | \end{teacher} 145 | 146 | \begin{exe}[N points on a circle] 147 | Given N points drawn randomly on the circumference of a circle, what is the probability that they are all within a semicircle? 148 | \end{exe} 149 | Source: Practical Guide 150 | \begin{teacher} 151 | \begin{sol} 152 | \end{sol} 153 | \end{teacher} 154 | 155 | \begin{exe}[Meeting Probability] 156 | A and B will arrive at the park at a random time from 17:00 to 18:00 and stay for 5 minutes. What is the probability that A meets B? 157 | \end{exe} 158 | Source: Practical Guide 159 | \begin{teacher} 160 | \begin{sol} 161 | \end{sol} 162 | \end{teacher} 163 | 164 | \begin{exe}[Moments of normal distribution] 165 | If $X \sim N(0,1)$, then what is $E[X^n]$? Calculate the values for n = 1,2,3,4. 166 | \end{exe} 167 | \begin{teacher} 168 | \begin{sol} 169 | \end{sol} 170 | \end{teacher} 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | \section{Expectation and Variance} 180 | \begin{exe} 181 | $X \sim N(\mu_X, \sigma_X^2)$ and $Y \sim N(\mu_Y, \sigma_Y^2)$ are independent, and you know $X + Y = s$. What is the expected value of $X$? 182 | \end{exe} 183 | \begin{teacher} 184 | \begin{sol} 185 | We need to use the following lemma:\\ 186 | If $(X, Y)$ are bivariate normal distributed, then $(a_1X+b_1Y, a_2X+b_2Y)$ are also bivariate normal for any real coefficients $a_1,\ a_2,\ b_1,\ b_2$. Moreover, if $X,\ Y$ are uncorrelated, i.e. $Cov(X, Y)=0$, then they are independent.\\ 187 | (It is unlikely you need to prove that. It may be given as hint in some cases)\\ 188 | From the lemma, we can deduce the orthogonal decomposition of $X$ as: 189 | $$X=(X-\frac{Cov(X,Y)}{Var(X)}Y) + \frac{Cov(X,Y)}{Var(X)}Y$$ 190 | For this problem, let's consider $(X, Z:=X+Y)$, which is bivariate normal from the lemma. We can see that $E(Z) = \mu_X+\mu_Y$ and $Var(Z) = \sigma_X^2+\sigma_Y^2$, $Cov(X,Z)= Cov(X,X)+Cov(X,Y) = \sigma_X^2$. We need to calculate $E(X|Z=s)$. 191 | \begin{align*} 192 | E(X|Z=s) &=E(X-\frac{Cov(X,Z)}{Var(X)}Z) + \frac{Cov(X,Z)}{Var(X)}Z|Z=s)\\ 193 | &=E(X-\frac{Cov(X,Z)}{Var(X)}Z|Z=s) + E(\frac{Cov(X,Z)}{Var(X)}Z|Z=s)\\ 194 | &=E(X-\frac{Cov(X,Z)}{Var(X)}Z)+\frac{Cov(X,Z)}{Var(X)}s\\ 195 | &(By\ independence)\\ 196 | &=\mu_X - \frac{\sigma_X^2}{\sigma_X^2}(\mu_X+\mu_Y) + \frac{\sigma_X^2}{\sigma_X^2}s\\ 197 | &=s-\mu_Y 198 | \end{align*} 199 | \end{sol} 200 | \end{teacher} 201 | 202 | \begin{exe}[Spinner] 203 | You have a spinner that generates random numbers that are uniform between 0 and 1. You sum the spins until the sum is greater than one. What is the expected number of spins? 204 | \end{exe} 205 | \begin{teacher} 206 | \begin{sol} 207 | We first need to reorganize the formula for expectation:\\ 208 | \begin{align*} 209 | E(n) &= P(n=1) +2P(n=2) +3P(n=3)+\cdots \\ 210 | &=P(n\geq1) + P(n\geq 2) +P(n\geq3) 211 | \end{align*} 212 | Then we need to find the formula for $P(n\geq i)$ for all $i \in N$. The event $n\geq k+1$ is equivalent to $X_1+X_2+\cdots X_{k}\leq 1$, where $X_i$ are i.i.d. uniform on $[0,1]$. $(X_1, X_2, \cdots, X_k)$ are uniform in the area $[0,1]^k$ and we need to calculate the volume bounded by $X_i\geq 0$ and $\sum\limits_{i=1}^k X_i \leq 1$. 213 | \begin{align*} 214 | V &=\int_0^1\int_0^{1-x_1}\cdots \int_0^{1-(x_1+x_2+\cdots x_n)} 1dx_{n+1}dx_n \cdots dx_1\\ 215 | &=\int_0^1\int_0^{1-x_1}\cdots \int_0^{1-(x_1+\cdots +x_{n-1})}1-(x_1+\cdots x_n)dx_n\cdots dx_1\\ 216 | &= \int_0^1\int_0^{1-x_1}\cdots \int_0^{1-(x_1+\cdots+x_{n-1})}ydydx_1\\ 217 | & (y=1-(x_1+ \cdots +x_n)) \\ 218 | &=\int_0^1\int_0^{1-x_1}\cdots \int_0^{1-(x_1+\cdots+x_{n-2})}\frac{1}{2}(1-(x_1+\cdots+x_{n-1}))^2dx_{n-1} dx_1\\ 219 | &(similar\ trick\ apply)\\ 220 | &=\int_0^1\int_0^{1-x_1}\cdots \int_0^{1-(x_1+\cdots+x_{n-3})}\frac{1}{3!}(1-(x_1+\cdots+x_{n-2}))^3dx_{n-2} dx_1\\ 221 | &=\int_0^1 \frac{1}{n!}y^ndy = \frac{1}{(n+1)!} 222 | \end{align*} 223 | So our final result is $E(n)=\sum\limits_{k=0}^{\infty} \frac{1}{k!}=e$. \\ 224 | (Remember the Taylor expansion of $e^x = \sum\limits_{n=1}^{\infty} \frac{x^n}{n!}$.) 225 | \end{sol} 226 | \end{teacher} 227 | 228 | \begin{exe}[St. Petersburg Paradox] 229 | Consider the following game played by flipping a fair coin. The pot begins at a 1 dollar, and the pot doubles until a tail is flipped, at which point you receive the pot. Assume you can play as many times as you want. What would you pay to play this game? 230 | \end{exe} 231 | \begin{teacher} 232 | Tag: Default Risk 233 | \begin{sol} 234 | The price should be equal to the expected payoff as it can be played many times. It can be deduced that the probability of getting $2^{i-1}$ dollars is $\frac{1}{2^i}$. So $E(X) = \sum_{i=1}^{\infty} 2^{i-1}\times\frac{1}{2^i}=\sum_{i=1}^{\infty} 1/2=\infty$. So that is the theoretical answer, which seems a bit unrealistic. 235 | 236 | Assuming in the real world, a bank is try to pricing a product like this, it is obviously no way charge the clients infinitely dollars. So what can be done to make it more realistic? A possible idea here is to consider the default risk of the game host. Assume the total available money of the host is $2^30$ dollar, then if you toss 31 head, the host will default and cannot pay you anything. Given such upper bound, the game may be priced with finite amount. 237 | \end{sol} 238 | \end{teacher} 239 | 240 | \begin{exe}[Roll all numbers] 241 | What is the expected number of rolls of a fair die needed to get all six numbers? 242 | \end{exe} 243 | \begin{teacher} 244 | \begin{sol} 245 | The problem may seems complicated at the first glance but once formulated in the correct way, it is relatively easy to solve. The right way to decompose the process is by getting a new number one by one until we get 6. The first roll will give a new number whichever the number it is. Given we have 1 number, getting the next number number is just a geometric process of success rate $\frac{5}{6}$. Similarly, given the condition that we have $i$ numbers, getting a new number is a geometric process of success rate $\frac{6-i}{6}$, which has expected trials of $\frac{6}{6-i}$. So the total expected rolls is just $1+\frac{6}{5}+\cdots+\frac{6}{1}=14.7$. 246 | \end{sol} 247 | \end{teacher} 248 | 249 | \begin{exe} 250 | A room of 100 people put their business cards in a hat, then each person randomly draws a business card. What's the expected number of people who draw their own business card? 251 | \end{exe} 252 | \begin{teacher} 253 | \begin{sol} 254 | At the first glance, it seems complicated as the event that A draw her own business card will affect the event that B draw B's card. (Because if A draw B's card, then B can not draw his own, but if not, then B has a chance to draw his own.) It will be hard to calculate directly by summing n times the probability of n people draw their own card. 255 | 256 | Denote $X$ to be the number of people who draw their own card and we need to calculate $E(X)$. Denote $X_i$ to be a random variable that equals to 1 if guest $i$ get her own card else 0, (Note here that $X_i$, $X_j$ are not independent.) and we have $X=\sum_{i=1}^{100}X_i$. Even $X_i$'s are dependent on each other, we still have $E(X) = \sum_{i=0}^{100} E(X_i)= 100\times \frac{1}{100}=1$. 257 | \end{sol} 258 | \end{teacher} 259 | 260 | \begin{exe}[Connecting noodles] 261 | You have 100 noodles and 200 ends. Each time, you randomly choose two ends and connect them. The process last until no end left. What is the expected number of circles at the end of the process? 262 | \end{exe} 263 | Source: Practical Guide 264 | \begin{teacher} 265 | \begin{sol} 266 | \end{sol} 267 | \end{teacher} 268 | 269 | \begin{exe}[Dice game] 270 | Consider a game that you roll a dice at get the face value. If you roll a 6, you can roll again. What is the fair price to enter the game? 271 | \end{exe} 272 | Source: Practical Guide 273 | \begin{teacher} 274 | \begin{sol} 275 | \end{sol} 276 | \end{teacher} 277 | 278 | \begin{exe}[First ace] 279 | Each time, you draw a card from a regular 52 poker without replacement. What is the expected number of draws to get the first ace? 280 | \end{exe} 281 | Source: Practical Guide 282 | \begin{teacher} 283 | \begin{sol} 284 | \end{sol} 285 | \end{teacher} 286 | 287 | \begin{exe}[N balls in a jar] 288 | Assuming that there are N distinct balls in a jar and each draw will be replaced with the same ball. What is the expected number of draws to get a complete set of N balls? After k draws, what is the expected numbers of distinct balls? 289 | 290 | \end{exe} 291 | Source: Practical Guide 292 | \begin{teacher} 293 | \begin{sol} 294 | \end{sol} 295 | \end{teacher} 296 | 297 | \begin{exe}[Range of default] 298 | Assume A has default probability $50\%$ and B has default probability $30\%$ but the correlation is unknown. What is the range of probability that A or B default? What is the range of correlation of the event A defaults and the events B defaults? 299 | \end{exe} 300 | Source: Practical Guide 301 | \begin{teacher} 302 | \begin{sol} 303 | \end{sol} 304 | \end{teacher} 305 | 306 | 307 | 308 | 309 | \begin{exe}[Random ants] 310 | 500 ants are randomly placed on 1-foot string and move to one random end of the string at speed 1 foot/min. If two ants collide heads on, they just immediately turn around and keep on moving. The process will last until all ants fall off the string. What is the expected time length of this process? 311 | \end{exe} 312 | Source: Practical Guide 313 | \begin{teacher} 314 | \begin{sol} 315 | \end{sol} 316 | \end{teacher} 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | \section{Conditional Probability} 326 | \begin{exe}[Next head] 327 | You have a bag with two coins. One will come up heads $40\%$ of the time and the other will come up heads $60\%$. You pick a coin randomly, flip it and get a head. What is the probability it will be heads on the next flip? 328 | \end{exe} 329 | \begin{teacher} 330 | \begin{sol} 331 | Notations of events:\\ 332 | $H$ -- Get a head;\\ 333 | $E_i$ -- Picked coin i;\\ 334 | $H'$ -- Get a head next time.\\ 335 | From Bayes formula, we have: 336 | $$P(E_1|H) = \frac{P(H|E_1) P(E_1)} {P(H|E_2) P(E_2) + P(H|E_1) P(E_1)} = \frac{0.4*0.5}{0.4*0.5 + 0.6*0.5}= 0.4$$ 337 | \begin{equation*} \label{1} 338 | \begin{split} 339 | P(H'|H) & = P(H'|E_1,\ H)P(E_1|H) + P(H'|E_2,\ H)P(E_2|H) \\ 340 | & = 0.4*0.4 + 0.6*0.6 = 0.52 341 | \end{split} 342 | \end{equation*} 343 | \end{sol} 344 | \end{teacher} 345 | 346 | \begin{exe}[Unfair coin] 347 | In front of you is a jar of 1000 coins. One of the coins has two heads,and the rest are fair coins. You choose a coin at random, and flip it ten times, getting all heads. What is the probability it is one of the fair coins? 348 | \end{exe} 349 | \begin{teacher} 350 | \begin{sol} 351 | Notation of events:\\ 352 | F -- Pick a fair coin;\\ 353 | S -- Pick a two-head coin;\\ 354 | H -- Flip 10 times, all heads.\\ 355 | \begin{equation*} 356 | \begin{split} 357 | P(F|H) &= \frac{P(H|F)P(F)}{P(H|F)P(F) + P(H|S)P(S)}\\ 358 | & = 0.5^{10}*0.999/(0.5^{10}*0.999+1*0.001) \approx 0.5 359 | \end{split} 360 | \end{equation*} 361 | \end{sol} 362 | \end{teacher} 363 | 364 | \begin{exe}[Monte Hall Problem] 365 | You are on a game show, and there are 3 doors. Two of the doors conceal nothing, and one door conceals a prize. The game show host, Monte Hall, knows where the prize is. He lets you pick a door. You picked, say, door 1. If you pick the door of prize, he will randomly open one remaining door. If you pick the door of nothing, then he opens the other door of nothing. Suppose he open the door 2. Finally he then offers you the chance to switch doors. What should you do? Please justify your action. (If you have completely no idea, you may just say "Toss a coin and let the god guide me!". LOL) 366 | \end{exe} 367 | \begin{teacher} 368 | Tag: Bayes formula 369 | \begin{sol} 370 | Notations of events:\\ 371 | $D_i$ -- the price are inside door i;\\ 372 | $O_2$ -- the host open the door 2. 373 | \begin{align*} 374 | P(D_1|O_2) &= \frac{P(O_2|D_1)P(D_1)}{P(O_2|D_1)P(D_1)+P(O_2|D_2)P(D_2)+P(O_2|D_3)P(D_3)}\\ 375 | &=\frac{\frac{1}{2}*\frac{1}{3}}{\frac{1}{2}*\frac{1}{3}+0*\frac{1}{3}+1*\frac{1}{3}}=\frac{1}{3} 376 | \end{align*} 377 | Similarly, we can have $P(D_2|O_2)=0$ and $P(D_3|O_2) = \frac{2}{3}$. So you should switch to door 3. 378 | \end{sol} 379 | \end{teacher} 380 | 381 | \begin{exe} 382 | You have a bucket of unfair coins. Each coin has a probability of getting heads, p, which is uniformly distributed between zero and one. You pick a coin, and flip it 64 times, getting 48 heads. What is the expected value of p for your coin? 383 | \end{exe} 384 | \begin{teacher} 385 | \begin{sol} 386 | It helps if you know the beta distribution. (If not, google it!) 387 | \end{sol} 388 | \end{teacher} 389 | 390 | \begin{exe} 391 | Alex and Beth take turns flipping a pair of coins. The first person to flip a pair of heads wins the game. Alex flips first. Beth eventually wins. What is the probability she flipped a pair of heads on her second turn? 392 | \end{exe} 393 | \begin{teacher} 394 | \begin{sol} 395 | \end{sol} 396 | \end{teacher} 397 | 398 | \begin{exe}[Order Dice] 399 | Roll 3 dice one by one, what is the probability that the outcome is strictly increasing? 400 | \end{exe} 401 | Source: Practical Guide 402 | \begin{teacher} 403 | \begin{sol} 404 | \end{sol} 405 | \end{teacher} 406 | 407 | \begin{exe}[Population die out] 408 | In a planet with 1 creature, this creature will die, stay the same, split into two or split into three with equal chance (0.25 for each). Each creature behave the same and independently. What is the probability that the creature will die out? 409 | \end{exe} 410 | Source: Practical Guide 411 | \begin{teacher} 412 | \begin{sol} 413 | \end{sol} 414 | \end{teacher} 415 | 416 | \begin{exe}[Candies in a jar] 417 | Given a jar with 10 red candies, 20 blue candies, 30 green candies, what is the probability that the jar still have blue and green candies after you have out all 10 red candies? (You are taking without replacement.) 418 | 419 | \end{exe} 420 | \begin{teacher} 421 | \begin{sol} 422 | \end{sol} 423 | \end{teacher} 424 | 425 | \begin{exe}[Russian roulette] 426 | 427 | \end{exe} 428 | Source: Practical Guide 429 | \begin{teacher} 430 | \begin{sol} 431 | \end{sol} 432 | \end{teacher} 433 | 434 | \begin{exe}[Aces] 435 | A poker of 52 cards is distributed to 4 players with each getting 13 card randomly. What is the probability that each play has an ace? 436 | \end{exe} 437 | Source: Practical Guide 438 | \begin{teacher} 439 | \begin{sol} 440 | \end{sol} 441 | \end{teacher} 442 | 443 | 444 | \begin{exe}[GRE scores] 445 | A student is taking GRE exams with 100 questions, each for 1 point. She is getting first question right and the second question wrong. In the following questions, the difficulty will adjust to her previous performance. For the i-th question, she has probability $\frac{k}{i-1}$ to get the correct answer if she has got k points in the previous $i-1$ questions. What is the probability that she ends up with 50 points after she completes all 100 questions? 446 | \end{exe} 447 | Source: Practical Guide 448 | \begin{teacher} 449 | \begin{sol} 450 | \end{sol} 451 | \end{teacher} 452 | 453 | \begin{exe}[Cars on road] 454 | Assume that it has probability p to observe at least one car on the road during a period of 20 minutes, what is the probability to observe at least one car on the road during a period of 5 minutes? You can assume that on a fix length period, the probability is fixed and on two non-overlap periods, the events are independent. 455 | \end{exe} 456 | Source: Practical Guide 457 | \begin{teacher} 458 | \begin{sol} 459 | \end{sol} 460 | \end{teacher} 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | \section{Markov Process and Martingale} 470 | \begin{exe} 471 | Starting at one vertex of a cube, and moving randomly from 472 | vertex to adjacent vertices, what is the expected number of moves until you 473 | reach the vertex opposite from your starting point? 474 | \end{exe} 475 | \begin{teacher} 476 | \begin{sol} 477 | Notation of states: (By the distance to the origin)\\ 478 | $S_0$ -- the origin;\\ 479 | $S_1$ -- the vertices next to origin;\\ 480 | $S_2$ -- the vertices next to opposite;\\ 481 | $S_3$ -- the opposite.\\ 482 | Denote $E(S_i)$ to be the expected moves to get to the opposite. Suppose we are in $S_0$, then after one move, we are in $S_1$. Now suppose we are in $S_1$, then we have 1/3 chance we will move back to $S_0$ and 2/3 chances to move to $S_2$. Similar for analysis on $S_2$. Finally if we are in $S_3$, then $E(S_3)=0$. Therefor, we have the equations: 483 | \begin{align*} 484 | E(S_0) &= 1+E(S_1)\\ 485 | E(S_1) &= 1+\frac{1}{3}E(S_0)+\frac{2}{3}E(S_2)\\ 486 | E(S_2) &= 1+\frac{1}{3}E(S_3)+\frac{2}{3}E(S_1)\\ 487 | E(S_3) &= 0 488 | \end{align*} 489 | Solve and get $E(S_0)=10,\ E(S_1) =9,\ E(S_2) = 7$. 490 | \end{sol} 491 | \end{teacher} 492 | 493 | \begin{exe} 494 | A red ant and a black ant are at opposite vertices of a cube. Each randomly picks an edge to traverse and moves to the next vertex. They continue this until they meet. What is the expected number of edges each ant traverses? 495 | \end{exe} 496 | \begin{teacher} 497 | \begin{sol} 498 | \end{sol} 499 | \end{teacher} 500 | 501 | \begin{exe}[First occurrence of sequence] 502 | If you roll a die repeatedly, what is the expected number of rolls until you see consecutive sixes?\\ 503 | Similarly, if you toss a coin repeatedly, what is the expected number of tosses until you see 3 consecutive H? 504 | \end{exe} 505 | \begin{teacher} 506 | \begin{sol} 507 | \end{sol} 508 | \end{teacher} 509 | 510 | \begin{exe}[Coin bet] 511 | A fair coin is tossed repeatedly to generate a sequence of H or T. Player A bets HHH will occur first and player B bets THH will occur fist. What is the probability that A will win? 512 | \end{exe} 513 | \begin{teacher} 514 | \begin{sol} 515 | \end{sol} 516 | \end{teacher} 517 | 518 | \begin{exe}[Gambler's Ruin] 519 | A gambler start with i dollars and has probability p to win 1 dollar each time. He will stop if he has N(>i) dollars or loses all his money. What is the probability that he end up losing all money? 520 | \end{exe} 521 | \begin{teacher} 522 | \begin{sol} 523 | \end{sol} 524 | \end{teacher} 525 | 526 | \begin{exe}[Dice bet] 527 | Two players bet on the result of rolls of 2 dice. Player A bets for 2 consecutive 7's while player B bets for sum of 12. The rolls will continue until one of the player wins. What is the probability of A wins? 528 | \end{exe} 529 | \begin{teacher} 530 | \begin{sol} 531 | \end{sol} 532 | \end{teacher} 533 | 534 | \begin{exe}[Color Balls*] 535 | A box contains n balls with different colors. (Totally n colors) Each time, a pair of balls are drawn in order and the first ball is painted into the order of the second ball. What is the expected numbers of draws to make the box containing only one color? 536 | \end{exe} 537 | Source: Practical Guide 538 | \begin{teacher} 539 | \begin{sol} 540 | \end{sol} 541 | \end{teacher} 542 | 543 | \begin{exe}[Drunk Man] 544 | A drunk man is standing at 17 and has 0.5 probability to move left or right. He will stop once he get to 0 or 100. What is the expected number of steps before he stop? 545 | \end{exe} 546 | \begin{teacher} 547 | \begin{sol} 548 | \end{sol} 549 | \end{teacher} 550 | 551 | \begin{exe}[Ticket Line] 552 | There is a line of 2n people waiting to buy a ticket of 1 dollar. N people has 1 dollar and the other n people only has a 2 dollar bill. The ticket seller has no change at hand and start to sell the ticket in order of the line. What is the probability that the seller can sell all her ticket without changing any positions? 553 | \end{exe} 554 | \begin{teacher} 555 | \begin{sol} 556 | \end{sol} 557 | \end{teacher} 558 | 559 | \begin{exe}[Dice Option] 560 | You can roll a dice for at most 3 times. After each roll, you can decide whether to accept the number or roll again. The final payoff is the number you decide to accept. What is the fair price for this game? 561 | \end{exe} 562 | \begin{teacher} 563 | \begin{sol} 564 | \end{sol} 565 | \end{teacher} 566 | 567 | \begin{exe}[World Series] 568 | Team A and team B will play a series of 7 games to fight for the champion. The team who gets the 4-th win will become the champion and no more games will play. You have 100 dollar and try to bet for the champion, i.e. you will get 200 if you are right and 0 otherwise. No dealers have such bets but there are bets for individual game results. You can bet n dollar for the result of game 1 and get 2n dollar if you are correct and 0 otherwise. How is your betting strategy on each game to get the payoff the betting for the final champion? 569 | \end{exe} 570 | \begin{teacher} 571 | \begin{sol} 572 | \end{sol} 573 | \end{teacher} 574 | 575 | \begin{exe}[Roll until 6] 576 | You will roll a dice repeatedly. Each time you roll a number other than 6, you are paid by the number rolled and allowed to roll again. But if you roll a 6, all the money is forfeited and you are not allowed to roll again. You can stop anytime you want. What is your strategy and what is the fair price for this game? 577 | \end{exe} 578 | \begin{teacher} 579 | \begin{sol} 580 | \end{sol} 581 | \end{teacher} 582 | 583 | \begin{exe}[Red and black*] 584 | A deck of 10 cards, consisting of 5 red and 5 black, is shuffled randomly and will be drawn in order. Each time a red card is reviewed, you are paid 1 dollar and if a black card is reviewed, you pay and lose 1 dollar. (It means after all cards are drawn, you will end up with 0 dollar.) Your option is to review one more card or stop at this point. What is your strategy and what is the fair price for this game? 585 | \end{exe} 586 | \begin{teacher} 587 | \begin{sol} 588 | \end{sol} 589 | \end{teacher} 590 | 591 | 592 | 593 | 594 | 595 | \section{Brownian Motion*} 596 | \begin{exe} 597 | What is the definition of Brownian motions? Please enumerate some properties of Brownian Motion 598 | \end{exe} 599 | \begin{teacher} 600 | \begin{sol} 601 | \end{sol} 602 | \end{teacher} 603 | 604 | \begin{exe} 605 | Denote $B_t$ to be a Brownian Motion. What is the probability that $B_1>0$ and $B_2<0$? 606 | \end{exe} 607 | \begin{teacher} 608 | \begin{sol} 609 | The answer is $\frac{1}{8}$. (Try to identify the area of event $B_1>0$ and $B_2-B_10$, $\exists N_0$ s.t. $\forall N>N_0$, $|a_N-0|<\epsilon$. 18 | \item $\exists \epsilon_0 >0$, $\forall N$, we can find $N_0>N$ s.t. $|a_{N_0} - 0| \geq \epsilon$. 19 | \item $\forall \epsilon >0$, $\exists \delta >0$ s.t. $\forall |x-x_0|<\delta$, $|f(x) - 0|<\epsilon$. 20 | \item $\exists \epsilon_0 >0$, $\forall \delta >0$, we can find $|x'-x_0|<\delta$ s.t. $|f(x') - 0| \geq \epsilon$. 21 | \end{itemize} 22 | \end{sol} 23 | \end{teacher} 24 | 25 | \begin{exe} 26 | What is the L'Hospital Rule? 27 | \end{exe} 28 | \begin{teacher} 29 | \begin{sol} 30 | \end{sol} 31 | \end{teacher} 32 | 33 | \begin{exe} 34 | What is: $\sqrt{2}^{\sqrt{2}^{\sqrt{2}^{\cdots}}}$ 35 | \end{exe} 36 | \begin{teacher} 37 | \begin{sol} 38 | \end{sol} 39 | \end{teacher} 40 | 41 | \begin{exe} 42 | Which positive integer a makes $\sqrt{a+\sqrt{a+\sqrt{a+\cdots}}}$ an integer? 43 | \end{exe} 44 | \begin{teacher} 45 | \begin{sol} 46 | \end{sol} 47 | \end{teacher} 48 | 49 | \begin{exe} 50 | Does $\sum\limits_{n=1}^\infty \pi^{\sqrt{n}}$ exist? 51 | \end{exe} 52 | \begin{teacher} 53 | \begin{sol} 54 | \end{sol} 55 | \end{teacher} 56 | 57 | 58 | 59 | \begin{exe} 60 | How do you understand derivatives and integrations? What is the geometric intuition of these concept? What is the relation of these two concepts? 61 | \end{exe} 62 | \begin{teacher} 63 | \begin{sol} 64 | \end{sol} 65 | \end{teacher} 66 | 67 | \begin{exe} 68 | What is the derivatives of the following functions: 69 | $x^n$, $e^x$, $\ln{x}$, $\sin{x}$, $\cos{x}$, $\tanh{x}$ 70 | \end{exe} 71 | \begin{teacher} 72 | \begin{sol} 73 | \end{sol} 74 | \end{teacher} 75 | 76 | \begin{exe} 77 | What is the product rule, quotient rule, chain rule of derivatives? 78 | \end{exe} 79 | \begin{teacher} 80 | \begin{sol} 81 | \end{sol} 82 | \end{teacher} 83 | 84 | \begin{exe} 85 | What is the general form of Taylor expansion? What is the Taylor expansion for the following functions: 86 | $e^x$, $\log{x}$, $\sin{x}$, $\cos{x}$. 87 | \end{exe} 88 | \begin{teacher} 89 | \begin{sol} 90 | \end{sol} 91 | \end{teacher} 92 | 93 | \begin{exe} 94 | What is integration by substitution? What is integral by parts? 95 | \end{exe} 96 | \begin{teacher} 97 | \begin{sol} 98 | Integration by substitution:\\ 99 | $\int f(g(x)) g'(x) dx = \int f(u) du$, where $u=g(x)$.\\ 100 | Integration by parts:\\ 101 | $\int f(x) dg(x) = f(x) g(x) - \int g(x) df(x)$ 102 | \end{sol} 103 | \end{teacher} 104 | 105 | \begin{exe} 106 | Which is bigger: $e^\pi$ or $\pi^e$ 107 | \end{exe} 108 | \begin{teacher} 109 | \begin{sol} 110 | \end{sol} 111 | \end{teacher} 112 | 113 | \begin{exe} 114 | What is $\int_0^{\infty} e^{-x^2/2} dx$? 115 | \end{exe} 116 | \begin{teacher} 117 | \begin{sol} 118 | \end{sol} 119 | \end{teacher} 120 | 121 | \begin{exe} 122 | If $X\sim N(0,1)$, what is $E(X|X>0)$? 123 | \end{exe} 124 | \begin{teacher} 125 | \begin{sol} 126 | \end{sol} 127 | \end{teacher} 128 | 129 | \begin{exe} 130 | Assume the snow started to fall some time before time 0 at constant speed. A plow start at time 0 from position 0 and it will remove constant volume per hour. For example, assume the current height of snow is H, width is W, the plow remove V for 1 hour. Then in the next dt period, the snow will become $H+hdt$, where $h$ is the speed of the snow and the plow will move $\frac{V}{HW}$ ahead. At time 1, the plow is observed to be in position 2 and at time 2, it is in position 3. What is the time the snow start to fall? 131 | \end{exe} 132 | \begin{teacher} 133 | \begin{sol} 134 | \end{sol} 135 | \end{teacher} 136 | 137 | \section{Ordinary Differential Equation (ODE)} 138 | \begin{exe}[Separable] 139 | Solve the ODE: $y'+6xe^{x^2}cos^2y =0$. 140 | \end{exe} 141 | \begin{teacher} 142 | \begin{sol} 143 | \end{sol} 144 | \end{teacher} 145 | 146 | \begin{exe}[First-Order Linear] 147 | Solve the ODE: $y'+\frac{y}{x}=\frac{1}{x^2}$ 148 | \end{exe} 149 | \begin{teacher} 150 | \begin{sol} 151 | \end{sol} 152 | \end{teacher} 153 | 154 | 155 | \begin{exe}[Homogeneous] 156 | Solve the ODE: $ay''+by'+cy=0$ 157 | \end{exe} 158 | \begin{teacher} 159 | \begin{sol} 160 | \end{sol} 161 | \end{teacher} 162 | 163 | 164 | \begin{exe}[Non-Homogeneous] 165 | Solve the ODE: $ay''+by'+cy=x$ 166 | \end{exe} 167 | \begin{teacher} 168 | \begin{sol} 169 | \end{sol} 170 | \end{teacher} 171 | 172 | \section{Matrix Decomposition and Eigenvalues} 173 | \begin{exe}[Determinant] 174 | For an n by n matrix $A$, what is the definition of its determinant? What is the relation of determinants of $A$ with the eigenvalues of $A$? How to decide if $A$ is invertible given the determinant of $A$? Can you give some properties of the determinant? 175 | \end{exe} 176 | \begin{teacher} 177 | \begin{sol} 178 | \end{sol} 179 | \end{teacher} 180 | 181 | \begin{exe}[Eigenvalue] 182 | What is the definition of eigenvalues and eigenvectors? In practice, how you will calculate these? 183 | \end{exe} 184 | \begin{teacher} 185 | \begin{sol} 186 | \end{sol} 187 | \end{teacher} 188 | 189 | \begin{exe}[Positive Definite] 190 | What is the definition of positive definite/semi-definite? For a positive definite/semi-definite matrix, what is the property of its eigenvalues and its upper left submatrix? Upper left $k$-submatrix of n by n $A$ is k by k matrix $A_k=(a_{i,j})\ \forall i,j\leq k$ 191 | \end{exe} 192 | \begin{teacher} 193 | \begin{sol} 194 | \end{sol} 195 | \end{teacher} 196 | 197 | \begin{exe}[Diagonalize] 198 | Suppose an n by n matrix $A$ has n different eigenvalues. Find an orthogonal matrix $Q$ and diagonal matrix $D$ s.t. $A=QDQ^{-1}$.\\ 199 | (What is the intuition and application of this decomposition) 200 | \end{exe} 201 | \begin{teacher} 202 | \begin{sol} 203 | \end{sol} 204 | \end{teacher} 205 | 206 | \begin{exe}[QR Decomposition] 207 | For a non-singular matrix A, find a orthogonal matrix Q and upper triangular matrix R with positive diagonal s.t. $A=QR$.\\ 208 | (What is the intuition and application of this decomposition) 209 | \end{exe} 210 | \begin{teacher} 211 | \begin{sol} 212 | There are several methods to find the decomposition. (More details found in WIKI.) I will introduce Gram-Schmidt process here. 213 | 214 | Let's denote $A=(a_1, a_2, \cdots, a_n)$ as a basis of $n$-dim vector space. Define a function of inner product $=\sum_{i=1}^n v_iw_i$ and the projection $proj_u(a) = \frac{}{}u$. 215 | 216 | Then a set of orthoganal basis $(u_1, u_2, \cdots, u_n)$ can be generated by: 217 | \begin{align*} 218 | u_1&=a_1,\\ 219 | u_2&=a_2-proj_{u_1}(a_2),\\ 220 | &\cdots\\ 221 | u_n&=a_n-\sum_{i=1}^{n-1}proj_{u_i}(a_n) 222 | \end{align*} 223 | Finally, the orthogonal normal basis $(e_1, e_2, \cdots, e_n)$ is normalized by $e_i = \frac{u_i}{|u_i|}$. 224 | 225 | If you understand what a projection mean, you can convince yourself the basis $(u_1, u_2, \cdots, u_n)$ are orthogonal. But sometimes you may be request to prove it rigorously. So we will do the prove here by induction. The base case for 1-d is trivial. Suppose we already have shown $(u_1,\cdots,u_{k-1})$ is orthogonal, we need to show that $=0 \quad \forall i&=\\ 228 | &= - c_i \quad \text{(By induction assumption)}\\ 229 | &= - \quad \text{($c_i$ is the coefficient of $proj_{u_i}(a_k)$)}\\ 230 | &=0 231 | \end{align*} 232 | Notice that the projection function can be rewrite in the new basis as $\frac{}{}u=$ and $u_i = $. So the construction process can be written as: 233 | \begin{align*} 234 | a_1&=e_1,\\ 235 | a_2&=e_1+e_2\\ 236 | &\cdots\\ 237 | a_n&=\sum_{i=1}^{n}e_i 238 | \end{align*} 239 | So we can write down the matrix $Q=(e_1, \cdots, e_n)$ and $R_{i,j} = $ for $i\leq j$. 240 | 241 | A direct application is to trianglize the equation $Ax=b$ by $Rx=Q^Tb$. As $R$ is upper triangle matrix, solving this equation is much faster then solve a general $Ax=b$. This equation is widely seen and one common seen scenario in financial world is when you do multi-variable linear regression, you need to solve the coefficient by least square error. 242 | \end{sol} 243 | \end{teacher} 244 | 245 | \begin{exe}[LU Decomposition] 246 | For a n by n non-singular matrix A, find a lower triangle matrix $L$ and upper triangle matrix $U$, s.t. $A=LU$.\\ 247 | (What is the intuition and application of this decomposition) 248 | \end{exe} 249 | \begin{teacher} 250 | \begin{sol} 251 | \end{sol} 252 | \end{teacher} 253 | 254 | \begin{exe}[Singular Value Decomposition*] 255 | For an arbitrary m by n matrix A, find m by n matrix $U$, n by n diagonal matrix $D$ and n by n orthogonal matrix $V$, s.t. $A=UDV$.\\ 256 | (What is the intuition and application of this decomposition) 257 | \end{exe} 258 | \begin{teacher} 259 | \begin{sol} 260 | \end{sol} 261 | \end{teacher} 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | % \begin{exe} 300 | 301 | % \end{exe} 302 | % \begin{teacher} 303 | % \begin{sol} 304 | % \end{sol} 305 | % \end{teacher} -------------------------------------------------------------------------------- /content/3-finance.tex: -------------------------------------------------------------------------------- 1 | \chapter{Finance Fundamental} 2 | \section{Time Value of Money} 3 | \section{Bonds and Equity} 4 | \begin{exe} 5 | \end{exe} 6 | \begin{teacher} 7 | \begin{sol} 8 | \end{sol} 9 | \end{teacher} 10 | 11 | \begin{exe} 12 | \end{exe} 13 | \begin{teacher} 14 | \begin{sol} 15 | \end{sol} 16 | \end{teacher} 17 | \begin{exe} 18 | \end{exe} 19 | \begin{teacher} 20 | \begin{sol} 21 | \end{sol} 22 | \end{teacher} 23 | \begin{exe} 24 | \end{exe} 25 | \begin{teacher} 26 | \begin{sol} 27 | \end{sol} 28 | \end{teacher} 29 | \begin{exe} 30 | \end{exe} 31 | \begin{teacher} 32 | \begin{sol} 33 | \end{sol} 34 | \end{teacher} 35 | \begin{exe} 36 | \end{exe} 37 | \begin{teacher} 38 | \begin{sol} 39 | \end{sol} 40 | \end{teacher} 41 | \begin{exe} 42 | \end{exe} 43 | \begin{teacher} 44 | \begin{sol} 45 | \end{sol} 46 | \end{teacher} 47 | 48 | \section{Derivatives} 49 | -------------------------------------------------------------------------------- /content/4-algorithms.tex: -------------------------------------------------------------------------------- 1 | \chapter{Basic Algorithms} -------------------------------------------------------------------------------- /content/5-brain_teasers.tex: -------------------------------------------------------------------------------- 1 | \chapter{Brain Teasers} 2 | 3 | \begin{exe}[Chess tournament] 4 | A chess tournament has $2^n$ players with skills $1>2>\cdots>2^n$. It is organized as a 5 | knockout tournament, so that after each round only the winner proceeds to the next 6 | round. Except for the final, opponents in each round are drawn at random. Let's also 7 | assume that when two players meet in a game, the player with better skills always wins. 8 | What's the probability that players 1 and 2 will meet in the final? 9 | \end{exe} 10 | \begin{teacher} 11 | Source: Practical Guide 12 | \begin{sol} 13 | \end{sol} 14 | \end{teacher} 15 | 16 | \begin{exe}[100th digit] 17 | What is the 100-th digit of $(1+\sqrt{2})^{3000}$? Equivalently, what is the unit digit of $(1+\sqrt{2})^{3000}*10^{100}$?\\ 18 | Hint: $(1+\sqrt{2})^2 + (1-\sqrt{2})^2=6$ 19 | \end{exe} 20 | \begin{teacher} 21 | Source: Practical Guide 22 | \begin{sol} 23 | With the hint, we claim that $(1+\sqrt{2})^{3000} + (1-\sqrt{2})^{3000}$ is an integer. (Proofs needed?)\\ 24 | Also we have $|1-\sqrt{2}|<\frac{1}{2}$, hence $(1-\sqrt{2})^{3000}< \frac{1}{2^{3000}}<<10^{-100}$. So the 100th digit for $(1-\sqrt{2})^{3000}$ is 0, hence the 100th digit of $(1+\sqrt{2})^{3000}$ is 9. 25 | \end{sol} 26 | \end{teacher} 27 | 28 | \begin{exe} 29 | How many numbers $x$ are there less that $10^6$ that the cubic of $x$ ends with 11, i.e. $x^3\ mod\ 100=11$? 30 | \end{exe} 31 | \begin{teacher} 32 | Source: Practical Guide 33 | \begin{sol} 34 | \end{sol} 35 | \end{teacher} 36 | 37 | \begin{exe} 38 | Given two bottles of liquid of volume $V$. One is water and other is pure alcohol. You have a spoon of volume $U$, pour water into alcohol then the mixed liquid back to the water. You can assume the bottles are large enough so that no liquid will leak, both time you transfer $U$ volume full without left. The questions here is, which is higher, the percentage of water in alcohol bottle, or the percentage of alcohol in water bottle. 39 | \end{exe} 40 | \begin{teacher} 41 | \begin{sol} 42 | \end{sol} 43 | \end{teacher} 44 | 45 | \begin{exe} 46 | There are two bells. One rings 4 times per minute while the other rings 5 time per minute. You here them ring at the same time. How long you need to wait until they ring at the same time again? 47 | \end{exe} 48 | \begin{teacher} 49 | \begin{sol} 50 | \end{sol} 51 | \end{teacher} 52 | 53 | \begin{exe} 54 | What is the sum of integers from 1 to 100? 55 | \end{exe} 56 | \begin{teacher} 57 | \begin{sol} 58 | \end{sol} 59 | \end{teacher} 60 | 61 | \begin{exe} 62 | A clock face is break into three parts. The numbers in each part has the same sum. How the faces is broken? 63 | \end{exe} 64 | \begin{teacher} 65 | \begin{sol} 66 | \end{sol} 67 | \end{teacher} 68 | 69 | \begin{exe} 70 | Given 12 marbles and a weight. The weight have two sides and only can tell which side is heavier or both side equal. 1 marble is fake and has different weight (may be heavier or lighter). How can you tell which marble is fake by using the weight only 3 times? 71 | \end{exe} 72 | \begin{teacher} 73 | \begin{sol} 74 | \end{sol} 75 | \end{teacher} 76 | 77 | \begin{exe} 78 | On Cartesian plane, a circle is tangent to the x-axis and y-axis. A point on the circle has coordinate $(5, 10)$. What is the radius of the circle? 79 | \end{exe} 80 | \begin{teacher} 81 | \begin{sol} 82 | \end{sol} 83 | \end{teacher} 84 | 85 | \begin{exe} 86 | On a cubic room, a bug is sitting in one corner. What is the shortest way to move to the extreme opposite corner? 87 | \end{exe} 88 | \begin{teacher} 89 | \begin{sol} 90 | \end{sol} 91 | \end{teacher} 92 | 93 | \begin{exe} 94 | On a 10 by 10 by 10 cube, the outer surface is painted. How many cubes are painted at least 1 face? 95 | \end{exe} 96 | \begin{teacher} 97 | \begin{sol} 98 | \end{sol} 99 | \end{teacher} 100 | 101 | \begin{exe} 102 | You have 10 tanks, each equipped with 1000L gasoline. A tank will consume 1L gasoline per mile. Each tank cannot carry more than 1000L, but you are allowed to transfer gasoline from 1 tank to the other in the middle way. For example, after going 100 miles, you can transfer 100L from tank A to tank B, so tank A has 800 and tank B has 1000. What is the strategy to reach the most distance from start and how many miles can you reach? 103 | \end{exe} 104 | \begin{teacher} 105 | \begin{sol} 106 | \end{sol} 107 | \end{teacher} 108 | 109 | \begin{exe} 110 | What is the angle between the hour and minute hands of a clock at the time of 6.15? 111 | \end{exe} 112 | \begin{teacher} 113 | \begin{sol} 114 | \end{sol} 115 | \end{teacher} 116 | 117 | \begin{exe} 118 | What time is it that after 3:00, the hour hand and minute hand coincide the first time? 119 | \end{exe} 120 | \begin{teacher} 121 | \begin{sol} 122 | \end{sol} 123 | \end{teacher} 124 | 125 | \begin{exe} 126 | In a room, there are 100 bulbs and 100 players, both labeled a different numbers from 1 to 100. Player i will change the state of the bulbs with numbers which is a multiple of i. Changing the state means switch on if the bulb is off and switch off if the bulb is on. For example, player 10 will change the state of 10, 20, ... 100. After all the players have done their operations, which bulbs are on? 127 | \end{exe} 128 | \begin{teacher} 129 | \begin{sol} 130 | \end{sol} 131 | \end{teacher} 132 | 133 | \begin{exe} 134 | 135 | \end{exe} 136 | \begin{teacher} 137 | \begin{sol} 138 | \end{sol} 139 | \end{teacher} 140 | 141 | \begin{exe} 142 | 143 | \end{exe} 144 | \begin{teacher} 145 | \begin{sol} 146 | \end{sol} 147 | \end{teacher} 148 | 149 | \begin{exe} 150 | 151 | \end{exe} 152 | \begin{teacher} 153 | \begin{sol} 154 | \end{sol} 155 | \end{teacher} 156 | 157 | \begin{exe} 158 | 159 | \end{exe} 160 | \begin{teacher} 161 | \begin{sol} 162 | \end{sol} 163 | \end{teacher} 164 | 165 | \begin{exe} 166 | 167 | \end{exe} 168 | \begin{teacher} 169 | \begin{sol} 170 | \end{sol} 171 | \end{teacher} 172 | 173 | \begin{exe} 174 | 175 | \end{exe} 176 | \begin{teacher} 177 | \begin{sol} 178 | \end{sol} 179 | \end{teacher} 180 | 181 | \begin{exe} 182 | 183 | \end{exe} 184 | \begin{teacher} 185 | \begin{sol} 186 | \end{sol} 187 | \end{teacher} 188 | 189 | \begin{exe} 190 | 191 | \end{exe} 192 | \begin{teacher} 193 | \begin{sol} 194 | \end{sol} 195 | \end{teacher} 196 | 197 | \begin{exe} 198 | 199 | \end{exe} 200 | \begin{teacher} 201 | \begin{sol} 202 | \end{sol} 203 | \end{teacher} 204 | 205 | \begin{exe} 206 | 207 | \end{exe} 208 | \begin{teacher} 209 | \begin{sol} 210 | \end{sol} 211 | \end{teacher} 212 | 213 | \begin{exe} 214 | 215 | \end{exe} 216 | \begin{teacher} 217 | \begin{sol} 218 | \end{sol} 219 | \end{teacher} 220 | 221 | \begin{exe} 222 | 223 | \end{exe} 224 | \begin{teacher} 225 | \begin{sol} 226 | \end{sol} 227 | \end{teacher} 228 | 229 | \begin{exe} 230 | 231 | \end{exe} 232 | \begin{teacher} 233 | \begin{sol} 234 | \end{sol} 235 | \end{teacher} 236 | 237 | \begin{exe} 238 | 239 | \end{exe} 240 | \begin{teacher} 241 | \begin{sol} 242 | \end{sol} 243 | \end{teacher} 244 | 245 | \begin{exe} 246 | 247 | \end{exe} 248 | \begin{teacher} 249 | \begin{sol} 250 | \end{sol} 251 | \end{teacher} 252 | 253 | \begin{exe} 254 | 255 | \end{exe} 256 | \begin{teacher} 257 | \begin{sol} 258 | \end{sol} 259 | \end{teacher} 260 | 261 | \begin{exe} 262 | 263 | \end{exe} 264 | \begin{teacher} 265 | \begin{sol} 266 | \end{sol} 267 | \end{teacher} 268 | 269 | \begin{exe} 270 | 271 | \end{exe} 272 | \begin{teacher} 273 | \begin{sol} 274 | \end{sol} 275 | \end{teacher} 276 | 277 | \begin{exe} 278 | 279 | \end{exe} 280 | \begin{teacher} 281 | \begin{sol} 282 | \end{sol} 283 | \end{teacher} 284 | 285 | \begin{exe} 286 | 287 | \end{exe} 288 | \begin{teacher} 289 | \begin{sol} 290 | \end{sol} 291 | \end{teacher} 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | % \begin{exe} 306 | 307 | % \end{exe} 308 | % \begin{teacher} 309 | % \begin{sol} 310 | % \end{sol} 311 | % \end{teacher} 312 | -------------------------------------------------------------------------------- /content/6-behaviour.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyhu4023/Quant-Interview-Question-Bank/30e948e01bd8bb7800acf5562068ceeec56f829f/content/6-behaviour.tex -------------------------------------------------------------------------------- /preamble/Book template.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{book} 2 | \usepackage{comment} 3 | \usepackage{amsthm} 4 | \usepackage{amsmath} 5 | %%%%%%%%%%%%%%%%%%%%%%%% Exercise solution environment %%%%%%%%%%%%%%%%%%% 6 | \newtheorem{exe}{}[chapter] 7 | \newenvironment{sol}{\begin{proof}[Solution:]}{\end{proof}} 8 | \includecomment{teacher} 9 | 10 | \usepackage[width=4.375in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry} 11 | \usepackage[pdftex]{graphicx} 12 | \usepackage{amsmath} 13 | \usepackage{amssymb} 14 | \usepackage{tipa} 15 | %\usepackage{txfonts} 16 | \usepackage{textcomp} 17 | %\usepackage{amsthm} 18 | %\usepackage{array} 19 | %\usepackage{xy} 20 | \usepackage{fancyhdr} 21 | 22 | \pagestyle{fancy} 23 | \renewcommand{\chaptermark}[1]{\markboth{#1}{}} 24 | \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} 25 | \fancyhf{} 26 | \fancyhead[LE,RO]{\bfseries\thepage} 27 | \fancyhead[LO]{\bfseries\rightmark} 28 | \fancyhead[RE]{\bfseries\leftmark} 29 | \renewcommand{\headrulewidth}{0.5pt} 30 | \renewcommand{\footrulewidth}{0pt} 31 | \addtolength{\headheight}{0.5pt} 32 | \setlength{\footskip}{0in} 33 | \renewcommand{\footruleskip}{0pt} 34 | \fancypagestyle{plain}{% 35 | \fancyhead{} 36 | \renewcommand{\headrulewidth}{0pt} 37 | } 38 | % 39 | %\parindent 0in 40 | \parskip 0.05in 41 | % 42 | 43 | 44 | % Book's title and subtitle 45 | \title{ 46 | \Huge \textbf{Practice Makes Quants} % \footnote{This is a footnote.} 47 | \\ 48 | \small Must solve problems to a qualified quant %\footnote{This is yet another footnote.} 49 | } 50 | % Author 51 | \author{\textsc{Andy Hu}} %\thanks{\url{www.example.com}}} 52 | 53 | \begin{document} 54 | \frontmatter 55 | \maketitle 56 | 57 | \newpage 58 | \subsection*{\center \normalsize Copyright \copyright 2009 by Suresh Emre} 59 | \subsection*{\center \normalsize All rights reserved.} 60 | \subsection*{\center \normalsize ISBN \dots} 61 | \subsection*{\center \normalsize \dots Publications} 62 | % 63 | \tableofcontents 64 | % 65 | \mainmatter 66 | % 67 | 68 | \include{probability} 69 | 70 | \include{stochastic_process} 71 | 72 | \include{calculus} 73 | 74 | \include{linear_algebra} 75 | 76 | \include{brain_teaser} 77 | 78 | \include{finance} 79 | 80 | \include{algorithm} 81 | 82 | 83 | \backmatter 84 | 85 | \end{document} 86 | -------------------------------------------------------------------------------- /preamble/exe_sol_env.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%% Exercise and solution environment %%%%%%%%%%%%%%%%%%% 2 | \usepackage{comment} 3 | \usepackage{amsthm} 4 | \newtheorem{exe}{}[chapter] 5 | \newenvironment{sol}{\begin{proof}[Solution:]}{\end{proof}} 6 | \includecomment{teacher} % To comment out solution in problem only version. --------------------------------------------------------------------------------