---
title: "Visualizing probability distributions"
output:
  pdf_document: default
---

# Uniform distribution

Here is the probability mass function for a $\mathrm{Unif}(\{1,\ldots, 20\})$ random variable.

```{r}
barplot(replicate(20,1/20), names.arg = 1:20)
```
\newpage

# Binomial distribution

Here is the probability mass function for a $\mathrm{Bin}(10,1/2)$ random variable.

```{r}
barplot(dbinom(0:10, 10, 1/2), names.arg = 0:10)
```

Here is the probability mass function for a $\mathrm{Bin}(10,1/3)$ random variable.

```{r}
barplot(dbinom(0:10, 10, 1/3), names.arg = 0:10)
```

# Poisson distribution

Here is the probability mass function for a $\mathrm{Pois}(5)$ random variable.
Well, not the whole probability function, just the first 21 values.

```{r}
barplot(dpois(0:20, 5), names.arg = 0:20)
```

Here is the probability mass function for a $\mathrm{Pois}(10)$ random variable.
Well, not the whole probability function, just the first 101 values.

```{r}
barplot(dpois(0:100, 10), names.arg = 0:100)
```
