Page 363 (Exercise 11): The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \({Y}_{n}\) on the nth day of the year. Finn observes that the differences \({X}_{n} = {Y}_{n+1} − {Y}_{n}\) appear to be independent random variables with a common distribution having mean μ = 0 and variance \(\sigma^2\) = 1/4. If Y1 = 100, estimate the probability that Y365 is
Answer:
Given \(\mu=0\) and \(\sigma^2=\frac { 1 }{ 4 }\)
\(\sigma=\sqrt{\frac{1}{4}}=0.5\)
\({ Y }_{ 365 }-{ Y }_{ 1 }={ X }_{ 1 }+{ X }_{ 2 }+,...,+{ X }_{ 364 }\)
a.)
\({ P(Y }_{ 365 }\ge 100)=1-P({ Y }_{ 365 }-{ Y }_{ 1 }\ge 0)\)
\(=1-P(\frac { { Y }_{ 365 }-{ Y }_{ 1 } }{ \sigma \sqrt { 365-1 } } \ge \frac { 100-100 }{ 0.5\sqrt { 364 } } )\)
\(Z = \frac { 100-100 }{ 0.5\sqrt { 364 } }=\frac { 0}{ 0.5\sqrt { 364 } } = 0\). By referring to the Z table or using the pnorm function in R.
1 - pnorm(0)
## [1] 0.5
So, the probability that \({Y}_{365}\) is greater than or equal to 100 is 0.5.
b.)
\({ P(Y }_{ 365 }\ge 110)=1-P({ Y }_{ 365 }-{ Y }_{ 1 }\ge 10)\)
\(=1-P(\frac { { Y }_{ 365 }-{ Y }_{ 1 } }{ \sigma \sqrt { 365-1 } } \ge \frac { 110-100 }{ 0.5\sqrt { 364 } } )\)
\(Z = \frac { 110-100 }{ 0.5\sqrt { 364 } }=\frac { 10}{ 0.5\sqrt { 364 } } = 1.048285\). By referring to the Z table or using the pnorm function in R.
1 - pnorm(10/(0.5*(sqrt(364))))
## [1] 0.1472537
So, the probability that \({Y}_{365}\) is greater than or equal to 110 is 0.1473.
c.)
\({ P(Y }_{ 365 }\ge 120)=1-P({ Y }_{ 365 }-{ Y }_{ 1 }\ge 20)\)
\(=1-P(\frac { { Y }_{ 365 }-{ Y }_{ 1 } }{ \sigma \sqrt { 365-1 } } \ge \frac { 120-100 }{ 0.5\sqrt { 364 } } )\)
\(Z = \frac { 120-100 }{ 0.5\sqrt { 364 } }=\frac { 20}{ 0.5\sqrt { 364 } } = 2.09657\). By referring to the Z table or using the pnorm function in R.
1 - pnorm(20/(0.5*(sqrt(364))))
## [1] 0.01801584
So, the probability that \({Y}_{365}\) is greater than or equal to 120 is 0.01801.
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Answer:
The Binomial distribution:
\(P(x)=\begin{pmatrix} n \\ x \end{pmatrix}{ p }^{ x }{ (1-p) }^{ n-x }\)
The moment generating function for Binomial distribution:
\({ M }_{ x }(t)=E({ e }^{ tx })\)
\(=\sum _{ x=0 }^{ n }{ { e }^{ tx } } p(x)\)
\(=\sum_{ x=0 }^{ n } { { e }^{ tx } } \begin{pmatrix} n \\ x \end{pmatrix}{ p }^{ x }{ (1-p) }^{ n-x }\)
\(=\sum _{ x=0 }^{ n }{ { { (p }e^{ t } })^{ x } } \frac { n! }{ x!(n-x)! } { q }^{ n-x }\)
\(={ { { (p }e^{ t } })^{ 0 } } \frac { n! }{ 0!(n-0)! } { q }^{ n-0 }+{ { { (p }e^{ t } })^{ n } } \frac { n! }{ n!(n-n)! } { q }^{ n-n }\)
\(={ q }^{ n }+{ { { (p }e^{ t } })^{ n } }\)
\(={ (q }+{ { { p }e^{ t } })^{ n } }\)
If we differentiate the moment generating function with respect t, then we get the expected value
\(\frac { d{ M }_{ X }(t) }{ dt }=n{ (q+p{ e }^{ t }) }^{ n-1 }p{ e }^{ t }\)
\(=np{ e }^{ t }{ (q+p{ e }^{ t }) }^{ n-1 }\)
Evaluating at t=0 and we know q+p=1, this gives the expected value
\(E(x)=np{ (q+p) }^{ n-1 }\)
\(=np\)
To find the second moment, we use the product rule
\(\frac { { d }^{ 2 }{ M }_{ X }(t) }{ d{ t }^{ 2 } }=np{ e }^{ t }[(n-1)({ q+p{ e }^{ t }) }^{ n-2 }p{ e }^{ t }]+({ q+p{ e }^{ t }) }^{ n-1 }[np{ e }^{ t }]\)
\(=np{ e }^{ t }({ q+p{ e }^{ t }) }^{ n-2 }[(n-1)p{ e }^{ t }+({ q+p{ e }^{ t }) }]\)
\(=np{ e }^{ t }({ q+p{ e }^{ t }) }^{ n-2 }[{ q+np{ e }^{ t }) }]\)
Evaluating at t=0 and we know q+p=1, this gives
\(E({x}^2)=np(q+p)^{n-2}(q+np)\)
\(=np(q+np)\)
So, the variance is
\(V(x)=E({x}^2)-[E(x)]^2\)
\(=np(q+np)-{n}^2{p}^2\)
\(=npq+{n}^2{p}^2-{n}^2{p}^2\)
\(=npq\)
Calculate the expected value and variance of the exponential distribution using the moment generating function.
Answer:
The Exponential distribution:
\({ f }_{ X }(x)=\lambda { e }^{ -\lambda x }\quad if\quad x\epsilon (0,\infty );\quad otherwise\quad { f }_{ X }(x)=0\)
The moment generating function for Exponential distribution:
\({ M }_{ x }(t)=E({ e }^{ tx })\)
\(=\int _{ 0 }^{ \infty }{ { e }^{ tx }\lambda { e }^{ -\lambda x } } dx\)
\(=\lambda \int _{ 0 }^{ \infty }{ { e }^{ (t-\lambda )x } } dx\)
\(=\lambda \left( \frac { { e }^{ -(\lambda -t)x } }{ -(\lambda -t) } \right) \begin{matrix} \infty \\ 0 \end{matrix}\)
\(=\lambda \left[ \frac { -{ e }^{ -\infty } }{ \lambda -t } +\frac { { e }^{ 0 } }{ \lambda -t } \right]\)
\(=\frac { \lambda }{ \lambda -t }\)
If we differentiate the moment generating function with respect t, then we get
\(\frac { d{ M }_{ X }(t) }{ dt }=\frac { d }{ dt } \left( \frac { \lambda }{ \lambda -t } \right)\)
\(=\lambda \frac { d }{ dt } { (\lambda -t) }^{ -1 }\)
\(=-\lambda { (\lambda -t) }^{ -2 }(-1)\)
\(=\frac { \lambda }{ { (\lambda -t })^{ 2 } }\)
Evaluating at t=0, this gives the expected value
\(E(x)=\frac { \lambda }{ \lambda ^{ 2 } }\)
\(=\frac { 1 }{ \lambda }\)
To find the second moment, we use the product rule
\(\frac { { d }^{ 2 }{ M }_{ X }(t) }{ d{ t }^{ 2 } }=(\lambda )[(-2){ (\lambda -t) }^{ -3 }(-1)]+{ (\lambda -t) }^{ -2 }[0]\)
\(=\frac { 2\lambda }{ { (\lambda -t) }^{ 3 } }\)
Evaluating at t=0, this gives
\(E({x}^2)=\frac { 2\lambda }{ { \lambda }^{ 3 } }\)
\(=\frac{2}{ { \lambda }^{ 2 } }\)
So, the variance is
\(V(x)=E({x}^2)-[E(x)]^2\)
\(=\frac{2}{ { \lambda }^{ 2 } } - [\frac { 1 }{ \lambda }]^2\)
\(=\frac { 1 }{ \lambda ^{ 2 }}\)