Exercise

# From rbinom to dbinom

To the right is currently code that

- Simulates the number of clicks/visitors (
`n_clicks`

) from 100 shown ads using the`rbinom`

function given that the underlying proportion of clicks is 10%. - Calculates the probability of getting 13 visitors (
`prob_13_visitors`

).

That is, in probability notation it's calculating P(`n_visitors`

= 13 | `proportion_clicks`

= 10%).

Instructions

**100 XP**

- First, try running this code.
- Then, rewrite this code so that it calculates
`prob_13_visitors`

using`dbinom`

instead.

*Remember*: `dbinom`

*directly* returns a probability and takes the following arguments: `dbinom(x = , size = , prob = )`

where `size`

and `prob`

are the same as for `rbinom`

, but `x`

is now the data you want to calculate the probability for.