C 03 ring 06 Lecture 6 Page of 6 Discrete Probability Cha 7 Discrete Probability: Terminology xeriment: Procedure that yields an outcome o.g., Tossing a coin three times Outcome: HHH in one trial, HTH in another trial, etc. amle sace: et of all ossible outcomes in the exeriment o.g., = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} vent: subset of the samle sace i.e., event is a set consisting of individual outcomes o.g., vent that # of heads is an even number so = {HHT, HTH, THH, TTT} If is a samle sace of equally likely outcomes, the robability of an event, = / o Counting comes into lay here! o.g., robability of an event of having even # of heads when tossing a coin three times = 4/8 = 0.5 Terminology examle and some samle questions. Consider the question: What is the robability of winning the lotto if there are 6 numbers drawn out of 4 numbers and you need to match them all? What is the exeriment? What is the samle sace? What is the event? What is the answer to the question? When life or at least dice isn t aren t fair. o far we ve assumed all events are equally likely. But what if they aren t? Traditionally this is discussed as having a coin or die that is unfair and the robability of each side coming u isn t the same. Let s consider a coin that has a head that is three times more likely to come u than a tail. That is, H=3T. What is the robably of getting a head from a single coin toss? What is the robability of getting two heads when tossing two of these coins? A head and a tail? Two tails? What is the odds of getting an even number of heads with three flis of our biased coin?
C 03 ring 06 Lecture 6 Page of 6 Combinations of events and comlements. ometimes we care about more than one event or an event not haening. Probability of an event not haening? Let be an event in a samle sace. The robability of the event, the comlementary event of i.e., a set of outcomes that does not haen, is given by A sequence of 0 bits is randomly generated. What are the odds that at least one of those bits is a zero? What is the robability of having a hand that doesn t have a single ace has either more or less than ace? Union of two events. Let and be events in the samle sace. Then because. We d need to divide each term by to get robabilities. Use this fact to find the robability of a a ositive integer not exceeding 00 selected at random is divisible by 5 or 7. ven with unfair/biased coins our combination rules still hold: =
C 03 ring 06 Lecture 6 Page 3 of 6 Conditional robability ometimes we want to know what the robability is of something given some other fact. xamle A bit string of length 4 is generated at random so that each of the 6 bit strings is equally likely. What is the robability that it contains at least two consecutive 0s, given that its first bit is a 0? : event that the string contains at least two consecutive 0s F: event that the string has its first bit as 0. What is F? F= F= make a list o F= Indeendence The events and F are indeendent if and only if F = F. An equivalent statement is that and F are indeendent if and only if F = In the case above, we showed that F and were not equal. o those two events are not indeendent. How about the following: Fli a coin three times o : the first coin is a head o F: the second coin is a head Roll two dice o : the sum of the two dice is 5 o F: the first die is a Roll two dice o : the sum of the two dice is 7 o F: the first die is a Deal two five card oker hands o : hand one has four of a kind o F: hand two has four of a kind Another examle xamle 4 age 457 of the text What is the conditional robability that a family with two children has two boys, given they have at least one boy? Assume that each of the ossibilities BB, BG, GB, and GG is equally likely, where B reresents a boy and G reresents a girl. Note that BG reresents a family with an older boy and a younger girl while GB reresents a family with an older girl and a younger boy. Are those two events indeendent?
C 03 ring 06 Lecture 6 Page 4 of 6 Bernoulli Trials and the Binomial Distribution uose that an exeriment can have only two ossible outcomes. For instance, when a bit is generated at random, the ossible outcomes are 0 and. When a coin is flied, the ossible outcomes are heads and tails. ach erformance of an exeriment with two ossible outcomes is called a Bernoulli trial, after James Bernoulli, who made imortant contributions to robability theory. In general, a ossible outcome of a Bernoulli trial is called a success or a failure. If is the robability of a success and q is the robability of a failure, it follows that + q =. i o what is the robability of getting exactly 4 multile choice questions out of 5 correct by guessing if each question has 3 otions? How about 3 correct? All 5? Bayes Theorem 7.3 a b b b a a b is the rior robability of b. b a is the osterior robability, after taking the evidence a into account. a b is the likelihood of the evidence, given the hyothesis. a is the rior robability of the evidence o used as a normalizing constant Why is this useful? Consider a medical diagnosis. Diagnostic evidence disease symtom is often hard to get. But it s what you really want. Causal evidence symtom disease is often easier to get. disease is easy to get. Diagnosing a Rare Disease Meningitis is rare: m = /50000 Meningitis causes stiff neck: sm = 0.5 tiff neck is not so rare: s = /0 You have a stiff neck. What is ms? i Quote is from the text, age 458.
C 03 ring 06 Lecture 6 Page 5 of 6 The oint being that we can quickly figure out if a stiff neck is a good reason to guess someone has Meningitis. o we want to know tos. ost is known as is t. But how do we comute os? os os t t os t t Does that seem reasonable? If so, we get: os t t t os os t t os t t That form is the one we find in the text. Alications There are a huge number of alications, mainly in artificial intelligence, related to Bayes theorem. One you interact with most every day is called Bayesian filtering, and it s mostly what is used to kee your inbox sam free. ay you have a set of B messages known to be sam and a set of G messages known to not be sam Google, for examle, gets a good sense of this when you label things as sam. We could then search for words or addresses, or whatever that tend to occur in B but are less common in G. uose that we have found that the word Rolex occurs in 50 of 000 messages known to be sam and in 5 of 000 messages known not to be sam. stimate the robability that an incoming message containing the word Rolex is sam, assuming that it is equally likely that an
C 03 ring 06 Lecture 6 Page 6 of 6 incoming message is sam or not sam. If our threshold for rejecting a message as sam is 0.9, will we reject such messages? xamle 3, age 473 though we ll aroach it a bit differently. We want to find the robability that a word with Rolex in it is sam. We don t know what ercent of all messages are sam, so let s just assume 50% for now. For sam Rolex we get s r r s s r s s r s s r s That last is true if s=.5. r s r s Of course, filtering based on one word isn t a very good idea you get lots of false ositives. Instead you use lots of different filters all together. xamle 4 on age 474 does a nice job of giving an examle of combining filters. Monty Hall What is the robability of winning with strategy? What would you have had to choose if strategy is to work? If strategy? This question was actually the subject of a big debate where serious mathematicians got the answer wrong. Of course, we could also use Bayes Theorem to work this out. I m showing that mainly as a review, but also as a bit more comlex of an examle.