# Stat 230 sp15 assignment 2

STAT 230 Spring 2015

Assignment 2

IMPORTANT:

– There are no extensions so late assignments will not be accepted (see course outline)

– You should write this assignment in your own words. Note that Cheating and Plagiarism

(i.e., submitting part or all of someone elses words or work as your own) are considered

academic offenses and will be addressed accordingly.

– The questions are different depending on which section you are in. Please see below.

FORMATTING GUIDELINES:

(a) You can type your solutions

Font: 12pt Times New Roman, single spacing

Margins: 0.8 inches (2 cm) minimum margin on all sides.

File format: .doc, .docx or .pdf

(b) Or you can scan your solutions (hand written in pen or DARK pencil so they can be

read when scanned)

Notes:

(1) Answer the questions in order

(2) Show all your work.

(3) Please submit all the solutions using ONE file ( .doc, .docx or .pdf)

(4) .zip files are NOT acceptable!

SUBMISSION INSTRUCTIONS:

Submit the assignment online through Learn. Double check the submission by viewing

your submission and downloading the file to make sure it works. We suggest submitting

the assignment at least a day before the deadline to avoid any technical issues that may

arise. We will only consider the most recent file submitted. Hardcopies will not be

accepted.

Assignment 2 Marking Rubric – by section

Question Section 001 Section 002 Section 003

1 11 marks 11 marks 11 marks

2 14 marks n/a (DON’T DO) do #2 OR #8 (14 marks)

3 25 marks 25 marks 25 marks

4 15 marks 15 marks 15 marks

5 17 marks 17 marks 17 marks

6 18 marks 18 marks 18 marks

7 n/a (DON’T DO) 14 marks n/a (DON’T DO)

8 n/a (DON’T DO) n/a (DON’T DO) do #2 OR #8 (14 marks)

marks : /100 Final mark: /5

Good Luck!

1

1. Suppose you’re excavating a goldmine. You have a gold detecting machine that

beeps when you’re on top of a gold site. You know in general that the chance of

finding gold in a goldmine is 30%. Suppose the machine falsely beeps when there

isn’t any gold 10% of the time, and doesn’t beep when there actually is 30% of the

time.

(a) Suppose the machine doesn’t beep over a particular area. What is the probability

that there is gold there? [3]

(b) Suppose the machine beeps over a particular area. What is the probability

that there isn’t any gold there? [3]

(c) To be safe, you went over a particular area with the machine 5 times. Suppose

it beeped 4 times. Assuming beeps are independent (and conditionally

independent), what is the probability that there is gold there? [5] (Hint: see

solution of Question 4.4.2).

2. Section 001 must do this question. Section 002 do not do this question. Section 003

may choose this question OR question 8.

Suppose you’re a reporter and you’re working on a story exposing a multinational

company for corporate fraud. You’d like to interview as many employees as possible.

There are n people available to interview where the probability of selecting anyone

of these people follows a Uniform distribution and the probability of interviewing

no one is 0.

(a) Suppose the probability that you interview at most 10 people is 1/3. How

many people are there left to interview if you already interviewed 25 people?

[3]

(b) Suppose n = 35. What is the probability that you interview at least 12 people?

[3]

(c) Suppose n = 35. Given that you’ve interviewed more than 20 people, what is

the probability that you’ll manage to interview fewer than 30 people? [3]

(d) Calculate the expected value of the number of people you interview if n = 35.

Why does this value make logical sense? [5]

3. Question 3

(a) Automobiles arrive at a vehicle equipment inspection station according to a

Poisson process with rate λ= 10 per hour. Suppose that with probability 0.5

an arriving vehicle will have no equipment violations.

i. What is the probability that exactly ten arrive during the hour and all ten

have no violations? [3]

ii. For any fixed y ≥ 10, what is the probability that y arrive during the hour,

of which ten have no violations? [3]

iii. What is the probability that ten no-violation cars arrive during the next

hour? [Hint: Sum the probabilities in part (ii) from y= 10 to ∞] [3]

2

(b) A reservation service employs five information operators who receive requests

for information independently of one another, each according to a Poisson

process with rate 2 per minute.

i. What is the probability that during a given 1-min period, the first operator

receives no requests? [3]

ii. What is the probability that during a given 1-min period, exactly four of

the five operators receive no requests? [3]

iii. What are the expected value and variance of the number of operators who

receive no requests? [5]

(c) Captain Jack Sparrow is stranded on an island, awaiting rescue. Suppose that

the probability for a ship to come by in a particular day is 20%. Assuming

each day is independent of the next, for at least how many days should he wait

(including the day in which he gets rescued) so that the probability of him

being rescued within these days is 60% or more? [5]

4. Question 4

(a) A gas station is supplied with gasoline once a week. Its weekly volume of sales

in thousands of liters is a random variable with probability density function:

f(x) = (

5(1 − x)

4 0 < x < 1

0 otherwise

What must the capacity of the tank be so that the probability of the supplys

being exhausted in a given week is 0.01? [5]

(b) A continuous random variable X has probability density function:

f(x) = (

4x

3 0 < x < 1

0 , otherwise.

i. Find the mean and variance of X. [5]

ii. Find the mean and standard deviation of the random variable Y = 1−2X.

[5]

5. The CPU time X, measured in hours, that is used weekly by an accounting firm is

a continuous random variable having cumulative distribution function:

F(x) =

0 x < 0,

x(8 − x)/16 0 ≤ x < 4,

1 x ≥ 4.

(a) Find the probability density function of X. [3]

(b) Find the mean and variance of X.[5]

(c) Find the median of X (i.e., the value m satisfying P(X ≤ m) = P(X ≥ m).

[3]

(d) The CPU time costs the firm $300 per hour of usage plus a $40 connection fee

paid weekly. Find mean weekly cost, and the probability that the weekly cost

of CPU time exceeds $500. [6]

3

6. Question 6 ( Show your work and use graphs )

(a) Suppose that blood chloride concentration (mmol/L) has a normal distribution

with mean µ = 104 and standard deviation σ = 5 (information in the article

Mathematical Model of Chloride Concentration in Human Blood, J. of Med.

Engr. and Tech., 2006: 2530).

i. What is the probability that chloride concentration equals 105? Is at most

105? [3]

ii. What is the probability that chloride concentration differs from the mean

by more than 1 standard deviation? Does this probability depend on the

values of µ and σ ? [4]

iii. How would you characterize the most extreme 0.1% of chloride concentration

values? [3]

(b) The lifetime of a calculator manufactured by Intel Corporation has a normal

distribution with a mean of 50 months and a standard deviation of one year.

What should the warranty be to replace a malfunctioning calculator if the company

does not want to replace more than 1% of all manufactured calculators.

[4]

(c) A soft-drink machine can be regulated so that it discharges an average of µ

ml. per cup. If the ounces of fill are Normally distributed, with a standard

deviation of 0.4 oz., what value should µ be set at so that 6-oz. cups will

overflow only 2% of the time? [4]

4

7. Section 002 ONLY. Use R for the following questions. Do this instead of q 2.

(a) Suppose there are 15 multiple choice questions in a probability class midterm.

Each question has 5 possible answers, and only one of them is correct. If a

student attempts to answer every question at random, find the probability of

having

i. Exactly 4 correct answers. [2]

ii. At most 4 correct answers. [2]

(b) Cars cross a bridge at a uniform rate and the number of cars in non-overlapping

time intervals are independent. On average 12 cars pass the bridge each minute.

Find the probability that 17 or more cars pass the bridge in a one minute time

interval. [2]

(c) Consider the “pressure” data frame in R. There are two columns: temperature

and pressure.

To work with the data set “pressure” in R:

• Step (1)

Type pressure in R, and it is supposed to give you the data set. If it does,

skip to Step 4. If it doesn’t, probably you need to install some packages

and R will instruct you to their names. packages —– Install Package(s)—

Canada(ON)—- the name of the package

• Step(2): Type library(the name of the package you install)

• Step(3): Now type pressure again you should get the data

• Step(4)

To obtain a specific column in pressure, use:

x1 < − pressure$temperature

x2 < − pressure$pressure

• Step (5)

Before working with the data, add the last two digits of your student

number to each observation of the variable that you will work with.

For example, if my student number is (20117993) I will add the number

93 to each data point.

To do that in R, use

x1 < − x1+93

x2 < − x2+93.

i. Find the mean, median ,variance, and standard deviation of the temperature

variable. [2]

ii. Find the mean, median ,variance, and standard deviation of the pressure

variable. [2]

iii. Plot the probability histogram for the temperature and the pressure using

the par function to display them in a 2 1 layout on the graphics page.

Repeat once again using a 1 2 layout with different colors. For the layout,

use

par(mfrow=c(2,1))

par(mfrow=c(1,2))

Add a suitable title and labels to the graphs. [4]

5

8. Optional question for Section 003 ONLY – you may do this question instead of

question 2 if you want.

(a) Derive a recursive relationship for the probability function of a Binomial(n, p)

random variable. That is, find the relationship between f(x) and f(x − 1) for

all x ≥ 1. [4]

(b) Write a recursive function in R that calculates f(x) for a Binomial random

variable, for integer values of x between 0 and n. Your function should take

3 parameters: x, n, and p, and use the relationship you found in (a) to call

itself. Don’t forget a base case! Check that it works for a few values using the

dbinom function in R. Submit the code for your function and your test cases.

[4]

(c) Write a function in R that calculates F(x) for a Binomial random variable, for

any real value x. Your function should take the same 3 parameters, x, n, and

p. The implementation of the function is up to you. Check that it works for a

few vaues using the pbinom function in R. Submit the code for your function

and your test cases. [6]

6