Everything from Week 2 to Week 6 in simple words, with the professor's own examples, and all 19 sample questions from Week 7 solved step by step.
Weeks 2 to 719 solved questionsNo symbol left unexplained
How to use this page
Go from top to bottom. Each lesson has the same shape: idea in simple words, then the rule, then an example from the slides.
Solutions are hidden. Read the question out loud, let everyone try for one or two minutes, then tap Show solution.
At the end of each lesson there is a blue box "Now solve". It sends you to the matching Week 7 sample questions. Solve them right away, while the idea is fresh.
The Menu button at the top jumps to any lesson or any question. You can also make the text bigger there.
The one idea behind the whole course
A probability is just a number between 0 and 1 that says how likely something is. 0 means "never". 1 means "always". 0.5 means "half of the time". Everything else in this course is a tool to find that number.
Plan for the 4 hours (12:00 to 4:00)
Time
What
Sample questions
12:00
0 · Symbols (quick look) and 1 · Sets and basic probability
Q1, Q2, Q3, Q4
12:35
2 · Conditional probability, Bayes, trees
Q7, Q8, Q9
1:10
3 · Counting and independent trials
Q5, Q6
1:30
4 · Random variables, PMF, the 6 families
Q10, Q11, Q13, Q16, Q19
2:15
Break, 10 minutes
2:25
5 · CDF
Q12, Q17
2:50
6 · Expected value and variance
Q14, Q15 (a, b, c)
3:20
7 · Conditional PMF
Q15 (d), Q18
3:45
9 · Formula sheet and traps (read together)
If you run late: never skip lessons 4, 5, 6. Most sample questions come from them.
0
Symbols dictionary
Come back here any time a symbol looks strange
Sets and events
Symbol
Say it
Meaning
{}
"the set of"
A list of things. Example: {1,2,3}
S
"sample space"
All possible results of the experiment
∈
"is in"
2∈{1,2,3} means 2 is inside the list
∈/
"is not in"
5∈/{1,2,3}
A⊂B
"A is inside B"
Everything in A is also in B
φ
"empty set"
A set with nothing in it. It means "impossible"
A∪B
"A or B"
In A, or in B, or in both
A∩B,AB
"A and B"
In A and in B at the same time. AB is a short way to write it
Ac
"not A"
Everything that is not in A
A−B
"A minus B"
In A but not in B
Probability
Symbol
Say it
Meaning
P[A]
"probability of A"
How likely A is. A number from 0 to 1
P[A∣B]
"probability of A given B"
How likely A is when we already know B happened. The bar | means "given"
n!
"n factorial"
n⋅(n−1)⋯2⋅1. Example: 4!=4⋅3⋅2⋅1=24. Also 0!=1
(kn)
"n choose k"
Number of ways to pick k things out of n when order does not matter
∑
"add up"
Add all the things that follow
≤,≥
"at most", "at least"
≤ includes the number itself. < does not
Random variables
Symbol
Say it
Meaning
X
"big X"
The name of a random number. Example: X = number of heads
x
"small x"
One value that X can take. Example: x = 2
SX
"range of X"
The list of all values X can take
PX(x)
"PMF of X"
P[X=x]. The probability that X is exactly x
FX(x)
"CDF of X"
P[X≤x]. The probability that X is x or less
E[X],μX
"expected value", "mu"
The average of X. Both symbols mean the same thing
Var[X]
"variance"
How spread out the values are
σX
"sigma", standard deviation
Var[X]. The typical distance from the average
PX∣B(x)
"PMF of X given B"
The PMF after we learn that B happened
p
"small p"
Probability of success in one try
α,λ
"alpha", "lambda"
Greek letters used in Poisson. λ = average per second. α=λT = average in T seconds
e
"e"
A fixed number, about 2.718. Use the ex button on the calculator
ϵ
"epsilon"
A very, very small positive number. a−ϵ means "just before a"
1
Sets and basic probability
Week 2
1.1Four words you must know
Word
Simple meaning
Die example
Experiment
Something we do and watch
Roll a die once
Outcome
One possible result
The die shows 4
Sample spaceS
The list of all possible outcomes
S={1,2,3,4,5,6}
Event
A group of outcomes we care about
"Roll is even" ={2,4,6}
In simple words
The sample space is the full menu. An outcome is one dish. An event is a group of dishes, like "all the spicy ones".
The slides say the sample space must be three things:
Finest-grain: every different result is written separately.
Mutually exclusive: only one outcome can happen each time.
Collectively exhaustive: no possible outcome is missing.
Example from the slides
Flip four coins (penny, nickel, dime, quarter). Each shows head (h) or tail (t). How many outcomes are in the sample space?
Show solution
Each coin has 2 results. There are 4 coins. Multiply:
2⋅2⋅2⋅2=24=16
The outcomes look like: hhhh, hhht, hhth, ..., tttt.
Answer16 outcomes
1.2The four set operations
Events are sets, so we combine them with set operations. The blue area is the result.
A ∪ BA OR B (or both)
A ∩ BA AND B together
AᶜNOT A
A − Bin A but not in B
Try them with a die. Let A={1,2,3} and B={2,4,6}.
Write
Read
Result
A∪B
A or B
{1,2,3,4,6}
A∩B
A and B
{2}
Ac
not A
{4,5,6}
A−B
A but not B
{1,3}
Rules from the slides
A−B=A∩BcAc=S−A
De Morgan's law (how "not" moves inside brackets):
(A∪B)c=Ac∩Bc
(A∩B)c=Ac∪Bc
De Morgan in simple words
"Not (tea or coffee)" is the same as "no tea and no coffee". When "not" goes inside, or flips to and, and and flips to or.
Is A∩B=φ? If you find even one common outcome, the answer is no.
Collectively exhaustive
Together they cover everything.
Is A∪B=S? If even one outcome of S is missing, the answer is no.
A group of events that is both is called an event space. Every outcome falls in exactly one of them.
Picture
Cut a pizza into slices. The slices do not overlap (mutually exclusive) and together they make the whole pizza (collectively exhaustive). The slices are an event space.
Quick check with a die
A={2,4,6} and B={1,2}. Mutually exclusive? Collectively exhaustive?
Show solution
A∩B={2}. They share 2, so they are not mutually exclusive.
A∪B={1,2,4,6}. The outcomes 3 and 5 are missing, so they are not collectively exhaustive.
1.4The rules of probability
P[A] means "the probability of event A". The whole theory stands on three basic rules, called axioms:
The 3 axioms
P[A]≥0. A probability is never negative.
P[S]=1. Something from the sample space always happens.
If events are mutually exclusive, the probability of "one or the other" is the sum: P[A1∪A2∪⋯]=P[A1]+P[A2]+⋯
From these we get the tools you will use in every question:
Your toolbox
Not rule:
P[Ac]=1−P[A]
Or rule (always works):
P[A∪B]=P[A]+P[B]−P[A∩B]
Or rule when disjoint (nothing shared, so P[A∩B]=0):
P[A∪B]=P[A]+P[B]
Split rule (cut A into the part inside B and the part outside B):
P[A]=P[AB]+P[ABc]
Equally likely outcomes:
P[A]=number of outcomes in Snumber of outcomes in A
Also: P[φ]=0, and if A⊂B then P[A]≤P[B].
Why do we subtract in the "or" rule?
If you add P[A] and P[B], the shared part A∩B is counted two times. So we take it away once.
Writing note: P[A∩B], P[A,B] and P[AB] all mean the same thing: "A and B".
Example from the slides: fair die
Roll a six-sided die. All faces are equally likely. Find the probability of each outcome, and of: "roll 4 or higher", "roll an even number", "roll the square of an integer".
Show solution
6 outcomes, all equally likely. Each one has probability 61.
"4 or higher" ={4,5,6}. That is 3 outcomes: 63=21.
"Even" ={2,4,6}. That is 3 outcomes: 63=21.
"Square of an integer" means 12=1 or 22=4. So {1,4}: 62=31.
Answer61 each; then 21,21,31
1.5The table trick (for questions with two labels)
Many questions describe each outcome with two labels, for example voice/data and long/brief. Draw a small table. Rows are one label, columns are the other. Each row and each column must add up to its total, and everything adds up to 1.
Example from the slides: phone calls
A call is voice (V) or data (D). It is also long (L) or brief (B). Given: P[V]=0.7, P[L]=0.6, P[VL]=0.35. Find:
Someone gives you a hint: "B happened". Now you forget everything outside B. B becomes your new, smaller world. Then you ask: inside this world, how much is A?
Rule
P[A∣B]=P[B]P[AB]
Read: "probability of A given B" equals "probability of both" divided by "probability of the hint". It only makes sense when P[B]>0.
Fast way when all outcomes are equally likely: count inside the new world.
P[A∣B]=outcomes in Boutcomes in both A and B
Example from the slides: the urn
An urn has two black balls numbered 1 and 2, and two white balls numbered 3 and 4. One ball is selected, all equally likely. A = "ball is black". B = "number is even". C = "number is more than 2". Find P[A∣B] and P[A∣C].
Show solution
Write the sets. S={1,2,3,4}, A={1,2}, B={2,4}, C={3,4}.
P[A∣B]: the new world is B={2,4}. Inside it, the black balls are {2}. So P[A∣B]=21. With the formula: P[B]P[AB]=2/41/4=21
P[A∣C]: the new world is C={3,4}. No black ball is in it. So P[A∣C]=0.
AnswerP[A∣B]=21, P[A∣C]=0
Trap
P[A∣B] and P[B∣A] are different. The thing after the bar is the hint. Always divide by the probability of the hint.
2.2The multiplication rule
Move P[B] to the other side of the last rule:
Rule
P[AB]=P[A∣B]P[B]
"Probability of both" = "probability of the first" × "probability of the second, given the first".
This is exactly what you do when you multiply along a branch of a tree diagram.
2.3Tree diagrams
Use a tree when the experiment happens in steps (first this, then that).
The 3 tree rules
Branches that leave the same point add up to 1.
Multiply along a path to get the probability of that path.
Add the paths that give what you want.
Example from the slides: two traffic lights
The first light is equally likely red or green. With probability 0.8 the second light has the same colour as the first. Find: P[G2] (second light is green), P[W] (you wait for at least one light), and P[G1∣R2].
First light, then second light. Same colour again has probability 0.8.Show solution
Second light green. Add the paths that end in G2: P[G2]=P[G1G2]+P[R1G2]=0.4+0.1=0.5
Wait for at least one light. You wait if at least one light is red. The only path with no waiting is G1G2. Use the "not" rule: P[W]=1−P[G1G2]=1−0.4=0.6
First green given second red. Use the conditional rule. The hint is R2. P[R2]=0.1+0.4=0.5 P[G1∣R2]=P[R2]P[G1R2]=0.50.1=0.2
AnswerP[G2]=0.5, P[W]=0.6, P[G1∣R2]=0.2
The "at least one" trick
"At least one" is hard to count directly. Its opposite, "none", is one single path. So: P[at least one] = 1 − P[none]. You will use this many times.
2.4Law of total probability
In simple words
You want P[A], but A can happen in several different situations B1,B2,… (an event space, like the pizza slices). Find A inside each situation, weigh it by how likely that situation is, and add.
Rule
P[A]=i=1∑mP[A∣Bi]P[Bi]
For three situations: P[A]=P[A∣B1]P[B1]+P[A∣B2]P[B2]+P[A∣B3]P[B3].
In a tree: this is "add all paths that end in A".
Example from the slides: resistors
Three machines make resistors. 80% of the resistors from B1 are acceptable (A), 90% from B2, 60% from B3. Each hour B1 makes 3000, B2 makes 4000, B3 makes 3000. They are all mixed. What is the probability that a resistor is acceptable? Also: what is the probability of picking a resistor from B2 that is not acceptable (N)?
Multiply along each path. The numbers on the right add up to 1.Show solution
Which machine? Total is 3000+4000+3000=10000. So P[B1]=0.3, P[B2]=0.4, P[B3]=0.3.
Given the machine:P[A∣B1]=0.8, P[A∣B2]=0.9, P[A∣B3]=0.6.
Add all paths that end in A: P[A]=0.8(0.3)+0.9(0.4)+0.6(0.3)=0.24+0.36+0.18=0.78
From B2 and not acceptable: one path. P[B2N]=0.4×0.1=0.04
AnswerP[A]=0.78 and P[B2N]=0.04
2.5Bayes' theorem: turning the question around
In simple words
You know "given the machine, how likely is a good resistor". The question asks the reverse: "given a good resistor, how likely is it from this machine?" Bayes flips the direction.
Rule
P[B∣A]=P[A]P[A∣B]P[B]
In a tree: (the one path you want) ÷ (all paths that end in A).
Example: resistors again
A resistor is acceptable. What is the probability it came from machine B3?
Top: the path B3A. Bottom: all three paths that end in A.
2.6Independent events
In simple words
A and B are independent when knowing one tells you nothing about the other. Example: a coin flip and a die roll.
The test
A and B are independent exactly when:
P[AB]=P[A]P[B]
Same thing, written another way: P[A∣B]=P[A] and P[B∣A]=P[B]. The hint changes nothing.
Biggest trap of this lesson
Independent is not the same as disjoint.
Disjoint: they cannot happen together. P[AB]=0.
Independent: they do not affect each other. P[AB]=P[A]P[B].
If A and B are disjoint (and both have probability more than 0), they are not independent. Why? If A happens, you know for sure B did not. That is a lot of information.
Example from the slides: three test lights
Three tests, each light is red (r) or green (g). All 8 sequences are equally likely. R2 = second light red, G2 = second light green, R1 = first light red. (a) Are R2 and G2 independent? (b) Are R1 and R2 independent?
Show solution
S={rrr,rrg,rgr,rgg,grr,grg,ggr,ggg}. Each outcome has probability 81.
(a)P[R2]=84=21 and P[G2]=21. The second light cannot be red and green together, so P[R2G2]=0. Test: P[R2]P[G2]=41=0. Not independent. (They are disjoint.)
(b)R1R2={rrr,rrg}, so P[R1R2]=82=41. Test: P[R1]P[R2]=21⋅21=41. Equal. Independent.
Example from the slides: circuit with two tests
A circuit has a mechanical test and an electrical test. Failures are independent. Mechanical failure has probability 0.05. Electrical failure has probability 0.2. Find the probability of each of the four results.
Show solution
Independent means: multiply. Let M = mechanical fails, E = electrical fails. Then P[Mc]=0.95, P[Ec]=0.8.
If step 1 can go n ways and step 2 can go k ways, then both steps together can go n×k ways.
Example from the slides: flip a coin (2 results) and roll a die (6 results). Together: 2×6=12 outcomes.
Picture
3 shirts and 2 trousers give 3×2=6 outfits. For every shirt you can pick any of the trousers.
3.2The two questions that pick the formula
Before any counting question, ask:
Can things repeat? (Can the same item be used again?)
Does order matter? (Is AB different from BA?)
Situation
Formula
Example
Repeat allowed, order matters "sampling with replacement"
mn
4-digit PIN: 104
No repeat, order matters "k-permutation"
(n)k=(n−k)!n!
Deal 3 cards in order: 52⋅51⋅50
No repeat, use all n, order matters
n!
Shuffle a deck: 52!
No repeat, order does not matter "k-combination"
(kn)=k!(n−k)!n!
Choose 7 cards as a hand: (752)
Arrange n items made of groups of identical items "multinomial"
n0!n1!⋯nm−1!n!
3 A's, 5 B's, 2 C's for 10 students
What the letters mean
mn: m = number of choices for each position, n = number of positions.
(n)k and (kn): n = how many things you choose from, k = how many you pick.
(n−k)!n! is just the first k numbers counting down from n. Example: 49!52!=52⋅51⋅50.
How to compute "n choose k" by hand
(35)=3!2!5!=(3⋅2⋅1)(2⋅1)5⋅4⋅3⋅2⋅1=12120=10
On the calculator it is the nCr button: 5 nCr 3 = 10. Useful fact: (kn)=(n−kn), so (35)=(25).
3.3Examples from the slides
Cards in order
Shuffle a deck and choose three cards in order. How many outcomes?
Show solution
No repeat (a card cannot come twice), order matters. So it is a k-permutation with n=52, k=3:
(52)3=(52−3)!52!=52⋅51⋅50=132600
Seven cards, no queens
We draw seven cards. What is the probability of getting a hand without any queens?
Show solution
A hand is a group. Order does not matter. So use "choose".
All possible hands: (752).
Hands with no queen: remove the 4 queens. Choose 7 from the other 48: (748).
All hands are equally likely, so divide:
P=(752)(748)≈0.550
Binary code words with 4 bits
Each code word has 4 bits (0 or 1), like 0110. (1) How many code words are there? (2) How many have exactly two zeroes? (3) How many begin with a zero? (4) With N = 8 bits and exactly M = 3 ones, how many code words?
Show solution
Each of 4 positions has 2 choices, repeats allowed: 24=16.
Choose which 2 of the 4 positions hold the zeroes: (24)=6.
The first bit is fixed (0). The other 3 bits are free: 23=8.
Choose which 3 of the 8 positions hold the ones: (38)=56.
Answer16, 6, 8, 56
Grades for 10 students
10 students take an exam. 3 of them get A, 5 get B, 2 get C. How many ways are there to distribute the grades?
Show solution
We arrange 10 grades, but the 3 A's are identical, the 5 B's are identical, the 2 C's are identical. This is the multinomial formula:
3!5!2!10!=6⋅120⋅23628800=2520
Trap
"How many words with exactly two zeroes" is notmn. The word "exactly" means you are choosing positions, so use (kn).
3.4Independent trials
In simple words
Repeat the same small experiment n times. Each time it is a success with probability p or a failure with probability 1−p. The tries do not affect each other. What is the chance of getting exactly n1 successes?
Rule
P[n0 failures and n1 successes]=(n1n)(1−p)n0pn1
where n=n0+n1 is the total number of tries.
Read it in three pieces:
pn1: the successes all happen.
(1−p)n0: the failures all happen.
(n1n): the number of different orders in which they can happen.
Example from the slides: sending one bit five times
A phone sends the same bit 5 times. The receiver is right if 3 or more of the 5 are received correctly. Each bit is wrong with probability q=0.1. What is the probability P[E] that the information is wrong?
Show solution
The information is wrong when 3, 4 or 5 of the bits are wrong. (Then fewer than 3 are correct.)
Here "success" = a bit is wrong, with p=0.1. There are n=5 tries.
3 wrong: (35)(0.1)3(0.9)2=10×0.001×0.81=0.0081
4 wrong: (45)(0.1)4(0.9)1=5×0.0001×0.9=0.00045
5 wrong: (55)(0.1)5=0.00001
Add: P[E]=0.0081+0.00045+0.00001=0.00856
AnswerP[E]=0.00856
This rule comes back in lesson 4 with a new name: the binomial random variable.
A random variable is a rule that turns each outcome into a number. Outcomes are often words or letters (like "hht"). We want numbers, so we can do maths with them.
Capital letterX: the name of the random number. Example: X = "number of heads".
Small letterx: one value it can take. Example: x=2.
{X=x} is an event: "X came out equal to x".
SX: the range. The list of all values X can take.
Discrete random variable: you can list its values one by one (0, 1, 2, ...). The whole course is about these.
Example from the slides: three phone calls
We observe three calls. Each is voice (v) or data (d), equally likely. X = number of voice calls. Y = number of data calls. R = XY (X times Y). Write the sample space and the values of X, Y, R.
Show solution
2⋅2⋅2=8 outcomes, each with probability 81.
Outcome
Prob.
X (voice)
Y (data)
R = XY
ddd
1/8
0
3
0
ddv
1/8
1
2
2
dvd
1/8
1
2
2
dvv
1/8
2
1
2
vdd
1/8
1
2
2
vdv
1/8
2
1
2
vvd
1/8
2
1
2
vvv
1/8
3
0
0
So R can only be 0 or 2: SR={0,2}.
4.2The PMF
Definition
PX(x)=P[X=x]
PMF = probability mass function. It is a price list: for each value x, it tells you the probability that X is exactly x.
Reading the symbol: the small X below the P says which random variable. The (x) is the value you ask about.
How to build a PMF (always the same 3 steps):
List the values X can take.
For each value, add the probabilities of all outcomes that give it.
Write it in the "brace form", and finish with 0 otherwise.
Example: PMF of R (three calls)
From the table above: R = 0 for 2 outcomes (ddd, vvv). R = 2 for the other 6 outcomes.
PR(r)=⎩⎨⎧1/43/40r=0r=2otherwise
PR(0)=82=41 and PR(2)=86=43. "Otherwise" means every other number has probability 0.
Example from the slides: two free throws
Wilt Chamberlain shoots two free throws. Each shot is good (g) or bad (b), equally likely. A good shot is 1 point. Find the PMF of X, the number of points.
Show solution
Outcomes: bb, bg, gb, gg. Each has probability 41.
A student takes two courses. In each one the grade is B (3 points) with probability 0.6 or C (2 points) with probability 0.4, independently. G = average of the two. Find the values of G and their probabilities.
Show solution
Outcome
Probability
G
BB
0.6 × 0.6 = 0.36
3
BC
0.6 × 0.4 = 0.24
2.5
CB
0.4 × 0.6 = 0.24
2.5
CC
0.4 × 0.4 = 0.16
2
So PG(2)=0.16, PG(2.5)=0.48, PG(3)=0.36.
4.3The three PMF rules
Theorem from the slides
PX(x)≥0. No negative probabilities.
x∈SX∑PX(x)=1. All the probabilities add up to 1.
P[B]=x∈B∑PX(x). For any event B, add the PMF of the values inside B.
How these rules are used in the exam
Rule 2 finds an unknown constant c: write the sum, set it equal to 1, solve for c.
Rule 3 answers "find P[X≥2]" or "find P[X is even]": pick the values that fit, add their probabilities.
Put in each value: PN(1)=1c, PN(2)=2c, PN(3)=3c. They must add to 1:
c+2c+3c66c+3c+2c611c=1=1=1⇒c=116
P[N=1]=c=116
P[N≥2]=PN(2)+PN(3)=113+112=115
P[N>3]=0. N can never be bigger than 3.
Answerc=116; then 116,115,0
4.4The six famous families
Some stories come back again and again, so their PMFs have names. In the exam your first job is to recognise the story. Then you copy the formula and put in the numbers.
In all of them: p = probability of success in one try, and 1−p = probability of failure.
1. Bernoulli (p)
Story: one try. X = 1 if success, X = 0 if failure.
PX(x)=⎩⎨⎧1−pp0x=0x=1otherwise
E[X]=pVar[X]=p(1−p)
2. Binomial (n, p)
Story: do a fixed number n of tries. X = how many successes.
PX(x)=(xn)px(1−p)n−x
for x=0,1,…,n, and 0 otherwise.
Read: (which x tries succeed) × (x successes) × (n − x failures). It is the independent trials rule from lesson 3.
E[X]=npVar[X]=np(1−p)
3. Geometric (p)
Story: keep trying until the first success. X = number of tries (the success is counted).
PX(x)={p(1−p)x−10x=1,2,3,…otherwise
Read: first x−1 failures, then one success.
E[X]=1/pVar[X]=(1−p)/p2
4. Pascal (k, p)
Story: keep trying until the k-th success. X = number of tries. ("k-th" means number k in order: 2nd, 3rd, ...)
PX(x)=(k−1x−1)pk(1−p)x−k
for x=k,k+1,…, and 0 otherwise.
Read: the last try is the k-th success. Before it, the other k−1 successes sit somewhere in the first x−1 tries. With k=1 it becomes the geometric.
E[X]=k/pVar[X]=k(1−p)/p2
5. Discrete uniform (k, l)
Story: every whole number from k to l is equally likely. (A fair die is uniform (1, 6).)
PX(x)=⎩⎨⎧l−k+110x=k,k+1,…,lotherwise
l−k+1 is just how many values there are. From 5 to 15 there are 15−5+1=11 values.
E[X]=(k+l)/2Var[X]=(l−k)(l−k+2)/12
6. Poisson (α)
Story: count how many arrivals (calls, hits, queries) happen in a time interval.
PX(x)=⎩⎨⎧x!αxe−α0x=0,1,2,…otherwise
α=λT
λ (lambda) = average arrivals per second. T = length of the interval. α (alpha) = average number of arrivals in that interval.
E[X]=αVar[X]=α
4.5Which family is it? Look for these words
Words in the question
Family
One try, yes or no
Bernoulli (p)
"Sends n times", "100 bits", "number of successes / errors in n tries"
Binomial (n, p)
"Until the first error / success", "number of tries needed"
Geometric (p)
"Until the third error", "until the k-th success"
Pascal (k, p)
"Uniformly distributed between ... and ...", "equally likely"
Discrete uniform (k, l)
"Average rate", "per second", "in an interval of T seconds", "arrivals"
Poisson (α = λT)
The quick question to ask yourself
What is fixed, and what is counted?
Number of tries is fixed, I count successes: binomial.
Number of successes is fixed (1 or k), I count tries: geometric or Pascal.
A time interval is fixed, I count arrivals: Poisson.
Traps
"Success" is whatever the question counts. In the modem question the "success" is an error.
Geometric and Pascal start at x=1 and x=k. Binomial and Poisson start at x=0.
Poisson: if the time interval changes, α changes. Always compute α=λT again.
"At least one" = 1−PX(0). "At least two" = 1−PX(0)−PX(1).
4.6Poisson examples from the slides
Web site hits (Week 4)
Hits at a web site are Poisson with λ=2 hits per second. (a) What is the probability of no hits in 0.25 seconds? (b) What is the probability of no more than two hits in one second?
Show solution
(a)T=0.25, so α=λT=2×0.25=0.5. "No hits" means x=0:
PX(0)=0!0.50e−0.5=e−0.5≈0.607
(Remember: any number to the power 0 is 1, and 0!=1.)
(b) New interval: T=1, so α=2×1=2. "No more than two" means 0, 1 or 2:
The number of queries in any 10-second interval is Poisson with α=5. (a) Probability of no queries in a 10-second interval? (b) Probability of at least two queries in a 2-second interval?
Show solution
(a)α=5: PK(0)=e−5≈0.0067
(b) The interval changed. 5 queries in 10 seconds means λ=105=0.5 per second. For 2 seconds: α=0.5×2=1.
CDF = cumulative distribution function. "Cumulative" means "collected so far". FX(x) is the probability that X is x or less.
In simple words
The PMF is the money you get on each day. The CDF is the total in your pocket so far. To get the CDF, walk from left to right and keep adding the PMF.
PMF PX(x)
CDF FX(x)
Asks
X is exactly x?
X is x or less?
Symbol
P[X=x]
P[X≤x]
Graph
Separate bars
A staircase going up
5.2From PMF to CDF
Example from the slides: CDF of R
R has PR(0)=41 and PR(2)=43. Find and sketch the CDF.
PMF of R: one bar for each possible value.
Walk from left to right and ask "how much probability have I passed so far?"
Before 0: nothing yet. Total = 0.
From 0 up to just before 2: we passed the bar at 0. Total = 41.
From 2 onward: we also passed the bar at 2. Total = 41+43=1.
FR(r)=⎩⎨⎧01/41r<00≤r<2r≥2
CDF of R. Filled dot = the value AT that point. Empty dot = not included.
What every CDF looks like (theorem from the slides)
It starts at 0 on the far left and ends at 1 on the far right.
It never goes down.
It jumps at each value X can take. The height of the jump at xi is PX(xi).
Between jumps it is flat (a horizontal line).
How to read the brace form
Look at the line "41 for 0≤r<2". The left side has ≤, so the jump happens at 0 and the value at 0 is already 41 (filled dot). The right side has <, so at 2 this line is finished (empty dot) and the next line takes over.
5.3From CDF back to PMF
Rule: the PMF is the jump
X can only take the values where the CDF jumps. At each one:
PX(xi)=−(height after the jump)(height before the jump)
Example: a CDF goes 0 → 0.2 at x=−1, then 0.2 → 0.7 at x=0, then 0.7 → 1 at x=1. So PX(−1)=0.2, PX(0)=0.7−0.2=0.5, PX(1)=1−0.7=0.3. Check: 0.2+0.5+0.3=1.
5.4Reading probabilities from a CDF
This is asked a lot. Learn this table. "Just before a" is written a−ϵ in the slides (ϵ is a tiny positive number).
You want
Do this
In words
P[X≤a]
FX(a)
Height at a (the filled dot)
P[X<a]
FX(a−ϵ)
Height just before a
P[X>a]
1−FX(a)
1 minus the height at a
P[X≥a]
1−FX(a−ϵ)
1 minus the height just before a
P[X=a]
jump at a
How much it jumps at a (0 if no jump)
P[a<X≤b]
FX(b)−FX(a)
Height at b minus height at a
The safest method
If the table feels hard: first write the PMF from the jumps. Then every question becomes "add the PMF of the values that fit". It always works and it is hard to get wrong.
Trap: < and ≤ are different
For discrete random variables, P[X<1] and P[X≤1] are different when X can be exactly 1. The difference is P[X=1], the jump at 1.
The opposite of "≤1" is ">1". The opposite of "<1" is "≥1". So P[X≥2]=1−P[X≤1], not 1−P[X≤2].
Part (d) of Q12 asks for the expected value. That is lesson 6: value × probability, then add.
6
Expected value and variance
Week 5, second half
6.1Three kinds of average for a list of numbers
Name
How
Mean
Add all the numbers, divide by how many there are
Median
Sort them, take the middle one (for an even count: halfway between the two middle ones)
Mode
The number that appears most often
Example from the slides: quiz grades
10 students have grades: 9, 5, 10, 8, 4, 7, 5, 5, 8, 7. Find the mean, the median and the mode.
Show solution
Sort first: 4, 5, 5, 5, 7, 7, 8, 8, 9, 10
Mean: the sum is 68. 68÷10=6.8
Median: 10 numbers, so the middle two are the 5th and 6th: 7 and 7. Median = 7
Mode: 5 appears three times, more than any other. Mode = 5
AnswerMean 6.8, median 7, mode 5
For a random variable the same three ideas use probabilities:
Modexmod: the value with the biggest PMF. PX(xmod)≥PX(x) for all x.
Medianxmed: the value that splits the probability in two equal sides. P[X<xmed]=P[X>xmed].
Mean: called the expected value. See next.
6.2Expected value E[X]
Definition
E[X]=μX=x∈SX∑xPX(x)
Take each value, multiply by its probability, and add. E[X] and μX ("mu") are two names for the same number.
In simple words
It is the long-run average. Repeat the experiment thousands of times and average the results: you get close to E[X]. It does not have to be a value X can really take. The average of a die is 3.5, but you never roll 3.5.
Example from the slides: E[R]
PR(0)=41, PR(2)=43. What is E[R]?
Show solution
E[R]=0⋅41+2⋅43=23=1.5
Example from the slides: cost of a call
A call is voice with P[V]=0.7 or data with P[D]=0.3. Voice costs 25 cents, data costs 40 cents. C = cost of one call. Find (1) the PMF PC(c), (2) E[C].
Show solution
C is 25 when the call is voice, and 40 when it is data:
PC(c)=⎩⎨⎧0.70.30c=25c=40otherwise
E[C]=25(0.7)+40(0.3)=17.5+12=29.5 cents
AnswerE[C]=29.5 cents
6.3Variance and standard deviation
Why we need them
Class A: two students both got 5. Class B: one got 0, one got 10. Both classes have average 5, but B is far more spread out. Variance is the number that measures this spread.
Definitions
Var[X]=E[(X−μX)2]=x∈SX∑(x−μX)2PX(x)
Variance = the average of the squared distances from the centre μX.
σX=Var[X]
Standard deviation σX ("sigma") = square root of the variance. It is the typical distance from the centre, in the same units as X. Also Var[X]=σX2.
The shortcut you will use in the exam
Var[X]=E[X2]−(E[X])2
where E[X2]=x∈SX∑x2PX(x): square each value first, then multiply by its probability, then add.
The 4-step recipe (same every time)
E[X]: value × probability, add.
E[X2]: value² × probability, add.
Var[X]=E[X2]−(E[X])2.
σX=Var[X].
Traps
E[X2] and (E[X])2 are different. In the first you square inside (before averaging). In the second you square the final average.
A negative value squared is positive: (−3)2=9.
Variance can never be negative. If you get a negative number, check your work.
In the long formula you multiply by the probabilityPX(x), not by μX.
Example from the slides: Var[R]
PR(0)=41, PR(2)=43, and E[R]=1.5. What is the variance of R?
Show solution
E[R2]=02⋅41+22⋅43=0+3=3
Var[R]=E[R2]−(E[R])2=3−(1.5)2=3−2.25=0.75
Check with the long formula: (0−1.5)2⋅41+(2−1.5)2⋅43=0.5625+0.1875=0.75. Same.
AnswerVar[R]=0.75, so σR=0.75≈0.866
Example from the slides: voltage V
PV(v)={1/70v=−3,−2,…,3otherwise
What is the variance of V?
Show solution
The values are −3, −2, −1, 0, 1, 2, 3. Seven values, each with probability 71.
E[V]=71(−3−2−1+0+1+2+3)=0. The values balance around 0.
E[V2]=71(9+4+1+0+1+4+9)=728=4
Var[V]=4−02=4
Check with the uniform formula, k=−3, l=3: 12(l−k)(l−k+2)=126⋅8=4. Same.
AnswerVar[V]=4
Example from the slides: two calls
PN(n)=⎩⎨⎧0.10.40.50n=0n=1n=2otherwise
Find (1) E[N], (2) the second moment E[N2], (3) Var[N], (4) σN.
Show solution
E[N]=0(0.1)+1(0.4)+2(0.5)=1.4
E[N2]=02(0.1)+12(0.4)+22(0.5)=0.4+2=2.4
Var[N]=2.4−(1.4)2=2.4−1.96=0.44
σN=0.44≈0.663
Answer1.4, 2.4, 0.44, 0.663
6.4Moments (just names)
Name
Formula
What it is
1st moment
E[X]
The average
2nd moment
E[X2]
Square, then average
n-th moment
E[Xn]
Same idea with power n
2nd central moment
E[(X−μX)2]
The variance
If the exam says "find the second moment", it just means E[X2].
6.5Variance of aX + b
Theorem
Var[aX+b]=a2Var[X]
Adding a number b changes nothing. Multiplying by a multiplies the variance by a2.
Why
If every student steps 3 metres forward, the gaps between them stay the same: adding does not change the spread. If you zoom a photo 2 times, every gap becomes 2 times bigger, and variance (a squared distance) becomes 22=4 times bigger.
Special cases from the slides: Var[b]=0 (a constant has no spread) and Var[X+b]=Var[X].
Example: if Var[X]=4, then Var[X+10]=4, Var[3X]=9⋅4=36, Var[2X−5]=4⋅4=16.
6.6Ready-made E[X] and Var[X] for the six families
If the question names the family, do not build a table. Use these directly.
Family
E[X]
Var[X]
Bernoulli (p)
p
p(1−p)
Binomial (n, p)
np
np(1−p)
Geometric (p)
p1
p21−p
Pascal (k, p)
pk
p2k(1−p)
Poisson (α)
α
α
Uniform (k, l)
2k+l
12(l−k)(l−k+2)
How to remember with less effort
Binomial = n Bernoullis. So multiply Bernoulli by n: np and np(1−p).
Pascal = k geometrics in a row. So multiply geometric by k: k/p and k(1−p)/p2.
Poisson: mean and variance are the same number α.
Uniform mean is the midpoint: (smallest + largest) ÷ 2.
Using the table backwards
Sometimes the exam gives you E[X] and asks for the PMF. Find the parameter from the table, then write the family formula. Example: geometric with E[X]=30 means p1=30, so p=301.
This is lesson 2 (conditional probability) meeting lesson 4 (PMF). Someone gives a hint about X, for example "X is 5 or more". The values that do not fit the hint become impossible. The values that fit share all the probability between them.
Definition
PX∣B(x)=P[X=x∣B]
Read: "the PMF of X given B". B is the hint (the "conditioning event").
The rule you actually use
PX∣B(x)=⎩⎨⎧P[B]PX(x)0x∈Botherwise
Keep the values inside B and divide each by P[B]. Everything outside B becomes 0.
The 3-step recipe
List the values of X that fit the hint. That is B.
Find P[B]: add the PMF of those values.
Divide the PMF of each kept value by P[B]. Check: the new numbers add up to 1.
Warm-up: a die
Roll a fair die. Hint: "the number is even". Find the conditional PMF.
Show solution
B={2,4,6}.
P[B]=61+61+61=21.
Each kept value: 1/21/6=31. The values 1, 3, 5 get 0.
PX∣B(x)={1/30x=2,4,6otherwise
Example from the slides: fax machines
The length X of a fax (in pages) has PMF
PX(x)=⎩⎨⎧0.150.10x=1,2,3,4x=5,6,7,8otherwise
The company has two machines: one for faxes shorter than five pages, one for faxes with five or more pages. What is the PMF of the fax length in the second machine?
Show solution
The second machine gets the long faxes. The hint is L={X≥5}={5,6,7,8}.
P[L]=0.1+0.1+0.1+0.1=0.4.
Each kept value: 0.40.1=0.25.
PX∣L(x)={0.250x=5,6,7,8otherwise
Check: 4×0.25=1.
Example from the slides: waiting for a bus
X is the time in whole minutes you wait for a bus:
PX(x)={1/200x=1,2,…,20otherwise
The bus has not arrived by the eighth minute. What is the conditional PMF of your waiting time X?
Show solution
"Not arrived by minute 8" means the wait is more than 8: B={X>8}={9,10,…,20}. That is 12 values.
P[B]=12×201=2012.
Each kept value: 12/201/20=121.
PX∣X>8(x)={1/120x=9,10,…,20otherwise
A conditional PMF is still a PMF (theorem from the slides)
PX∣B(x)≥0 for any x in B.
x∈B∑PX∣B(x)=1.
For any event C inside B: P[C∣B]=x∈C∑PX∣B(x).
7.2The other direction: mixing several PMFs
In simple words
Sometimes the question gives you one PMF for each situation (rainy day or sunny day, image page or text page). You want the one overall PMF. This is the law of total probability from lesson 2, written with PMFs.
Rule
PX(x)=i=1∑mPX∣Bi(x)P[Bi]
For each situation Bi: (PMF in that situation) × (probability of that situation). Then add.
Example from the slides: the 70-year-old
X = number of additional years a 70-year-old person lives. With high blood pressure (event H), X is geometric (p = 0.1). With regular blood pressure (event R), X is geometric (p = 0.05). Find PX∣H(x) and PX∣R(x). If 40% of all 70-year-olds have high blood pressure, what is the PMF of X?
Show solution
Geometric formula: p(1−p)x−1 for x=1,2,… Put in each p:
PX∣H(x)={0.1(0.9)x−10x=1,2,…otherwise
PX∣R(x)={0.05(0.95)x−10x=1,2,…otherwise
P[H]=0.4, so P[R]=1−0.4=0.6.
Mix them: PX(x)=PX∣H(x)P[H]+PX∣R(x)P[R]
PX(x)=0.04(0.9)x−1+0.03(0.95)x−1
for x=1,2,…, and 0 otherwise.
(because 0.4×0.1=0.04 and 0.6×0.05=0.03)
7.3Conditional expected value and variance
Nothing new here. Do the same recipe as lesson 6, but with the conditional PMF in place of the PMF.
Rules
E[X∣B]=μX∣B=x∈B∑xPX∣B(x)
E[X2∣B]=x∈B∑x2PX∣B(x)
Var[X∣B]=E[X2∣B]−(E[X∣B])2
And to get the overall average from the averages in each situation:
E[X]=i=1∑mE[X∣Bi]P[Bi]
Example from the slides: long faxes
For the fax PMF above, find the conditional expected value, the conditional variance and the conditional standard deviation for the long faxes.
Show solution
From before: PX∣L(x)=0.25 for x=5,6,7,8.
E[X∣L]=0.25(5+6+7+8)=0.25×26=6.5 pages
E[X2∣L]=0.25(25+36+49+64)=0.25×174=43.5
Var[X∣L]=43.5−(6.5)2=43.5−42.25=1.25
σX∣L=1.25≈1.12 pages
Answer6.5, 1.25, 1.12
Big example from the slides: web pages
N = number of packets needed to send a web page. If the page has images (event I), N is uniform between 1 and 50. If the page is just text (event T), N is uniform between 1 and 5. A page has images with probability 1/4. Find:
Mix them with P[I]=41 and P[T]=43.
For n=1 to 5, both situations are possible: 501⋅41+51⋅43=0.005+0.15=0.155
For n=6 to 50, only images are possible: 501⋅41=0.005
Cover the solution. Try alone first. Then open it and compare step by step.
Tap Mark done when everyone understands the question. 0 of 19 done
Each question has a tag that tells you which lesson it comes from.
Q1Sets · Lesson 1
An integrated circuit factory has three machines X, Y and Z. Test one circuit produced by each machine. Either a circuit is acceptable (a) or it fails (f). An observation is a sequence of three test results for the circuits from X, Y and Z, in that order. For example, aaf means the circuits from X and Y pass and the circuit from Z fails.
(a) What are the elements of the sample space?
(b) What are the elements of the sets ZF = {circuit from Z fails} and XA = {circuit from X is acceptable}?
(c) Are ZF and XA mutually exclusive?
(d) Are ZF and XA collectively exhaustive?
(e) What are the elements of the sets C = {more than one circuit acceptable} and D = {at least two circuits fail}?
(f) Are C and D mutually exclusive?
(g) Are C and D collectively exhaustive?
Key idea: the 1st letter is machine X, the 2nd is Y, the 3rd is Z. Mutually exclusive = share nothing. Collectively exhaustive = together they cover all of S.
Show solution
(a) Three positions, 2 choices each: 23=8 outcomes.
S={aaa,aaf,afa,aff,faa,faf,ffa,fff}
(b)ZF: the third letter is f. XA: the first letter is a.
ZFXA={aaf,aff,faf,fff}={aaa,aaf,afa,aff}
(c) Do they share anything? ZF∩XA={aaf,aff}. This is not empty. No, not mutually exclusive.
(d) Do they cover all of S? ZF∪XA={aaa,aaf,afa,aff,faf,fff}. The outcomes faa and ffa are missing. No, not collectively exhaustive.
(e) "More than one acceptable" = 2 or 3 a's. "At least two fail" = 2 or 3 f's.
CD={aaa,aaf,afa,faa}={aff,faf,ffa,fff}
(f)C∩D=φ. They share nothing. Yes, mutually exclusive.
(g)C∪D has all 8 outcomes, so it equals S. Yes, collectively exhaustive.
Why (f) and (g) work: with 3 circuits, either at least 2 are acceptable or at least 2 fail. Never both, and always one of them.
Q2Equally likely · Lesson 1
Shuffle a deck of cards and turn over the first card. What is the probability that the first card is a heart?
Key idea: all 52 cards are equally likely. Count and divide.
Show solution
A deck has 52 cards in 4 suits (hearts, diamonds, clubs, spades). Each suit has 13 cards.
P[heart]=all cardshearts=5213=41
Answer41=0.25
Q3Table trick · Lesson 1
There are two types of cellular phones: handheld phones (H) and mobile phones (M). Phone calls can be classified by the speed of the user as fast (F) or slow (W). Monitor a call and observe the type of phone and the speed of the user. The probability model has: P[F]=0.5, P[HF]=0.2, P[MW]=0.1.
What is the sample space of the experiment? Calculate: (a) P[W] (b) P[MF] (c) P[H]
Key idea: two labels (phone type and speed), so draw a 2 × 2 table.
Show solution
Sample space. Each call has a type and a speed: S={HF,HW,MF,MW}.
Table. The bold numbers are given. Fill the others by subtracting.
F (fast)
W (slow)
Total
H
0.2
0.4
0.6
M
0.3
0.1
0.4
Total
0.5
0.5
1
(a) A call is fast or slow, never both: P[W]=1−P[F]=1−0.5=0.5
(b) Column F must add to 0.5: P[MF]=P[F]−P[HF]=0.5−0.2=0.3
(c) Column W must add to 0.5: P[HW]=P[W]−P[MW]=0.5−0.1=0.4. Row H: P[H]=P[HF]+P[HW]=0.2+0.4=0.6
Answer(a) 0.5 (b) 0.3 (c) 0.6
Q4Disjoint and independent · Lessons 1, 2
In an experiment, A and B are events with probabilities P[A∪B]=43 and P[A]=41. Furthermore, A and B are disjoint.
Find P[A∩B], P[B], P[A∩Bc] and P[A∪Bc]. Are A and B independent?
Key idea: "disjoint" means they share nothing, so P[A∩B]=0. Draw two circles that do not touch.
Show solution
P[A∩B]. Disjoint means no overlap: P[A∩B]=0
P[B]. For disjoint events P[A∪B]=P[A]+P[B]. So 43=41+P[B], which gives P[B]=21
P[A∩Bc] means "in A and not in B". A is completely outside B, so all of A is "not in B". P[A∩Bc]=P[A]=41
P[A∪Bc] means "in A, or not in B". A is already inside "not B", so adding A changes nothing: A∪Bc=Bc. P[A∪Bc]=P[Bc]=1−21=21
Independent? Test: is P[AB]=P[A]P[B]? Left side: 0. Right side: 41⋅21=81. Not equal. Not independent.
Answer0,21,41,21. A and B are not independent.
Remember: disjoint events (with probability above 0) are never independent.
Q5Counting · Lesson 3
Consider a language containing four letters: A, B, C, D. How many three-letter words can you form in this language? How many four-letter words can you form if each letter appears only once in each word?
Key idea: ask "can letters repeat?" In the first part yes. In the second part no.
Show solution
Three-letter words. Nothing says letters cannot repeat (AAB is a word). 3 positions, 4 choices each. This is mn with m=4, n=3:
4⋅4⋅4=43=64
Four-letter words, each letter once. No repeats, order matters, and we use all 4 letters. First position: 4 choices, then 3, then 2, then 1:
4⋅3⋅2⋅1=4!=24
Answer64 three-letter words and 24 four-letter words
Q6Counting · Lesson 3
Consider a binary code with 5 bits (0 or 1) in each code word. An example of a code word is 01010. How many different code words are there? How many code words have exactly three 0's?
Key idea: "how many in total" is mn. "Exactly three 0's" means choosing positions, so use "n choose k".
Show solution
All code words. 5 positions, 2 choices each: 25=32
Exactly three 0's. Choose which 3 of the 5 positions hold the zeros. The other two are 1's automatically.
(35)=3!2!5!=6⋅2120=10
Answer32 code words. 10 of them have exactly three 0's.
Q7Tree diagram · Lesson 2
A machine produces photo detectors in pairs. Tests show that the first photo detector is acceptable with probability 3/5. When the first photo detector is acceptable, the second photo detector is acceptable with probability 4/5. If the first photo detector is defective, the second photo detector is acceptable with probability 2/5. Use a tree diagram to find the following.
(a) What is the probability that exactly one photo detector of a pair is acceptable? (b) What is the probability that both photo detectors in a pair are defective?
Key idea: branches from one point add to 1. Multiply along a path. Add the paths you want.
Show solution
Build the tree. Fill in the missing branches with "1 minus":
First detector: acceptable 53, so defective 1−53=52.
After an acceptable first: second acceptable 54, so defective 51.
After a defective first: second acceptable 52, so defective 53.
A = acceptable, D = defective. 1 means first detector, 2 means second.
(a) Exactly one acceptable. Two paths (green in the tree): "first good, second bad" and "first bad, second good".
You have a six-sided die that you roll once. Let Ri denote the event that the roll is i. Let Gj denote the event that the roll is greater than j. Let E denote the event that the roll of the die is even-numbered.
(a) What is P[R3∣G1], the conditional probability that 3 is rolled given that the roll is greater than 1?
(b) What is the conditional probability that 6 is rolled given that the roll is greater than 3?
(c) What is P[G3∣E], the conditional probability that the roll is greater than 3 given that the roll is even?
(d) Given that the roll is greater than 3, what is the conditional probability that the roll is even?
Key idea: the hint (after the bar) becomes the new world. Count inside it.
Show solution
First translate the names into sets:
R3={3}, R6={6}
G1={2,3,4,5,6} (greater than 1), G3={4,5,6} (greater than 3)
E={2,4,6}
(a) New world G1 has 5 outcomes. The roll 3 is one of them.
P[R3∣G1]=P[G1]P[R3G1]=5/61/6=51
(b) New world G3={4,5,6} has 3 outcomes. The roll 6 is one of them.
P[R6∣G3]=3/61/6=31
(c) New world E={2,4,6}. Greater than 3 inside it: {4,6}, two outcomes.
P[G3∣E]=P[E]P[G3E]=3/62/6=32
(d) Now the hint is G3={4,5,6}. Even inside it: {4,6}, two outcomes.
P[E∣G3]=P[G3]P[EG3]=3/62/6=32
Answer(a) 51 (b) 31 (c) 32 (d) 32
(c) and (d) are equal here only because E and G3 both have 3 outcomes. In general P[A∣B] and P[B∣A] are different.
Q9Total probability and Bayes · Lesson 2
A company has three machines B1, B2 and B3 for making 1 kΩ resistors. It has been observed that 80% of resistors produced by B1 are within 50 Ω of the nominal value. Machine B2 produces 90% of resistors within 50 Ω of the nominal value. The percentage for machine B3 is 60%. Each hour, machine B1 produces 3000 resistors, B2 produces 4000 resistors, and B3 produces 3000 resistors. All of the resistors are mixed together at random in one bin and packed for shipment.
What is the probability that the company ships a resistor that is within 50 Ω of the nominal value? What is the probability that an acceptable resistor comes from machine B3?
Key idea: first question = add all paths that end in "acceptable" (total probability). Second question = one path divided by all of them (Bayes).
Show solution
Let A = "the resistor is within 50 Ω" (acceptable).
Probability of each machine. Total per hour: 3000+4000+3000=10000.
P[B1]=0.3, P[B2]=0.4, P[B3]=0.3
Given the machine:P[A∣B1]=0.8, P[A∣B2]=0.9, P[A∣B3]=0.6.
Multiply along each path. The numbers on the right add up to 1.
(a) Find the value of the constant c.
(b) Find P[V∈{u2∣u=1,2,3,⋯}].
(c) Find the probability that V is an even number.
(d) Find P[V>2].
Key idea: all probabilities add to 1 (this gives c). Then for each part, pick the values that fit and add their probabilities.
Show solution
(a) Put each value into cv2:
v
1
2
3
4
PV(v)=cv2
c
4c
9c
16c
They must add to 1: c+4c+9c+16c=30c=1, so c=301.
v
1
2
3
4
PV(v)
1/30
4/30
9/30
16/30
(b) The strange set {u2∣u=1,2,3,…} means "all perfect squares": 1,4,9,16,… Which values of V are perfect squares? Only 1 and 4.
PV(1)+PV(4)=301+3016=3017
(c) Even values of V: 2 and 4.
PV(2)+PV(4)=304+3016=3020=32
(d) Values bigger than 2: 3 and 4.
PV(3)+PV(4)=309+3016=3025=65
Answer(a) c=301 (b) 3017 (c) 32 (d) 65
Q11Binomial · Lesson 4
When a conventional paging system transmits a message, the probability that the message will be received by the pager it is sent to is p. To be confident that a message is received at least once, a system transmits the message n times.
(a) Assuming all transmissions are independent, what is the PMF of K, the number of times the pager receives the same message?
(b) Assume p = 0.8. What is the minimum value of n that produces a probability of 0.95 of receiving the message at least once?
Key idea: a fixed number n of tries, and we count successes: binomial. "At least once" = 1 − P[zero times].
Show solution
(a) n independent tries. Each is a success (received) with probability p. K counts the successes. So K is binomial (n, p):
PK(k)=(kn)pk(1−p)n−k
for k=0,1,…,n, and 0 otherwise.
(b) "At least once" means K≥1. Its opposite is K=0 (never received):
P[K≥1]=1−PK(0)=1−(1−p)n=1−(0.2)n
We need this to be at least 0.95. Try values of n:
n
(0.2)n
1−(0.2)n
≥ 0.95?
1
0.2
0.80
No
2
0.04
0.96
Yes
Answer(a) binomial (n, p), formula above (b) minimum n=2
Where does PK(0)=(1−p)n come from? Put k=0 in the formula: (0n)=1 and p0=1, so only (1−p)n is left. It means "fail n times in a row".
Q12CDF · Lessons 5, 6
The random variable X has CDF
FX(x)=⎩⎨⎧00.20.71x<−1−1≤x<00≤x<1x≥1
(a) Draw a graph of the CDF.
(b) Write PX(x), the PMF of X. Be sure to write the value of PX(x) for all x from −∞ to ∞.
(c) Find P[X<1] and P[X=1].
(d) Find the expected value of the random variable X.
Key idea: the CDF jumps at −1, 0 and 1. Those are the values of X. The size of each jump is the PMF.
Show solution
(a) A staircase. Height 0 until −1, then 0.2 until 0, then 0.7 until 1, then 1 forever. Filled dot on the left of each step, empty dot on the right.
Answer for (a): a staircase with jumps at −1, 0 and 1.
(b) Jump sizes:
at x=−1: 0.2−0=0.2
at x=0: 0.7−0.2=0.5
at x=1: 1−0.7=0.3
PX(x)=⎩⎨⎧0.20.50.30x=−1x=0x=1otherwise
"For all x from −∞ to ∞" just means: do not forget the line 0 otherwise. Check: 0.2+0.5+0.3=1.
(c)P[X<1]: values smaller than 1 are −1 and 0. 0.2+0.5=0.7. (Same as the height just before 1.) P[X=1]=PX(1)=0.3. (The jump at 1.)
(d) Value × probability, then add:
E[X]=(−1)(0.2)+(0)(0.5)+(1)(0.3)=−0.2+0+0.3=0.1
Answer(c) P[X<1]=0.7, P[X=1]=0.3 (d) E[X]=0.1
Q13"At least once" · Lesson 4
You manage a ticket agency that sells concert tickets. You assume that people will call three times in an attempt to buy tickets and then give up. Each time a caller tries, the probability that they get through to your agency is p (independent each time). You want to be able to serve at least 95% of the people who want tickets. What is the minimum value of p necessary to meet your goal?
Key idea: a person is served if they get through at least once in 3 tries. Use 1 − P[fail all three].
Show solution
One try fails with probability 1−p. The tries are independent, so failing all 3 has probability (1−p)3.
Served = not failing all three:
P[served]=1−(1−p)3
We need at least 0.95:
1−(1−p)3(1−p)3≥0.95≤0.05
Take the cube root of both sides (calculator: 0.051/3):
1−pp≤30.05≈0.368≥1−0.368=0.632
AnswerMinimum p≈0.632
Check: with p=0.632, (0.368)3≈0.05, so 95% are served.
Q14Families backwards · Lessons 4, 6
Suppose that E[X]=30 is the expected value of geometric random variable X. What is the PMF of X? (Write the equation)
Suppose that E[X]=5 is the expected value of Poisson random variable X. What is the PMF of X? (Write the equation)
Key idea: use the E[X] formula of the family to find its parameter. Then write the family's PMF with that number.
Show solution
Geometric.E[X]=p1=30, so p=301 and 1−p=3029. Put it in p(1−p)x−1:
PX(x)=⎩⎨⎧301(3029)x−10x=1,2,3,…otherwise
Poisson.E[X]=α=5. Put it in x!αxe−α:
PX(x)=⎩⎨⎧x!5xe−50x=0,1,2,…otherwise
To get full marks, always write the range of x (geometric starts at 1, Poisson starts at 0) and the "0 otherwise" line.
(a) Draw a graph of the CDF.
(b) Write PX(x), the PMF of X.
(c) Find the standard deviation of the random variable X.
(d) Find PX∣B(x), where the condition B={X>0}. What are E[X∣B] and Var[X∣B]?
Key idea: this one question uses three lessons. Jumps give the PMF. Then the 4-step recipe. Then the 3-step conditional recipe.
Show solution
(a) Staircase with jumps at −3, 5 and 7.
Answer for (a): jumps at −3, 5 and 7.
(b) Jump sizes: at −3: 0.4−0=0.4. At 5: 0.8−0.4=0.4. At 7: 1−0.8=0.2.
PX(x)=⎩⎨⎧0.40.40.20x=−3x=5x=7otherwise
(c) The 4-step recipe.
x
−3
5
7
Sum
PX(x)
0.4
0.4
0.2
1
x⋅PX(x)
−1.2
2
1.4
2.2
x2⋅PX(x)
9(0.4) = 3.6
25(0.4) = 10
49(0.2) = 9.8
23.4
E[X]=2.2 and E[X2]=23.4. Var[X]=E[X2]−(E[X])2=23.4−(2.2)2=23.4−4.84=18.56 σX=18.56≈4.31
(d) The 3-step conditional recipe.
Values that fit X>0: 5 and 7. (−3 is thrown away.) P[B]=0.4+0.2=0.6
Divide: 0.60.4=32 and 0.60.2=31
1. Find the standard deviation of X.
2. Find P[μX−σX≤X≤μX+σX], the probability that X is within one standard deviation of the expected value.
3. Find PX∣B(x), where the condition B={X≥μX}.
4. What are E[X∣B] and Var[X∣B]?
Key idea: recognise binomial with n=5 and p=21. Make a small table of the PMF first. It answers everything.
Show solution
Why n=5, p=21? The binomial formula is (xn)px(1−p)n−x. With p=21: (21)x(21)5−x=(21)5=321. So PX(x)=(x5)⋅321.
x
0
1
2
3
4
5
(x5)
1
5
10
10
5
1
PX(x)
1/32
5/32
10/32
10/32
5/32
1/32
Part 1. Use the ready-made binomial formulas:
μX=np=5⋅21=2.5
Var[X]=np(1−p)=5⋅21⋅21=1.25
σX=1.25≈1.118
Part 2. The interval is from 2.5−1.118=1.382 to 2.5+1.118=3.618. Which whole numbers are inside? Only 2 and 3.
Each time a modem transmits one bit, the receiving modem analyzes the signal that arrives and decides whether the transmitted bit is 0 or 1. It makes an error with probability p, independent of whether any other bit is received correctly.
(1) If the transmission continues until the receiving modem makes its first error, what is the PMF of X, the number of bits transmitted?
(2) If p = 0.1, what is the probability that X = 10?
(3) If the modem transmits 100 bits, what is the PMF of Y, the number of errors?
(4) If p = 0.01 and the modem transmits 100 bits, what is the probability of Y = 2 errors at the receiver? What is the probability that Y ≤ 2?
(5) If the transmission continues until the receiving modem makes three errors, what is the PMF of Z, the number of bits transmitted?
(6) If p = 0.25, what is the probability of Z = 12 bits transmitted?
Key idea: here the "success" is an error. Read the words: "until first error" is geometric, "100 bits, number of errors" is binomial, "until three errors" is Pascal.
Show solution
(1) "Until the first error", counting bits: geometric (p).
PX(x)={p(1−p)x−10x=1,2,3,…otherwise
(2)p=0.1, x=10: nine correct bits, then one error.
PX(10)=0.1(0.9)9≈0.0387
(3) A fixed number of bits (100), counting errors: binomial (100, p).