[1] 0.9990234
[1] 0.9990234
# Dekking et al Exercise 4.7b
# Probability that the batch contains no defective lamps
dbinom(0, 1000, 0.001)
[1] 0.3676954
[1] 0.3680635
[1] 0.08020934
[1] 0.08020934
Digging deeper
2024-10-09
Suppose \(X\sim Bin\left(n,p\right)\). Let \(n\), \(p\), and \(k\) be given.
dbinom(k, n, p)
to find \(\mathbb{P}\left(X=k\right)\).pbinom(k, n, p, lower.tail = TRUE)
to find \(\mathbb{P}\left(X\leq k\right)\).nsim
observations from \(X\), we use rbinom(nsim, n, p)
.[1] 0.08020934
Below you will find a function which can be used to plot what the binomial distribution looks like.
Definition 1 (Wasserman (2004, p. 22) Definition 2.9) \(X\) is discrete if it takes countably many values \(\{x_1 , x_2 , \ldots\}\). We define the probability function or probability mass function for \(X\) by \(f_X (x) = \mathbb{P}\left(X = x\right)\).
Definition 2 (Support) Let \(X\) be a random variable with probability mass function \(f_X\). The support of \(X\) is \[\mathsf{supp}\left(X\right)=\{x\in\mathbb{R}: f_X(x)> 0\}\]
Countable here means either finite or could be place in a one-to-one correspondence with the set of integers.
Not all functions could be probability mass functions. They have to satisfy
The cdf of \(X\) could be obtained as \[F_X(x)=\sum_{x_i\leq x} f_X(x_i)\]
Wasserman (2004, p. 21) Theorem 2.7: If the cdfs of two random variables \(X\) and \(Y\) are equal, then \(\mathbb{P}\left(X\in A\right)=\mathbb{P}\left(Y\in A\right)\).
If the cdfs of two random variables \(X\) and \(Y\) are equal, then \(X\) and \(Y\) are said to have identical distributions or equal in distribution.
Observe that it is not that the random variables \(X\) and \(Y\) are equal. Refer to Wasserman p. 25.
Not all functions could be cdfs. Refer to Wasserman (2004, p. 21) Theorem 2.8.
What are the connections between the probability mass function and the cdf?