(See Exercises 3 and 4 from "Problems on Random Variables and Probabilities"). The class
T = [1 3 2 3 4 2 1 3 5 2];
pc = 0.01*[8 13 6 9 14 11 12 7 11 9];
[X,PX] = csort(T,pc);
ddbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot
(See Exercise 6 from "Problems on Random Variables and Probabilities"). A store has eight items for sale. The prices are $3.50, $5.00, $3.50, $7.50, $5.00, $5.00, $3.50, and $7.50, respectively. A customer comes in. She purchases one of the items with probabilities 0.10, 0.15, 0.15, 0.20, 0.10 0.05, 0.10 0.15. The random variable expressing the amount of her purchase may be written
Determine and plot the distribution function for X.
T = [3.5 5 3.5 7.5 5 5 3.5 7.5];
pc = 0.01*[10 15 15 20 10 5 10 15];
[X,PX] = csort(T,pc);
ddbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot
(See Exercise 12 from "Problems on Random Variables and Probabilities"). The class
Determine and plot the distribution function for the random variable
npr06_12
Minterm probabilities in pm, coefficients in c
T = sum(mintable(4)); % Alternate solution. See Exercise 12 from "Problems on Random Variables and Probabilities"
[X,PX] = csort(T,pm);
ddbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot
Suppose a is a ten digit number. A wheel turns up the digits
0 through 9 with equal probability on each spin. On ten spins what is the probability
of matching, in order, k or more of the ten digits in a,
In a thunderstorm in a national park there are 127 lightning strikes.
Experience shows that the probability of of a lightning strike starting a fire is about
0.0083. What is the probability that k fires are started,
P = ibinom(127,0.0083,0:3) P = 0.3470 0.3688 0.1945 0.0678
A manufacturing plant has 350 special lamps on its production lines.
On any day, each lamp could fail with probability
P = 1 - cbinom(350,0.0017,1:6)
= 0.5513 0.8799 0.9775 0.9968 0.9996 1.0000
Two hundred persons buy tickets for a drawing. Each ticket has probability
0.008 of winning. What is the probability of k or fewer winners,
P = 1 - cbinom(200,0.008,3:5) = 0.7838 0.9220 0.9768
Two coins are flipped twenty times. What is the probability the results
match (both heads or both tails) k times,
P = ibinom(20,1/2,0:20)
Thirty members of a class each flip a coin ten times. What is the probability that at least five of them get seven or more heads?
p = cbinom(10,0.5,7) = 0.1719
P = cbinom(30,p,5) = 0.6052
For the system in Exercise 6, call a day in which one or more failures occur among the 350 lamps a “service day.” Since a Bernoulli sequence “starts over” at any time, the sequence of service/nonservice days may be considered a Bernoulli sequence with probability p1, the probability of one or more lamp failures in a day.
p1 = 1 - (1 - 0.0017)^350 = 0.4487 k = 1:5; (prob given day is a service day)
P = p1*(1 - p1).^(k-1) = 0.4487 0.2474 0.1364 0.0752 0.0414
P0 = (1 - p1)^7 = 0.0155
For the system in Exercise 6 and Exercise 10 assume the plant works seven days a week. What is the probability the third service day occurs by the end of 10 days? Solve using the negative binomial distribution; repeat using the binomial distribution.
p1 = 1 - (1 - 0.0017)^350 = 0.4487
P = sum(nbinom(3,p1,3:10)) = 0.8990 Pa = cbinom(10,p1,3) = 0.8990A residential College plans to raise money by selling “chances” on
a board. Fifty chances are sold. A player pays $10 to play; he or she wins $30
with probability
Determine the distribution for X and calculate
N = 0:50;
PN = ibinom(50,0.2,0:50);
X = 500 - 30*N;
Ppos = (X>0)*PN'
Ppos = 0.9856
P200 = (X>=200)*PN'
P200 = 0.5836
P300 = (X>=300)*PN'
P300 = 0.1034
A single six-sided die is rolled repeatedly until either a one or a six turns up. What is the probability that the first appearance of either of these numbers is achieved by the fifth trial or sooner?
P = 1 - (2/3)^5 = 0.8683
Consider a Bernoulli sequence with probability
P = sum(nbinom(4,0.53,4:10)) = 0.8729 Pa = cbinom(10,0.53,4) = 0.8729
Fifty percent of the components coming off an assembly line fail to meet specifications for a special job. It is desired to select three units which meet the stringent specifications. Items are selected and tested in succession. Under the usual assumptions for Bernoulli trials, what is the probability the third satisfactory unit will be found on six or fewer trials?
P = cbinom(6,0.5,3) = 0.6562
The number of cars passing a certain traffic count position in an hour has Poisson (53) distribution. What is the probability the number of cars passing in an hour lies between 45 and 55 (inclusive)? What is the probability of more than 55?
P1 = cpoisson(53,45) - cpoisson(53,56) = 0.5224
P2 = cpoisson(53,56) = 0.3581
Compare
k = 0:10;
Pb = 1 - cbinom(5000,0.001,k+1);
Pp = 1 - cpoisson(5,k+1);
disp([k;Pb;Pp]')
0 0.0067 0.0067
1.0000 0.0404 0.0404
2.0000 0.1245 0.1247
3.0000 0.2649 0.2650
4.0000 0.4404 0.4405
5.0000 0.6160 0.6160
6.0000 0.7623 0.7622
7.0000 0.8667 0.8666
8.0000 0.9320 0.9319
9.0000 0.9682 0.9682
10.0000 0.9864 0.9863
bincomp
Enter the parameter n 5000
Enter the parameter p 0.001
Binomial-- stairs
Poisson-- -.-.
Adjusted Gaussian-- o o o
gtext('Exercise 17')
Suppose
k = 3:8;
Px = cbinom(12,0.375,k);
Py = cpoisson(4.5,k);
Pz = exp(-k/4.5);
disp([k;Px;Py;Pz]')
3.0000 0.8865 0.8264 0.5134
4.0000 0.7176 0.6577 0.4111
5.0000 0.4897 0.4679 0.3292
6.0000 0.2709 0.2971 0.2636
7.0000 0.1178 0.1689 0.2111
8.0000 0.0390 0.0866 0.1690
The number of noise pulses arriving on a power circuit in an hour is a random quantity having Poisson (7) distribution. What is the probability of having at least 10 pulses in an hour? What is the probability of having at most 15 pulses in an hour?
P1 = cpoisson(7,10) = 0.1695 P2 = 1 - cpoisson(7,16) = 0.9976
The number of customers arriving in a small specialty store in an hour is a random quantity having Poisson (5) distribution. What is the probability the number arriving in an hour will be between three and seven, inclusive? What is the probability of no more than ten?
P1 = cpoisson(5,3) - cpoisson(5,8) = 0.7420
P2 = 1 - cpoisson(5,11) = 0.9863
Random variable
k = [80 100 120];
P = cbinom(1000,0.1,k)
P = 0.9867 0.5154 0.0220
P1 = cpoisson(100,k)
P1 = 0.9825 0.5133 0.0282
The time to failure, in hours of operating time, of a televesion set subject to random voltage surges has the exponential (0.002) distribution. Suppose the unit has operated successfully for 500 hours. What is the (conditional) probability it will operate for another 500 hours?
For
Twenty “identical” units are put into operation. They fail independently.
The times to failure (in hours) form an iid class, exponential (0.0002). This means the
“expected” life is 5000 hours. Determine the probabilities that at least k,
for
p = exp(-0.0002*5000)
p = 0.3679
k = [5 8 10 12 15];
P = cbinom(20,p,k)
P = 0.9110 0.4655 0.1601 0.0294 0.0006
Let
P1 = gammadbn(20,0.0002,100000) = 0.5297 P2 = cpoisson(0.0002*100000,20) = 0.5297
The sum of the times to failure for five independent units is
a random variable
Interarrival times (in minutes) for fax messages on a terminal are
independent, exponential (
Customers arrive at a service center with independent interarrival
times in hours, which have exponential (3) distribution. The time X for the
third arrival is thus gamma
Five people wait to use a telephone, currently in use by a
sixth person. Suppose time for the six calls (in minutes) are iid, exponential (1/3).
What is the distribution for the total time Z from the present for the six calls? Use an
appropriate Poisson distribution to determine
A random number generator produces a sequence of numbers between 0 and 1. Each of these can be considered an observed value of a random variable uniformly distributed on the interval [0, 1]. They assume their values independently. A sequence of 35 numbers is generated. What is the probability 25 or more are less than or equal to 0.71? (Assume continuity. Do not make a discrete adjustment.)
p = cbinom(35,0.71,25) = 0.5620
Five “identical” electronic devices are installed at one time. The units fail independently, and the time to failure, in days, of each is a random variable exponential (1/30). A maintenance check is made each fifteen days. What is the probability that at least four are still operating at the maintenance check?
p = exp(-15/30) = 0.6065 P = cbinom(5,p,4) = 0.3483
Suppose
P1 = gaussian(4,81,8) - gaussian(4,81,2)
P1 = 0.2596
P2 = gaussian(4,81,9) - gaussian(4,84,-1)
P2 = 0.4181
Suppose
P1 = gaussian(5,81,9) - gaussian(5,81,3)
P1 = 0.2596
P2 = gaussian(5,81,10) - gaussian(5,84,0)
P2 = 0.4181
Suppose
P1 = gaussian(3,64,9) - gaussian(3,64,1)
P1 = 0.3721
P2 = gaussian(3,64,7) - gaussian(3,64,-1)
P2 = 0.3829
Items coming off an assembly line have a critical dimension which
is represented by a random variable
p = gaussian(10,0.01,10.05) - gaussian(10,0.01,9.95)
p = 0.3829
P = cbinom(10,p,3)
P = 0.8036
The result of extensive quality control sampling shows that a certain model
of digital watches coming off a production line have accuracy, in seconds per month,
that is normally distributed with
Use the m-procedure bincomp with various values of n from 10 to 500 and p from 0.01 to 0.7, to observe the approximation of the binomial distribution by the Poisson.
Experiment with the m-procedure bincomp.
Use the m-procedure poissapp to compare the Poisson and gaussian distributions. Use various values of μ from 10 to 500.
Experiment with the m-procedure poissapp.
Random variable X has density
tappr
Enter matrix [a b] of x-range endpoints [-1 1]
Enter number of x approximation points 200
Enter density as a function of t 1.5*t.^2
Use row matrices X and PX as in the simple case
cdbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot
Random variable X has density function
tappr
Enter matrix [a b] of x-range endpoints [0 2]
Enter number of x approximation points 200
Enter density as a function of t t - (3/8)*t.^2
Use row matrices X and PX as in the simple case
cdbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot
Random variable X has density function
tappr
Enter matrix [a b] of x-range endpoints [0 2]
Enter number of x approximation points 400
Enter density as a function of t (6/5)*(t<=1).*t.^2 + ...
(6/5)*(t>1).*(2 - t)
Use row matrices X and PX as in the simple case
cdbn
Enter row matrix of VALUES X
Enter row matrix of PROBABILITIES PX % See MATLAB plot