Current location: Homepage > ai > Harvard CS50’s Artificial Intelligence with Python – Full University Course - Ep45

Harvard CS50’s Artificial Intelligence with Python – Full University Course - Ep45

2025-07-11 11:52:02 [php] Source: ByteGenius
piece of informationthat is intellipaat ai tutorialusually easier to know easier toimmediately have access to data for andthis is the information that I actuallywant to calculate or I might want toknow for for example if I know that whatPro some probability of counterfeitbills have like Blurry text around theedges because counterfeit printersaren't nearly as good at printing textprecisely so I have some informationabout given that something is acounterfeit Bill like x% of counterfeitbills have blurry text for example andusing that information then I cancalculate some piece of information thatI might want to know like given that Iknow there's blurry text on a bill whatis the probability that that bill iscounterfeit so given one conditionprobability I can calculate the otherconditional probability as well and sonow we've taken a look at a couple ofdifferent types of probability we'velooked at unconditional probabilitywhere I just look at what is theprobability of this event occurringgiven no additional evidence that Imight have access to and we've alsolooked at conditional probability whereI have some sort of evidence and I wouldlike to using that evidence be able tocalculate some other probability as wellthe other kind of probability that'll beimportant for us to think aboutis joint probability and this is whenwe're considering the likelihood ofmultiple different events simultaneouslyand so what do we mean by this well forexample I might have probabilitydistributions that look a littlesomething like this like I want to knowthe probability distribution of cloudsin the morning and that distributionlooks like this 40% of the time C whichis my random variable here is equal toit's cloudy and 60% of the time it's notcloudy so here is just a simpleprobability distribution that iseffectively telling me that 40% of thetime it's cloudy I might also have aprobability distribution for rain in theafternoon where 10% of the time or withprobability 0.1 it is raining in theafternoon and with probability 0.9 it isnot raining in the afternoon and usingjust these two pieces of information Idon't actually have a whole lot ofinformation about how these twovariables relate to each other but Icould if I had access to their jointprobability meaning for everycombination of these two things meaningmorning cloudy and afternoon rainmorning cloudy and afternoon not rainmorning not cloudy and afternoon rainand morning not cloudy and afternoon notraining if I had access to values foreach of those four I'd have moreinformation so information that'd beorganized in a table like this and thisrather than just a probabilitydistribution is a joint probabilitydistribution it tells me the probabilitydistribution of each of the possiblecombinations of values that these randomvariables can take on so if I want toknow what is the probability that on anygiven day it is both cloudy and rainywell I would say all right we're lookingat cases where it is cloudy and caseswhere it is raining and the intersectionof those two that row and that column is0.08 so that is the probability that itis both cloudy and rainy using thatinformation and using this conditionalprobability table or using this jointprobability table I can begin to drawother pieces of information about thingslike conditional probability so I mightask a question like what is theprobability distribution of clouds giventhat I know that it is raining meaning Iknow for sure that's rain that it'sraining tell me the probabilitydistribution over whether it's cloudy ornot given that I know already that it isin fact raining and here I'm using C tostand for that random variable I'mlooking for a distribution meaning theanswer to this is not going to be asingle value it's going to be two valuesa vector of two values where the firstvalue is probability of clouds thesecond value is probability that it isnot cloudy but the sum of those twovalues is going to be one because whenyou add up the probabilities of all ofthe possible Worlds the result that youget must be the number one and well whatdo we know about how to calculate aconditional probability well we knowthat the probability of a given B is theprobability of A and B divided by theprobability of B so what does this meanwell it means that I can calculate theprobability of clouds given that it'sraining as the probability of clouds andraining divided by the probability ofrain and this comma here for for theprobability distribution of clouds andrain this comma sort of stands in forthe word and you'll sort of seen TheLogical operator and and the comma usedinterchangeably this means theprobability distribution over the cloudsand knowing the fact that it is rainingdivided by the probability of rain andthe interesting thing to note here andwhat we'll often do in order to simplifyour mathis that dividing by the probability ofrain the probability of rain here isjust some numerical constant it is somenumber dividing by probability of rainis just dividing by some constant or inother words multiplying by the inverseof that constant and it turns out thatoften times we can just not worry aboutwhat the exact value of this is and justknow that it is in fact a constant valueand we'll see why in a moment so insteadof expressing this as this jointprobability divided by the probabilityof rain sometimes will just represent itas Alpha times the numerator here theprobability distribution of C thisvariable and that we know that it israining for instance so all we've donehere is said this value of one over theprobability of rain that's really just aconstant that we're going to divide byor equivalently multiply by the inverseof at the end we'll just call it Alphafor now and deal with it a little bitlater but the key idea here now and thisis an idea that's going to come up againis that the conditional distribution ofC given rain is proportional to meaningjust some Factor multiplied by The Jointprobability of c and Rain being true andso how do we figure this out well thisis going to be the probability that itis cloudy given that it's rainy which is8 and the probability that it's notcloudy given that it's rainy which is0.02 and so we get Alpha times here nowis that probability distribution 008 isclouds and Rain 02 is not cloudy

(Editor: javascript)

Recommended articles
Hot reading