(ex) of BT (Bernoulli Trials) using "Tossing a coin" example
1. two possible outcomes: "success" (p) or "failure" (q)
- let success be event we get heads
- let failure be event we get tails
2. p doesn't change
- chance of getting success (ex. subsequent head) doesn't change from one trial to the
3. trials are indep.
- if you get 6 heads, that doesn't chance chance of getting tails
We use BT in one of two ways, dep. on what is of interest:
1. want to know #trials until first success
- aka: how long do we have to keep going until first success?
=> in this case, use Geometric model
2. want to know #successes in fixed #trials - we have fixed # of attempts, so want to know how many times we succeed in these
=> in this case, use Binomial model
- how many attempts will be made (n), how likely are you to succesed on each one
(p), and how many successes u like to see (k)
(THIS WILL BE PROVIDED TO US ON EXAM)
n k p
8 0 0.2725 0.1678
8 1 0.3847 0.3355
^- above is layout of table, along with two rows of data.
For all questions on this slide, we are using:
n = 10, p = 0.15
(ex) coffee cups
- buy 10 cups (n = 10), and 15% chance of being winner on any cup of cofee
1. What is P of 0 prizes? (k=0) - that is telling us p = 0.15, n =10, k = 0, so our p of interest = 0.1969
- p =0.15, n = 10, x = 0 successes
- this is chance of getting exactly no successes at all up to 10, if chance of succeeding
- this is chances of getting no successes at all
=> (these q's simply req. looking up on table)
2. What is P of exactly 1 prize? (k=1)
3. What is P of exactly 2 prizes? (k=2)
4. What is P of getting 2 prizes or less?
- this is asking (P of no prizes) + P(exactly 1) + P(exactly 2)
- 0.1969 + 0.3474 + 0.1937 = 0.7380
=> about 74% chance of winning 2 or less prizes
(we are literally adding up the answers we got from Q's 1-3)
- its complement, "NOT 2 prizes or less", is
5. What is P of getting 2 prizes or more?
- we can do:
P(2) + P(3) + P(4) + P(5) + P(6) + P(7) + P(8) + P(9) + P(10) =
OR - we can get the complement: P(1 prize or less) and then subtract this from 1 to get
P(2 prizes or more)
- the P of getting 2 prizes or more means that you are NOT getting 1 prize or less (ie.
less than 2 prizes)
=> 1 - (0.1969 + 0.3474) = 0.4557
- what we did here was
the same thing as saying "3 prizes or more".
- the bottom
- n=10, k=10,
=> in the context of our problem, this means that it is v.unlikely (~0%) to
get all 10 prizes, out of 10 trials, given that chance of success is 0.15.
WHAT IF P> 0.5 IN BINOMIAL TABLE? - Binomial table does not go p > 0.5
- Suppose n=8 and p=0.7, What is the probability of:
1- exactly 7 successes?
2- 7 or more successes?
- Idea: count failures instead of successes
P(success) = 0.7=> this means: P(fail) = 0.3
If there are 8 trials, and we have 7 successes, then => this means 1 failure.
(we converted our success info into failure info)
- so now, we use table with:
- p = 0.3
- k = 1
- n = 8
- b/c we equivalently expressed our "success" info in terms of "failure",
and now we have a p we can work with that is p < 0.5, so we can use binomial table.
- chances of getting exactly 7 successes
=> this is answer we want; P = 0.1977
We do not have to take this number away from 1
- we aren't taking away from 1, b/c we already turned eth around: #successes ->
#failures, and P success -> P failure 2.
- 7 or more successes = 7 or 8 successes
- P(success) = 0.7 => P(failure) = 0.3
- 7,8 successes => 1,0 failures
- if we had either 7 or 8 succeses, then this is equivalent to saying
that we had 1 or no failures at all (one failure or less).
- so we have to get:
a) p = 0.3, k = 1, n = 10
P(exactly 1 failure) = 0.1977
b) p = 0.3, k = 0, n = 10
P(no failure) = 0.0576
, and then, add these two up.
=> P(7 or more successes) = 0.1977 + 0.0576 = 0.2553.
-successes and failures are kind of symmetric in Binom distrib.
MEAN AND SD OF BINOMIAL DISTRIBUTION
- Mean of number of successes in binomial distribution (n)(p)
- SD of number of successes =
For derivation of SD formula, see MATH BOX, p451
(did calc. for prev ex.; n = 10, p =0.15)
EXAMPLE (using n = 10, p =0.15)
- 10 successes in possible, but v.unlikely
- so distribution likely to be skewed to right
USE STATCRUNCH TO GET PROBABILITY HISTOGRAMS OF BINOMIAL
DISTRIBUTIONS (STA, CALCULATORS, BINOMIAL)
- n=10, p = 0.15
- R-skewed distribution Figure 2
- n = 10, p = 0.75
- L-skewed distribution
- n = 100, p = 0.15
- looks symmetric, but tiny bit skewed to right Figure 4
- n = 10, p = 0.50
- shape of distribution is symmetric
- works even for small number of trials (ie. when n is small)
HOW DOES THE SHAPE DEPEND ON P?
- if p < 0.5, R-skewed
- if p > 0.5, L-skewed
- if p = 0.5, symmetric
WHAT HAPPENS TO THE SHAPE AS n INCREASES?
- shape becomes more normal -
- if #trials is large, even if p is far away from 0.5 (ex. p =0.15), then shape becomes
normal, as long as #trials is big enough
WHAT DOES THIS SUGGEST TO DO IF n IS TOO LARGE FOR THE TABLES?
- Binomial table will probably go up to n = 20
- if n > 20 and we do not have that "n" given on the table, then cannot calculate
- but we know that once it becomes as big as 100, even for v.small p, shape becomes
Given that n is too large (n is too big for table), then try NORMAL
APPROXIMATION TO BINOMIAL
- we get mean and SD of binomial using Binomial model formula, but then we assume
that it is normal
- having done so, we can use z-score formula
- P(10 or fewer prizes in 100 coffee cups) = ?
- n = 100, recall: p = 0.15 (from prev slides)
- Using this, we can calculate mean and SD: -
- then, for 10 prices (y),
- we use mean be mu = 15, SD be sigma = 3.57, and x be 10
- look up on Table Z (in textbook) for proportion less, which is 0.0808.
- remember: this is an APPROXIMATION.
=> this is saying that the probability that we win 10 or fewer prizes after buying 100
coffee cups is about less than 9%
- however, Professor Butler did it with MyStatCrunch and found exact answer to be
a) n LARGE AND
b) p NOT FAR FROM 0.5
=> req. that #trials be big, and p not be far from 0.5, and when we multiply n and p
together, we get a product that is larger than 10.
- then, approximation would be valid.
- the bigger n gets, the more normal it gets
- the closer p is to 0.5, the more normal it will be - if p is long way away from 0.5, then need bigger