Professional Documents
Culture Documents
7 - PDFOptim 1
7 - PDFOptim 1
> X-rend(100,60)<0.6;| The MATLAB code for this task appears on the left. The >> Yesum(x.1) 100 x 60 matric X has j, jth element LG, 5)=0 (tails) or XC, j)=1 (heads) to indicate the result of fp i of subexperiment j. Since Y sums X across the first dimension, (3) is the number of heads in the jth subexperiment, Each Y¢3) is between () and 100 and generally in the neighborhood of 50. The output of a sample run is shown in Figure 2.4 Example 2.26 Simulate the testing of 100 microprocessors as described in Example 2.23. Your output should be a 4 1 vector X such that X, is the number of grade i microprocessors, Yebiptest.a The first line generates a row vector of random grades Geceil(4erand(1,100));| for 1100 microprocessors, The possible test scores are in the vector T. Lastly, K+hist(G,T) returns a histogram Xehist (G,7) vector X such that XCj) counts the number of elements GG) that equal TC) Note that "help hist" will show the variety of ways that the hist function can be called. Morever, X-hist(G,T) does more than just count the number of elements of @ that equal each element of T. In particular, hist (G,T) creates bins centered around each T(j) and counts the number of elements of @ that fall into each bin Note that in Marian all variables are assumed to be matrices. Th writing MArLaa code, X muy be an ye x 1m matzix, an n> L column vector, a Lx m row vootor, or a 1 T scalar. Tn Maran, we write (4,5) to index tho i, jth clement By contrast, in this text, we vary the notation depending on whether we have aPROBLEMS 57 sealar X, or a vector or matric X. In addition, we use X,,) to denote the i, jth element variable, Quiz 2.5 Thus, X and X (ina MATLAB code fragment) may botl retor to the same The flip of a thick coin yields heads with probability 0.4, tails with probability 0.5, or lands on ity edge with probability 0.1 should be a 3x1 vector X such that Xi, 3 of beads, tails, aud edge. Problems Difficulty Easy 2.L1e Suppose sou Hip a coin twice, On any Hip, the coin comes up heads with prot ability 1/4, Use fy and 7) to denote the result of Hip 4 (a) What is the probability, P[/M| 172), that the first flip is heads given that the sec ‘ond flip is heads? (b) What is the probability that the first Hip ia howds ned the seemd lip is tala? 2.1.20 For Feample 22. suppase PIGi] = 1/2, Pie 3/4, and P\Ga) Ra] = 1/8 Find PIG: 1}, andl LC Ga). 2.1.3 At the end of regulation time, ie ‘kethall team ix trailing hy ane point and a player Yoes to the line for two free tarows. AC the player wakes exactly one free throw the game goes we. The prcba bility that the frst fee throw is good is 1/2. However, if the first attempt is good the player relaxes nd the xeccnd attempt ts good with probability player misses the Hist attempt, the added pressure reduces the success probability: to 1/1. What isthe probability that the game goes lilo, overtinne? /4. However. if the 2.1.de You have two biased coins. Coin A comes up tieads with probability L/4, Coin B comes up heads with probability 3/4 Tawever, you are not aure whieh is which 0 vou chose coin ranidomly sind you Bip it. IF the flip is heads, yom gmess that the fipped coin is B; otherwise, vou guess that the flipped coln is A. What is the probabil- ity P{C] that your gues is comect? Sintulate 100 thick coin fips. Your output , and X3 are the mumiber of occurrences Moderate 2.1.59 Suppose that for the general popula tion, 1 in 5000 people carries the human im mumodeficiency viras (HEY). «A test for the presence of HIV yields either a positive (+) be negative (-} response, Suppose the test gives the correct ansiwer 99% of the time What is P[=|/7], the conditional probabil ity that @ person tests negetive given that the person docs have the HIV virus? What is PLH|1], the conditional probability that arrandomly chosen person has the ITV virus, given that the person tests positive? Difficult Experts Only 2.1.6 A machine produces photo detecta: in pairs. ‘Teste thay the Hrst photo dutector is acceptable with probability 3/5, When the Stat photo detector is accept ble, the seeond photo detector 1s accept- able with probability 4/2. Lf the lirst photo Jotector ie defective, the second photo tector is weceptable with probability 2 (@) Pind the probability that exactly one phote detector La pair is acceptable. (0) Pind the probability thet beth photo detectors in a pair are defective 2.1.78 You have two biased coins, Co comes up heads with probability 1/4. C DB comes up beads with probability Tow a0 you flip each 3/4 + which ig which ence, choosing the frst coin randomly, Use A and Ti to dente the result of flip’, Let A, be the event that coin A was flipped first, Let By be the event that coin 2 was lipped first, What i P[Ay As)?58 CHAPTER2 Ase Hi and Hy independent” Explain your answer 2.1.8 A particular birth defeet of the heart a newborn infant gill aye the de: fact D with probability PID) = 10~*. in the gencval rxam ofa newbom, a particular Tear arrhythmia A occurs with probability 0.99 nfania with the defict, Tosever the arthythmia also appears with probabil: ily O.L in infants without the defect. When the arrhythunia ts present, # lab test for defect is perforined. The result of the test ia either positive (event T~) or negn tive (event T~}. Ina newhorm with the de- foet, the lab test is positive with probabil ity p = 0.8901 Th newhorn without the defect, the Tab test is neyative with probability p = 0.900 If the arrhythmia is present and the test is positive, (lien heart surgery (event 11) is perfonned, (a) Given the arytunia 4 is preseat, what is the probability the infant has ue de- fioct D? ipendent. from test 10 test (b) Given chat an infamt bas the defect; what is the probability PLD} that Ihoart sungery iv performed? Given that the Infant does not have tlhe defect, what is the probability q=PIT P| thatan unnecessary heart surgery is performed? (d) Find the probability P/M] ¢hot an in- fant has heart surgery. performed for the arrythmia (c) Given that heart surgery is performed. what is the probability thut the new: the defect? born does not hav 2.1.98 Suppore Dagwood (Blondie’s huss band) wants to eat a sane goonadict. Dagwood decides to let the frp Of acoin dewermine whether he eats. Using ich but needs ta fan unbiased coin, Dagwood will postpone the diet (and go dinectly to the rafrigerator) if either (a) he flips heads on his first fip or (b) he fips tails on the first flip but then proceeds to get two heads out of the next three flips. Note that the first dip is no! SEQUENTIAL EXPERIMENTS counted in the attempt to win two of thee and that Dagwood never performs any un necessary flips. Tet 72, be the event that Dagwood flips heads on try j, Let T, be the event that tails occurs on Hip 4 (0) Draw the tree for this experiment, L bel the probabilities of a (b) What are Pixs) aud PZ)? (6) Lot 2 be the eveut that Dogwood miust diet, What is P[D]? What ie Pi7T,)D)? (a) Are Hy and Hz independent events? 21.108 The quality of each pair of photo detectors prodnced by the machine in Prob- Jem 2.1.6 is independent of the quality of very other pair of detectors, (a) What is the probability of finding no good detestorn ina collection of'n pairs produced hy the machine? (b) How many pairs of detectors must the machine produce to reach a probability of 0,99 that there will be at Teast one aeceptable photo detector? 21.118 In Steven Steogata’s New York Times blog http: //opizioaator bloge nytimes .con/2010/04/25/chances~are/ Tref=opinion, the following problem was posed to highlight the eonfusing character of conditional probabilities Before quing on vacation for a week, you ask your apacsy frien ta water your viling plant. Without waier, the plant has a 90 percent chance of dying. ven with proper watering, it has « 20 percent chance of dir ing. And He probability that gor friend twill forget to. water if a8 30 percent. Ce) What's the chance iat your plant will sur- vive the werk? (b) Jf at's dead when you return, what's the chance that your friend forgot to wader it? (¢) If yon friend forgot to water i, what's the chance Wil be dead uden you return Solve parts (a), (b) and (c) of this problem, 21.128 Each time @ fisherman casts his line, a fish is caught with probability p, in- dependent. of whether @ fish. Is caught on y other cast of the line, ‘The fisherman will fich all day until a fish is caught audthen he will quit and go home, Let @; de- note: the event that on cast ¥ the fisherman catches a fish, Draw the tree for this exper= iment and find PIC)), P[C,], aud P|Cy) as functions of p. 2.2.16 On each tun of the knob, a gum Dall machine is equally likely to dispense red, yellow, green or blue gumball, indepeu- dent from turn to turn. After eight tums, whats ix the: probability Pls YG] that you have received 2 red, 2 yellow, 2 green and 2 blue gumba 2.2.26 A Stachnrst candy package contains }2 individual candy pieces. Fach piece is equally likely Lo be berry, orange, lemon, or cheuy, independent of all other picces. (a) What is the probability thet a Star- burst paekage has only berry or cherry piven ond znre orange or lemon pinces? (b) What is the probability that a Sta Thnirst package Inns no: cherry pieces? (¢) What is the probability P[F)] that all twelve pieces of your Starburst are the same Havor? 2.2.36 Your Starburst candy hes 12 pieces, three pieces of each of four flavors: herny orange. and cherry, arranged in a vandom order in the pack. You draw the rst threo pieces from tbe pack. (a) What is the sante Flavor Temon. wrobability they are all the (b) What is the probability they axe all di ferent flavors? 2.2.88 Your Starburst exndy hus 12 plore three pieces of each of four flavors: berry Jemou, orange, and cherry, arranged ia 4 random order in the pac. You draw the first fonrr pioous From the pack (is) What is the probability P[FA] they ane all che same flavor? What is the probability P[Fy] they are all different Biers? () (ec) What is the probability P [Fy] that your Starburst hes exactly tivo pieves of each of two diffrent flavors? PROBLEMS 59 2.2.5% In a gamo of rummy, you are dealt a seven-card hand. (a) What isthe probability P[A hand has only ted eards | that your (b) What is the peobability PUA] that your hand has only face cards? (c) What is the probability Pld; F] that your rnd hus ony red face cards? (The face cards ace jack, queen, snd king.) 2.2.6 In a game of poker, you are dealt a five-eawd hand. (a) What is the probability P[Rs] that your hand has only red cast? (b} What isthe how akind? probability of a “full with three-ofa-kind andl te 2.2.7@ Consider a inary code with 5 bits (0-0 2) lu each code word, Au example of a code word is 01010, How many differ ont cade words are there? How many code words hava exaetly three 0's? 2.2.8% Consider a language containing four letters: A, B.C, D. How many threeletter swords can you form in this language? Tow many four-letter words can you form ifeach letter 2.2.96 On an American League baschalt team with 15 field players and 10 pitchers the manager selects a starting Eneup with S field players, 1 pitebor, and 1 designated hitter. ‘The lineup specifies the players for these positions aud the pesitions In a be ing order for the 8 ficld players and lesig- rusted hitter. If the designated hitter must Tse chosen among all Hie field players, how many possible starting lineups are there? .ppears only once in cach word? 2.2.10 Suppose that in Problem 2.2.9, the designated hitter ean be chosen from among, all the players. Tow many possible starting lineups ace there? 2.2.11 At a casino, the only gan berless roulette. On w spin of the wheel the ball lands in @ space with color red (7), -n (g), or block (4), ‘The wheel has 19 ved spaces, 1) green spaces and 2 black spaces.60 CHAPTER (a) 1a 40 spins of the whedl, find the prob- ability of the event A= {19 reds. 19 greens, and 2 blacks} (8) Ta 40 spins of th ability of Gis wheel, find the probs 19 greens} (c) The only bets allowed are red and green. Given that you randomly choose to bet red or green, what is the proba bility p that your bet is a winner? 2.2.12 centers, A basketball team has three pure four pure forwards, four pure guares, and one swingman who ean play vither ard or forward. A pure position player can play only the designated posi tion. If the coach must start lineup with fone conter, two Forwards, and two guards, how many possible Tneups ean the ecach choose” 2.2.13) An instant lottery kicket consists of a collection of boxes covered with gray wax. Hor a subset of the boxes, the gray wax. hides a special mark, I a player seratehes olf the correet number of the wwarked boxes {and no boxes without the mark), then that ticket is a winner, Design an instant lontery game in which a player seratches five boxes and the probability that a ticket is a winmer is approximately 0.01 2.3.16 Consider a binary code with 5 (0.0r 1) in each code word. An example of code word is 01070, Tn eseh cade word, # Dit is a zeco with probability 0.5, indepen dent of any other bit bits (a) What is the probability of the code ‘word OOLIT (b) What ig the probability (hat, word contains exactly thn a code 23.20 7 NBA championships over approximately 50 Thus it may soem roasonable to a sume that ins given year the Celtics sin the Litle with probability p= 16/30 = 0.32, independent of any other year, Given such 2 model, what would be the probability ¢ Boston Celtics have won 16 SEQUENTIAL EXPERIMENTS of the Celtics winning eight straight cham- pionships beginning in 19597 Also, what Would he the probability of the Celtics wine ning the title in 10 out of 11 years, starting in 10597 Given your answers, de you trust this simple probability model? 23.3% Suppose each day that you drive to work a traffic light that you encounter is ther green with probability 7/16, sod with probability’ 7/16, or yellow with probability V/R, independent of the status of the light oa any other day. If over the couse of five days. G, Y. and #t denote the mum times the light is found to be seven, yellow, or red, respectively, whust is the probability that PIG =2.Y = 1, R= 2]? Also, what is the probability P{G er of 2.3.40 lu a game beweeu two equal teams, the home team wins with probability p> 1/2. Ta a best of three playo series, a team, with the home advantage has a game at home, followed by a game away, followed by a home game if necessary. The seri over as suo as One team wins {wo game What is P[H], the probability that the team wwith the home advantage wins the series? Ts the home advantage increased by playing three-game series rather than a oue-gamie playoff? ‘That is, is it true that PIA] > p for all p > 1/2? 2.3.50 A collection of field. goal kickers are divided lute groups 1 aud 2, Group i lies i kickers, On any kick, « kicker from group twill kick a field goal with proba: bility 1/(/—1). independent of the outcome Of any otter kicks, (a) A Wicker id selectod at random from among. all the kickers and stteripts one ficld goal, Let A be te event that a field goal is Wicked. Find PLR] (b) ‘Iwo kickers are solocted at random; K. is the event that kicker y kicks a field goal. Are KX, and Na independent? (oc) A Kicker i selected at random and at= tempts 10 field goals. Tet M he the number af misses. PIT = 5)2.4.18 A particular operation has six com ponents. Each component has & failure probebility q. independent of any other eomp. A succena oth of the following conditions: © Compononts 1, 2, and 9 all work, or component 4 works J operation requires © Component 6 or component 6 woul Drawn block diagram fir this aperntion similar to those of Figure 2.2 en page 53. Derive a forimula for the protiability PM that the operation is succosstul 2.4.28 We wish to modify the collular tole phone coding system in Example 2.27 in order to reduce the number of errors, In particular, if there are two o three zeroes in the received sequence of 3 bits; we will say that a deletion (event 9) occurs Othe erwise, if ab least 4 zeroes are receiver, the recelver decides a zero was sent, or if at least 4 ones are received, the seceiver decides « one was sent, We say that an crror oceu if ( was sent and the receiver decides j #4 was sent, For this modified protocol, what is the probability P[£| of au error? What is the probability PLD] of a deletion’? 2.4.3 Suppose a LO-digit phone aumber is transmitted by a cellular phone using foxr auch digit, using the model of binary symbol errors and deletions given in Problem 24.2. Let C denote the umuber of bits sent correctly, D the num bor of deletions, and £ the uumbor of ex wors, Find PIC +6, Dd. d, and ¢ 24.4) Consider the devier in Prob: Tam 2.4.1. Suppose ee can replace anyone component with an ultrareliable component that has a fallure probability of g/2 = 0.05. Which component should wo replace? 29.1 tvinls of the experinn Your ov tors C binary symbobs for ¢) few all ¢ Build a MATLAG simulation of 30 nt of Example 2.3. nny shold be a pair of 50% 1 yee nd H. Fer the ith trial. 4, will PROBLEMS 61 zocord whether it was heads (H, = 1) or tails (Hi = 0), and C, © {1.2} will rocord which coin was picked. 2.5.28 Following Qui suppos communication link hes different probabilities for transmitting Gand | Wher a | is sont, it is received as i 0 with, probability 0,01. When a 0 is sent, itis r= ceived as a 1 with probability 0,03, Each bit in a packer is still equally likely to bea Dor 1, Packets have been coded such that if five or fewer bits are received ia error, then the packet can be decoded. Simulate the transmission of 100 packets, each contsine ing 100 bits, Connt the number of packe decoded correctly. the 2.8.38 For a failure probability q = 0.2, simulate 100 trials of the siz-component test oF Problem 24.1. Te were found to work? Perform 10) repetitions ef the 100 telals, What do you learn from 10 repetitions of 100 trials compared to a simuleted experiment with 100 trials? many devices 2.5.49 Write « Marian finetion Necountequal (G,) thet duplicates the action of bist (G,1) in Example 2.26, Hint: Use ndgria, 2.5.5 simulation to Ssolve” Problen In thie problem, we use a MATLAB Qa. Recall hat @ particular operation has six eompo- uewts, Each component bas @ fallure prob- ability q independent of any: other compor nowt. Tho operation is sucessful if both © Components 1. 2, and 3-all work, or component 4 work. © Component 5 oF component 6 works. With g = 0.2, simulate the replacement of @ component with an ulleareliable compe nent. For cach replacement of a regular component, pertorm 100 trials: Ave 100 trinls sufficient to decide which component should be replaced?3 Discrete Random Variables 3.1 Definitions A random variable assigns numbers to outcomes in the sample space of an experiment, Chapter 1 defines a probability model, It hegins with a physical model of an experiment, An experiment consists of a procedure and observations. ‘The set, of all possible observations, §, is the sample space af the experiment. S is the beginning of the mathenttical probability model. In addition to S, the muathenuatical model Includes a rule for assigning numbers between i)-and 1 to sets A in S. ‘Thus for every AC S, the model gives usa probability PLA), where 0< Pl] < L Tn this chapter and for most of the remainder of this book, we examine probability models that assign ummabers to the outcomes in the sumple space, When we observe one of these numbers. we refer to the observation as a random variable. Ta our for example, X notation, the name of a sandora variable is always a capital letter, The set of possible values of X is the range of X. Since we often consider more than one random variable at a time, we denote the range of a random variable by the letter $ with a subseript that is the name of the ig the range of random variable X, $y is the range of ran forth. We use Sy to donote the range of X because the X ig analogous to S, the set of ‘ble outcomes of A probability model always begins wit an experiment. Each random variable is related directly to this experiment. ‘There are three types of relationships. fandom variable, Thus $y m variable 3°, and 60, ot of all possible values of n experiment 1. The random variable is the observation. Example 3.1 The experiment is to attach a photo detector to an optical fiber and count the number of photons arriving in a oné-microsecond time interval. Each observation 6234 DEFIWITIONS — 63 is a random variable X. The range of X is Sx = {0,1.2,...}. In this case, Sx, the range of X', and the sample space S are identical ‘The randow variable is a fuuction of Ue observation. Example 3.2 The experiment is to test six integrated circuits and after each test observe whether the circuit is accepted (a) or rejected (r). Each observation is a sequence of six letters where each letter is either a or r. For example, sy = aeraza, The sample space consists of the 64 possible sequences. A random variable related to this experiment is .V, the number of accepted circuits. For outcome ss, N = 5 circuits are accepted. The range of N is Sy = {0.1...-.6)] ¢ random variable is a function of another random variable Example 3.3 In Example 3.2, the net revenue 2 obtained for 2 batch of six integrated circuits is $5 for each circuit accepted minus $7 for each circuit rejected. (This is because for each bad circuit that goes out of the factory, it will cost the company $7 to deal with the customer's complaint and supply a good replacement circuit:) When .V circuits are accepted, 6—V’ circuits are rejected so that the net revenue Fis related to V by the function R=g(N BN — (6 —N} = BN — Ad dollars, (3) Since Sw = {0.....6}, the range of Tis Sie (42,90, -18,—6,6, 18, 30} ‘The revenue associated with ss = aaraaa and all other outcomes for which 2 is (5) 18 dollars (3.3) If we have a probabilily model for the Integrated cireult experiment ia Exum ple 1 ase that probability model to obtain a probability: model for the random variable, ‘The remainder of this chapter will develop methods to charac terize probability medels for random variables. We observe thet in the preceding csumples, the value of a random variable eau always. be derived from the outcome of the underlying experiment. This is not a coincidence, The formal definition of a random variable reflects this fact64 CHAPTER DISCRETE RANDOM VARIABLES Definition 3.1 Random Variable Arandom variable consists of wn experiment with « probability measure Pl) de~ jfined on-n sample space § and a function that assigns o real number to cach auteome in the sample space of the experiment, This definition acknowledges that a random variable is the result of an underlying exporiuent, but it also permits us to separate the experiment, in particular, tke observations, from the process of assigning, numbers to ontcomes. As we saw in Example 3.1, the assignment aay be implicit in the definition of he expecinent, or it may require further analysis Jn some definitions of experiments, the procedures contain variable parameters, Tn these experiments, there can be values of the parameters for which it is inn possible to perform the observations specified in the experiments. In these cases, the experiments do not produce random variables. We refer to experiments with paramoter settings that do not produce random variables as improper experiments. Example 3.4 The procedure of an experiment is to fire a rocket in a vertical direction from Earth's surface with initial velocity V km/h. The observation is 7’ seconds, the time elapsed until the rocket returns to Earth. Under what conditions is the experiment improper? At low velocities, V’, the rocket will return to Earth at @ random time T' seconds that depends on atmospheric conditions and small details of the rocket's shape and weight. However, when V > 0* = 40,000 km/hr, the rocket will not return to Earth. Thus, the experiment is improper when V >" because it is impossible to perform the specified observation. On oceasion, it is important to identify the mundont variable by the function X(s) thar maps the sample outcome s to the corresponding value of the random variable X, As needed, we will write (X lo emphasize that there iy a set of sample points $< $ for which X(s) =x. That is, we have adopted the shorshand notation {x ry = (8 2 8|X(s) = (aay Here are some more random variables: © A, the nimber of students asleep in the next probability Ieetitre: re in the next hour: © C, the number of texts you rece! © M4, the mumber of mninntes you wait until the next Lext-arrives, Random variables A ond Care discrete random variables. The possible valies of these random variables form @ countable set. ‘The underlying experiments have ample spaeos that are discrete. The random variable AF ean he any nomogative real number, It is a continuous random variable. Its experiment has a continuous