Download Tutorial 3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
The Chinese University of Hong Kong
ENGG2430D: Probability and Statistics for Engineers
2015-16 Term 2
Tutorial 3: Discrete Random Variables
Hongyang Li, Francis
February 29, 2016
1 Recap
• Basic Counting Principal.
(a) Creating a set of elements can be modeled as several stages of choices.
(b) Given a sequence of possible choices at the first stage, there are ni possible
choices at the i-th stage.
(c) Total number of possible elements of the r-stage process is n1 · n2 · · · nr .
• Permutation.
(a) If the order of selection matters, the selection is called a permutation, and
otherwise, it is called a combination.
(b) Two types of counting arguments that involve the selection of k objects out of
a collection of n objects.
(c) n! = n × (n − 1) × · · · × 1.
(d) k-permutations: when we are ready to select the last (the k-th) object, we have
already chosen k − 1 objects, which leaves us with n − (k − 1) choices for the last
one. The definition is as follows
n(n − 1) · · · (n − k + 1) =
n(n − 1) · · · (n − k + 1)(n − k) · · · 1
.
(n − k) · · · 1
• Combination.
1
(a) Combination means how many choices we have from the candidate pool, independent of their ordering.
(b) For example, choose 2 pens out of 4 different colors, how many choices do we
have?
(c) Notice that creating combinations is different than forming k-permutations because in combinations there is no ordering of the selected elements.
(d) The number of possible combinations is equal to:
n
n!
=
.
k
k!(n − k)!
• Partitions.
(a) A combination can be viewed as a partition of the set in multiple parts. One
part contains k elements and the other contains the remaining nk.
(b) How many ways of all possible subsets?
• Random Variable.
A random variable is a real-valued function of the experimental outcome.
• Probability Mass Function (PMF).
(a) The probability of each numerical value that the random variable can take:
pX (x) = P({X = x}).
(b) PMF calculation of a random variable. For each x,
1. Collect all the possible outcomes that result in the event.
2. Add all the possibilities to obtain p(x).
• Examples of Random Variables.
(a) PMF of the geometric random variable:
pX (k) = (1 − p)k−1 p.
For example, pass a test within five tries, toss the coin until a head comes up at
the 4th time, etc.
(b) PMF of the binomial random variable:
n
(1 − p)n−k pk .
pX (k) =
k
For example, consider the coin toss case where the chance that it has 2 heads and
3 tails in the 5 tosses.
2
• Functions of Random Variables.
(a) If Y = g(X) is a function of a random variable X, then Y is also a random
variable, since it provides a numerical value for each possible outcome.
(b) Consider the case y = g(x). To obtain p(y) for any y, we add the probabilities
of all values of x such that g(x) = y:
X
pX (x).
pY (y) =
x|g(x)=y
2 Examples
Example 1 (counting). You have n1 classical music CDs, n2 rock music CDs, and n3
country music CDs. In how many different ways can you arrange them so that the CDs
of the same type are contiguous?
Solution:
First we choose how these types of music are arranged, it’s 3!. Then, within each type,
there are ni choices (permutation). Hence, the total number of arrangement is 3! × n1! ×
n2! × n3!.
Example 2 (random variable). Consider a random variable X such that
pX (x) =
x2
a
f or x ∈ A,
P(X = x) = 0 f or x ∈
/ A,
where A = {−3, −2, −1, 1, 2, 3} and A > 0 is a real parameter.
(a) Find a.
(b) What is the PMF of the random variable Z = X 2 ?
Solution:
(a) Remember the sum of values of the PMF over all values must equal to 1:
1=
3
X
pX (x) =
28
,
a
-1
1/28
1
1
1/28
1
x=−3
which implies that a = 28.
(b)
x
pX (x)
Z|X = x
-3
9/28
9
-2
1/7
4
2
1/7
4
3
9/28
9
3
The PMF of Z is thereby:


1/14, if z = 1,
pZ (z) = 2/7, if z = 4,


9/14, if z = 9.
Example 3 (random variable). 90 students, including Joe and Jane, are to be split
into three classes of equal size, and this is to be done at random. What is the probability
that Joe and Jane end up in the same class?
Solution:
Assume one of them, say Joe has chosen one class, then the choice she has to have the
same class with him is 29 (left quota) / 89 (total students excluding Joe). Therefore, the
answer is 29/89.
Example 4 (random variable). Draw the top 7 cards from a well-shuffled standard
52-card deck. Find the probability that the 7 cards include exactly 3 aces.
Solution:
(#ways to choose 3 aces) × (#ways to choose other 4 cards)
#ways to choose 7 cards
4 48 52 =
/
3 4
7
P =
Example 5 (counting). We have a group of n persons. Consider clubs that consist of a
special person from the group (the club leader) and a number (possibly zero) of additional
club members. Count the number of possible clubs of this type in two different ways and
investigate the algebraic identity.
Solution:
(1) Select a leader, we have n choices, for the left (n − 1), we decide whether or not we
add them into the club. Thus, there are n × 2n−1 choices.
(2) We fixed the number of k, and choose k members out of n possible persons. Then
we select a leader from the k candidates. At last, by considering all the possible values
of k, that is, sum over k = 1 to k = n, we have:
n
X
n
k
= n × 2n−1 .
k
k=1
4