1、273. Random Variables3.1 Definition of Random VariablesIn engineering or scientific problems, we are not only interested in the probability of events, but also interested in some variables depending on sample points. (定义在样本点上的变量)For example, we maybe interested in the life of bulbs produced by a cer
2、tain company, or the weight of cows in a certain farm, etc. These ideas lead to the definition of random variables.1. random variable definitionDefinition 3.1.1 A random variable is a real valued function defined on a sample space; i.e. it assigns a real number to each sample point in the sample spa
3、ce.Here are some examples.Example 3.1.1 A fair die is tossed. The number shown is a random Xvariable, it takes values in the set . 1,26 AExample 3.1.2 The life of a bulb selected at random from bulbs tproduced by company A is a random variable, it takes values in the interval . (0,) ASince the outco
4、mes of a random experiment can not be predicted in advance, the exact value of a random variable can not be predicted before the experiment, we can only discuss the probability that it takes some 28value or the values in some subset of R.2. Distribution functionDefinition 3.1.2 Let be a random varia
5、ble on the sample space . X SThen the function. ()FPxRxis called the distribution function of XNote The distribution function is defined on real numbers, not on ()sample space.Example 3.1.3 Let be the number we get from tossing a fair die. XThen the distribution function of is (Figure 3.1.1)0,1;(),1
6、2,5;6,.ifxnFxnifFigure 3.1.1 The distribution function in Example 3.1.33. PropertiesThe distribution function of a random variable has the ()FxXfollowing properties:(1) is non-decreasing.()Fx29In fact, if , then the event is a subset of the event 12x1Xx,thus2Xx1122()()(FxPxxF(2) ,()lim0x.()(3)For an
7、y , .This is to say, the R0000li()(xFxFdistribution function of a random variable is right continuous.() XExample 3.1.4 Let be the life of automotive parts produced by Xcompany A , assume the distribution function of is (in hours)201,;(),.xeFxPxFind , .(20PX13XSolution By definition,.1(20)(0)632PXFe
8、13)(0)PX1.50.5(1()384eAQuestion: What are the probabilities and ?(20)2PXExample 3.1.5 A player tosses two fair dice, if the total number shown is 6 or more, the player wins $1, otherwise loses $1. Let be the amount won, find the distribution function of .XSolution 30Let be the total number shown, th
9、en the events contains 1X 1Xksample points, . Thusk2,345k, 1()36kPX2,345And 512kso525(1)()18kPX3Thus 0,1;5()18,.xFxPXxFigure 3.1.2 The distribution function in Example 3.1.5The distribution function of random variables is a connection betweenprobability and calculus. By means of distribution functio
10、n, the main tools in calculus, such as series, integrals are used to solve probability and statistics problems.3.2 Discrete Random Variables 离散型随机变量31In this book, we study two kinds of random variables.Definition 3.2.1 A random variable is called a discrete random Xvariable, if it takes values from
11、 a finite set or, a set whose elements can be written as a sequence 12,n Assume a discrete random variable takes values from the set X. Let 12,nX , (3.2.1)()nPXap12,.Then we have , . 0np12, the probability distribution of the discrete random variable (概率分X布)X a1 a2 anprobability p1 p2 pn注意随机变量 X 的分布
12、所满足的条件(1) Pi 0(2) P1+P2+Pn=1离散型分布函数And the distribution function of is given byX(3.2.2)()naxFxPpIn general, it is more convenient to use (3.2.1) instead of (3.2.2). Equation (3.2.1) is called the probability distribution of the discrete random variable .X32Example 1For an experiment in which a coin
13、is tossed three times (or 3 coins are tossed once), construct the distribution of X. (Let X denote the number of head occurrence)Solution n=3, p=1/2X pr 0 1/81 3/82 3/83 1/8Example 2在一次试验中,事件 A 发生的概率为 p, 不发生的概率为 1p, 用X=0 表示事件 A 没有发生,X=1 表示事件 A 发生,求 X 的分布。two-point distribution(两点分布) X 0 1P 1-p p某学生参
14、加考试得 5 分的概率是 p, X 表示他首次得 5 分的考试次数,求 X 的分布。geometric distribution (几何分布)X 1 2 3 4 k P p q1p q2p q3p qk1 33pExample 3 (射击 5 发子弹) 某射手有 5 发子弹,射一次命中率为 0.9,如果命中目标就停止射击,如果不命中则一直射到子弹用尽,求耗用子弹数 x 的概率分布。*Example 3.2.1 A die is tossed, by we denote the number shown, Assume that the Xprobability is proportional
15、to , . Find the probability ()Pkk12,6distribution of .Solution Assume that , constant, .()PXkc1,26kSince the events , are mutually exclusive and 126their union is the certain event, i.e., the sample space , we haveS,61()21kPXcthus . The probability distribution of is (Figure 3.2.1)12c, . ()21k,26k A
16、123456px/734Figure 3.2.1 Probability distribution in Example 3.2.1Question. What is the difference between distribution functions and probability distributions例 2 有一种验血新方法:把 k 个人的血混在一起进行化验,如果结果是阴性,那么对这 k 个人只作一次检验就够了,如果结果是阳性,那么必须对这 k 个人再逐个分别化验,这时 k 个人共需作 k+1次检验。假设对所有人来说,化验是阳性反应的概率为 p,而且这些人反映是独立的。设 表示
17、每个人需要化验的次数,求 的分布XX(construct the distribution of )Binomial distribution(二项分布)Example 3.2.2 A fair die is tossed 4 times. Let be the number of six Xgot. Find the probability distribution of .Solution. The possible values of are .X0,123First we find the probability . ()PSince means that no six occur i
18、n 4 tosses. 0XThe probability that six fails to occur in a single toss is , and all 5/6trials are independent, so.45(0)6PXNow consider the probability , . ()k12,34Since means that six occurs exactly times, they may occur Xkin any tosses of 4 tosses.35The event that they occur in a special order (for
19、 example, the first ktosses), has probability , 4(5/6)1/kand we have such combinations. Thus4kC4()(/)/6kkPXi.e. 62512525(0), (), ()193416PX. 43, 96PXPXAX 0 1 2 3 4PBinomial DistributionsAn experiment often consists of repeated trials, each with two possible outcomes “success” and “failure”. The most
20、 useful application deals with the testing of items as they come off an assembly line, where each test or trial may indicate a defective or a non-defective item. We may choose to define either outcome as a success. The process is referred to a Bernoulli process. Each trial is called a Bernoulli tria
21、l.Consider an experiment consists of independent repeated trials, neach trials result in two outcomes “success” and “failure”, and the probability of success, denote by , remains constant. Then this process pis called a Bernoulli process.Definition 3.4.1 The number of successes in Bernoulli trials i
22、s Xn36called a binomial random variable. The probability distribution of this discrete random variable is called the binomial distribution with parameters and , denoted by .np(,)BnpThe random variable in Example 3.2.2 is an example of binomial random variable.Theorem 3.4.1 The probability distributi
23、on of the binomial distribution with parameters and is given bynp, (3.4.1)()(,)(1)knknPXkbCp0,12,nProof First, consider the probability of obtaining consecutive ksuccesses, followed by consecutive failures. These events are knindependent, therefore the desired probability is .(1)kkpSince the success
24、es and failures may occur in any order, and knkfor any specific order, the probability is again . We must now ()knkdetermine the total number of sample points in the experiment that have successes and failures. This number is equal to the number of knkpartition of outcomes into two groups with in on
25、e group and in knkthe other, i.e. . Because the partitions are mutually exclusive, thus we knChave, ()(,)(1)knknPXkbpCp0,12,n ALet , the binomial expansion of the expression 1q ()nqpgives37011()nnnqpCpqCp.;,(;,)(;,)bbEach term correspond to various values of binomial distribution, this is the reason
26、 that we called it “binomial distribution”.Example 2For an experiment in which 9 coins are tossed, Let X denotes the number of head occurrence, construct the binomial distribution of Xwhat is the probability of obtaining between 3 and 6 successes.poisson distribution(泊松分布)Definition 3.5.1 A discrete
27、 random variable is called a Poisson Xrandom variable, if it takes values from the set , and if0,12, ()(;)!kPXkpe 0,12k(3.5.1)Distribution (3.5.1) is called the Poisson distribution with parameter, denoted by .()PNote that .000() 1!kkkXeeHere are some examples of Poisson random variables:(a) the num
28、ber of radioactive particles passing through a counter in certain time period;(b) the number of telephone calls received by an office in certain time 38period; (c) the number of bacteria in a given culture;(细菌,培养基)(d) the number of typing errors per page in a certain book.Example 3.5.1 From a labora
29、tory experiments, it is known that the number of Xradioactive particles passing(放射性粒子) through a counter in a given millisecond is a Poisson random variable with parameter . 4What is the probability that 6 particles enter the counter in a given millisecond?Solution The probability is .64(;)012!peExa
30、mple 3.5.2 The number of oil tankers arriving each day at a certain port is a XPoisson random variable with parameter 10. What is the probability that on a given day no more than 3 tankers having arrived?Solution. The probability is331000(;1)!kkPpe. 120136eHomeworkChapter 3 (P47) 1, 2, 3, 5,7, 2139二
31、项分布与泊松分布的关系Theorem 3.5.2 Let be a sequence of binomial random variables with probability Xdistribution . If for some constant , we have when (;,)nbkpnp, and , then n0, when , and .(;,)(;)nkkn0nproof*Example 3.5.4 Suppose that, on average, 1 person in 1000 makes a numerical error in preparing his or
32、her income tax return. If 5000 forms are selected at random and examined, find the probability that 6, 7 or 8 of the forms contain an error.Solution Let be the number of forms contain an error, then has X Xthe binomial distribution of parameter and .50n01pUsing Poisson distribution as approximations
33、, we have;65(6;50,.1)(,)0.142!bpe;75(7;,.)(,).!. 85(8;50,.1)(,)063!bpe A二项分布的应用例子Example 3.4.1 It is known that 15% of certain articles manufactured are 40defective, what is the probability that in a random sample of 5 articles(a ) exactly 2 are defective.(b) at least 2 are defective.Solution In thi
34、s case, .5,n01p(a) The probability is .235(2;,.)(.).8012bC(b)The desired probability is the sum of getting 2, 3, 4, 5 defective articles, or, we may first find the probability of the complement event, i.e., getting or 1 defective article. So, if we denote the number of defective 0articles by , then
35、we haveX. 514(2)(1)0.8(.)08516PXCExample 3.4.2 A man is able to hit a target 7 times of 10 on the average.(a) Find the probability that he hits the target exactly 3 times in 6 shots;(b) In how many shots the probability that he hits the target at least one time is greater than 0.95?Solution (a) The
36、probability is .336(;,0.7)(.)01852bC(b) In shots, the probability that he hits at least one time is n.1(;,.)3nnSince when , we have 3,0.95n41so in 3 shots, the probability that he hits the target at least one time is .10.97053.3. Expectation and Variance1Expectation (mean) 数学期望Suppose in the final e
37、xam, you got 85 in calculus, 90 in algebra and 83 in statistics, then your average score is .(85903)/86Assume a player tossed a fair die 20 times. He won $11 when he get six and lost $1 otherwise. If he gets six 4 times. Then the average amount he gets per toss is1()16.20Consider the future games. S
38、ince we cannot predict the outcome of the game, we cannot predict the exact amount he will win in the game. But we can predict the average amount he will win. Assume he tosses the die 600 times, in average, six will occur 100 times, thus, the average amount he will win per toss would be115(0(1)5()16
39、6We say that in average he will win $1 per toss.Definition 3.3.1 Let be a discrete random variable. The expectation or Xmean of is defined as(3.3.1)()()xEP42NoticeIn the case that takes values from an infinite number set, (3.3.1) Xbecomes an infinite series. If the series converges absolutely(级数绝对收敛
40、), we say the expectation exists, otherwise we say that the ()EXexpectation of does not exist.XExample 3.3.1 A fair die is tossed . Find the expectation of spots shown.XSolution Since takes values from the set and the X1,2345,6distribution is, .1()6Pk,26kThus,. 617()2kEXAIf a discrete random variabl
41、e assume each of its values with an equal probability, we say this probability distribution is a discrete uniform distribution(离散均匀分布). The distribution in Example 3.3.1 is a discrete uniform distribution. Example 3.3.2 A player tosses a fair coin until a head occurs. If the first head occurs at -th
42、 time, the player wins dollars. Find the average amount the player nnwins.43Solution Let be the amount the player wins. Then takes values X Xfrom the set . The player wins dollars if and only if he gets 1,2,n ktails first, and follows by a head. Thus k1()2kPXSo1()2kEA二项分布的数学期望Now we give the expecta
43、tion and variance of binomial distribution. Theorem 3.4.3 The expectation and variance of a binomial random variable with parameters n and p are given by X. (),EXnp()(1)DXnp(3.4.2)Proof Consider the identity.00()()nnkkknkpxqCpxqCpqxRegard as constants, as a variable. Differentiate both sides of this
44、 ,identity with respect to , we have x. (3.4.3)11()nknknpxqCpqPut , we get.1nknpqBut , thus()knPXCpq440 0()()n nknknk kEXPXCpqp Take differentiation on both sides of (3.4.3),.22 2(1)(1)nknkknpxqCpqxPut , we get1x. (3.4.4)22(1)(1)nknkpqpAdd (3.4.3) and (3.4.4) to get22220()()()(nkDXEXPknp221()nknkCpq
45、222()()(1)p泊松分布的期望Theorem 3.5.1 The expectation and variance of a Poisson random variable with parameter are, respectively,Xand . (3.5.2)()E()DXProof By the definition,001()()!()!kkkkPee .100!kkeHomework chapter 38, 9, 10, 22, 27, 30452008-3-19验血问题验血次数 X 的数学期望为 11()()1.kkkEqqN 个人平均需化验的次数为 . 由此可知,只要选
46、择()kN使 , 则 N 个人平均需化验的次数 .k1kq N当 固定时,我们选取 使得 小于 1 且取到最小值,这pk1kLq时就能得到最好的分组方法.例如, ,则 ,当 时, 取到最小值. 此时得0.1p.9q4k1kq到最好的分组方法.若 ,此时以 分组,则按第二方案平均只0N需化验. 411(.9 )5()次这样平均来说,可以减少 40%的工作量. 补充例问题提出某工厂需要在五周内采购 1000 吨原料,估计原料价格为 500 元的概率为 0.3,600 元的概率为 0.3,700 元的概率为 0.4,试求最佳采购策略,使采购价格的期望值最小。思考题如果你能预先知道 5 周的原料价格,
47、当然是按最低价购买全部原料, 46则此时价格的期望值是多少?The expectation of discrete random variables has the following properties数学期望性质Theorem 3.3.1 Let be a discrete random variable, then (assume all Xexpectations exist):(a) If for some constant , then .()1PaIR()EXa(b)Let be a function of , thengXX(3.3.2)()()xEgPx(c) If are
48、 discrete random variables, then 12,n(3.3.3)1212()=E()E()n nXXX (d)If , then .(0)P(0(e) If and , then .)(0)P(f) For any constant , (3.3.4)b(EX(g)Schwarzs inequality. (许瓦慈不等式) Let X,Y be random variables, then (3.3.5)22()()EXYEYThe equality holds iff or for some constant a.01P()1PaXProof (a) By the definit