# [Probability] We have two options for serving ads within Newsfeed : 1 – out of every 25 stories, one will be an ad 2 – every story has a 4% chance of being an ad For each option, what is the expected number of ads shown in 100 news stories? If we go with option 2, what is the chance a user will be shown only a single ad in 100 stories? What about no ads at all? (Asked in Facebook Interview)

Data Science Interview QuestionsCategory: Data Science[Probability] We have two options for serving ads within Newsfeed : 1 – out of every 25 stories, one will be an ad 2 – every story has a 4% chance of being an ad For each option, what is the expected number of ads shown in 100 news stories? If we go with option 2, what is the chance a user will be shown only a single ad in 100 stories? What about no ads at all? (Asked in Facebook Interview)
1. Apply binomial distribution concepts to answer this
2. On glassdoor, one user has a correct answer:
1. Bin(100, 0.04,1)
Bin(100, 0.04, 0)

Bin(n,p,r) = Binomial distribution for n trials, p probability of being ad and r number of ads

3. Here’s the visualization: (Excel formula: BINOM.DIST(N,100,4%,FALSE) where N is the number of ads. Basics of binomial distribution is here: https://www.khanacademy.org/math/statistics-probability/random-variables-stats-library/binomial-random-variables/v/generalizing-k-scores-in-n-attempts