Proposition 1.1 De Moargan’s Laws

Download Report

Transcript Proposition 1.1 De Moargan’s Laws

Part 2: Named Discrete Random Variables
http://www.answers.com/topic/binomial-distribution
Chapter 13: Bernoulli Random Variables
http://www.boost.org/doc/libs/1_42_0/libs/math/doc/sf_and_dist/html/
math_toolkit/dist/dist_ref/dists/bernoulli_dist.html
Bernoulli distribution: Summary
Things to look for: one trial, success or failure
0 ๐‘œ๐‘ข๐‘ก๐‘๐‘œ๐‘š๐‘’ ๐‘–๐‘  ๐‘Ž ๐‘“๐‘Ž๐‘–๐‘™๐‘ข๐‘Ÿ๐‘’
Variable: ๐‘‹ =
1 ๐‘œ๐‘ข๐‘ก๐‘๐‘œ๐‘š๐‘’ ๐‘–๐‘  ๐‘Ž ๐‘ ๐‘ข๐‘๐‘๐‘’๐‘ ๐‘ 
Parameter:
p = P(S), q = P(F) = 1 โ€“ p
Mass:
P(X = 1) = p, P(X = 0) = q
๐”ผ(X) = p
Var(X) = pq
Bernoulli Distribution
Do the following follow a Bernoulli distribution?
If so, a) What is a failure and what is a success? b)
Determine p and q, c) Calculate E and Var.
1) Rolling a fair 4-sided die and observing whether
the number showing is a 1 or not.
2) The number of births of girls in a county hospital
on any specific day.
3) If a patient takes a drug to see if it is effective or
not.
Bernoulli Distribution(cont)
4) In a drug trial, some patients with the same
condition are given a drug and some are given a
placebo to see if the drug is effective or not.
5) In quality control we want to see if a particular
product is โ€˜defectiveโ€™. We take random samples
from an assembly line and check each sample to
see if the product is defective.
6) We look at the percentage that a basketball player
makes her shots. We want to know how many
baskets it takes until she misses a shot.
Bernoulli Distribution(cont)
7) At a certain point in a card game, if you get spade, you
with $4, if you get a 2 (except the 2โ™ ), you lose $5, if
you get the Aโ™ฅ, you win $20, and if you get any other
card, the game ends with no money being exchanged.
a) What is your expected gain or loss?
b) You and 3 friends are playing using the rules above
using your own deck. We are interested if a player
receives any of the cards listed.
i. What is the expected value of the number people
getting one of the above cards?
ii. What is the variance of the number of people
getting one of the above cards?
Chapter 14: Binomial Random Variables
http://www.vosesoftware.com/ModelRiskHelp/index.htm#Distributions
/Discrete_distributions/Binomial_distribution.htm
Binomial Distribution: Situation
In each case, identify whether the situation is binomial
are not. If it is binomial, state what the parameters
are, n and p.
1. Rolling a fair 4-sided die 5 times and observing
whether the number showing is a 1 or not.
2. In quality control we want to see if a particular
product is โ€˜badโ€™. We take random samples from an
assembly line that uses different machines to product
the product.
3. We draw 2 cards from a deck without replacement.
We are interested in knowing if the cards are red or
not.
Binomial distribution: Summary
Things to look for: BInS
Variable: X = # of success in n trials (0 โ‰ค X โ‰ค n)
Parameters:
n: number of trials (n = 1 ๏‚ฎ Bernoulli)
p = P(S) = constant, q = P(F) = 1 โ€“ p
Mass:
๐‘ƒ ๐‘‹=๐‘ฅ =
๐”ผ(X) = np
Var(X) = npq
๐‘›
๐‘ฅ
๐‘ ๐‘ฅ ๐‘ž๐‘›โˆ’๐‘ฅ , ๐‘ฅ = 0, 1, โ‹ฏ , ๐‘›
Binomial r.v. (in class)
A restaurant serves eight entrées of fish, 12 of beef,
and 10 of poultry. If customers select from these
entrées randomly, what is the probability that
a) two of the next four customers order fish entrées?
b) at most one of the next four customers orders fish?
c) at least one of the next four customers orders fish?
d)* How many customers would the restaurant have
to serve to be sure that there is a 90% chance that
at least one of them orders a fish entrée?
e) What is the expected number of customers (in the
next 4 customers) that will order fish?
f) What is the standard deviation of the number of
people who order fish?
Shapes of Histograms
Symmetric
Right skewed
Left skewed
g)What is the mass, graph of mass, graph
of CDF?
X
0
1
2
3
4
else
pX(x) 0.289 0.421 0.229 0.056 0.005 0
px(x)
0.45
0.40
0.35
0.30
0.25
0.20
0.15
0.10
0.05
0.00
1
0.8
0.6
0.4
0.2
0
-2
0
1
2
3
4
x
-0.2
0
2
4
Probability histograms for binomial distributions
with different pโ€™s with n = 8
0.40
0.30
px(x)
px(x)
px(x)
0.35
0.25
0.40
0.35
0.30
0.30
0.20
0.25
0.20
0.25
0.20
0.15
0.15
0.15
0.10
0.10
0.10
0.05
0.00
0 1 2 3 4 5 6 7 8x
p = 0.2
0.05
0.05
0.00
0.00
0 1 2 3 4 5 6 7 8x
0 1 2 3 4 5 6 7 8x
p = 0.5
p = 0.8
Chapter 15: Geometric Random
Variables
http://raven.iab.alaska.edu/~ntakebay/teaching/programming/probability/node8.html
Geometric distribution: Summary
Things to look for: BIS
Variable: X = # of trials until the first success (1 โ‰ค X)
Parameters:
p = P(S) = constant, q = P(F) = 1 โ€“ p
Mass:
P(X = x) = qx-1p, x = 1, 2, 3, โ€ฆ
1
๐”ผ ๐‘‹ =
๐‘
๐‘ž
๐‘‰๐‘Ž๐‘Ÿ ๐‘‹ = 2
๐‘
Example: Geometric Distribution
Suppose that we roll an 20-sided die until a '1' is rolled.
Let X be the number of times it takes to roll the '1'.
a) Why is this a geometric distribution?
b) What is the PMF of X?
c) What is the probability that it will take exactly 10
rolls?
d) If you decide in advance that you will roll the die 10
times, what is the probability that you will have
exactly one โ€˜1โ€™? How is this different from part c)?
e) What is the expected number of rolls?
f) What is the standard deviation of the number of rolls?
g) *What does the mass look like?
h) *What does the CDF look like?
Shape of Geometric PMF
px(x)
p=0.05
CDF
1
0.06
0.05
0.8
0.04
0.6
0.03
0.4
0.02
0.2
0.01
0
0.00
0
20 40 60 80 100
x
0
20
40
60
80 100
X
Example: Geometric r.v. (cont)
Suppose that we roll an 20-sided die until a '1' is
rolled. Let X be the number of times it takes to roll
the '1'.
i) What is the probability that it will take no more
than 10 rolls?
j) What is the probability that it will take between 10
and 20 rolls (exclusive)?
k) Determine the number of rolls so that the person
has a 90% or greater chance of rolling a โ€˜1โ€™?
Example: Geometric r.v. (cont)
Suppose that we roll an 20-sided die until a '1' is
rolled. Let X be the number of times it takes
to roll the '1'.
h) What is the probability that it will takes more
than 10 rolls to roll the โ€˜1โ€™?
i) Assuming that it takes more than 20 rolls to
roll the โ€˜1โ€™. Find the probability that it will
take more than 30 rolls to roll the โ€˜1โ€™?
Chapter 16: Negative Binomial
Random Variables
http://www.vosesoftware.com/ModelRiskHelp/index.htm#Distributions
/Discrete_distributions/Negative_Binomial.htm
Negative Binomial distribution: Summary
Things to look for: BIS
Variable: X = # of trials until the rth success (r โ‰ค X)
Parameters:
r = the desired number of successes
p = P(S) = constant, q = P(F) = 1 โ€“ p
Mass:
๐‘ƒ ๐‘‹ = ๐‘ฅ =
๐‘Ÿ
๐”ผ ๐‘‹ =
๐‘
๐‘ž๐‘Ÿ
๐‘‰๐‘Ž๐‘Ÿ ๐‘‹ = 2
๐‘
๐‘ฅโˆ’1
๐‘Ÿโˆ’1
_๐‘Ÿ๐‘๐‘Ÿ
๐‘ฅ
๐‘ž
,๐‘ฅ
= ๐‘Ÿ, ๐‘Ÿ + 1, โ€ฆ
Example: Negative Binomial r.v.
Suppose that we roll an n-sided die until a '1' is
rolled. Let X be the number of times it takes
to roll the ninth '1'.
a) Why is this a Negative Binomial situation?
b) What are the possible values of x?
c) What is the PMF of X?
d) What is the probability that it will take 40
rolls?
e) What is the expected number of rolls?
f) What is the standard deviation of the
number of rolls?
Comparison: Binomial vs. Negative
Binomial
Binomial
Negative Binomial
Question
What is the prob.
What is the probability
that that you will
that 40th roll will be the
roll 9 โ€œ1โ€™s in the first 9th โ€˜1โ€™?
40 rolls?
Distribution X ~ Binomial
X ~ NegBinomial
(n = 40, p = 0.05)
(r = 9, p = 0.05)
Meaning of X X = # of successes = X = # of rolls until the
9
9th โ€˜1โ€™
Probabiltiy ๐‘ƒ ๐‘‹ = 9
๐‘ƒ ๐‘‹ = 40
40
39
9
31
=
0.05 0.95
=
0.059 0.9531
9
8
= 1.09 × 10โˆ’4
= 2.45 × 10โˆ’5
Chapter 17: Poisson Random Variables
http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html
/math_toolkit/dist/dist_ref/dists/poisson_dist.html
Examples of Poisson R.V.โ€™s
1. The number of patients that arrive in an
emergency room (or any other location)
between 6:00 pm and 7:00 pm (or any other
period of time) with a rate of 5 per hour.
2. The number of alpha particles emitted per
minute by a radioactive substance with a rate
of 10 per minute.
3. The number of cars that are located on a
particular section of highway at a given time
with an average value of 7 per mile .
Examples of Poisson R.V. (extension)
4. The number of misprints on a page of a book.
5. The number of people in a community living to
100 years of age.
6. The number of wrong telephone numbers that
are dialed in a day.
7. The number of packages of cat treats sold in a
particular store each day.
8. The number of vacancies occurring during a year
in the Supreme Court.
Poisson distribution: Summary
Things to look for: BIS*
Variable: X = # of successes during the specified
โ€˜periodโ€™
Parameters:
๏ฌ = the average rate of events
Mass:
๐‘ƒ ๐‘‹ = ๐‘ฅ =
๐”ผ(X) = ๏ฌ
Var(X) = ๏ฌ
๐‘’ โˆ’๐œ† ๐œ†๐‘ฅ
,๐‘ฅ
๐‘ฅ!
= 0,1, โ€ฆ
Example: Poisson Distribution (class)
In any one hour period, the average number of phone
calls per minute coming into the switchboard of a
company is 2.5.
a) Why is this story a Poisson situation? What is its
parameter?
b) What is the probability that exactly 2 phone calls are
received in the next hour?
c) Given that at least 1 phone call is received in the
next hour, what is the probability that more than 3
are received?
d) *What does the mass look like in this situation?
e) *What does the CDF look like in this situation?
Shapes of Poisson
px(x)
0.30
0.25
0.20
0.15
0.10
0.05
0.00
๏ฌ = 2.5
1
0.8
0.6
CDF ๏ฌ = 2.5
0.4
0.2
0 2 4 6 8 10 12
0
-1 1 3 5 7 9 11 13
x
Example: Poisson Distribution
In any one hour period, the average number of
phone calls per minute coming into the
switchboard of a company is 2.5.
f) What is the probability that there will be exactly
6 phone calls in the next 2 hours?
g) How many phone calls do you expect in the next
2 hours?
h) What is the probability that there will exactly 6
phone calls in one out of the next three 2-hour
time intervals?
Example: Poisson Distribution (2) - Class
Every second on average, 5 neutrons, 3 gamma
particles and 6 neutrinos hit the Earth in a
certain location.
a) Why is this story a Poisson situation?
b) What is the expected number of particles to hit
the Earth in that location in the next 5 seconds?
c) What is the probability that exactly 20 particles
will hit the Earth at that location in the next 2
seconds?
d) What is the probability that exactly 20 particles
will hit the Earth at that location tomorrow from
1 pm to 1:00:02 (2 seconds after 1 pm)?
Examples of Poisson R.V. (extension) class
For each of the following, is n large and p small?
4. The number of misprints on a page of a book.
5. The number of people in a community living to
100 years of age.
6. The number of wrong telephone numbers that
are dialed in a day.
7. The number of packages of cat treats sold in a
particular store each day.
8. The number of vacancies occurring during a year
in the Supreme Court.
Example: Poisson Approximation to a
Binomial - class
On my page of notes, I have 2150 characters.
Say that the chance of a typo (after I proof it)
is 0.001.
a) Is the Poisson approximation to the binomial
appropriate?
b) What is the probability of exactly 3 typos on
this page?
c) What is the probability of at most 3 typos?
Poisson vs. Binomial
P(X = x) Binomial Poisson
0
0.11636 0.11648
1
0.25042 0.25044
2
0.26935 0.26922
3
0.19305 0.19294
4
0.10372 0.10371
5
0.04456 0.04459
6
0.01595 0.01598
7
0.00489 0.00491
8
0.00131 0.00132
9
0.00031 0.00032
Poisson vs. Bionomial
Binomial
0.3
0.2
0.1
0.0
0
2
4
6
8
10
8
10
Poisson
0.3
0.2
0.1
0.0
0
2
4
6
Chapter 18: Hypergeometric Random
Variables
http://www.vosesoftware.com/ModelRiskHelp/index.htm#Distributions
/Discrete_distributions/Hypergeometric_distribution.htm
Hypergeometric distribution: Summary
Things to look for: Bn, without Replacement
Variable: X = # of successes
Parameters:
N = total number of items in population
M = total number of successes in population
N โ€“ M = total number of failures in population
n = items selected
Mass:
๐‘ƒ ๐‘‹ = ๐‘ฅ =
๐‘€
๐”ผ ๐‘‹ =๐‘›
๐‘
๐‘€
๐‘ฅ
๐‘โˆ’๐‘€
๐‘›โˆ’๐‘ฅ
๐‘
๐‘›
๐‘€
๐‘€ ๐‘โˆ’๐‘›
๐‘‰๐‘Ž๐‘Ÿ ๐‘‹ = ๐‘›
1โˆ’
๐‘
๐‘ ๐‘โˆ’1
Example: Hypergeometric Distribution
A quality assurance engineer of a company that
manufactures TV sets inspects finished
products in lots of 100. He selects 5 of the 100
TVโ€™s at random and inspects them thoroughly.
Let X denote the number of defective TVโ€™s
obtained. If, in fact 6 of the 100 TVs in the
current lot are actually defective, find the
mass of the random variable X.
Example: Hypergeometric Distribution (2) - class
A textbook author is preparing an answer key for the answers
in a book. In 500 problems, the author has made 25 errors. A
second person checks seven of these calculations randomly.
Assume that the second person will definitely find the error
in an incorrect answer.
a) Explain in words what X is in this story. What values can it
take?
b) Why is this a Hypergeometric distribution? What are the
parameters?
c) What is the probability that the second person finds exactly
1 error?
d) What is the probability that the second person finds at least
2 errors?
e) What is the expected number of errors that the second
person will find?
f) What is the standard deviation of the number or errors that
the second person will find?
Example: Capture-Recapture Sampling
Estimating the Size of a Population. Suppose that an
unknown number, N, of bluegills inhabit a small lake
and that we want to estimate that number. One
procedure for doing so, often referred to as the
capture-recapture method, is to proceed as follows:
1. Capture and tag some of the fish, say 250 and then
release the fish back into the lake and give them
time to disperse.
2. Capture some more of the animals, say 150, and
determine the number that are tagged, say 16.
These are the recaptures.
3. Use the data to estimate N.
Example: Hoosier Lotto (class)
The Lotto. In the Hoosier lotto, a player specifies six
numbers of her choice from the numbers 1 โ€“ 48. In
the lottery drawing, six winning numbers are chosen
at random without replacement from the numbers 1
โ€“ 48. To win a prize, a lotto ticket must contain two or
more of the winning numbers.
a) Confirm the mass of X from the Hoosier lottery web
site which is on the next page. (Homework)
b) If the player buys one Lotto ticket, determine the
probability that she wins a prize (at least 2 numbers
correct).
c) If the player buys one Lotto ticket per week for a
year, determine the probability that she wins a prize
at least once in the 52 tries. (Hint: What is this
distribution?)
Example: Hoosier Lotto (cont)
These are the odds from the Hoosier lottery
(https://www.hoosierlottery.com/games/hoosier-lotto)
6 OF 6 1:12,271,512
4 OF 6 1:950
2 OF 6 1:7
5 OF 6 1:48,696
3 OF 6 1:53
Example: Powerball (BONUS)
When playing
Powerball, you
receive a ticket with
five (5) numbers
from 1 โ€“ 59 and one
(1) Powerball
number from 1 โ€“ 35.
Confirm the
following odds
(including the overall
odds of winning):
Binomial Approximation to the
Hypergeometric
M = 200
Chapter 19: Discrete Uniform Random
Variables
http://www.milefoot.com/math/stat/pdfd-uniformdisc.htm
Discrete Uniform distribution: Summary
Things to look for: equally likelihood situation
Variable: X = the choice of the outcome
Parameters:
N = total number of possible outcomes
Mass:
๐‘ƒ ๐‘‹ = ๐‘ฅ =
๐‘+1
๐”ผ ๐‘‹ =
2
๐‘2 โˆ’ 1
๐‘‰๐‘Ž๐‘Ÿ ๐‘‹ =
12
1
,๐‘ฅ
๐‘
= 1, 2, โ€ฆ , ๐‘
Example: Discrete Uniform (class)
A charitable organization is conducting a raffle in which
the grand prize is a new car. Five thousand tickets,
numbered 0001, 0002, โ€ฆ, 5000 are sold at $10 each.
At the grand-prize drawing, one ticket stub will be
selected at random from the 5000 ticket stubs
a) Why is this a Discrete Uniform distribution, and what is
the parameter?
b) Explain in words what X is terms of the story? What
values can it take on?
c) Suppose that you hold tickets numbered 1003 โ€“ 1025.
What is the probability that you win the grand prize?
Calculate the following even though they donโ€™t really
mean anything.
d) What is the expected value of the winning number?
e) What is the standard deviation?
Chapter 20: Summary of Part III
http://www.wolfram.com/mathematica/new-in-8/parametric-probability-distributions
/univariate-discrete-distributions.html
Summary of Discrete Distributions
X
Expected values and Variances for selected
families of discrete random variables.
Family
Bernoulli
Binomial
Geometric
Neg. Binomial
Poisson
Param(s) Expected
Value
p
p
Variance
q
n,p
p
r,p
np
1/p
r/p
npq
q/p2
qr/p2
๏ฌ
๏ฌ
๐‘€
๐‘›
๐‘
๐‘+1
2
๏ฌ
๐‘€
๐‘€ ๐‘โˆ’๐‘›
๐‘›
1โˆ’
๐‘
๐‘ ๐‘โˆ’1
๐‘2 โˆ’ 1
12
Hypergeometric
N,n,p
Uniform discrete
N
Example: Determine the Distribution (class)
For each of the following situations, state which distribution (and
approximation distribution if applicable) would be appropriate and
why. Also please state all parameters. Note: A possible answer is
โ€˜noneโ€™.
Exercises 20.1 โ€“ 20.9 (pp. 271 โ€“ 272)
Typo is 20.6 Let X be the number of broken ice cream conesโ€ฆ.
20.a: Let X be the number of ice cream cones that you need to
sample to find the 2nd waffle cone and the 3rd regular cone if they
come from a large, independent population and 10% of the waffle
cones are broken and 15% of the regular cones are broken.
20.b: Let X be the number of ice cream cones in your sample which
are broken if you sample 50 of them from 2 boxes, one of which was
roughly handled and the other was handled normally. Assume that
12% of the cones from the plant are broken and handling the box
roughly breaks an additional 2%.
20.c: Let X be the number of broken ice cream cones that you give to
your class of 20 if originally 12 of the 100 ice cream cones in the box
are broken. To avoid jealousy, you give one ice cream cone per
person whether they are broken or not.