riables a V Random

advertisement
Stat 330 (Spring 2015): slide set 7
1
for the event
{ω|ω ∈ Ω and X(ω) = x}.
{X = x}
Notation: To avoid cumbersome notation, we write
That is, the set of possible values for X(ω) is {0, 1, 2, 3}
2
X(ω) is then an integer between 0 and 3 for every possible sequence of
throws of 3 darts.
X(ω) = k, if the outcome ω has k hits to the red area, and 3 − k hits to
the gray area.
More formally:
• Between 2 and 7 wrong bits (inclusive) received: {2 ≤ X ≤ 7}
• Exactly 2 wrong bits received: {X = 2}
• At least one wrong bit received: {X ≥ 1}
• No wrong bits received: {X = 0}
Examples of events and equivalent expressions using X.
That is, the possible values for X are {0, 1, 2, 3, 4, 5, 6, 7, 8}
3
Use random variable X to “count” the number of wrong bits received. X
assigns a value between 0 and 8 to each sequence in the sample space.
Example Suppose, 8 bits are sent through a communication channel. Each
bit has a certain probability to be received incorrectly. We are interested in
the number of bits that are received incorrectly.
on any throw.
We define X to be the function that assigns the number of times that the
red area is hit in a sequence of three throws.
1
9
Practice with notation
Stat 330 (Spring 2015): slide set 7
Also note that P (red) =
Imagine we throw three darts on this board one by one and we are interested
in the number of times the red area has been hit. This count is a random
variable!
Example: Very simple Dartboard
Random Variable A function X : Ω → R is called a random variable.
Dartboard (continued...)
Last update: January 16, 2015
Stat 330 (Spring 2015)
Slide set 7
Stat 330 (Spring 2015): slide set 7
Intuitive idea: If the value of a numerical variable depends on the outcome
of an experiment, we call the variable a random variable.
Random Variables
Stat 330 (Spring 2015): slide set 7
is defined as
(ii)
i pX (xi )
= 1 (the sum of all values is 1)
6
(i) 0 ≤ pX (x) ≤ 1 for all x ∈ {x1, x2, x3, . . .} (all values must be between
0 and 1)
pX is the pmf of X, if and only if
Properties of PMF:
3.
2.
1.
z
pZ (z)
y
pY (y)
x
pX (x)
0
0.22
-1
0.1
-3
0.1
1
0.18
0
0.45
-1
0.45
3
0.24
1.5
0.25
0
0.15
5
0.17
3
-0.05
5
0.25
7
0.18
4.5
0.25
7
0.05
7
Experiment: Which of the following functions is a valid probability mass
function?
These properties give us an easy method to check, whether a function is a
probability mass function
Examples:
· 19 · 89 + 19 · 89 · 19 + 89 · 19 · 19 =?
Stat 330 (Spring 2015): slide set 7
1
9
Stat 330 (Spring 2015): slide set 7
=
= P (RRG) + P (RGR) + P (GRR)
= P (RRG or RGR or GRR)
P (2 reds) = P (X = 2)
The event “exactly 2 reds” is formally written as {ω : X(ω) = 2}, and with
the simpler notation for this event is X = 2.
Example: Dartboard What is the probability that you hit the red square
exactly twice in 3 throws?
• Very often we are interested in probabilities of the form P (X = x). We
can think of this expression as a function, that yields different probabilities
depending on the value of x.
5
The function pX (x) := P (X = x) is called the probability mass function
of X.
Definition: Probability Mass Function, PMF
Probability Mass Function
Stat 330 (Spring 2015): slide set 7
• Assume X is a discrete random variable. The image of X is therefore
countable and can be written as {x1, x2, x3, . . .}
Discrete R.V.s
4
Im(X) = {0, 1, 2, 3, 4, 5, 6, 7, 8} is a finite set → X is a discrete random
variable.
2. Communication channel: X = “# of incorrectly received bits”
image of Y is an interval (uncountable image) → Y is a continuous
random variable.
Im(Y ) = (0, ∞).
1. Put a disk drive into service, measure Y = “time till the first major
failure”.
Definition:
The image of a random variable X
Im(X) := {x : x = X(ω) for some ω ∈ Ω}.
Image of R.V.: all possible values X can take
Stat 330 (Spring 2015): slide set 7
⎧
⎨ −x
2x
h(x) =
⎩
0
for x = 1, 3, 5
for x = 2, 4
for x = 6.
10
For that, we look at another function, h(x), that counts the money I win
with respect to the number of spots:
of
of
of
of
of
of
all
all
all
all
all
all
will
will
will
will
will
will
be
be
be
be
be
be
1,
2,
3,
4,
5,
6,
and
and
and
and
and
and
I
I
I
I
I
I
will
will
will
will
will
will
gain
gain
gain
gain
gain
gain
-1
4
-3
8
-5
0
dollars
dollars
dollars
dollars
dollars
dollars
· (−1) + 16 · 4 + 16 · (−3) + 16 · 8 + 16 · (−5) + 16 · 0 =
3
6
= 0.5
11
We denote this by E(h(X)) and define this mathematically in the next
lecture.
In this example, we are calculating the expected value of the function h(X)
dollars per play.
1
6
X
X
X
X
X
X
Gambling Example Continued...
tosses
tosses
tosses
tosses
tosses
tosses
In total I expect to get
1/6
1/6
1/6
1/6
1/6
1/6
Stat 330 (Spring 2015): slide set 7
Stat 330 (Spring 2015): slide set 7
In
In
In
In
In
In
9
1
2
3
4
1/6 1/3 1/3 1/6
The diagram shows all six faces of a particular die.
If Z denotes the number of spots on the upturned
face after toss this die, what is the probability mass
function for Z?
Assuming, that each face of the die appears with
the same probability, we have 1 possibility to get
a 1 or a 4, and two possibilities for a 2 or 3 to
appear, which gives a probability mass function
for Z as:
Example: Roll of a doctored die
z
p(z)
Stat 330 (Spring 2015): slide set 7
More Examples of Discrete R.V.’s
8
be the number of spots turned up, then if
I pay you $X
you pay me $2X
no money changes hands.
What amount of money do I expect to win?
Gamblers Luck!: Toss a die. Let X
⎧
⎨ 1, 3 or 5
2 or 4
X=
⎩
6
Statistics of R.V.s
The probability mass function for Y therefore is
x
1 2 3 4 5 6
pX (x) 16 16 61 61 61 16
Assuming, that the die is a fair die means, that the outcomes of each face
turning up are equally likely i.e., probabilities of each face turning up are
equal.
Obviously, Y is a random variable with image Im(Y ) = {1, 2, 3, 4, 5, 6}.
Let Y be the number of spots on the upturned face of a die.
Example: Roll of a fair die
More Examples of Discrete R.V.’s
Download