They're basically the same, except pbinom gives the cumulative probabilities. You're less likely to make mistakes using dbinom.

```
# probabilities of x = 0-4 successes out of size = 4
size = 4
prob = 0.9
x <- 0:size
set.seed(123)
# probability density
d <- dbinom(x = x, size = size, prob = prob)
plot(x, d, main = "Probability of x successes")
```

```
# cumulative probability density
p <- pbinom(q = x, size = size, prob = prob)
plot(x, p, main = "Probability of x successes or less")
```

```
# inverse function
q <- qbinom(p = (0:100)/100, size = size, prob = prob)
plot(q, (0:100)/100, main = "Inverse cumulative density function")
```

```
# generate random numbers
r <- rbinom(n = 10000, size = size, prob = prob)
hist(r, main = "10000 Samples")
```

^{Created on 2020-11-17 by the reprex package (v0.3.0)}