




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































Exercises
The exercises in these notes are a selection of exam papers and in-class assign- ments 2006–2009, all with well commented solutions.
Quickies
Each chapter ends with some “quickies”. Quickies are questions with very brief answer, i.e. no more than one line. Quickies are neither quick questions nor they have to be answered quickly: only the answers should be concise. In general, all answers must be properly justified to get credit. For example, if the question is
Is 10 a prime number? Why?
the right answer would be No, because 10 is the product of 2 and 5. On the contrary, the following answers are to be considered wrong for the reasons shown in parentheses:
Milano, September 6, 2015
ii
It is important to point out that these problems are di↵erent: the first, to find the probabilities, always comes before the second. The first problem, the determination of probabilities, is an extremely di - Classical probability cult task. Historically, the first attempt to solve it was the “classical”theory of probability. In the classical theory of probability, if all the results of an exper- iment are equally likely, the probability of any event is the ratio of the number of results favorable to the event to the total number of results. For example, if the experiment is the determination of the EUR/USD exchange rate 6 months from now, and we consider just three results, “less or equal to 1.2”, “greater or equal to 1.4” e “between 1.2 and 1.4”, equally probable, the probability that “the rate will be greater than or equal to 1.2” is 2/3, because there are only 3 possible outcomes and only 2 out of 3 are favorable to the event. subjective view Following the “subjective”, the determination of the probability of an event depends on the person who estimates it. For example, consider the launch of a new product and the estimation of its probability of success: a young person could judge the product too “traditional” and assess the probability as 40%. In contrast, an experienced business man could positively view the “continuity” of the product from the previous versions and estimate the same probability as 70%. Of course, both of them will base their estimates only on their respective (di↵erent) knowledge, which in turn is made up of the past experiences of the individual. frequentist view According to a third view, called frequentist, the determination of proba- bilities is an experimental process where the experiment is to be done, in the same conditions, an infinite number of times. The relative frequency of the event in the sequence of experiments will “converge” to the probability of the event. Although somehow intriguing, this view is in fact unfeasible. To repeat an experiment in the same conditions again and again is impossible; in addi- tion, even if the relative frequency will converge, the definition gives no clue about when, i.e. there is no way to know how many experiments are to be done to get a su cient approximation of the required probability. As every view has its own strengths and weaknesses, we will think of the values of probabilities as being given “a priori”. The second problem, to find how to use probability in computations, is a technical one and can be solved in a formal way. What follows is a (very) brief summary of a few facts from probability theory. The reader interested in going into a greater depth into this topic could look at [4].
1.2 Formalizing probability: events and probability
Given an experiment whose outcome is uncertain, we define a “sample space”.
Definition 1.2.1 (Sample space). The set of all possible outcomes of an ex- periment is called sample space, ⌦.
Elements of ⌦ are called elementary events or atomic events 1.
Definition 1.2.2 (Event). A subset A of ⌦ is called an event. (^1) to be precise, elementary events are not elements of the sample space, but singletons, that is subsets of ⌦ with only one element
1.2. Formalizing probability: events and probability
Here are three examples.
Example 1.2.1 (Tax reductions). You are a general contractor and are con- sidering the government announcement that current tax reductions could be extended for one or two years. The experiment relevant for you is the extension of the reductions so
⌦ = {“no extension”, “one year extension”, “two years extension”}
and the elementary events “no extension”, “one year extension”, “two years extension”. The event corresponding to the English sentence
A = {“the extension has been approved”}
is A = {“one year extension”, “two years extension”}
Example 1.2.2 (Share price). The experiment is to observe the price of a company share at a certain time. In this case, ⌦ = {x 2 R : x > 0 }. Elemen- tary events are all positive real numbers. The event “the price is less than 10” corresponds to the subset { 0 < x < 10 }.
Example 1.2.3 (Production). The experiment consists in randomly choosing a piece in a given production lot. There are two production plants, S1 e S2, that produce the same number of pieces in the same time. Each piece can be perfect or faulty. If C1 is a perfect piece coming from plant 1 and D1 is a faulty piece from the same plant, and analogously for plant 2, we have
⌦ = {C 1 , C 2 , D 1 , D 2 }.
The event “the piece is faulty” corresponds to {D 1 , D 2 }.
As events are subset of ⌦, we recall some set theory definitions about set operations. The following examples are related to the previous ones.
Definition 1.2.3. ⌦, as a subset of itself is called certain event; the empty set, ;, is called impossible event.
Events are subsets (of ⌦) and therefore usual operations on sets can be extended to events.
Definition 1.2.4. The complement of an event A is the event that occurs whenever A does not occur and is denoted by A¯.
In example 1.2.1, if B is the event “tax reductions have been extended for one year” then B¯ is
B¯ = {“no extension”, “two years extension”}.
Definition 1.2.5. Given two events A and B, event A [ B is called union (or Boolean 2 sum) of events A and B and occurs if A occurs or B occurs or both.. Usually, the sentence referring to the union of events is made up connecting the two sentences referring to each event with “or”.
(^2) from George Boole, 2 November 1815 - 8 December 1864, an English mathematician and philosopher.
1.3. Conditional probability
Example 1.3.1. The contractor in example 1.2.1, based on past experiences, assigns a 40% probability to the event “tax reductions will be extended”. Then, he knows that a draft of the extension is currently being written and so he in- creases the probability of the event to 70%. The event “a draft of the extension is being written” changed the probability of the event “tax reductions will be extended” and the contractor, given the news, is likely to change his decisions.
Example 1.3.2. The owner of the production plants in example 1.2.3 started a quality assurance process. An engineer is sent to inspect production lots. Each lot is made up of the same number of pieces from both plants. The inspector randomly extracts one piece from a lot to assess its quality. With no other information, the probability that a piece is produced in plant 1 is 50%. Further analyses show that plant 1 produces 1 faulty piece out of 10 while plant 2, being newer than plant 1, produces 1 faulty piece out of 50. The engineer further inspects the piece and finds that is it faulty. Now the probability that the piece comes from plant 1 is greater than before, because in a single lot the production is the same for both plants but plant 1 is more likely to produce faulty pieces. The occurrence of the event “the piece is faulty” changed the probability of the event “the piece comes from plant 1”.
In both examples a change of probability assessments occurred: both sub- jects gave an initial estimate of the probability of a certain event (prior prob- ability ) and then, taking into account some new facts, changed the initial estimate into a new one (posterior probability Prior and posterior probability
. The new probability is called “conditional probability”.
Definition 1.3.1 (Conditional probability). If P (B) > 0 the probability of A given that B has occurred, is called “conditional probability of A given B” and is equal to
P (A|B) = P (A \ B) P (B) Using the classical probability view, the previous formula is easily explained. If there are, say, N possible outcomes of the experiment, the fact that B has occurred reduces the number of possible outcomes to N ⇥ P (B), i.e. the number of outcomes favorable to B. Of those outcomes, only N ⇥ P (A \ B) are favorable to A and to B at the same time. The result then follows as a classical computation of probability.
Example 1.3.3. Two dice are rolled. We would like to know the probability of the event “the sum of the dice is greater than 6” (event A). If we assume the dice are fair, the number of possible outcomes is 36, while those favorable to A are 21 (see Figure 1.1). Therefore P (A) = 21/ 36 ' 58 .33%. Now assume we know that “the first die shows three” (event B). This fact changes our estimate on the occurrence of A into P (A|B). Now the possible outcomes are just six, and among them only three are favorable to A so P (A|B) = 50% (see Figure 1.2).
The following theorem is useful in many applications.
Theorem 1.3.1. If A and B are events, then
P (B) = P (B|A)P (A) + P (B|A)P (A)
remaining outcomes (black). The probability that the sum is greater than 6 is Figure 1.2: Roll of two dice: if the first shows 3, sample space is shrunk to the third row. There are 3 rolls with sum greater than 6 (green) and 3 with sum less or equal to 6 (black). The probability that the sum is greater than 6 given
If + means “experts give positive opinion” e means “experts give negative opinion”, we can rephrase the previous facts using the formulas P (+|F ) = 0. 8 and P ( |F ) = 0.9. We might also write, for example, that when trucks re- mained working after one year, 20% of the times experts failed in predicting their status, so P ( |F ) = 0.2. Similarly, when dealing with trucks that would eventually be found broken, 10% of the times experts gave them positive opin- ion, i.e. P (+|F ) = 0.1. If we now ask the experts about the new trucks, we already know their answer will modify our confidence in trucks’ life. We are to compute the probability of F given one of the possible opinions. If we get a positive opinion, then
P (F |+) =
P (+|F )P (F ) P (+|F )P (F ) + P (+|F )P (F )
=
= 0. 9491...
and therefore P (F |+) = 0. 0508... If, on the contrary, the opinion will be negative, then
P (F | ) =
P ( |F )P (F ) P ( |F )P (F ) + P ( |F )P (F )
=
2 ⇥ 0. 7
2 ⇥ 0 .7 + 0. 9 ⇥ 0. 3 =
14
41
= 0. 3414...
and therefore P (F | ) = 0. 6586... These are not surprising results, because experts are shown to be right most of the times. Therefore, if they give a positive opinion we expect the probability of the trucks to be working after one year to increase (from 0.7 to 0.9491). On the other side, in the case of a negative opinion we expect the same probability to decrease (to 0.3414). Numeric results depend on the experts reliability. For example, if we assume that when trucks are working after one year, experts always give a positive opinion, we have P (+|F ) = 1 and, consequently, P ( |F ) = 0. If we further assume that when trucks do not last for one year, experts give a negative opinion, we have P ( |F ) = 1 and P (+|F ) = 0. If we compute the probability in this new scenario, we get:
P (F |+) =
P (+|F )P (F ) P (+|F )P (F ) + P (+|F )P (F )
=
1 ⇥ 0. 7 1 ⇥ 0 .7 + 0 ⇥ 0. 3
=
= 1
which implies P (F |+) = 0, and
P (F | ) = P ( |F )P (F ) P ( |F )P (F ) + P ( |F )P (F )
=
0 ⇥ 0. 7 0 ⇥ 0 .7 + 0. 9 ⇥ 0. 3
=
0
= 0
which implies P (F | ) = 1. The previous statements can be informally trans- lated into English by saying that “experts are always right”: if they give a positive opinion, the truck will work; otherwise the truck will not work. This situation is actually impossible but it serves as an extreme case that can be approached when probabilities are close to 1. If only one of the two probabilities equals 1, e.g. P (+|F ) = 1, while the other remains as in the original definition, P ( |F ) = 0.9, we get:
P (F |+) =
P (+|F )P (F ) P (+|F )P (F ) + P (+|F )P (F )
= 1 ⇥ 0. 7 1 ⇥ 0 .7 + 0. 1 ⇥ 0. 3 =
= 0. 9589...
which implies P (F |+) = 0. 0410... , and
P (F | ) =
P ( |F )P (F ) P ( |F )P (F ) + P ( |F )P (F )
=
0 ⇥ 0. 7 0 ⇥ 0 .7 + 0. 9 ⇥ 0. 3
= 0
which implies P (F | ) = 1. We know that when trucks are working, experts are always right (P (+|F ) = 1) and give a positive opinion. However, when trucks are not working (F ) experts give negative opinions only 90% of the times, thus they give a positive (wrong) opinion in the 10% of the time. Thus, if we get a positive opinion we are not sure the trucks are going to work or not (but we expect the probability of them working to increase). On the contrary, if we get a negative opinion we are sure the truck is not going broken within a year. The other somewhat strange situation happens when both reliabilities equal 50%, P (+|F ) = 0.5 e P ( |F ) = 0.5. We have P ( |F ) = 0.5 and P (+|F ) = 0. 5 and therefore:
P (F |+) =
P (+|F )P (F ) P (+|F )P (F ) + P (+|F )P (F )
=
=
= 0. 7
which implies P (F |+) = 0. 3... , and
P (F | ) =
P ( |F )P (F ) P ( |F )P (F ) + P ( |F )P (F )
=
=
= 0. 7
1.5. Expected value of a random variable
1.5 Expected value of a random variable
Definition 1.5.1 (Expected value). If X is a discrete random variable and p (^) i is the probability that it takes the value x (^) i , p (^) i = P (X = x (^) i ), the expected value of X is
E (X) =
X^ n
i=
x (^) i ⇥ p (^) i
Example 1.5.1. In example 1.4.1 the expected value of the random variable X is
E (X) =
X^3
i=
x (^) i ⇥ p (^) i = 100000 ⇥ 0 .1 + 200000 ⇥ 0 .6 + 250000 ⇥ 0 .3 = 205000
Note that, in general, the expected value of a random variable is not one of the values the variable can take. One can informally explain this definition assuming that the experiment could be repeated many times in the same con- ditions (i.e. with the same probability distribution). In this case, when the number of experiments is large, the mean value of the whole set of experiments, i.e. the sum of the values taken by X divided by the number of experiments that have been made, should be close to the expected value of X 4.
1.6 Problems
Problem 1.6.1. An investment company has just bought 10 millions of euros of buildings in downtown Milan. According to the company CEO, the prob- ability that the value of the buildings will increase by 30% in the next two years is 0.3, while the probability that the value will increase by 10% is 0.5. Otherwise, the value of building will remain the same. What is the expected value of the buildings after two years?
Problem 1.6.2. A company is planning an incentive travel to a tropical island for its best customers. According to the company board the probability that the travel will be a success is 80%. Two members of the company board are going to go to the island before approving the planned travel. When they are back, they will give an opinion about the place and its facilities. Past experience shows that when the travel was a success, the testers gave a positive opinion 90% of the times. When it was a flop, the opinion was negative 80% of the times. Now, the two members are on their way back. How can the probability of a success change?.
1.7 Quickies
Question 1.7.1. A risky investment can result in a revenue of 1, 2 or 5 millions euros. Could it be that the expected value of the investment is 6 M euros? Why?
Question 1.7.2. Let P (A|B) = 0.4. Is it true, in general, that P (A|B) = 0.6?
(^4) From a theoretical viewpoint, this statement should be made more precise and could then be rigorously justified. The reader interested in this topic can see [4].
Question 1.7.3. Let P (A|B) = 0.4 Is it true, in general, that P (A|B) = 0.6?
Question 1.7.4. Let A and B be two events with P (A) = 0.4 and P (B) = 0.3. Could it be that P (A [ B) = 0.8?
Question 1.7.5. Given two events A and B we know that P (A) = 0.4 and A implies B. Is it possible that P (B) = 0.6?