ELEC 321
# Tutorial 2

Updated 2017-09-22

- Problem set A: 2, 5, 8, 9,10
- Lecture slide (module 2): page 53 to end
- Basic R Code: (3 Prisoner’s Problem)

A track star will run two races. The probability that he wins the ﬁrst race is 0.70, the probability that he wins the second race is 0.60 and the probability that he wins both races is 0.50. Find the probability that (a) he wins at least one race; (b) he wins exactly one race; (c) He wins neither race; (d) he wins the second race given he lost the ﬁrst.

Let

be the event that he wins the first race

be the event that he wins the second race

We observe that the two events are not independent since

The probability of event hat at least one race is won

This is found using the inclusion-exclusion formula.

The event for winning exactly one race is

Thus the chance of winning exactly one is

**Alternatively**, we could also use the result from part (a): which is

The event is for not winning any race is .

Where is calculated from part (a)

Let event be when he wins the second race, given that he lost the first one.

A box contains ﬁve green balls, three black balls and seven red balls. Two balls are selected at random without replacement from the box. What is the probability that

(a) Both balls are red?

(b) Both balls are the same color?

(c) The second ball is green?

Let

**Without replacement** means that when the ball is taken, it cannot be taken again. (The sample space decreases). So when the second ball is being picked, the number of balls left is 14 (instead of 15)

We want:

Using total theorem of probability, we want

The random variable X has probability mass function , for .

(a) Determine

(b) Calculate

(c) Calculate

We know that is a random variable, and .

There are the probabilities:

and from the second property we can say:

For a discrete random variable that has the following **Probability Mean Function** (PMF): . Then is the expectation of . Where expectation of is defined as

Example: on expectation of (side note)is a random variable that takes the value of with equal probabilities (i.e. ).

So

which (average)

and in this case, , so

John has 10 keys in a chain, one of which opens his apartment door. After a big celebration, he returns home one evening and ﬁnds that he cannot identify the apartment key. He works out a clever plan: chooses a key at random and try it. If it fails, he puts it aside and try another randomly chosen key, and continues this way until he can open the door.

(a) What is the probability that the ﬁrst attempt works?

(b) What is the probability that the second attempt works?

(c) What is the probability that the attempt works (for )

(d) What is the expected number of attempts until a key works?

Let be the event for attempt that works.

This automatically implies that the first time did not work. so:

But the first term because there is no two key that works at the same time.

Using the pattern we observed from part (a), we can write the general expression:

We may utilize **Chain Rule of Probability** on to this equation.

Chain Rule of Probability:

… we get:

We want expected number of attempted: where is the number of attempts.

*Interpretation*: if John tries for a long time, he should be able to open the door after 5-6 attempts on average.

Peter is in the same situation. He comes up with a less clever plan: randomly chooses one key from the chain until the key works. He misses the clever step of setting aside failing keys!

(a) What is the probability that the ﬁrst attempt works?

(b) What is the probability that the attempt works?

(c) What is the probability that the attempt works (for )?

(d) What is the expected number of attempts until the key works?