Probability Puzzles
Mar 16, 2024
The following are a collection of interview-esque questions I see in the wild and think are valuable for practice on the fundamentals for data science & quant roles. The solutions are moderately verbose on purpose to include many talking points for discussion.
I have a totally fair 7-sided die. I roll the die 523 times. What’s the expected number of times that the sequence 3-2-5-7-4 will show up?
Firstly, we note that each roll of the dice is independent and uniform. So we can compute the probability of this singular event happening as:
Secondly, we note that in 523 rows, the sequence can only start in 519 positions because the length of itself is 5.
We denote the event that sequence starts at position as
We have because sequence either starts at position or does not
For clarity, let’s also denote the event as the number of occurences of the sequence. Then, the expected value of occurences is
Finally, it is worth to also note that the ’s are in fact not independent. For example, if then we know that and so on.