Mathematics - Discrete Mathematics - Conditional Probability
hive-163521·@drifter1·
0.000 HBDMathematics - Discrete Mathematics - Conditional Probability
 [[Image 1](https://commons.wikimedia.org/wiki/File:Law_of_total_probability.png)] ## Introduction Hey it's a me again [@drifter1](https://peakd.com/@drifter1)! Today we continue with **Mathematics**, and more specifically the branch of "**Discrete Mathematics**", in order to get into **Conditional Probability**. I highly suggest checking the post on [Probability](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-probability) before this one! So, without further ado, let's get straight into it! * * * ## Conditional Probability For dependent events, where the occurrence of one affects the outcome of another, a new kind of probability is defined known as conditional probability. The probability of an event *A* from occurring when an event *B* has already occurred is denoted as *P(A | B)*, and given by:  Solving for the intersection, results in:  In a similar manner, the probability of event *B* from occurring when *A* has occurred is:  If the events *A* and *B* are independent then:  ### Law of Total Probability Based on conditional probability, it's possible to calculate the total probability of an event *B* for any number of disjoint events *A<sub>i</sub>*. The resulting equation is known as the law of total probability:  Each intersection can also be replaced with the corresponding conditional probability equation yielding:  ### Bayes' Theorem Let's not forget to mention Bayes' Theorem, which is basically an equation that relates *P(A | B)* and *P(B | A)*. It's easy to derive such an equation from the definition of conditional probability:  **Note**: Of course commutativity applies for the intersection of *A* and *B*. So, knowing *P(A)*, *P(B)* and either of the two it's possible to calculate the other using this equation. * * * ## Full-On Example Consider a bowl is filled with 3 black and 5 white marbles. What's the probability of picking: - two consecutive black marbles - black marble followed by white marble - three consecutive black marbles - a black marble in the second pick  The overall number of marbles is 8, and so the probabilities of picking a black and white marble respectively are initially:  ### Two consecutive black marbles After picking a black marble, 7 marbles will be remaining, with only 2 being black. The probability of picking a second black marble, after a black one has already been picked, is thus:  And so, the total probability for picking two consecutive black marbles is:  ### Black marble followed by white marble After picking a black marble, 5 out of the 7 remaining ones will be white. So, the probability of picking a white one after a black marble is:  As such, the total probability for picking a black marble followed by a white marble is:  **Bonus**: Of course, the order doesn't matter in this problem, as picking a white one and then a black one has the same probability (it's simply the intersection of *B* and *W* in either order). As such, after picking a white one 3 black marbles will remain, giving the same total probability of:  ### Three consecutive black marbles After two black marbles have already been picked, picking a third marble has a probability of:  as 6 marbles will remain with only 1 being black. As such, the total probability is:  In other words, the probability is basically the product:  as each pick depends on the previous pick. ### Black marble in second pick This last case is a great example of the law of total probability! Because it's uncertain what came first, the probability will be a sum of two cases: - black marble was picked first - white marble was picked first So, picking a black marble in the second pick has a probability of:  * * * ## RESOURCES: ### References 1. https://www.javatpoint.com/discrete-mathematics-tutorial 2. http://discrete.openmathbooks.org/dmoi3.html 3. https://brilliant.org/wiki/discrete-mathematics/ 4. https://www.investopedia.com/terms/b/bayes-theorem.asp ### Images 1. [https://commons.wikimedia.org/wiki/File:Law_of_total_probability.png](https://commons.wikimedia.org/wiki/File:Law_of_total_probability.png) Mathematical equations used in this article, have been generated using [quicklatex](http://quicklatex.com/). Block diagrams and other visualizations were made using [draw.io](https://app.diagrams.net/). * * * ## Previous articles of the series * [Introduction](https://peakd.com/hive-163521/@drifter1/mathematics-an-introduction-to-discrete-mathematics) → Discrete Mathematics, Why Discrete Math, Series Outline * [Sets](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-sets) → Set Theory, Sets (Representation, Common Notations, Cardinality, Types) * [Set Operations](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-set-operations) → Venn Diagrams, Set Operations, Properties and Laws * [Sets and Relations](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-sets-and-relations) → Cartesian Product of Sets, Relation and Function Terminology (Domain, Co-Domain and Range, Types and Properties) * [Relation Closures](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-relation-closures) → Relation Closures (Reflexive, Symmetric, Transitive), Full-On Example * [Equivalence Relations](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-equivalence-relations) → Equivalence Relations (Properties, Equivalent Elements, Equivalence Classes, Partitions) * [Partial Order Relations and Sets](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-partial-order-relations-and-sets) → Partial Order Relations, POSET (Elements, Max-Min, Upper-Lower Bounds), Hasse Diagrams, Total Order Relations, Lattices * [Combinatorial Principles](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-combinatorial-principles) → Combinatorics, Basic Counting Principles (Additive, Multiplicative), Inclusion-Exclusion Principle (PIE) * [Combinations and Permutations](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-combinations-and-permutations) → Factorial, Binomial Coefficient, Combination and Permutation (with / out repetition) * [Combinatorics Topics](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-combinatorics-topics) → Pigeonhole Principle, Pascal's Triangle and Binomial Theorem, Counting Derangements * [Propositions and Connectives](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-propositions-and-connectives) → Propositional Logic, Propositions, Connectives (∧, ∨, →, ↔ and ¬) * [Implication and Equivalence Statements](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-implication-and-equivalence-statements) → Truth Tables, Implication, Equivalence, Propositional Algebra * [Proof Strategies (part 1)](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-proof-strategies-part-1) → Proofs, Direct Proof, Proof by Contrapositive, Proof by Contradiction * [Proof Strategies (part 2)](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-proof-strategies-part-2) → Proof by Cases, Proof by Counter-Example, Mathematical Induction * [Sequences and Recurrence Relations](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-sequences-and-recurrence-relations) → Sequences (Terms, Definition, Arithmetic, Geometric), Recurrence Relations * [Probability](https://peakd.com/hive-163521/@drifter1/mathematics-discrete-mathematics-probability) → Probability Theory, Probability, Theorems, Example * * * ## Final words | Next up And this is actually it for today's post! Next time we will get into an overview of Graph Theory... See ya!  Keep on drifting! Posted with [STEMGeeks](https://stemgeeks.net)
👍 joeyarnoldvn, khalstem, fatman, voter002, slider2990, portugalcoin, mangos, eturnerx, acont, koskl, blrog, oldsoulnewb, isnochys, yggdrasil.laguna, stemgeeks, stemcuration, abh12345.stem, brofund-stem, adamada.stem, solominer.stem, dorkpower, cd-stem, stuntman.mike, stemcur, stemline, star.stem, babytarazkp, saboin.stem, scooter77.stem, sillybilly, andy4475, krishu.stem, pfwaus, peerfinance, chapmain, limka, holovision.stem, stem.alfa, mundo.curioso, enforcer48, admiralbot, steemflagrewards, aninsidejob, memehub, lemouth, steemstem-trig, steemstem, minnowbooster, howo, robotics101, dna-replication, roelandp, khalil319, stemsocial, lamouthe, metabs, curie, techslut, walterjay, valth, dhimmel, mobbs, samminator, mahdiyari, alexander.alexis, ludmila.kyriakou, tsoldovieri, abigail-dantes, bhoa, postpromoter, kenadis, gentleshaid, r00sj3, sco, intrepidphotos, fragmentarion, hadji, pab.ink, geopolis, alexdory, charitybot, melvin7, francostem, de-stem, deholt, temitayo-pelumi, motherofalegend, pboulet, stem.witness, crowdwitness, walterprofe, odditiesandends, enzor, hijosdelhombre, stemng, croctopus, charitymemes, doctor-cog-diss, arunbiju969, txracer, limeric01, sam99, revo, meno, irgendwo, ryenneleow, gravii4, double-negative, steemstorage, appics.tutorial, manic.calm, holoferncro, zirkonov, cloh76, bitrocker2020, gunthertopp, stayoutoftherz, superlotto, diabonua, armandosodano, cakemonster, aicu, swayzilla, drricksanchez, joelagbo, ozmash, steemean, zirky, tfeldman, mulletwang, thelordsharvest, pandasquad, cooltivar, vietthuy, deriyon, epicdice, thesoundof, dmoonfire, meritocracy, mayberlys, barizon, netvalar, kephler, nbs.gmbh, kevinwong, thecryptodrive, privex, newsflash, dandesign86, investingpennies, bartosz546, dreamm, paulmoon410, utube, takowi, achimmertens, merlin7, tigerrkg, bit4bit, stevieboyes, banvie, daeshim, aabcent, pateldhawal4, zerozerozero, gingerninja, smjn, monsterjamgold, edencourage, beta500, louis00334, conocorp, alinalazareva, laxam, therising, yougotavote, cleanplanet, devann, peterale, gandhi-disciple, gabriele-gio, namiks, jerrybanfield, rt395, princessmewmew, val.halla, communitybank, sportscontest, fantasycrypto, lorenzopistolesi, nateaguila, citizendog, douglasjames, mularh, zerofour, mmoonn, yourmind, kylealex, otp-one, brianoflondon, raynen, precarious, crypto.currents, pimpstudio, dcrops, mayorkeys, axelx12, limeric19, realkiki85, steemcryptosicko, sallhiddles, quinnertronics, justyy, bflanagin, rmu01, bedazzled, dauerossi, steveconnor, michaias, rtron86, hutty, xerxes.alpha, milagrosmhbl, lycanskiss, someguy123, federacion45, zyx066, punchline, bellaian, goldrooster, drawmeaship, cliffagreen, aries90, migka, djennyfloro, ew-and-patterns, majes.tytyty, neneandy, movingman, carolinaelly, whangster79, taniagonzalez, goblinknackers, rmach, mcsvi, firstamendment, meanbees, ibt-survival, forykw, inthenow, sanderjansenart, primersion, celinavisaez, minnowspeed, justlee87, wanderingmoon, death-and-taxes, lordvader, pladozero, atheistrepublic, dondido, sevenoh-fiveoh, juecoree, stem-espanol, yehey, uche-nna, iamphysical, tomastonyperez, erickyoussif, yusvelasquez, lorenzor, analealsuarez, felixrodriguez, azulear, carloserp-2000, yrmaleza, miguelangel2801, emiliomoron, delpilar, elvigia, josedelacruz, andrick, reinaseq, fran.frey, aleestra, giulyfarci52, wilmer14molina, aqua.nano, newton666, zeruxanime, runvan, psicoluigi, mammasitta, sincensura, aaronkroeblinger, ubaldonet, medro-martin, realblockchain, sardrt, massivevibration, bennettitalia, eric-boucher, robertbira, eliaschess333, nicole-st, esthersanchez, marcocasario, gaottantacinque, cribbio, gasaeightyfive, flatman, dranren, orlandogonzalez, cyprianj, gifty-e, ennyta, gaming.yer, endopediatria, anaestrada12, heryanna, dkmathstats, harpreetjanda, oscurity, brofi,