Statistics 1

In-Class Exercise 7

Yu-You Liou

Shih Chien University

2026-09-16

Data for Questions 1 and 2

A bookstore records the number of textbooks bought per customer.

x <- c(0, 1, 2, 3, 4)
p <- c(0.18, 0.34, 0.23, 0.15, 0.10)

Question 1

Is It a Probability Distribution?

Check the two requirements of a discrete probability distribution in R.

  1. Every probability lies between 0 and 1.
  2. The probabilities sum to 1, using sum().

Report whether p is a valid probability distribution.

Question 2

Mean, Variance, and Standard Deviation

For the distribution above, compute in R:

\mu=\sum x\cdot P(x),\qquad \sigma^2=\sum x^2\cdot P(x)-\mu^2,\qquad \sigma=\sqrt{\sigma^2}

Round each answer to two decimal places with round(), and interpret \mu in one sentence.

Question 3

Expectation

A charity sells 1,000 raffle tickets at NT$100 each. There is one first prize of NT$30,000 and two second prizes of NT$10,000.

  1. Write the probability distribution of the gain from buying one ticket.
  2. Compute the expected gain in R.
  3. Should a buyer expect to make money? Explain in one sentence.