# STAT2203/7203辅导、辅导R语言编程

- 首页 >> Database作业 (S2-2022): Assignment 02

Due: 16-September-2022 @16:59

1. [10 marks each]

A firm has five cement mixers for hire, the hire charge for each of which is $15.00 per

day. The overheads are $5.00 per mixer per day, whether or not they are hired. Suppose

the daily demand for cement mixers has a Poisson distribution with mean 4.

(a) What is the probability that the firm makes a (strictly positive) profit on any given

day?

(b) What is the expect profit for each day? You may want to use the R function dpois.

For all of the above, you must provide your mathematical derivations by hand. However,

to calculate your final answer, you can use R or (any other programming of your choice).

2. [5 marks each]

It has been suggested that income in the USA in 1997 has an exponential distribution

with mean $35,200. Assuming this distribution for income:

(a) What is the median (0.5-quantile) income?

(b) What is the probability that a person’s income is less than $10,000?

(c) What income would put a person in the top 1% of earners?

For all of the above, you must provide your mathematical derivations by hand. However,

to calculate your final answer, you can use R or (any other programming of your choice).

3. [10 marks each]

Suppose X ～ N (1, 4).

(a) Determine the pdf of Y = eX .

(b) Compute the mean and variance of Y .

4. [5 marks each]

A pair of random variables (X, Y ) has a joint probability distribution in which X ～

Exp(1) and the conditional probability density function of Y given {X = x} is

fY |X(y|x) =

{

e?(y+x), y ≥ ?x

0, else.

1

(a) Determine the marginal probability density function for Y .

(b) Using the fact that E[XY ] = E[XE[Y |X]], compute Cov(X, Y ).

5. [5 marks each]

The random variables X and Y have a joint probability density fX,Y given by

fX,Y (x, y) =

???c x y, 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,0 otherwise.

(a) Find the constant c.

(b) Are X and Y independent? Prove or disprove this.

(c) Calculate P(2X > Y ).

6. [20 marks]

A study is conducted examining the difference in texting speeds on a mobile phone

while sitting versus walking. The texting speeds both while sitting and while walking are

recorded in words per minute for sixty people. The person’s age and type of mobile phone

(‘Pear’ or ‘Robot’) used are also recorded. The data is present in the file TextSpeed.csv.

Assuming the data is normally distributed (you can check the q-q plot for yourself to see

that this assumption is not entirely unreasonable here), use R or (any other programming

of your choice) to construct a 90% confidence interval for mean texting speed while

sitting. Throughout this question (and others), define any notation you use.

100 marks in total

Note:

This assignment counts for 20% of the total mark for the course.

Although not mandatory, if you could type up your work, e.g., LaTex, it would be

greatly appreciated.

Show all your work and attach your code and all the plots (if there is a programming

question).

Combine your solutions, all the additional files such as your code and numerical

results, all in one single PDF file.

Please submit your single PDF file on Blackboard.

Due: 16-September-2022 @16:59

1. [10 marks each]

A firm has five cement mixers for hire, the hire charge for each of which is $15.00 per

day. The overheads are $5.00 per mixer per day, whether or not they are hired. Suppose

the daily demand for cement mixers has a Poisson distribution with mean 4.

(a) What is the probability that the firm makes a (strictly positive) profit on any given

day?

(b) What is the expect profit for each day? You may want to use the R function dpois.

For all of the above, you must provide your mathematical derivations by hand. However,

to calculate your final answer, you can use R or (any other programming of your choice).

2. [5 marks each]

It has been suggested that income in the USA in 1997 has an exponential distribution

with mean $35,200. Assuming this distribution for income:

(a) What is the median (0.5-quantile) income?

(b) What is the probability that a person’s income is less than $10,000?

(c) What income would put a person in the top 1% of earners?

For all of the above, you must provide your mathematical derivations by hand. However,

to calculate your final answer, you can use R or (any other programming of your choice).

3. [10 marks each]

Suppose X ～ N (1, 4).

(a) Determine the pdf of Y = eX .

(b) Compute the mean and variance of Y .

4. [5 marks each]

A pair of random variables (X, Y ) has a joint probability distribution in which X ～

Exp(1) and the conditional probability density function of Y given {X = x} is

fY |X(y|x) =

{

e?(y+x), y ≥ ?x

0, else.

1

(a) Determine the marginal probability density function for Y .

(b) Using the fact that E[XY ] = E[XE[Y |X]], compute Cov(X, Y ).

5. [5 marks each]

The random variables X and Y have a joint probability density fX,Y given by

fX,Y (x, y) =

???c x y, 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,0 otherwise.

(a) Find the constant c.

(b) Are X and Y independent? Prove or disprove this.

(c) Calculate P(2X > Y ).

6. [20 marks]

A study is conducted examining the difference in texting speeds on a mobile phone

while sitting versus walking. The texting speeds both while sitting and while walking are

recorded in words per minute for sixty people. The person’s age and type of mobile phone

(‘Pear’ or ‘Robot’) used are also recorded. The data is present in the file TextSpeed.csv.

Assuming the data is normally distributed (you can check the q-q plot for yourself to see

that this assumption is not entirely unreasonable here), use R or (any other programming

of your choice) to construct a 90% confidence interval for mean texting speed while

sitting. Throughout this question (and others), define any notation you use.

100 marks in total

Note:

This assignment counts for 20% of the total mark for the course.

Although not mandatory, if you could type up your work, e.g., LaTex, it would be

greatly appreciated.

Show all your work and attach your code and all the plots (if there is a programming

question).

Combine your solutions, all the additional files such as your code and numerical

results, all in one single PDF file.

Please submit your single PDF file on Blackboard.