Theprobability distributionof a discrete random variableXis a list of each possible value ofXtogether with the probability thatXtakes that value in one trial of the experiment.
The probabilities (Probability Mass Function) in the probability distribution of a random variable X must satisfy the following two conditions:
Each probability P(x) must be between 0 and 1: 0≤P(x)≤1 .
The sum of all the probabilities is 1 : ΣP(x)=1.
EXAMPLE 1. A fair coin is tossed twice. Let X be the number of heads that are observed.
Construct the probability distribution of X .
Find the probability that at least one head is observed. P(X≥1)
[ Solution ]
library(Rstat)
# 0. Sample Space
S <- tosscoin2(2); S
# 1. Define X
# 1-1. define function to count the number of Heads
countH <- function(x) sum(x=="H")
# 1-2. Define X
X <- apply(S, 1, countH)
# 2. Prob. Distribution Table
y <- table(X) / nrow(S)
# 3. plot table
barplot(y)
> # 0. Sample Space
> S <- tosscoin2(2); S
## X1 X2
## 1 H H
## 2 T H
## 3 H T
## 4 T T
>
> # 1. Define X
> # 1-1. define function to count the number of Heads
> countH <- function(x) sum(x=="H")
>
> # 1-2. Define X
> X <- apply(S, 1, countH); X
## [1] 2 1 1 0
>
> # 2. Prob. Distribution Table
> y <- table(X) / nrow(S); y
## X
## 0 1 2
## 0.25 0.50 0.25
>
> # 3. plot table
> barplot(y)
P(X≥1)=0.5+0.25=0.75
EXAMPLE 2. A pair of fair dice is rolled. Let X denote the sum of the number of dots on the top faces.
Construct the probability distribution of X .
Find P(X≥9) .
Find the probability that X takes an even value.
[ Solution ]
library(Rstat)
# probability distribution of X
rolldie.sum(2)
EXAMPLE 4. A service organization in a large town organizes a raffle each month. One thousand raffle tickets are sold for $1 each. Each has an equal chance of winning. First prize is $300, second prize is $200, and third prize is $100. Let X denote the net gain from the purchase of one ticket.
Construct the probability distribution of X .
Find the probability of winning any money in the purchase of one ticket.
Find the expected value of X , and interpret its meaning.
EXAMPLE 5. A life insurance company will sell a $200,000 one-year term life insurance policy to an individual in a particular risk group for a premium of $195. Find the expected value to the company of a single policy if a person in this risk group has a 99.97% chance of surviving one year.