Docsity

Cumulative Distribution Functions and Random Variables, Lecture notes of Mathematics

Toggle sidebar
bg1
Topic 7
Random Variables and Distribution
Functions
7.1 Introduction
statistics probability
universe of sample space - ⌦
information and probability - P
+ +
ask a question and define a random
collect data variable X
+ +
organize into the organize into the
empirical cumulative cumulative
distribution function distribution function
+ +
compute sample compute distributional
means and variances means and variances
Table I: Corresponding notions between statistics and probability. Examining
probabilities models and random variables will lead to strategies for the collection
of data and inference from these data.
From the universe of possible information, we ask
a question. To address this question, we might col-
lect quantitative data and organize it, for example,
using the empirical cumulative distribution func-
tion. With this information, we are able to com-
pute sample means, standard deviations, medians
and so on.
Similarly, even a fairly simple probability
model can have an enormous number of outcomes.
For example, flip a coin 332 times. Then the num-
ber of outcomes is more than a google (10100)–
a number at least 100 quintillion times the num-
ber of elementary particles in the known universe.
We may not be interested in an analysis that con-
siders separately every possible outcome but rather
some simpler concept like the number of heads or
the longest run of tails. To focus our attention on
the issues of interest, we take a given outcome and
compute a number. This function is called a ran-
dom variable.
Definition 7.1. Arandom variable is a real val-
ued function from the probability space.
X:⌦!R.
Generally speaking, we shall use capital letters near the end of the alphabet, e.g., X, Y, Z for random variables.
The range Sof a random variable is sometimes called the state space.
Exercise 7.2. Roll a die twice and consider the sample space ⌦={(i, j); i, j =1,2,3,4,5,6}and give some random
variables on ⌦.
Exercise 7.3. Flip a coin 10 times and consider the sample space ⌦, the set of 10-tuples of heads and tails, and give
some random variables on ⌦.
101
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Cumulative Distribution Functions and Random Variables and more Lecture notes Mathematics in PDF only on Docsity!

Topic 7

Random Variables and Distribution

Functions

7.1 Introduction

statistics probability

universe of sample space - ⌦

information and probability - P

ask a question and define a random

collect data variable X

organize into the organize into the

empirical cumulative cumulative

distribution function distribution function

compute sample compute distributional

means and variances means and variances

Table I: Corresponding notions between statistics and probability. Examining probabilities models and random variables will lead to strategies for the collection of data and inference from these data.

From the universe of possible information, we ask a question. To address this question, we might col- lect quantitative data and organize it, for example, using the empirical cumulative distribution func- tion. With this information, we are able to com- pute sample means, standard deviations, medians and so on. Similarly, even a fairly simple probability model can have an enormous number of outcomes. For example, flip a coin 332 times. Then the num- ber of outcomes is more than a google ( 10 100 ) – a number at least 100 quintillion times the num- ber of elementary particles in the known universe. We may not be interested in an analysis that con- siders separately every possible outcome but rather some simpler concept like the number of heads or the longest run of tails. To focus our attention on the issues of interest, we take a given outcome and compute a number. This function is called a ran- dom variable.

Definition 7.1. A random variable is a real val- ued function from the probability space. X : ⌦! R.

Generally speaking, we shall use capital letters near the end of the alphabet, e.g., X, Y, Z for random variables. The range S of a random variable is sometimes called the state space.

Exercise 7.2. Roll a die twice and consider the sample space ⌦ = {(i, j); i, j = 1, 2 , 3 , 4 , 5 , 6 } and give some random variables on ⌦.

Exercise 7.3. Flip a coin 10 times and consider the sample space ⌦, the set of 10-tuples of heads and tails, and give some random variables on ⌦.

We often create new random variables via composition of functions:

! 7! X(!) 7! f (X(!))

Thus, if X is a random variable, then so are

X 2 , exp ↵X,

p X 2 + 1, tan 2 X, bXc

and so on. The last of these, rounding down X to the nearest integer, is called the floor function.

Exercise 7.4. How would we use the floor function to round down a number x to n decimal places.

7.2 Distribution Functions

Having defined a random variable of interest, X, the question typically becomes, “What are the chances that X lands in some subset of values B?” For example,

B = {odd numbers}, B = {greater than 1}, or B = {between 2 and 7}.

We write {! 2 ⌦; X(!) 2 B} (7.1)

to indicate those outcomes! which have X(!), the value of the random variable, in the subset A. We shall often abbreviate (7.1) to the shorter statement {X 2 B}. Thus, for the example above, we may write the events

{X is an odd number}, {X is greater than 1} = {X > 1 }, {X is between 2 and 7} = { 2 < X < 7 }

to correspond to the three choices above for the subset B. Many of the properties of random variables are not concerned with the specific random variable X given above, but rather depends on the way X distributes its values. This leads to a definition in the context of random variables that we saw previously with quantitive data..

Definition 7.5. A (cumulative) distribution function of a random variable X is defined by

F (^) X (x) = P {! 2 ⌦; X(!)  x}.

Recall that with quantitative observations, we called the analogous notion the empirical cumulative distribution function. Using the abbreviated notation above, we shall typically write the less explicit expression

F (^) X (x) = P {X  x}

for the distribution function.

Exercise 7.6. Establish the following identities that relate a random variable the complement of an event and the union and intersection of events

  1. {X 2 B}c^ = {X 2 B c^ }
  2. For sets B 1 , B 2 ,.. ., [

i

{X 2 B (^) i } = {X 2

[

i

B} and

\

i

{X 2 B (^) i } = {X 2

\

i

B}.

  1. If B 1 ,... B (^) n form a partition of the sample space S, then C (^) i = {X 2 B (^) i }, i = 1,... , n form a partition of the probability space ⌦.

If we look at the graph of this cumulative distribution function, we see that it is constant in between the possible values for X and that the jump size at x is equal to P {X = x}. In this example, P {X = 5} = 4/ 36 , the size of the jump at x = 5. In addition,

F (^) X (5) F (^) X (2) = P { 2 < X  5 } = P {X = 3} + P {X = 4} + P {X = 5} =

X

2 <x 5

P {X = x}

We shall call a random variable discrete if it has a finite or countably infinite state space. Thus, we have in general that:

P {a < X  b} =

X

a<xb

P {X = x}.

Exercise 7.9. Let X be the number of heads on three independent flips of a biased coin that turns ups heads with probability p. Give the cumulative distribution function F (^) X for X.

Exercise 7.10. Let X be the number of spades in a collection of three cards. Give the cumulative distribution function for X. Use R to plot this function.

Exercise 7.11. Find the cumulative distribution function of Y = X 3 in terms of F (^) X , the distribution function for X.

7.3 Properties of the Distribution Function

A distribution function F (^) X has the property that it starts at 0, ends at 1 and does not decrease with increasing values of x.. This is the content of the next exercise.

Exercise 7.12. 1. lim (^) x!1 F (^) X (x) = 0.

  1. lim (^) x!1 F (^) X (x) = 1.
  2. F (^) X is nondecreasing.

! 1 !0.8 !0.6 !0.4 !0.2 0 0.2 0.4 0.6 0.8 1

! 1

!0.

!0.

!0.

!0.

0

1

x

0.0 0.5 1.

0.^ 0.^ 0.^ 0.^

x

probability

0.0 0.5 1.

0.^ 0.^ 0.^ 0.^

0.0 0.5 1.

0.^ 0.^ 0.^ 0.^

0.0 0.5 1.

0.^ 0.^ 0.^ 0.^

0.0 0.5 1.

0.^ 0.^ 0.^ 0.^

Figure 7.2: (top) Dartboard. (bottom) Cumula- tive distribution function for the dartboard ran- dom variable.

The cumulative distribution function F (^) X of a discrete random variable X is constant except for jumps. At the jump, F (^) X is right continuous,

lim x!x 0 + F (^) X (x) = F (^) X (x 0 ).

The next exercise ask that this be shown more generally.

Exercise 7.13. Prove the statement concerning the right continuity of the distribution function from the continuity property of a probability.

Definition 7.14. A continuous random variable has a cumulative distribu- tion function F (^) X that is differentiable.

So, distribution functions for continuous random variables increase smoothly. To show how this can occur, we will develop an example of a continuous random variable.

Example 7.15. Consider a dartboard having unit radius. Assume that the dart lands randomly uniformly on the dartboard. Let X be the distance from the center. For x 2 [0, 1],

F (^) X (x) = P {X  x} =

area inside circle of radius x area of circle

⇡x 2 ⇡ 1 2

= x 2.

Thus, we have the distribution function

F (^) X (x) =

0 if x  0 , x 2 if 0 < x  1 , 1 if x > 1.

The first line states that X cannot be negative. The third states that X is at most 1, and the middle lines describes how X distributes is values between 0 and 1. For example,

F X

indicates that with probability 1/4, the dart will land within 1/2 unit of the center of the dartboard.

Exercise 7.16. Find the probability that the dart lands between 1/3 unit and 2/3 unit from the center.

Exercise 7.17. Let the reward Y for through the dart be the inverse 1 /X of the distance from the center. Find the cumulative distribution function for Y.

Exercise 7.18. An exponential random variable X has cumulative distribution function

F (^) X (x) = P {X  x} =

0 if x  0 , 1 exp(x) if x > 0.

for some > 0. Show that F (^) X has the properties of a distribution function.

Its value at x can be computed in R using the command pexp(x,0.1) for = 1/ 10 and drawn using

curve(pexp(x,0.1),0,80)

0 20 40 60 80

x

pexp(x, 0.1)

Figure 7.3: Cumulative distribution function for an exponential random variable with = 1/ 10.

Exercise 7.19. The time until the next bus arrives is an exponential random variable with = 1/ 10 minutes. A person waits for a bus at the bus stop until the bus arrives, giving up when the wait reaches 20 minutes. Give the cumulative distribution function for T , the time that the person remains at the bus station and sketch a graph.

Even though the cumulative distribution function is defined for every random variable, we will often use other characterizations, namely, the mass function for discrete random variable and the density function for continuous random variables. Indeed, we typically will introduce a random variable via one of these two functions. In the next two sections we introduce these two concepts and develop some of their properties.

The mass function and the cumulative distribution function for the geometric random variable with parameter p = 1/ 3 can be found in R by writing

x<-c(0:10) f<-dgeom(x,1/3) F<-pgeom(x,1/3)

The initial d indicates density and p indicates the probability from the distribution function.

data.frame(x,f,F) x f F 1 0 0.333333333 0. 2 1 0.222222222 0. 3 2 0.148148148 0. 4 3 0.098765432 0. 5 4 0.065843621 0. 6 5 0.043895748 0. 7 6 0.029263832 0. 8 7 0.019509221 0. 9 8 0.013006147 0. 10 9 0.008670765 0. 11 10 0.005780510 0.

Note that the difference in values in the distribution function F (^) X (x) F (^) X (x 1), giving the height of the jump in F (^) X at x, is equal to the value of the mass function. For example,

F (^) X (3) F (^) X (2) = 0. 7037037 0 .5555556 = 0.148148148 = f (^) X (2).

Exercise 7.24. Check that the jumps in the cumulative distribution function for the geometric random variable above is equal to the values of the mass function.

Exercise 7.25. For the geometric random variable above, find P {X  3 }, P { 2 < X  5 }. P {X > 4 }.

We can simulate 100 geometric random variables with parameter p = 1/ 3 using the R command rgeom(100,1/3). (See Figure 7.4.) Histogram of x

x

Frequency

0 2 4 6 8 10 12

0

10

20

30

40

50

Histogram of x

x

Frequency

0 5 10 15 20

0

1000

2000

3000

4000

5000

Figure 7.4: Histogram of 100 and 10,000 simulated geometric random variables with p = 1/ 3. Note that the histogram looks much more like a geometric series for 10,000 simulations. We shall see later how this relates to the law of large numbers.

7.5 Density Functions

Definition 7.26. For X a random variable whose distribution function F (^) X has a derivative. The function f (^) X satisfying

F (^) X (x) =

Z (^) x

f (^) X (t) dt

is called the probability density function and X is called a continuous random variable.

By the fundamental theorem of calculus, the density function is the derivative of the distribution function.

f (^) X (x) = lim x! 0

F (^) X (x + x) F (^) X (x) x

= F (^) X^0 (x).

In other words, F (^) X (x + x) F (^) X (x) ⇡ f (^) X (x)x.

We can compute probabilities by evaluating definite integrals

P {a < X  b} = F (^) X (b) F (^) X (a) =

Z (^) b

a

f (^) X (t) dt.

Figure 7.5: The probability P {a < X  b} is the area under the density function, above the x axis between y = a and y = b.

The density function has two basic properties that mirror the properties of the mass function:

  • f (^) X (x) 0 for all x in the state space.

R 1

1 f^ X^ (x)^ dx^ = 1.

Return to the dart board example, letting X be the dis- tance from the center of a dartboard having unit radius. Then,

P {x < X  x + x} = F (^) X (x + x) F (^) X (x) ⇡ f (^) X (x)x = 2x

and X has density

f (^) X (x) =

0 if x < 0 , 2 x if 0  x  1 , 0 if x > 1.

Exercise 7.27. Let f (^) X be the density for a random variable X and pick a number x 0. Explain why P {X = x 0 } = 0.

Example 7.28. For the exponential distribution function (7.3), we have the density function

f (^) X (x) =

0 if x  0 , e x^ if x > 0.

Example 7.29. Density functions do not need to be bounded, for example, if we take

f (^) X (x) =

0 if x  0 , p^ c x if^0 < x <^1 , 0 if 1  x.

For continuous random variables,

f (^) X 1 ,X 2 (x 1 , x 2 )x 1 x 2 ⇡ P {x 1 < X 1  x 1 + x 1 , x 2 < X 2  x 2 + x 2 } = P {x 1 < X 1  x 1 + x 1 }P {x 2 < X 2  x 2 + x 2 } ⇡ f (^) X 1 (x 1 )x 1 f (^) X 2 (x 2 )x (^2) = f (^) X 1 (x 1 )f (^) X 2 (x 2 )x 1 x 2.

Thus, for independent continuous random variables, the joint probability density function

f (^) X 1 ,X 2 (x 1 , x 2 ) = f (^) X 1 (x 1 )f (^) X 2 (x 2 )

is the product of the marginal density functions.

Exercise 7.33. Generalize the notion of independent mass and density functions to more than two random variables.

Soon, we will be looking at n independent observations x 1 , x 2 ,... , x (^) n arising from an unknown density or mass function f. Thus, the joint density is f (x 1 )f (x 2 ) · · · f (x (^) n ). Generally speaking, the density function f will depend on the choice of a parameter value ✓. (For example, the unknown parameter in the density function for an exponential random variable that describes the waiting time for a bus.) Given the data arising from the n observations, the likelihood function arises by considering this joint density not as a function of x 1 ,... , x (^) n , but rather as a function of the parameter ✓. We shall learn how the study of the likelihood plays a major role in parameter estimation and in the testing of hypotheses.

7.7 Simulating Random Variables

One goal for these notes is to provide the tools needed to design inferential procedures based on sound principles of statistical science. Thus, one of the very important uses of statistical software is the ability to generate pseudo- data to simulate the actual data. This provides the opportunity to test and refine methods of analysis in advance of the need to use these methods on genuine data. This requires that we explore the properties of the data through simulation. For many of the frequently used families of random variables, R provides commands for their simulation. We shall examine these families and their properties in Topic 9, Examples of Mass Functions and Densities. For other circumstances, we will need to have methods for simulating sequence of independent random variables that possess a common distribution. We first consider the case of discrete random variables.

7.7.1 Discrete Random Variables and the sample Command

The sample command is used to create simple and stratified random samples. Thus, if we enter a sequence x, sample(x,40) chooses 40 entries from x in such a way that all choices of size 40 have the same probability. This uses the default R command of sampling without replacement. We can use this command to simulate discrete random variables. To do this, we need to give the state space in a vector x and a mass function f. The call for replace=TRUE indicates that we are sampling with replacement. Then to give a sample of n independent random variables having common mass function f, we use sample(x,n,replace=TRUE,prob=f).

Example 7.34. Let X be described by the mass function

x 1 2 3 4 f (^) X (x) 0.1 0.2 0.3 0.

Then to simulate 50 independent observations from this mass function:

x<-c(1,2,3,4) f<-c(0.1,0.2,0.3,0.4) sum(f)

[1] 1

data<-sample(x,50,replace=TRUE,prob=f) data [1] 1 4 4 4 4 4 3 3 4 3 3 2 3 3 3 4 4 3 3 2 4 1 3 3 4 2 3 3 3 1 2 4 3 2 3 4 4 4 4 2 4 1 [43] 2 3 4 4 1 4 3 4

Notice that 1 is the least represented value and 4 is the most represented. If the command prob=f is omitted, then sample will choose uniformly from the values in the vector x. Let’s check our simulation against the mass function that generated the data. (Notice the double equal sign, ==.) First, recount the observations that take on each possible value for x. We can make a table.

table(data) data 1 2 3 4 5 7 18 20

or use the counts to determine the simulated proportions.

counts<-rep(0,max(x)-min(x)+1) for (i in min(x):max(x)){counts[i]<-length(data[data==i])} simprob<-counts/(sum(counts)) data.frame(x,f,simprob) x f simprob 1 1 0.1 0. 2 2 0.2 0. 3 3 0.3 0. 4 4 0.4 0.

Exercise 7.35. Simulate the sums on each of 20 rolls of a pair of dice. Repeat this for 1000 rolls and compare the simulation with the appropriate mass function.

(^00) 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.

1

x

Figure 7.6: Illustrating the Probability Transform. First simulate uniform random variables u 1 , u 2 ,... , un on the interval [0, 1]. About 10% of the random numbers should be in the interval [0. 3 , 0 .4]. This corresponds to the 10% of the simulations on the interval [0. 28 , 0 .38] for a random variable with distribution function F (^) X shown. Similarly, about 10% of the random numbers should be in the interval [0. 7 , 0 .8] which corresponds to the 10% of the simulations on the interval [0. 96 , 1 .51] for a random variable with distribution function F (^) X , These values on the x-axis can be obtained from taking the inverse function of F (^) X , i.e., x (^) i = F (^) X 1 (u (^) i ).

u<-runif(100) x<-sqrt(u) xd<-seq(0,1,0.01) plot(sort(x),1:length(x)/length(x), type="s",xlim=c(0,1),ylim=c(0,1), xlab="x",ylab="probability") par(new=TRUE) plot(xd,xdˆ2,type="l",xlim=c(0,1),ylim=c(0,1),xlab="",ylab="",col="red")

Exercise 7.38. If U is uniform on [0, 1], then so is V = 1 U.

Sometimes, it is easier to simulate X using F (^) X 1 (V ).

Example 7.39. For an exponential random variable, set

u = F (^) X (x) = 1 exp(x), and thus x =

ln(1 u)

Consequently, we can simulate independent exponential random variables X 1 , X 2 ,... , X (^) n by simulating independent uniform random variables V 1 , V 2 ,... Vn and taking the transform

X (^) i =

ln V (^) i.

R accomplishes this directly through the rexp command.

7.8 Answers to Selected Exercises

7.2. The sum, the maximum, the minimum, the difference, the value on the first die, the product.

7.3. The roll with the first H, the number of T , the longest run of H, the number of T s after the first H.

7.4. b 10 n^ xc/ 10 n

7.6. A common way to show that two events A 1 and A 2 are equal is to pick an element! 2 A 1 and show that it is in A 2. This proves A 1 ⇢ A 2. Then pick an element! 2 A 2 and show that it is in A 1 , proving that A 2 ⇢ A 1. Taken together, we have that the events are equal, A 1 = A 2. Sometimes the logic needed in showing A 1 ⇢ A 2 consist not solely of implications, but rather of equivalent statements. (We can indicate this with the symbol ().) In this case we can combine the two parts of the argument. For this exercise, as the lines below show, this is a successful strategy. We follow an arbitrary outcome! 2 ⌦.

1.! 2 {X 2 B}c^ ()! 2 / {X 2 B} () X(!) 2 / B () X(!) 2 B c^ ()! 2 {X 2 B c^ }. Thus, {X 2 B}c^ = {X 2 B c^ }. 2.! 2

S

i {X^2 B^ i^ }^ ()^!^2 {X^2 B^ i^ }^ for some^ i^ ()^ X(!)^2 B^ i^ for some^ i^ ()^ X(!)^2

S

i B^ i^ () ! 2 {X 2

S

i B}. Thus,^

S

i {X^2 B^ i^ }^ =^ {X^2

S

i B}.^ The identity with intersection is similar with^ for all instead of for some.

  1. We must show that the union of the C (^) i is equal to the state space S and that each pair are mutually exclusive. For this

(a) Because B (^) i are a partition of ⌦,

S

i B^ i^ =^ ⌦, and [

i

C (^) i =

[

i

{X 2 B (^) i } = {X 2

[

i

B (^) i } = {X 2 ⌦} = S,

the state space.

(b) For i 6 = j, B (^) i \ B (^) j = ;, and C (^) i \ C (^) j = {X 2 B (^) i } \ {X 2 B (^) j } = {X 2 B (^) i \ B (^) j } = {X 2 ;} = ;.

7.7. Let’s check the three axioms. Each verification is based on the corresponding axiom for the probability P.

  1. For any subset B, P (^) X (B) = P {X 2 B} 0.
  2. For the sample space S, P (^) X (S) = P {X 2 S} = P (⌦) = 1.
  3. For mutually exclusive subsets B (^) i , i = 1, 2 , · · · , we have by the exercise above the mutually exclusive events {X 2 B (^) i }, i = 1, 2 , · · ·. Thus,

P X

[^1

i=

B (^) i

= P

X 2

[^1

i=

B (^) i

= P

[^1

i=

{X 2 B (^) i }

X^1

i=

P {X 2 B (^) i } =

X^1

i=

P (^) X (B (^) i ).

7.9. For three tosses of a biased coin, we have

x 0 1 2 3 P {X = x} (1 p) 3 3 p(1 p) 2 3 p 2 (1 p) p 3 Thus, the cumulative distribution function,

F (^) X (x) =

0 for x < 0 , (1 p) 3 for 0  x < 1 , (1 p) 3 + 3p(1 p) 2 = (1 p) 2 (1 + 2p) for 1  x < 2 , (1 p) 2 (1 + 2p) + 3p 2 (1 p) = 1 p 3 for 2  x < 3 , 1 for 3  x

7.10. From the example in the section Basics of Probability, we know that

x 0 1 2 3 P {X = x} 0.41353 0.43588 0.13765 0. To plot the distribution function, we use,

hearts<-c(0:3) f<-choose(13,hearts)*choose(39,3-hearts)/choose(52,3) (F<-cumsum(f)) [1] 0.4135294 0.8494118 0.9870588 1. plot(hearts,F,ylim=c(0,1),type="s")

0.0 0.5 1.0 1.5 2.0 2.5 3.

hearts

F

Thus, the cumulative distribution function,

F (^) X (x) =

0 for x < 0 ,

  1. 41353 for 0  x < 1 ,
  2. 84941 for 1  x < 2 ,
  3. 98706 for 2  x < 3 , 1 for 3  x

7.11. The cumulative distribution function for Y ,

F (^) Y (y) = P {Y  y} = P {X 3  y}

= P {X  3

p y} = F (^) X ( 3

p y).

7.12. To verify the three properties for the distri- bution function:

  1. Because F (^) X (x) = 0 for all x < 0 , lim (^) x!1 F (^) X (x) = 0.
  2. lim (^) x!1 exp(x) = 0. Thus, lim (^) x!1 F (^) X (x) = lim (^) x!1 1 exp(x) = 1.
  3. For x < 0 , F (^) X is constant, F (^) X (0) = 0. For x 0 , note that exp(x) is decreasing. Thus, F (^) X (x) = 1 exp(x) is increasing. Consequenlty, the distribution function F (^) X is non-decreasing.

7.19. The distribution function has the graph shown in Figure 7.8.

0 20 40 60 80

0 20 40 60 80

0 20 40 60 80

x

F

Figure 7.8: Cumulative distribution function for an exponential random variable with = 1/ 10 and a jump at x = 20.

The formula

F (^) T (x) = P {X  x} =

0 if x < 0 , 1 exp(x/10) if 0  x < 20 , 1 if 20  x.

7.22. For r 6 = 1, write the expressions for s (^) n and rs (^) n and subtract. Notice that most of the terms cancel.

s (^) n = c+ cr +cr 2 + · · · + cr n rs (^) n = cr +cr 2 + · · · + cr n^ +cr n+ (1 r)s (^) n = c cr n+1^ = c(1 r n+1^ )

Now divide by 1 r to obtain the formula.

7.23 The event {X > b} is the same as having the first b + 1 coin tosses turn up tails. Thus, the outcome is b + 1 independent events each with probability 1 p. Consequently, P {X > b} = (1 p) b+^.

7.25. P {X  3 } = F (^) X (3) =. 8024691 , P { 2 < X  5 } = F (^) X (5)F (^) X (2) = 0. 8683128 0 .5555556 = 0. 3127572 , and P {X > 4 } 1 F (^) X (4) = 1 0 .8024691 = 0. 1975309.

7.27. Let f (^) X be the density. Then

0  P {X = x 0 }  P {x 0 x < X  x + x} =

Z (^) x 0 +x

x 0 x

f (^) X (x) dx.

Now the integral goes to 0 as x! 0. So, we must have P {X = x 0 } = 0.

7.28. Because the density is non-negative on the interval [0, 1], F (^) X (x) = 0 if x < 0 and F (^) X (x) = 1 if x 1. For x between 0 and 1, (^) Z (^) x

0

p t

dt =

p t

x 0

p x.

Thus,

F (^) X (x) =

(^0) p if x  0 , x if 0 < x < 1 , 1 if 1  x.

7.31. The random variable Y has distribution function

F (^) Y (y) = P {Y  y} = P {aX + b  y} = P {aX  y b}.

For a > 0

F (^) Y (y) = P

X 

y b a

= F X

y b a

Now take a derivative and use the chain rule to find the density

f (^) Y (y) = F (^) Y^0 (y) = f (^) X

y b a

a

|a|

f (^) X

y b a

For a < 0

F (^) Y (y) = P

X

y b a

= 1 F X

y b a

Now the derivative

f (^) Y (y) = F (^) Y^0 (y) = f (^) X

y b a

a

|a|

f (^) X

y b a

7.32. The joint density (mass function) for X 1 , X 2 ,... , X (^) n

f (^) X 1 ,X 2 ,...,X (^) n (x 1 , x 2 ,... , x (^) n ) = f (^) X 1 (x 1 )f (^) X 2 (x 2 ) · · · f (^) X (^) n (x (^) n )

is the product of the marginal densities (mass functions).

7.35. Here is the R code.

x<-c(2:12) x

[1] 2 3 4 5 6 7 8 9 10 11 12

f<-c(1,2,3,4,5,6,5,4,3,2,1)/ sum(f) [1] 1 (twodice<-sample(x,20,replace=TRUE,prob=f)) [1] 9 7 3 9 3 6 9 5 5 5 5 10 10 12 9 8 6 8 11 8 twodice<-sample(x,1000,replace=TRUE,prob=f) counts<-rep(0,max(x)-min(x)+1) for (i in min(x):max(x)){counts[i]<-length(twodice[twodice==i])} freq=counts/(sum(counts)) data.frame(x,f,freq[min(x):max(x)]) x f freq.min.x..max.x.. 1 2 0.02777778 0. 2 3 0.05555556 0.