Loading
Notes
Study Reminders
Support
Text Version

Probability of Random Variables

Set your study reminders

We will email you at these times to remind you to study.
  • Monday

    -

    7am

    +

    Tuesday

    -

    7am

    +

    Wednesday

    -

    7am

    +

    Thursday

    -

    7am

    +

    Friday

    -

    7am

    +

    Saturday

    -

    7am

    +

    Sunday

    -

    7am

    +

In this lecture, we discussed conditional probability further.We take some simple examples to understand and illustrate the concepts that we learned in the earlier lecture.So, begin with some match the following questions so that we understand the concepts.There are 5 items given in column A and 5 items given in column B. So, probability of B given A probability of B complement given A Bayes rule multiplication rule and independent events.The probability of B given A is P of A and B divided by P of A is the equation that we saw in the earlier lecture.So, that is the answer.The probability of B complement given A is relatively easy that is 1 minus probability of B given which is shown as 2 here.The earlier one was shown as 1 here Baye’s rule different forms.So, one of the equations is P of A given B is equal to P of B given A into P of A by of B which is given which is Baye’s rule from here.The multiplication rule is 4 P of A and B is equal to P of A into P of B given A and independent events P of A is equal to P of A given B because A and B are independent and therefore, P ofA is given B.Next, we look at some true or false questions.Now the course instructor wants to find out the reasons for absence in class.So, let A be the event that the student is absent and B is an event the student is sick.So, thprobability that a student is absent is higher than the probability that the student i absent given she is sick.So, the answer is false because generally absence could involve other reasons other tha sickness and because we restricted to a reason that is sickness.So, probability of the person is absent given that the percent is sick will be much higher tha the probability that the student is absent considering other things other than sickness.Therefore, the answer is a false probability that the student is sick when it is knowntha she is absent is equal to the probability that she is absent given that she is sick this is comparing P of A given B and P of B given A and we have already seen that Pof A given B is not equal to P of B given A. And therefore, the answer to this question is a false.If P of A there is P of absence is 0.15 and P of sick P of S is 0.1 then we can,t find of S given A, we need to know P of A and S which is not given, and therefore, we can not find the probability of P of sick given absent with the data that is being provided.So, we also want to check whether some of these are independent or dependent.So, recording the manufacturer of a sequence of a car is in a highway are not dependent so much on each other.So, they could become the sequence of cars can be independent.Recording the age of a person coming out of a movie theater.Again we could generalize it by saying independent though one might argue that there is a large proportion of people belonging to a certain age bracket who would go to movies, but by and large if we assume that people of any age group, go to a movie then it is independent.Tracking the number of visits to a video available on the internet can be dependent that would depend on an earlier visit and so on.Amount purchased by different people in a supermarket does not depend so it is independent, recording the type of accident during the rainy season by an insurance company.So, a moment there is a rainy season you could have more accidents that come out of skidding would come out of other rain-related things.So, there is a dependence in the whole process.So, look at a few more questions, one question is it is observed that half the tape recorders have a flaw and such tape recorders would die within 6 months if they had a flaw.Die meaning, they would stop working within 6 months if they had a flaw, out of those that do not have a flaw 10 percent would anyway stop working within 6 months.Now, your tape recorder died in 4 months, which means it stopped working in 4 months.What is the probability that it had the flaw?So now, you want to use Baye’s equation.So, the probability that it died or it did not work given that it had a flaw is given by this equation so, 0.5 into 1 by because this one comes because if they have a flaw within with 0.5 it will anyway die within 6 months.So, since it died within 4 months 0.5 into 1 plus 0.5 into 0.1.So, you get 0.5 divided by 0.5 into 1.1.So, 91 percent that it had a flaw.Out of 10 items that has arrived, one is defective a worker picks these parts one by one, what's the probability that the first is defective and the second is defective given that the first is not defective.So, the first is the defective probability of defective is 0.1.So, and there are 10.So, you pick anyone randomly, and 1 by one implies it picked randomly and 0.1.Given that the first is not what is the probability that it is.So, it is 1 by 9 because the first one is not defective.So, there are 9 remaining parts out of which one is defective and therefore, it is 1 by9 and it is 0.11.Then we look at one more question you are traveling by air from city A to city B with stopover at C. The probability that your flight arrives in time in the intermediate airport is 0.9 and if it arrives in time the probability that your luggage makes it to the flight from C to B is 0.95.If the flight is late in the intermediate then the probability of luggage making it is 0.6.What is the probability that your luggage comes to B when you reach B? And if your baggage is not there when you reach B what is the probability that you arrived late at C which is the intermediate place.So, question number 1, the probability that your luggage comes to B when you reach B is reaching in time and luggage going from C to B and reaching C late into the probability of luggage going from C to B. So, reaching C in time is 0.9 and luggage going is 0.95.So, reaching late is 0.1 and luggage going is 0.6.So, 0.9 into 0.95 plus 0.1 into 0.6 which is 0.915.Second, if your baggage is not there when you reach your destination B, what is the probability that you arrived late in the intermediate one C. So, the general equation is given here, which is now expanded to probability given that there is no luggage what is the probability that you arrived in C later.So, probability of arriving in C late given that there is no luggage when we reached Bi's probability of no luggage given late into a probability of late, divided by probability no luggage given late into the probability of late, plus the probability of no luggage given time into the probability of in time.So, the probability of no luggage given late is 0.4 because probability given late no luggage1 minus 0.6 which is 0.4 probability of late is 0.1 because arrival is 0.9.So, 0.4 into 0.1 plus same 0.4 and 0.1 comes here plus 0.05 into 0.9.So, the probability of in time is 0.9 which is here and then 0.95 percent is when it goes.So, 0.05 is the probability that it does it goes late the luggage does not come.So, 0.05 into 0.9; so, 0.04 by 0.085 which is 0.47.In a colony, it is observed that 82 percent of the people have the internet at home it is also known that 76 percent have computers and out of these 11 percent do not have internet.Treating proportions as probabilities, find the probability that among the houses not connected to the internet how many do not have a computer.So, we could assume or save without any loss of generality that there are 100 houses.So, there are 100 houses which are shown here.Which is 100, 82 percent have internet.So, we create this table with a computer without computer with internet, without internet.So, the total here with the internet is 82 therefore, without internet is 18.76 percent have computers.So, with computers total for the computer is 76 total without computer is 24.So, 11 percent do not have internet.So, with a computer without internet is 11 percent of 76, which is 8.36 and therefore, we can fill the rest of the table 67.34 14.36 and so on.So, without a computer and without internet is 9.64.So, the probability is 9.64 by 18, and 0.5356 is the answer.So, with this, we finish our discussion on some aspects of probability as well as conditional probability.Now we move to the next topic in probability which is random variables.And will spend some time understanding random variables.And then we will work out some examples to further our understanding.Now, let us start by saying sale in a shop today is 10000 the shop owner expects the same sale tomorrow with a probability of 70 percent.It can be 12000 with a probability of 12 percent or 9000 with a probability of 18 percent.So now, we have the sale in a shop as a variable.And this variable according to the sentence or text is given can take 3 values, which is10000, 12000, and 9000 with probabilities 70 percent 12 percent, and 18 percent adding up to 100 percent.Again proportions and probabilities are used interchangeably.So, the probability is expressed as a percentage. In this example the sale or change in the sale as the case may be is the random variable. Here is a variable that can take multiple values with defined probabilities. It becomes a random variable.So, it describes the probability of an uncertain future, the numerical outcome of a random process. Conventionally capital X or uppercase X is used to represent a random variable. X does not represent a single number, but represents a collection of possibilities and the probabilities associated with them.So, in this case, change X is the variable we are looking at.So, an increase is plus 2000 is a change with a probability of 0.12 if it remains the same 0with probability of 0.7 and if it decreases it is minus 1000 with the probability of 0.18.Note that, the notation capital X equal to small x means that the random variable X uppercase takes a possible value of small x given by the lowercase.So, the probability distribution of a random variable is given by P of x equal to P of X equal tox wherein X equal to x the uppercase X is the random variable and the lowercase x the value that the random variable can take or a possibility that the random variable take.A cycle shop sells 4 types of cycles A to B and these cost 2500, 4000, 6000 and 8000respectively.How do the people who buy 60 percent buy A 25 percent buy B, 12 percent buy C. So, 60plus 25 is 85 plus 12 is 97.So, what is P of Y equal to D is 3 percent because the proportions add up to 1 so, 60plus 25 85, 85 plus 12 97 and 3 percent?What is the probability that a cycle costing 4000 is bought? So, you could have 4000, 6000, and 8000 which is 25 plus 12 plus 3.So, 40 percent or 0.4 which is also equal to 1 minus less than 4000, so 1 minus 0.6.Now, what are some properties of random variables; A random variable conveys information that resembles what we may observe in a histogram.We take data for 50 days and let us say the sale was the same in 35 instances the sales increased by 2000 in 6 instances decreased by 1000 in 9 instances from the base value.So, X bar the expected value of the change in the sale is minus 1000 into 9 times because it decreased by 1000 in 9 instances plus 0 into 35 times there was no change 35 out of50 times plus 2000 increase.So, 2000 6 times divided by 50 which becomes 60.So, mu of the random variable is the weighted average of the possible outcomes and their probabilities.So, the expected value one could use X bar equal to 60, but then we generalize that mu equal to 60 which is the mean of the random variable.Now, what is the difference between x bar and mu? x bar is a statistic computed from the data well mu is a parameter.Parameters are represented using Greek letters.So, mu is equal to x 1 into P of x 1 plus x 2 into P of x 2 plus etcetera.So, mu tells us that on average the sale can increase at 60 per day.Mu is also known as the expected value of x.So, E of X is mu.So, also note that the expected value need not take any of the values of the possible outcomes and it can be an entirely new number.Another exercise to increase popularity a TV show announces prize money of 50000 daily and asks 5 questions.They pick only one caller for a question and the money is distributed equally to the caller with the correct answer.The probabilities of a number of winners are 0.05, 0.15, 0.25, 0.3, and 0.25 for the 5 question respectively.Mu is equal to 1 into 0.05 plus 2 into 0.15 plus 3 into 0.25 plus 4 into 0.3 plus 5 into0.25 which is 3.55.Expected money is 50000 by 3.55 which is 14000 and 85.They pick only one caller for a question and the money is distributed equally to the caller with the correct answer.So, the probabilities of the number of winners are 0.05, 0.15, 0.25, 0.3, and 0.25 now this means that there are 5 people who are called one for each question.Now, this 0.05 means out of these 5 people only one answered it correctly.This 0.15 means out of the 5 people 2 answered it correctly and if 3 answered correctly the probability is 0.25 and so on.Therefore, the expected number of people who answered it correctly is 3.55, and therefore, expected money per person giving the correct answer is 14085.Now, if we say that on this day only one person gave the correct answer.So, that person gets 50000.One out of the 5 gave the correct answer.So, a person gets 50000 and that happens with the probability of 0.05.2 people gave the correct answer then the money per person is 25000 that happens with0.15, and so on.And if we now find the expected value it is 16666 and .75 verses 14000 and 85.So, the expected value of money one is higher than the total money by the expected number of winners.So, it depends on how you calculate and what is the expected value we are trying to calculate.Now, let us also try to understand variance and standard deviation just because mu is positive the sale does not increase though on average it is expected too.For example, a lucky draw may have a positive mu, but not all people make money all the time.So, variance and standard deviation of a random variable summarize the uncertainty among the outcomes.So, variance is the expected value of the squared deviation from mu.So, sigma square is equal to the variance of X is equal to the expected value of X minus mu the whole square, which is x 1 minus mu the whole square into the probability of x 1 plus x 2 minus mu the whole square into a probability of x 2 and so on.To compute the variance of a random variable we revisit the example the sale example where change in sale X is the random variable and we have seen that this random variable takes3 values 2000 plus 2000, 0 and minus thousand with probabilities 0.12, 0.7, and 0.18 we also note that these probabilities add to 1.Now, the expected value of this random variable is 2000 into 0.12 plus 0 into 0.7 minuses 1000into 0.18.2000 into 0.12 is 240, 0 into 0.7 is 0, minus thousand into 0.18 is 180, minus 180.And therefore, the expected value is 240 minus 180 which is 60 which is shown here as mu equal to 60.Now to compute the variance and standard deviation we first find out the deviation which is X minus mu.So, 2000 minus 60 is 1940.0 minus 60 is minus 60.Minus 1000 minus 60 is minus 1060.X minus mu square values are shown here for the 3.And the variance is sigma x minus mu the whole square into P of x which is 3763600 into 0.12plus 3600 into 0.7 plus 1123600 into 0.18 which adds up to 653880.In this variance computation, we do not have a divided by n which normally we saw when we did this in statistics.The reason being the sum of the probabilities adds up to one and therefore, we do not have to divide it by n.So, sigma square is calculated 653880 which is the variance and standard deviation is the square root of it is variance we take the positive square root and we get 800 and8.628.So, this is how we calculate the expected value or mean and the standard deviation of random variable.Another example A customer had ordered 2 engines and the profit per engine is 20,000.There are 10 new engines and stock and by mistake 2 used engines are mixed with the10 new engines.If the customer gets a used engine, then it can be replaced with the shipping cost of thousand.If by for some reason both the engine sent happened to be used engines, then the order will be canceled and the shipping cost for 2 engines is incurred.Now how do we model this?Now we have a new engine and used engine for the first and a new engine for and used engine for the second.Now there are 2 there 10 new engines in stock and by mistake 2 used engines are mixed with the 10 new engines now there are 12 engines out of which 10 are new and 2 are used.So, the first engine assumes we are picked randomly a new engine would be picked with the probability5 by 6.And a used engine would be picked with the probability of 1 by 6.Now second one if the first one was a new engine then out of the 10 new engines 1has already been picked and 11 are remaining.So, another new engine would be 9 by 11 and a used engine would be 2 by 11.And in the first instance if we had by mistake picked a used engine then the second one picking new engine is 10 by 11 and picking another used engine is 1 by 11 and therefore, probabilities are 15 by 22, 5 by 33, 5 by 33 and 1 by 66 and let us just check if they add up to 1.So, 15 by 22 is 45 by 66, 5 by 33 is 10 by 66 so, 45 plus 10 55 plus another 10, 65 plus1 so, 66 by 66.Now, what happens if some reason both are both happen to be used engines, then the gain is 40000 because one used engine it can be replaced 2 used engines the order will be canceled.And the shipping cost for 2 engines is incurred.So, if both are new engines there is no issue.So, 20000 plus 20000, 40000 is the gain and that happens with the probability of 15 by22.So, 15 by 22 is 0.682 if 1 engine is a used engine and one is a new engine the gain is20000 the other one has to be taken back and a shipping cost of thousand is incurred.So, the actual gain is 19000 and that happens with the probability of one new one used is5 by 33, one used one new is 5 by 33.So, it is 10 by 33, which is about 0.303 and if both happen to be used then there is both have to have to be recalled so, 0 and then there is a 2000 shipping cost.So, it becomes minus 2000.And now the average is 40000 into 0.682 plus 19000 into 0.303 minuses 2000 into 0.015 which is 33007.Now X minus mu is calculated 40000 minus 33007, 19000 minus 2000 minus 33 squared multiple variance is 111180951 and the standard deviation is 10544.24.So, though the expected value is high 33007 the high standard deviation indicates that in this case there can even be a loss.However, small the probability of that loss is.So, we finished or conclude this lecture at this point where we defined a random variable and then we also said it can take values we defined a notation X capital X equal to small.Where capital X is the random variable and small x is the value.And then we define the mean or the expected value.So, we said the gain or outcome multiplied by
the probability.We also defined the variance and standard deviation.So, we find the expected value and then we do X minus mu, and then we do X minus mu the whole square multiplied by the probability.And then we sum it up to get the variance and then the square root of the variance isthe standard deviation.So, we looked at all this.So, we define what is a random variable and then how to calculate it is mean and standard deviation.So, will also look at some properties of random variables and answer some simple questions like what happens if, for example, we add or subtract a constant and so on.So, we look at all of these what happens to the variance when we multiply by a constant.So, all these things we will look at in the next lecture.n this lecture we continue the discussion on Random Variables.In the previous lecture, we were looking at this problem where we said that; the customerhas ordered 2 engines and then we looked at a situation where, the 10 new engines and2 old engines which have been added by mistake. And then we tried to find out what is theexpected value and we also found out what is the standard deviation of X.Now, let us continue the discussion by looking at properties of expected values, becausewe always have this question you know; what happens when we add or subtract a constant,what happens when we multiply and so on. So, expected value of X plus or minus c, wherec is a constant is E of X expected value of X plus minus expected value of c. Now c beinga constant it is expected value will be c itself and therefore, E of X plus or minusc is equal to E of X, E of X plus or minus c. One has to read this carefully this isE of expected value of X plus or minus constant is equal to expected value of X plus or minusconstant. For example, in the previous problem, what is the expected value after paying theinitial shipping fee; that would be if the shipping fee is 1000 then 33007 minus 1000is 32007. Also we have to remember that capital letters X represents a random variable, andlowercase letters generally indicate either constants or the values that the random variablecan take. Therefore, you will always find you know P of X equal to x capital X equalto small x.So, capital X is the random variable which takes a value small x. Now what happens tothe variance and standard deviation. So, variance of X plus minus c which means when we addor subtract a constant, the variance does not change. So, it remains as variance ofX. Similarly, standard deviation X plus minus c also will not change because the variancehad not changed, and standard deviation of X plus or minus c is equal to standard deviationof X. If we multiply by a constant then expected value of c X, where c is the constant is ctimes expected value of x. So, the expected value of X gets multipliedby c whereas, the left hand side expected value of multiplying every possible valuethat capital X can take by c. Now standard deviation of c X is equal to positive valueor absolute value of c because a time c can be negative. So, absolute value of c intostandard deviation of X, and variance of c X is equal to c square into variance of X.And since there is a square root involved it will become standard deviation has to bepositive therefore, we take absolute value of c.Now, what happens when we have a combination of an addition and a multiplication. So, Eof a plus b X is equal to a plus b times E of X. Now that is a direct application ofwhat we saw here, and what we saw here. So, expected value of a plus b X is equal to aplus b times expected value of X. Standard deviation of a plus b X is equal to absolutevalue of b, remember the a will go; a being a constant will not have an effect in thevariance and in standard deviation so a goes. Only b is important and b can be negativeso we also want to say here that we take the positive value of the b.So, absolute value of b into standard deviation of X and variance of a plus b X will be bsquare into variance of X.We now look at this exercise where A and B play a game, A and B toss coins. If both areheads that is if both A and B toss heads A wins rupees 200, if both are tails B winsrupees 100. And if one is a head and one is a tail no money is transacted. We also assumethat A has a biased coin with a 60 percent probability of heads, while B has a fair coinwith a 50 percent probability of heads. Find the expected value of A expected value ofB and the variances. Now, this random variable there are 3 outcomesboth toss heads, one head one tail or one tail one head; and both toss tails. So, welook at this problem from A’s perspective. So, gain for person A when both toss headsis 200 with a probability of 0.3, because A tossing a head is 0.6 the problem assumesthat A has a biased coin. B has a fair coin with 0.5 therefore, both tossing heads is0.6 into 0.5 which is 0.3. One head one tail is A tossing a head 0.6 B tossing at a tail0.5 which gives us 0.3. A tossing a tail 0.4 B tossing a head 0.5 multiplication is 0.2.So, 0.3 plus 0.2 is 0.5 which is shown here, H T and T H is 0.5, H T is 0.3, T H 0.2 andthe total is 0.5. Both tossing tails A tosses tail with 0.4, B tosses tail with 0.5 andtherefore, both tossing tail is 0.4 into 0.5 which is 0.2 which is also given here. Nowthe expected value is 200 into 0.3 plus 0 into 0.5 minus 100 into 0.2.So, 200 into 0.3 is 60, 0 into 0.5 is 0, minus 100 into 0.2 is minus 20 therefore, the expectedvalue is 40. Now this expected value is shown as mu equal to 40 here. So, we find the deviationsX minus mu 160 minus 40 and minus 140. Square values are shown 25600, 1600, 19600.So, the variance is 25600 into 0.3, plus 1600 into 0.5, plus 19600 into 0.2 which givesus 12400 and standard deviation of A is square root of 12400 positive square root which is111.36.Now let us look at the problem from B’s point of view, and try to understand the relationshipbetween the expected value of B and the variance of B versus expected value for A and the variancefor A. Now when we look at this from B’s point of view again the random variable takes3 values with a difference; that when both toss heads B loses 200 therefore, B the valuethat it takes for both heads is minus 200 with the same probability of 0.3.So, when A gains 200 B loses 200 therefore, we get minus 200 with 0.3 0 with 0.5 and plus100 with 0.2. Remember that for both tails A lost 100 which is B’s gain and therefore,B gets plus 100. Now the expected value of this random variable is minus 200 into 0.3plus 0 into 0.5 plus 100 into 0.2, which is minus 40. Variance of B is we find out thedeviations so mu is shown here as minus 40. So, the X minus mu for the 3 outcomes areminus 200 minus minus 40 which is minus 160. Once again minus 200 minus minus 40 is minus160, 0 minus 40, 0 minus minus 40 is 40, 100 minus minus 40 is 140. Please note that muis minus 40 and therefore, the calculations are shown like this.If you see carefully in the previous case the value is where 160 minus 40 and minus140 here it is minus 160, 40 and 140. So, X minus mu square will be the same becausehere we have negative there you had a positive so 25600, 1600, 19600. So, the variance is25600 into 0.3 plus 1600 into 0.5 plus 19600 into 0.2, which is 12400 and the standarddeviation is 111.36. So, up to this point we realize that expected value of B is thenegative of the expected value of A. Variance of B is the same, standard deviation of Bis also the same, from the earlier relationships we saw that E of B is equal to c times E ofA. Now, c is minus 1 because what is A’s gainis B’s loss and what is A’s loss is B’s gain. Therefore, if E of A is 40, E of B isc times expected value of A minus 1 into 40, which is minus 40, which is what we computedhere. Variance of B is c square into variance of a where c is minus 1, c square is plus1. So, variance of B is equal to variance of A and we found out that both are 12400,for A it is 12400 for B also it is 12400. Standard deviation of B is absolute valueof c into standard deviation of A, since c is minus 1 absolute value is plus 1 so oneinto standard deviation of A same 111.36 and both show the same value.Therefore, we have just shown and demonstrated this equation that E of B is equal to c timesE of A and variance is the same in this case; where c is minus 1 c square is plus 1. So,variance of B is c square into variance of A and standard deviation of B is absolutevalue of c into standard deviation of A.Now if we express these numbers in paise, what happens to the mean and the variance?Now, expected value of B is rupees minus 40 which is minus 4000 paise. And therefore,the 3 gains are minus 200 becomes minus 20000, 0 stays as 0 and plus 100 becomes 10000. So,X minus mu gets multiplied by 100 earlier it was minus 160, 40 and plus 140 now it isminus 16000 plus 4000 and plus 14000. The squares get multiplied by 100 into 100 whichis 10000. So, 256 1 2 3 4 5 followed by 6 0’s and 16 followed by 6 0’s and 196 followedby 6 0s. And therefore, the variance is 256000000 into 0.3 and so on. And when we do this weget 124000000, which means the variance gets multiplied by 10000 and the standard deviationgets multiplied by 100, the expected value also gets multiplied by 100.So now we try to establish that relationship. So, expected value of B in paise is c timesthe normal E of B, now in this case c is 100. So, earlier expected value of B was minus40 now it becomes minus 4000, which we have calculated here which we can also see as minus20000 into 0.3 plus, 0 into 0.5, plus 10000 into 0.2. So, variance of B in paise is equalto c square into variance of B in rupees. So, 12400 becomes 12400 into 10000. So, sincec is 100 c square is 10000 it gets multiplied by 10000. Standard deviation of B is equalto absolute value of c into standard deviation of B in rupees. So, standard deviation ofB in paise is 100 times standard deviation of B in rupees which is 111.36 into 100 whichis 11136.Now let us look at another example to compare random numbers and understand this. So, letus take an imaginary situation where, say we have to decide between England and Indiato host the next cricket world cup. Now let us say there are 60 matches the number ofpeople attending matches and the probability are given. So, please note that this is animaginary problem that we are trying to solve, and we are only trying to explain the methodologyusing this interesting imaginary situation. So, we would say that in England the expectedpeople could be 10000 or 20000 or 30000 attending a match whereas, in India it could be 30000,40000, 60000 attending a match, and with probability is given as 0.2 0.5 0.3. Let us assume theticket cost about 600 in India and 30 pounds in England find the expected value standarddeviation and compare.So, let us say we do it in England so outcome 10000 people attending with probability 0.2and so on. So, expected value for the people attending is 10000 into 0.2 plus 20000 into0.5 plus 30000 into 0.3, and the expected value is 21000; now a deviations are alsogiven so minus 11000 minus 1000 and 9000. So, we find the variance and we find the standard deviation.