stats for engineers: lecture 3. conditional probability suppose there are three cards: a red card...
TRANSCRIPT
![Page 1: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/1.jpg)
Stats for Engineers: Lecture 3
![Page 2: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/2.jpg)
1 2 3 4 5
11%14%
3%
29%
44%
Conditional probability
Suppose there are three cards:
A red card that is red on both sides, A white card that is white on both sides, and A mixed card that is red on one side and white on the other.
All the cards are placed into a hat and one is pulled at random and placed on a table.
If the side facing up is red, what is the probability that the other side is also red?
1. 1/62. 1/33. 1/24. 2/35. 5/6
![Page 3: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/3.jpg)
Conditional probability
Suppose there are three cards:
A red card that is red on both sides, A white card that is white on both sides, and A mixed card that is red on one side and white on the other.
All the cards are placed into a hat and one is pulled at random and placed on a table.
If the side facing up is red, what is the probability that the other side is also red?
Red card
White card
Mixed card
13
13
13
Top Red
Top White
Top White
Top Red
12
12
1
1 13
13
16
16
Let R=red card, TR = top red.
ΒΏ23
ΒΏ
13
13+ 1
6
Probability tree
![Page 4: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/4.jpg)
Conditional probability
Suppose there are three cards:
A red card that is red on both sides, A white card that is white on both sides, and A mixed card that is red on one side and white on the other.
All the cards are placed into a hat and one is pulled at random and placed on a table.
If the side facing up is red, what is the probability that the other side is also red?
The probability we want is P(R|TR) since having the red card is the only way for the other side also to be red.
Let R=red card, W = white card, M = mixed card. Let TR = top is a red face.
For a random draw P(R)=P(W)=P(M)=1/3.
π (π π )=π (π π |π )π (π )+π (π π |π )π (π )ΒΏ1 Γ
13+
12
Γ13
Total probability rule:
ΒΏ12
This is
ΒΏ1Γ
13
12
ΒΏ23
Intuition: 2/3 of the three red faces are on the red card.
![Page 5: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/5.jpg)
Summary From Last Time
Permutations - ways of ordering k items: k!
Ways of choosing k things from n, irrespective of ordering:
πΆππ=(ππ)= π !
π! (πβπ )!
Random Variables: Discreet and Continuous
Mean π=πΈ ( π ( π ) ) β‘ β¨ π ( π ) β©=βπ
π (π ) π (π=π)
β¨ππ+ππ β©=β¨ππ β©+ β¨ππ β©=π β¨ π β© +π β¨π β©=πππ+πππMeans add:
Bayesβ Theorem π ( π΄|π΅ )= π (π΅|π΄ )π ( π΄)π (π΅ )
π ( π΄|π΅ )= π ( π΄β©π΅ )π (π΅ )e.g. from
Total Probability Rule: π (π΅ )=βπ
π (π΅|π΄π )π ( π΄π)
![Page 6: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/6.jpg)
Mean of a product of independent random variables
If and are independent random variables, then
ΒΏβπ₯
π (π₯ )π₯βπ¦
π (π¦ ) π¦
ΒΏ β¨ π β© β¨π β©=ππ ππ
β¨ ππ β©=βπ₯βπ¦
π (π₯β© π¦ )π₯π¦=ΒΏβπ₯βπ¦
π (π₯ )π (π¦ ) π₯π¦ ΒΏ
Note: in general this is not true if the variables are not independent
Example: If I throw two dice, what is the mean value of the product of the throws?
Two throws are independent, so
The mean of one throw is
ΒΏ (1+2+3+4+5+6 )Γ 16=
216
=3.5
ΒΏ1 Γ16+2 Γ
16+3 Γ
16+4 Γ
16+5 Γ
16+6 Γ
16
![Page 7: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/7.jpg)
Variance and standard deviation of a distribution For a random variable X taking values 0, 1, 2 the mean is a measure of the average value of a distribution, . The standard deviation, , is a measure of how spread out the distribution is
π (π=π)
πππ
π
![Page 8: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/8.jpg)
Definition of the variance (=
So the variance can also be written
β¨ ( π βπ )2 β©= β¨π 2β 2π π+π2 β©Note that
ΒΏ β¨π 2 β© β 2 β¨ π π β©+π2
ΒΏ β¨π 2 β© β 2π2+π2
ΒΏ β¨π 2 β© βπ2
π β¨ π β©=π2
π 2β‘ var (π )=β¨ ( πβπ)2 β©=ΒΏ
This equivalent form is often easier to evaluate in practice, though can be less numerically stable (e.g. when subtracting two large numbers).
![Page 9: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/9.jpg)
Example: what is the mean and standard deviation of the result of a dice throw?
Answer: Let be the random variable that is the number on the dice
The mean is as shown previously.
The variance is = (=
Hence the standard deviation is π=3.5
ππ
![Page 10: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/10.jpg)
Sums of variances For two independent (or just uncorrelated) random variables X and Y the variance of X+Y is given by the sums of the separate variances.
Hence
Why? If has , and has , then
Hence since , if then
var
ΒΏβ¨ (π βππ )2+(π βππ )2+2 (πβππ ) (π βπ π¦ )β©
If X and Y are independent (or just uncorrelated) then
= [βVariances addβ]
![Page 11: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/11.jpg)
var (π+π+π+β¦ )=var (π )+var (π )+var (π )+β¦
In general, for both discrete and continuous independent (or uncorrelated) random variables
Example:
The mean weight of people in England is ΞΌ=72.4kg, with standard deviation 15kg.
What is the mean and standard deviation of the weight of the passengers on a plane carrying 200 people?
Answer:
The total weight
Since means add
Assuming weights independent, variances also add, w
π=β45000 Kg2 β 212 Kgππ2 =β
π=1
200
225 Kg2=200 Γ225 Kg2=45000 Kg2
In reality be careful - assumption of independence unlikely to be accurate
![Page 12: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/12.jpg)
1 2 3 4 5
13%
7% 6%
43%
30%
Error bars
A bridge uses 100 concrete slabs, each weighing tonnes [i.e. the standard deviation of each is 0.1 tonnes]
What is the total weight in tonnes of the concrete slabs?
1.
![Page 13: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/13.jpg)
Error bars
A bridge uses 100 concrete slabs, each weighing tonnes [i.e. the standard deviation of each is 0.1 tonnes]
What is the total weight in tonnes of the concrete slabs?
Means add, so
Note: Error grows with the square root of the number:
fractional error decreases
But the mean of the total is
Hence
Variances add, with , so
![Page 14: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/14.jpg)
Binomial distribution A process with two possible outcomes, "success" and "failure" (or yes/no, etc.) is called a Bernoulli trial.
Discrete Random Variables
e.g. coin tossing: Heads or Tails
quality control: Satisfactory or Unsatisfactory
An experiment consists of n independent Bernoulli trials and p = probability of success for each trial. Let X = total number of successes in the n trials.
Then for k = 0, 1, 2, ... , n.
This is called the Binomial distribution with parameters n and p, or B(n, p) for short. X ~ B(n, p) stands for "X has the Binomial distribution with parameters n and p."
(ππ)ππ (1 βπ )πβπ
Reminder:
(ππ)
Polling: Agree or disagree
![Page 15: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/15.jpg)
Situations where a Binomial might occur 1) Quality control: select n items at random; X = number found to be satisfactory. 2) Survey of n people about products A and B; X = number preferring A. 3) Telecommunications: n messages; X = number with an invalid address. 4) Number of items with some property above a threshold; e.g. X = number with height > A
![Page 16: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/16.jpg)
"X = k" means k successes (each with probability p) and n-k failures (each with probability 1-p).
Justification
Suppose for the moment all the successes come first. Assuming independence
probability =
=
successes: failures:
Every possible different ordering also has this same probability. The total number of ways of choosing k out of the n trails to be successes is , so there are , possible orderings.
Since each ordering is an exclusive possibility, by the special addition rule the overall probability is added times:
![Page 17: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/17.jpg)
π=0.5
π(π=π)
![Page 18: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/18.jpg)
Example: If I toss a coin 100 times, what is the probability of getting exactly 50 tails?
Answer:
Let X = number tails in 100 tosses
Bernoulli trial: tail or head,
π (π=50 )=πΆππππ(1βπ)πβπ=πΆ50
100 0.550 (1β 0.5 )50
β 0.0796
![Page 19: Stats for Engineers: Lecture 3. Conditional probability Suppose there are three cards: A red card that is red on both sides, A white card that is white](https://reader035.vdocuments.us/reader035/viewer/2022070306/551756a25503460e6e8b4608/html5/thumbnails/19.jpg)
Example: A component has a 20% chance of being a dud. If five are selected from a large batch, what is the probability that more than one is a dud?
P(More than one dud) =
Bernoulli trial: dud or not dud,
=
Answer:
Let X = number of duds in selection of 5
=
= 1 - 0.32768 - 0.4096 0.263.