This is a graded in-class assignment. Show all your work in R Markdown files. Submit compiled Word files only.

Question 1

A boutique shop offers three types of jams; strawberry, cherry and orange. 40% of its customers buy strawberry jam, 30% cherry jam and the rest orange jam. What is the probability that the first 10 customers of the shop buys 3 strawberry, 3 cherry and 4 orange jams?

Solution: Multinomial distribution.

\[\binom{10}{3,3,4} 0.4^3 * 0.3^3 * 0.3^4 = 0.05878656 \]

factorial(10)/(factorial(3)*factorial(3)*factorial(4)) * 0.4^3 * 0.3^3 * 0.3^4
## [1] 0.05878656

Question 2

A basket contains 30 eggs; 25 of them intact, 5 broken. If I take 10 eggs randomly from the basket, what is the probability of getting 2 broken eggs?

Solution: Hypergeometric distribution.

\[\dfrac{\binom{5}{2}\binom{25}{8}}{\binom{30}{10}} = 0.3599848 \]

(choose(5,2)*choose(25,8))/choose(30,10)
## [1] 0.3599848

Question 3

A traveling salesman knocks on doors to sell brand new tupperware. At each attempt his probability of making a sale is 0.1. What is the probability that he made his first sale at the 10th attempt?

Solution: Geometric distribution.

\[ (0.9)^9 * (0.1) = 0.03874205\]

(0.9)^9 * (0.1)
## [1] 0.03874205

Question 4

Suppose there are 10 balls in an urn, numbered from 1 to 10. If I take three balls out of the urn without putting them back, what is the probability that they are in decreasing order (e.g. 10 - 5 - 1)?

Solution: Decreasing order is a special order. There is only one decreasing order in every permutation set. For instance

1 - 5 - 10 1 - 10 - 5 5 - 1 - 10 5 - 10 - 1 10 - 1 - 5 10 - 5 - 1

So, the answer is 1/6.

Question 5

A basketball player has the probability 0.7 to score at each shot. He will be rewarded with money equal to the square of the score he makes out of 10 shots (e.g. If he takes 7 successful shots he will be rewarded with \(7^2 = 49\)TL). But if he makes 6 or less score he will not be paid.

  1. What is the maximum amount of money he can get?
  2. What is the expected earnings of the player?
  3. What is the variance of his earnings?

Solution:

  1. 10 out of 10 means 10^2 = 100.
  2. \(g(X = x) = x^2\), \(f(g(X) = x^2) = f(X = x) = \binom{10}{x} 0.7^x * 0.3^(10-k)\), so \(E[g(x)] = \sum_{i=0}^10 g(x)f(x)\).

    \(g(X) = 0\) if \(x \le 6\). So \(49 * \binom{10}{7} 0.7^7 * 0.3^3 + 64 * \binom{10}{8} 0.7^8 * 0.3^2 + 81 * \binom{10}{9} 0.7^7 * 0.3 + 100 * (0.7)^10 = 40.64761\)

rewards <- (7:10)^2
probs <- dbinom(7:10,10,0.7)
expectation <- sum(rewards*probs)
  1. \(V(X) = E[X^2] - (E[X])^2\). We know that \(E[X] = 40.64761\), then \((E[X])^2 = 1652.228\). So \(E[X^2] = 2673.72\) and \(V(X) = 1021.492\).
ex2<-sum(rewards^2*probs)
ex2 - expectation^2
## [1] 1021.492