Holooly Plus Logo

Question 7.3: An innovative winemaker experiments with new grapes and adds......

An innovative winemaker experiments with new grapes and adds a new wine to his stock. The percentage sold by the end of the season depends on the weather and various other factors. It can be modelled using the random variable X with the CDF as

F\left(x\right) =\left\{\begin{matrix} 0 \quad\quad\quad\quad if  x \lt 0 \\ 3x^{2} − 2x^{3}\quad\quad  if  0 \leq x \leq 1 \\ 1 \quad\quad\quad\quad if  x \gt 1. \end{matrix} \right.

(a) Plot the cumulative distribution function with R.
(b) Determine f (x).
(c) What is the probability of selling at least one-third of his wine, but not more than two thirds?
(d) Define the CDF in R and calculate the probability of c) again.
(e) What is the variance of X?

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

(a) There are several ways to plot the CDF. One possibility is to define the function and plot it with the curve command. Since the function has different definitions for the intervals [∞, 0), [0, 1], (1,∞], we need to take this into account. Remember that a logical statement in R corresponds to a number, i.e. TRUE = 1 and FALSE = 0; we can thus simply add the different pieces of the function and multiply them with a condition which specifies if X is contained in the interval or not (Fig. B.15):

cdf < −function(x){
(3 ∗ x ˆ2 − 2 ∗ xˆ3) ∗ (x <= 1&x >= 0) + 1 ∗ (x > 1) + 0 ∗ (x < 0)
}
curve(cdf,from=-0.5,to=1.5)

(b) The PDF is

\frac{d}{dx}F(x) =F^{\prime}(x) = f (x) =\left\{\begin{matrix} 6(x − x^{2})     if  0 \leq x \leq 1 \\ 0                     elsewhere.. \end{matrix} \right.

(c)

P\left(\frac{1}{3}\leq X\leq \frac{2}{3} \right) =\int_{\frac{1}{3} }^{\frac{2}{3} }{f\left(x\right)dx } =F\left(\frac{2}{3} \right)-F\left(\frac{1}{3} \right)

=\left[3\left(\frac{2}{3} \right)^{2}-2\left(\frac{2}{3} \right)^{3} \right] -\left[3\left(\frac{1}{3} \right)^{2}-2\left(\frac{1}{3} \right)^{3} \right]

= 0.48149.

(d) We have already defined the CDF in (a).We can now simply plug in the x-values of interest:

cdf(2/3)-cdf(1/3)

(e) The variance can be calculated as follows:

E\left(X\right) =\int_{0}^{1}{x6\left(x-x^{2}\right)dx } =6\cdot \int_{0}^{1}{\left(x^{2}-x^{3}\right)dx }

=6\left[\frac{1}{3}x^{3} -\frac{1}{4}x^{4} \right] ^{1}_{0} =6\cdot \left(\frac{1}{3} -\frac{1}{4} \right)=0.5

E\left(X^{2}\right) =\int_{0}^{1}{x^{2}6\left(x-x^{2}\right)dx } =6\cdot \int_{0}^{1}{\left(x^{3}-x^{4}\right)dx }

=6\left[\frac{1}{4}x^{4} -\frac{1}{5}x^{5} \right] ^{1}_{0} =6\cdot \left(\frac{1}{4} -\frac{1}{5} \right)=0.3

Var(X) = E(X²) − [E(X)]² = 0.3 − 0.5² = 0.05.

1

Related Answered Questions

Question: 7.7

Verified Answer:

(a) The joint PDF is: (b) The marginal distributio...