Problem set 1 :

1. The price of one share of stock in the Pilsdorff Beer Company is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean μ = 0 and variance σ^2 = 1/4. If Y1 = 100, estimate the probability that Y365 is

Ans) Given E(x)=μ=0, σ=1/2, n=364.

This is a Gaussian random walk of 364 steps. The probability distribution is given by N(100,nσ^2)=N(100,91),

We can use pnorm to calculate the probabilities.

(a) >= 100.

Ans)

1 - pnorm(100,100,91)
## [1] 0.5

There is a 50% chance the stock price will exceed it’s value of $100 or even more.

(b) >= 110.

Ans)

1 - pnorm(110,100,91)
## [1] 0.4562483

There is a 45.6% chance that the stock price will increase to $110 or even more .

(c) >= 120.

Ans)

1 - pnorm(120,100,91)
## [1] 0.4130212

There is a 41.3% chance that the stock price will increase to $120 or even more .

Problem set 2:

2. Calculate the expected value and variance of the binomial distribution using the moment generating function.

Sol) For binomial distribution, P(X=k)=(n k).pk.qn−k, where q=1−p.

Expected value and variance are two main moments of the distribution.

Expected value is also known as mean.

From the textbook: g(t) = ∑limit(j=0,n) (nj)(pe^t) ^j .q^n−j

Moment generating function : g(t)=(pet+q)n

For first moment: g′(t) =n(pet+q)n−1pet

For secong moment: g′′(t)=n(n−1)(pet+q)(pe^t)2+n(pet+q)npet

At t = 0 : g′(0) =n.(p+q)^n−1.p

g′′(0)=n(n−1)(p+q)n−1p2+n(p+q)np

=n(n−1)p2+np

Expected value is also known as mean :

μ=μ1=g′(0)=np {since p=q-1,p+q =1}

Variance :

σ2=μ2−μ1^2

=g′′(0)−[g′(0)]^2

σ2=n(n−1)p2+np−(np)2

σ2=np[(n−1)p+1−np]

σ2=np[(np−p)+1−np]

σ2=np[1−p]=npq

Finally we arrived at the known definitions for binomial distribution :- E(X)=np and V(X)=npq.

Problem set 3 :

3. Calculate the expected value and variance of the exponential distribution using the moment generating function.

Sol) For exponential distribution, f(x)=λe^−λx.

Moment generating function :g(t)=∫limit(∞,0)etx.λ.e−λxdx

g(t)=λe^(t−λ)x/t−λ|∞0

g(t)=λ/λ−t

For first moment : g′(t)=λ/(λ−t)2

At t=0 : g′(0)=λ/λ2

Expected value : μ = g′(0)=1/λ.

For second moment :g′′(t)=2λ/(λ−t)^3

At t=0 : g′′(0)=2λ/λ^3

Variance : σ2 =g′′(0)−g′(0)2

=2/λ2−1/λ2

=1/λ^2.

We arrived at the known definitions for Exponential distribution :- E(X)=1/λ and V(X)=1/λ2.