Posts by Tag

probability

Rolling 6 dice

less than 1 minute read

What is the probability the sum of 6 dice rolls is a multiple of 6?

Uniform on unit sphere

less than 1 minute read

If we draw uniformly form the unit sphere, and call its coordinates $(X,Y,Z)$, what is the variance of $X$?

Product of uniforms

less than 1 minute read

If $U_1, U_2 \overset{iid}{\sim} U[0,1]$, compute $Pr(U_1U_2 \le .5)$?

Two 6-sided die

less than 1 minute read

Let $X,Y$ be the outcomes of rolling two iid six-sided dies. Compute $\mathrm{Pr}(X+Y < XY)$.

Ordering uniforms

1 minute read

Suppose you are going to be shown three iid uniform rv, $U_i \sim U[0,1]$. Your task is to after seeing $U_1$, assign it lowest, middle, or highest. Then see...

Gambler’s ruin

less than 1 minute read

If $X_0=0$, and goes up or down one at each time step with equal probability, what is the probability $X$ hits $4$ before $X$ hits $-6$?

OLS coefficient bounds

less than 1 minute read

If $Y \sim X$ gives coefficient $\hat\beta$, what is the bound on the coefficient $\hat\theta$ from $X \sim Y$?

Probability of pizza

less than 1 minute read

I like to eat pizza on weekends. $\mathrm{Pr}(\text{eat pizza Sat}) = .3$ and $\mathrm{Pr}(\text{eat pizza Sun}) = .4$. What is the probability that I will e...

Gold and silver coins

1 minute read

Suppose we play a game where we flip a gold coin 500 times and a silver coin 500 times. We get 3 dollars per gold head, and 1 dollar per silver head, getting...

Back to Top ↑

linear regression

Bounding $R^2$

less than 1 minute read

We have $X, Y, Z$, where $Z \sim X$ has $R^2=.1$ and $Z \sim Y$ has $R^2=.2$. Bound the $R^2$ of $Z \sim X + Y$.

Hyperplanes

less than 1 minute read

You have points in 3D. How to find hyperplane that minimizes z-axis error? How to find hyperplane that minimizes orthogonal error? When would you prefer one ...

OLS when $X$ is too large.

1 minute read

What is OLS solution? How is it derived? How to compute with $n \gg p$, such that $X$ cannot be loaded in memory. Consider both when $p$ very small, but also...

OLS coefficient bounds

less than 1 minute read

If $Y \sim X$ gives coefficient $\hat\beta$, what is the bound on the coefficient $\hat\theta$ from $X \sim Y$?

Back to Top ↑

mental math

Drawing primes

less than 1 minute read

If I draw 4 numbers without replacement from the first 16 primes, what is the probability the sum is even?

2 player game

less than 1 minute read

Suppose two players play a game alternating turns. Player 1 goes first and has 50% chance of winning in that round. Player 2 goes second (if P1 doesn’t win) ...

Uniform on unit sphere

less than 1 minute read

If we draw uniformly form the unit sphere, and call its coordinates $(X,Y,Z)$, what is the variance of $X$?

Two 6-sided die

less than 1 minute read

Let $X,Y$ be the outcomes of rolling two iid six-sided dies. Compute $\mathrm{Pr}(X+Y < XY)$.

Sine integral

less than 1 minute read

Compute $\int_\pi^{2\pi} \sin x dx$.

Gambler’s ruin

less than 1 minute read

If $X_0=0$, and goes up or down one at each time step with equal probability, what is the probability $X$ hits $4$ before $X$ hits $-6$?

Back to Top ↑

optimization

Solving an underdetermined system

less than 1 minute read

A lot of firms will ask questions that are variations on the following: Suppose you have a $p$ -dimensional parameter $x$ you want to estimate, and you have...

How to regularize a neural network?

less than 1 minute read

Solution This is just a basic question to query if you have basic familiarity with neural networks. You should mention techniques such as dropout,...

Partitioning square roots

less than 1 minute read

How would you partition the square roots of the first 50 natural numbers $\sqrt 1, \sqrt 2, \dots, \sqrt{50}$ into two groups $A, B$, such that

Back to Top ↑

computational linear algebra

OLS when $X$ is too large.

1 minute read

What is OLS solution? How is it derived? How to compute with $n \gg p$, such that $X$ cannot be loaded in memory. Consider both when $p$ very small, but also...

Back to Top ↑

linear algebra

Solving an underdetermined system

less than 1 minute read

A lot of firms will ask questions that are variations on the following: Suppose you have a $p$ -dimensional parameter $x$ you want to estimate, and you have...

Finding colinear subset

2 minute read

This note explores the following quant interview question: if you are given a matrix $X \in \mathbb{R}^{n\times p}$ that you are told has colinearity, how wo...

Hyperplanes

less than 1 minute read

You have points in 3D. How to find hyperplane that minimizes z-axis error? How to find hyperplane that minimizes orthogonal error? When would you prefer one ...

Back to Top ↑

cross validation

CV tradeoff

2 minute read

In a quant interview last year, I was asked a question about the tradeoff in changing the number of folds $k$ in $k$-fold cross-validation. Obviously, as the...

Estimating the SE of Lasso CV coefficients

3 minute read

This note comes from the following question: You have data $X, Y$ and you run a lasso-penalized linear regression of $Y$ onto $X$, with the lasso parameter t...

Back to Top ↑

combinatorics

First color out

less than 1 minute read

We have a sack with 60 balls: 30 yellow, 20 red, and 10 white. If we draw randomly from the sack w/o replacement until all are drawn, what is the probability...

Counting passwords

less than 1 minute read

If I have an 8 digit passcode, taking values $0-9$, what is the probability that a randomly generated passcode has exactly $5$ occurrences of the same digit?...

Back to Top ↑

maximum likelihood

Ordering uniforms

1 minute read

Suppose you are going to be shown three iid uniform rv, $U_i \sim U[0,1]$. Your task is to after seeing $U_1$, assign it lowest, middle, or highest. Then see...

Gold and silver coins

1 minute read

Suppose we play a game where we flip a gold coin 500 times and a silver coin 500 times. We get 3 dollars per gold head, and 1 dollar per silver head, getting...

Back to Top ↑

calculus

Product of uniforms

less than 1 minute read

If $U_1, U_2 \overset{iid}{\sim} U[0,1]$, compute $Pr(U_1U_2 \le .5)$?

Sine integral

less than 1 minute read

Compute $\int_\pi^{2\pi} \sin x dx$.

Back to Top ↑

lasso

Estimating the SE of Lasso CV coefficients

3 minute read

This note comes from the following question: You have data $X, Y$ and you run a lasso-penalized linear regression of $Y$ onto $X$, with the lasso parameter t...

Back to Top ↑

bootstrap

Estimating the SE of Lasso CV coefficients

3 minute read

This note comes from the following question: You have data $X, Y$ and you run a lasso-penalized linear regression of $Y$ onto $X$, with the lasso parameter t...

Back to Top ↑

autoregression

Back to Top ↑

method of moments

Back to Top ↑

programming

Back to Top ↑

bit manipulation

Back to Top ↑

principle components analysis

Hyperplanes

less than 1 minute read

You have points in 3D. How to find hyperplane that minimizes z-axis error? How to find hyperplane that minimizes orthogonal error? When would you prefer one ...

Back to Top ↑

algorithms

Streaming mean and variance

less than 1 minute read

How to update mean and variance in a streaming way? By streaming we mean without retaining the individual samples, i.e. computing $\bar x_n$ from only $\bar...

Back to Top ↑

machine learning

How to regularize a neural network?

less than 1 minute read

Solution This is just a basic question to query if you have basic familiarity with neural networks. You should mention techniques such as dropout,...

Back to Top ↑

data structures

Find next in binary search tree

less than 1 minute read

For a binary search tree (BST), if you are at node $A$, how would you find the lexicographically next node after $A$? That is, how would you find the smalle...

Back to Top ↑

geometry

Bounding $R^2$

less than 1 minute read

We have $X, Y, Z$, where $Z \sim X$ has $R^2=.1$ and $Z \sim Y$ has $R^2=.2$. Bound the $R^2$ of $Z \sim X + Y$.

Back to Top ↑

PCA

Finding colinear subset

2 minute read

This note explores the following quant interview question: if you are given a matrix $X \in \mathbb{R}^{n\times p}$ that you are told has colinearity, how wo...

Back to Top ↑

extracts

Store-bought extracts for at-home drinks

2 minute read

I have recently been watching videos from Darcy O’Neil’s YouTube channel Art of Drink. In it, he goes through techniques for how to extract flavor compounds ...

Back to Top ↑